type, but you don't have to make it as
such to get this to work.
Could have been that my JDK API differed slightly from your's.
-----Original Message-
From: Jon Wingfield [mailto:[EMAIL PROTECTED]
Sent: Wednesday, August 08, 2007 4:49 AM
To: Tomcat Users
d take any kind of timestamp variable.
Oracle does have a Timestamp field/data type, but you don't have to make it as
such to get this to work.
Could have been that my JDK API differed slightly from your's.
-Original Message-
From: Jon Wingfield [mailto:[EMAIL PROTECTED]
S
That looks ok. Timestamp is the correct thing to use.
You have two systems: one that works, one that doesn't. So, check for
differences in the SQL sub-systems between the two:
Are the drivers of the same (uptodate) version?
Are the database schemas using the same column type? (ie the one that
f
I don't think there is an out of the box valve for doing this.
However, it shouldn't be too much work to use a Filter to wrap the
response (and it's outputstream/writer) so that as the data is pumped to
the client it is also written to a log.
Obviously, for the log to make sense entire responses
You are using jdk1.5 features (autoboxing, for example ) in your JSP pages.
Early versions of the 5.5 tree bundled a jsp compiler (JDT) which didn't
support these new language features.
Later versions bundled an updated version of the compiler...
For deploying on 5.5.9 just get rid of your autob
Is it a mime-type issue?
The content is probably being vended as application/octet-stream, which
the mobile device is probably not liking.
You can add additional mime-mappings into your web.xml.
If you are fronting tomcat with apache httpd you can also add
mime-mappings into the httpd.conf
Jo
he OS signal
>> like
>> SIGQUIT
>> Does anyone know how can i see the stack trace in this situation?
>> i use Tomcat 5.5.20 in linux , java, 1.5.0_10
>>
>> thanks
>>
>>
>>
>>
>>
>> On 6/12/07, Jon Wingfield <[EMAIL PROTECTED]&
You can supply a custom loader for a webapp to do this sort of thing:
http://tomcat.apache.org/tomcat-5.5-doc/config/loader.html
Each webapp would require a context.xml to enable the custom loader.
Regards,
Jon
Hamster wrote:
Hi,
In resin, there is a possibility to configure it with following:
using JBuider2006, what profiler can used in JBuider2006?
thanks
peter
On 6/12/07, Jon Wingfield <[EMAIL PROTECTED]> wrote:
Chuck answered a similar query recently:
http://marc.info/?l=tomcat-user&m=118113828210257&w=2
Your servlets are serving long-running requests (or are in i
Chuck answered a similar query recently:
http://marc.info/?l=tomcat-user&m=118113828210257&w=2
Your servlets are serving long-running requests (or are in infinite
loops, dead-locked etc) when you are trying to shutdown tomcat.
The first thing I'd do in this situation is SIGQUIT tomcat to get a
The order of events is:
Startup:
All listeners get called.
All filters, load-on-startup servlets get inited.
Shutdown:
All filters, servlets get destroyed.
All listeners get called.
So, it is possible for the combination of load-on-startup init +
contextDestroyed to do the same job as just using
That works well. We implemented a custom Realm in that way:
http://mail-archives.apache.org/mod_mbox/tomcat-users/200605.mbox/[EMAIL
PROTECTED]
David Delbecq wrote:
En l'instant précis du 19/03/07 13:31, Tremal Naik s'exprimait en ces
termes:
2007/3/19, David Delbecq <[EMAIL PROTECTED]>:
I d
Another thing to note is that mysql automatically closes idle
connections after 8hrs (by default).
You can configure DBCP to test on borrow or to periodically squirt some
sql down idle connections.
HTH,
Jon
David Wood wrote:
Chris,
Thanks very much for the suggestion.
I'm not using conne
Netbeans profiler. Free and does a pretty good job.
http://profiler.netbeans.org/
http://profiler.netbeans.org/docs/help/5.5/profile_j2ee.html
asaf.lahav wrote:
Can anyone recommend a good (and FREE) java profiling tool that can be used
to profile a webapp running under Tomcat 5.5?
Thanks
Have you tried the request attributes specified in section "SRV.9.9
Error Handling" of the servlet spec? Specifically, the request attribute
named "javax.servlet.error.request_uri".
HTH,
Jon
Tomas Pop wrote:
Hello,
I have a problem with change of the method
HttpServletRequest.getRequestUR
Mark,
Take a look at the LiveHttpHeaders plug-in for Firefox. It may help you
debug this on the client side.
Temporarily enabling the RequestDumperValve on the server side will
enable you to see if cookies are reaching the server.
HTH,
Jon
Aronszajn, Mark wrote:
Thanks for the information.
But you need to cater for the people who hit the login page and then go
to lunch. Happens more frequently than you might think ;)
David Smith wrote:
Don't send people who logout to a protected page, forcing a login page
to appear. Better to offer up a public, non-login page and have people
cl
Quick and dirty solution is to have your login page make a meta refresh
every, say, ten minutes pointing to the index page of your protected
content.
This simple approach works for us. We also catch "unexpected" errors
coming back from the login form submission and re-present the login
page.
You've also got other candidates such as database connections, JMS
connections etc which could spawn threads (For example, for keep-alive
functionality).
The easiest thing to do is a thread dump (send the process a SIGQUIT
signal) after stopping tomcat to see which thread(s) are keeping the JV
If you have a custom error page set up you can trap the 408 response
code and redirect to an appropriate resource. Works for me :)
Alternatively, you can set up a meta refresh on your login page so you
never get the 408. Of course, because the refresh has to go to some
protected page and not b
Erm. ok. Where does the redirectURL variable come from? Unless it has
parameters encoded into it that will be your problem.
Also, be a bit wary in using the RequestDumperValve with non-ascii
charset data as it can corrupt some parameters:
http://marc.theaimsgroup.com/?l=tomcat-user&m=112530311
Rache,
Tools like ieHTTPHeaders and LiveHTTPHeaders will also help you determine
what the browser actually sends to the server, including any redirects
caused by 302 response codes.
HTH,
Jon
> Rache,
>
>> But this usually occur after redirects.
>
> This is what I was going to ask about: if you
Hi OP,
They probably mean what they say ;)
See the jdk javadocs for the System/Runtime classes.
The Free Memory stat often causes confusion initially. It's the free
memory in the block of RAM currently assigned to the JVM.
So, it looks like at startup Tomcat is assigned 8Mb under your JVM on
W
Another approach would be to put Apache in front and use mod_headers:
http://httpd.apache.org/docs/1.3/mod/mod_headers.html
http://httpd.apache.org/docs/2.0/mod/mod_headers.html
Note: I've not tried this approach and don't know if you can remove
mandatory headers...
Jon Wingf
You'll probably need to write your own connector!
See prepareResponse method:
http://svn.apache.org/repos/asf/tomcat/connectors/trunk/http11/src/java/org/apache/coyote/http11/Http11Processor.java
http://svn.apache.org/repos/asf/tomcat/connectors/trunk/http11/src/java/org/apache/coyote/http11/Http
It's not running because you schedule the task and then immediately
cancel it. The scheduleAtFixedRate call doesn't block.
Cameron wrote:
Hello
Just trying to schedule a batch email run using Timer and TimerTask framework on
Tomcat 4.1.31
Found the following example from http://www.javapracti
This may be of help (emphasis on may):
http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4765019
Has a bit about tuning Xss for a high number of threads.
MW Janssen wrote:
Hi,
These are my parameters:
I have Xmx1024m and Xms1024m as well for the heap size memory. I dont set
Xss so I presum
The process running tomcat can't (read isn't allowed by OS) to create
any more threads:
"java.lang.OutOfMemoryError: unable to create new native thread"
If you are on unix you can up the number by tinkering with the ulimit
command.
HTH,
Jon
MW Janssen wrote:
Hi,
Can anyone explain and s
And you could mock up the database connection...
www.jmock.org
We test all our db, servlet, tag, jms (etc, etc) code with mocks.
Avi Deitcher wrote:
Marc,
Have a look at MirrorJNDI, which creates an in-memory JNDI structure. I
use it to test code that should run inside a servlet container and
go?
Brian
-Original Message-
From: Jon Wingfield [mailto:[EMAIL PROTECTED]
Sent: Wednesday, July 12, 2006 11:30 AM
To: Tomcat Users List
Subject: Re: Accessing a servlet
You've deployed this in the ROOT webapp?
form action should be "/firstpack/JustALittleTest"
McRav
r
with same name of package
3 changed entry in web.xml file to reflect package that servlet is in
for the url-pattern
4 changed JSP so that the forms action="firstpack.JustALittleTest"
I've looked at the log files but I'm not sure what to look for.
Brian
-Original Message
hat the forms action="firstpack.JustALittleTest"
I've looked at the log files but I'm not sure what to look for.
Brian
-Original Message-
From: Jon Wingfield [mailto:[EMAIL PROTECTED]
Sent: Wednesday, July 12, 2006 7:49 AM
To: Tomcat Users List
Subject: Re: Accessing a servlet
I would check in tomcat logs directory for reasons why the servlet is
not available. One reason could be that classes should be in a package:
http://tomcat.apache.org/faq/classnotfound.html
HTH,
Jon
McRaven, Brian wrote:
OK I did that and now my system is hanging which I guess could be an
er
Probably not without using standard java io and a file path (which you
can't rely on for packed web-apps).
If the file was in /appName/WEB-INF/classes it would be a resource that
could be found by the classloader.
HTH,
Jon
sbell wrote:
Hello,
Is there anyway of referencing a properties fi
The HTTP spec (rfc2616) says clients should only send the Date header
with http messages with body content (POST, PUT) and even then it's
optional.
Try adding a date string as a parameter on your GET request which your
servlet can then parse from request.getParameter(...).
One way to do this
You need to look at your access logs. You'll probably see two requests.
Your form submit button calls javascript which also calls form.submit().
I think, if you don't return false from the javascript you will get two
form submissions. Try removing the form.submit() from the javascript.
HTH,
J
incipal to get the list of roles associated with the
principal.
Thanks for the pointer.
Any issues moving all the jar from server/lib to common/lib for a quick
workaround?
On 6/29/06, Jon Wingfield <[EMAIL PROTECTED]> wrote:
In addition, custom Realms merely need to create instances of Pri
In addition, custom Realms merely need to create instances of Principal.
There is no requirement for them to extend GenericPrincipal.
Our Realm classes are deployed to server/lib
Our extension to Principal is deployed to common/lib
See the thread "Is custom realm using user/role data in webapp
Additionally, many client-side Security/Anti-Virus software packages
automatically remove the referer header from requests.
Markus Schönhaber wrote:
Robert Kudyba wrote:
We have our server.xml file set w/ the following entry:
Valve className="org.apache.catalina.valves.AccessLogValve"
director
Can't you add the filter to conf/web.xml? I think tomcat (conceptually)
folds all of conf.xml into each webapp's web.xml.
Again, this behaviour is tomcat specific but at least the filter isn't.
Jon
Filip Hanik - Dev Lists wrote:
in tomcat you can write a Valve
http://tomcat.apache.org/tomc
be able to help.
Jon
Nikita Tovstoles wrote:
I know double-submission isn't part of my problem, because the client
sending these requests is our in-house C app.
-nikita
Jon Wingfield wrote:
I would turn on the access logs (if you haven't already) and check
that the browser isn
I would turn on the access logs (if you haven't already) and check that
the browser isn't actually sending two requests.
This can sometimes happen if the user double-clicks submit buttons.
There are plenty of threads in the archives of this list suggesting ways
to mitigate this double-submission
What happens when you remove the enctype attribute from your form?
The enctype you specified is for binary uploads. Tomcat doesn't
automatically parse the http inputstream for parameters for this content
type.
HTH,
Jon
Oliver Enders wrote:
Browser is IE6.0, here´s the code:
<%
String m =
Or better, read
http://tomcat.apache.org/tomcat-5.5-doc/class-loader-howto.html
and
http://tomcat.apache.org/faq/classnotfound.html
and deploy your application code appropriately.
For the impatient: Tomcat doesn't use CLASSPATH. It sets up its own
based on the servlet specification. Each deploy
From previous posts to this list I believe the WebDAV servlet shipped
with tomcat is intentionally a bare bones implementation.
Have you seen the Slide project? http://jakarta.apache.org/slide/index.html
Jon
[EMAIL PROTECTED] wrote:
I want to make my own implementation of
org.apache.catalina.
You can do it. But there are a few quirks.
Your Realm classes have to be accessible to the server class loader.
This means another layer of indirection is needed to keep all your
webapp specific classes out of the common/server classloader.
What we did, where:
Common Classloader:
An interfac
At a guess:
http://svn.apache.org/repos/asf/tomcat/build/tags/tc5.5.x/TOMCAT_5_5_15/
Joe Bohn wrote:
Mark,
Thanks for the clarification. One more question. Is there a branch or
tag in SVN for 5.5.15? I can get the source for 5.5 but I don't know
how to get the source for a dot release.
After re-reading the original description you should probably be aware
of this portion of the javadocs for request.getParameter:
If the parameter data was sent in the request body, such as occurs with
an HTTP POST request, then reading the body directly via
getInputStream() or getReader() can
What is buf.length? Is it the actual length of the data you want to post
or is it 8k?
The data you receive on the Tomcat side may be truncated by the
Connector if the body data is longer than the value set for the
Content-Length header.
HTH,
Jon
Vikram Goyal wrote:
Hi all,
I am trying
I may be wrong but I think there are only two predefined names: "common"
and "combined". For all others you set the pattern attribute to the
required number and ordering of pattern elements as defined in the docs.
From the docs:
The shorthand pattern name common (which is also the default)
corr
atalina].[localhos
t][/unique]=INFO, R
-Original Message-
From: Jon Wingfield [mailto:[EMAIL PROTECTED]
Sent: Monday, March 27, 2006 8:15 AM
To: Tomcat Users List
Subject: Re: Distinguish between users and robots in access log?
Looks like you are running the default access log sett
Looks like you are running the default access log settings.
For logging of user-agent and referer (when given) try:
CustomLog logs/access_log combined
http://httpd.apache.org/docs/1.3/logs.html#accesslog
HTH,
Jon
Scott Purcell wrote:
I really would like to find out how my (and if my site) is
Try replacing the ampersand character with the xml entity &
HTH,
Jon
Mark Whitby wrote:
Further to my email earlier I've discovered I can either have the
truncation on or the reconnect on, but I can't include both in the url
otherwise Tomcat doesn't start up. Also, if I take off the
autorec
Compression works very well.
I added a homegrown GZip filter to the AXIS urls and also saw approx 10x
compression. There are also a number of similar OSS Filters out there.
There were .NET clients accessing the web-services and they needed a
tweak to handle the compression:
http://www.dotnetj
er(container) no NPE would happen.
Zsolt
-Original Message-
From: Jon Wingfield [mailto:[EMAIL PROTECTED]
Sent: Thursday, February 23, 2006 5:05 PM
To: Tomcat Users List
Subject: Re: How to configure my Realm class from context.xml?
Your Realm implementation needs to sit in the server clas
Your Realm implementation needs to sit in the server classloader as the
Realm interface is only defined there (in catalina.jar).
This is a PITA so when we did this we made the Realm implementation just
lookup the real implementation via JNDI. That way all the authentication
logic stayed in the
Your underlying problem is the exclamation mark at the start of your
scriptlet. This makes the jsp ompiler put free standing code into the
init method or creates methods on the servlet that you can call within
your jsp. Without the exclamation mark the compiler inlines the
scriptlet into the _j
It doesn't. But there are 3rd party apis to help. Two popular ones are:
http://servlets.com/cos/ (read the, not very onerous, license before
commercial use)
http://jakarta.apache.org/commons/fileupload/
HTH,
Jon
Sam Lee wrote:
> Dear Guys,
>
> I want to know how tomcat parse multipart requests
Your html isn't correct:
http://www.w3.org/TR/html4/interact/forms.html#h-17.3
I would remove the enctype attribute, correct the accept-charset name
and see if you get any further.
HTH,
Jon
Manish Dalakoti wrote:
Hi,
I'm using form-based authentication.
Although i'm able to create multilin
he jsp was last compiled.
Have a look in the tomcat logs for jsp compilation errors.
Make sure the compiled class of the bean is correct version of the code.
And, if worst comes to worst, try deleting tomcat's work directory to
clear out any stale jsp class files.
Jon Wingfield wrote:
This is
This is how I read the error: There is no method with the signature
void setapellido(String[] values)
which (given your code sample) there isn't.
Is the insertar.jsp doing something like
contacto.setapellido(request.getParameterValues("name"));
instead of
contacto.setapellido(request.getParam
Our custom loader sits in a jar in $CATALINA_HOME/server/lib
Our classloader uses different parent classloaders depending on which
version of TC is running.
In 4.1 we just use the parent classloader as supplied in the constructor.
In 5.0.x we use the classloader of WebAppClassLoader as the paren
Also be aware that autoReconnect=true only works (according to the mysql
docs) for Connections with autocommit set to true.
If you are using a connection pool make sure it checks the validity of
Connections every so often. This is configurable for DBCP:
http://jakarta.apache.org/commons/dbcp/c
Try the binary distribution instead of the source bundle:
http://archive.apache.org/dist/tomcat/tomcat-4/archive/v4.0.5/bin/
Either jakarta-tomcat-4.0.5.zip or jakarta-tomcat-4.0.5.exe should be fine.
CATALINA_HOME will probably then be:
C:\tomcat\jakarta-tomcat-4.0.5
HTH,
Jon
Aaron Bortman w
I did an AJAX version of this a couple of months ago.
The slight gotcha is that the AJAX request prolongs the life of the
session (you can't, it seems, override the cookie for AJAX requests) so
the interval has to be slightly longer than the expiry time for the session.
Reynir Hubner wrote:
-
last time I looked there weren't any mature OSS gateways written in
java. That could have changed though...
Jon
Carl Olivier wrote:
Hi.
Great. Thanks! Is there Gateway software available though? If you wanted
to set your own gateway up?
Carl
-Original Message-----
From: Jon
You don't need a WAP gateway. The mobile operator's have them and they
proxy the browser request :)
You just need to make sure the wml you vend is valid and sent with the
correct mime type and the operator's gateway will do the rest
(conversion to wmlc, a wbxml tokenized version of the markup).
Yes. It is possible ;)
Write a custom Realm, probably extending RealmBase. Methods such as
authenticate(username,credentials) return your custom Principal.
The custom realm has to be packaged in to commons/lib. The way we got
around classloader hell was to have an interface in common/lib whic
If the browser supports it you would send the whole page in one
multipart response a bit like a mail message.
Here's one way to do it:
So, you'd have to buffer the response. Then create a
javax.mail.internet.MimeMultipart and add BodyParts
(javax.mail.internet.MimeBodyPart) for the html and ea
One works and one doesn't.
Are the two web applications the same?
Are the DBCP and Datasource configurations the same?
In the application that doesn't work make sure connections are returned
to the pool for every code path. One leak and this could result in an
empty pool at its maximum size and
ed.
That's really good news.
Do I need to know about the 'box model' or can I just
take it as given and use it as is?
Thanks again.
Regards
--- Jon Wingfield <[EMAIL PROTECTED]> wrote:
Sure. You just need to add the correct mime-types to
the web.xml in
$TOMCAT_HOME/conf an
Sure. You just need to add the correct mime-types to the web.xml in
$TOMCAT_HOME/conf and tomcat's default servlet will serve them.
http://www.iana.org/assignments/media-types/
audio/mp4
audio/3gpp
video/mp4
video/3gpp
video/3gpp2
The video ones are probably the ones to go for.
The 3gpp and m
72 matches
Mail list logo