and the connections would
increase per context added.
Is there a way to share the connection pool object across contexts? Again
all this relates back to whether the various contexts runs within one JVM
session or each has its own JVM session.
[Kitching Simon]
I'm not quite
running speed is very slow, can I use multi-jvm to
make it faster?
sorry for stupid question, hope can get answer.
rgds
sun
[Kitching Simon]
I can't see how running multiple jvms will improve the
speed of your servlets...more processes will slow
down your machine
Hi Geoff,
As far as I know (and I did a fair bit of research on this
topic), there is no way for any java app to start as one
user, then switch to running as another user.
What I do is run tomcat on port 8080 as non-root, and
use a firewall product to redirect port 80 - 8080. This
works fine.
Hi,
I don't know if my approach qualifies as
"best practice", but I do have a couple of
comments to contribute to this thread..
I would just point out first that the following
comments really applies to tomcat running
"stand-alone". After re-reading your email, you
appear to be talking about
Hi,
I recently filed a bug report in BugRat, and
see that there is now a comment
"fixed in tomcat 3.2.2".
However, I can't find any release called 3.2.2
on the apache site, nor any such tag in the
cvs repository.
Can anyone tell me
(a) how to get the fixed code?
(b) when a binary 3.2.2
$TOMCAT_HOME/conf/web.xml is not used in tomcat 3.2
Put the mapping in yourwebapp/WEB-INF/web.xml
-Original Message-
From: David Fan [SMTP:[EMAIL PROTECTED]]
Sent: Monday, January 15, 2001 5:51 PM
To: [EMAIL PROTECTED]
Subject: url-pattern mapping worked in 3.1, but not
.
Is there a way to define this in web.xml, besides copying the init-param
section of the global parameter to every servlet's section in web.xml?
[Kitching Simon] Yep!
To set a parameter accessable by all servlets
*in a web application*, see "context-param" tag
(or is it co
Try running the shutdown command several times.
On HP-UX, I need to run it 3 times to shut tomcat
down; on solaris I only need to run the script once.
It appears to be related to the way different JVMs
handle interrupting threads; I've asked several times
on this group but no-one seems to have
It would help if you said what version
of tomcat, what operating system
and what java version..
If you are working on unix, then are
the directory and files readable by the
user that tomcat is running as?
Regards,
Simon
-Original Message-
From: Chalasani, Ashant [SMTP:[EMAIL
'[EMAIL PROTECTED]'
Subject: AW: Mounting directory
Thanks Simon,
I am using
jakarta-tomcat-3.2.1.zip
Win-NT 4.0
Java 1.2 on jBuilder 3
Regards,
Ashant
-Ursprngliche Nachricht-
Von: Kitching Simon [mailto:[EMAIL PROTECTED]]
Gesendet: Thursday, January
Hi William,
Tomcat *can* share binaries across multiple running instances.
However, as I found the docs a bit confusing when I tried to
get this working, here's how to do it:
create the following directory structure for each instance (eg under
each user's home directory if you want an instance
The problem is that the java virtual machine you are using
has a bug. There really isn't any work-around for this sort
of problem - if the jvm is buggy, the best thing is to change
jvm.
JVM version 1.3 is available for just about every platform
now, I suggest you download install it.
Regards,
Classic VM (build 1.2.2_006, green threads, nojit)
-Original Message-
From: Khaled Ben Mohamed [ mailto:[EMAIL PROTECTED]]
Sent: Thursday, January 11, 2001 10:17 AM
To: '[EMAIL PROTECTED]'
Subject:
-Original Message-----
From: Kitching Simon [ mai
A java implementation of crypt can be found at:
http://locutus.kingwoodcable.com/jfd/crypt.html
Alternatives are to use MD5 or similar from the
java encryption api (I think most jvms provide an
implementation of the major algorithms). However,
if you need to access the password from both
java
Hi Cam,
Servlets don't "have threads".
Tomcat as a whole has a pool of threads for serving
incoming requests (see the Connector tag in
$TOMCAT_HOME/conf/server.xml).
Unless you do something unusual, tomcat creates
*one* instance of your servlet, and only one.
Any *tomcat* request-serving
Hi All,
While following a related thread (RE: a simple test to charset),
a question occured to me about charset encodings in URLs.
This isn't really tomcat-related (more to do with HTTP standards)
but thought someone here might be able to offer an answer.
When a webserver sends content to a
Hi Markus,
This is a problem has been puzzling me for quite
a while too.
However, it does seem related to an exception being
generated in my own code, ie it happens only after
some jsp I have written throws an exception (which
I catch log). I think, therefore, that it isn't a tomcat
bug as
problems with not encoded URL`s in Netscape, but the IE always translates
them right.
Birte Glimm
[Kitching Simon]
The problem is that there are multiple different encoding schemes.
If IE is "translating them right" then what rules exactly is it
If you don't specify a port when you type the url into a web browser,
most (all?) web browsers default to port 80.
The problem with having tomcat run on port 80 "out of the box" is that:
(a) you might be installing tomcat on a machine that already has a web
server
running on the standard port.
According to the sun servlet specs, you are **not allowed** to
do a forward operation after having called a method to get the
output stream, exactly as the message states.
Are you sure you have never obtained an output stream
before attempting to forward to "confirm.jsp" ??
If you have
I think the most likely cause is that it is your SQL
statement that is throwing an exception when you
try to insert non-ascii characters into a text column
in the database.
Java text is all based on UNICODE, so it is unlikely
that tomcat has any problems at all with special
characters.
So the
quest req, HttpServletResponse resp, String
page, String
component) throws IOException, ServletException
{
RequestDispatcher rd =
req.getRequestDispatcher("/"+component+"/"+page);
rd.forward(req, resp);
}
/sample code
??? any clue?
Matt
Ki
Perhaps the problem is that your servlet *is*
being started, but is throwing an exception
during constructor or init method..print
statements in your constructor and init method
should prove this one way or another.
The load-on-startup value is just an integer that
indicates order of startup
Hi Andre,
I'm still willing to bet your sql is the problem.
It looks exactly like you are catching a nasty
exception somewhere, and totally ignoring it
(though I have been known to be wrong on
occasions :-)
I think you will have to provide more info, and
in particular do some research/debugging
And the "default" timeout for sessions can be set in your
web.xml file with:
session-config
session-timeout
30
/session-timeout
/session-config
The value is in minutes...
Cheers,
Simon
-Original Message-
From: Jeff Fletcher [SMTP:[EMAIL
Very interesting - a concrete example is always more interesting
to investigate than an abstract bug!
So I gave your code a try and it worked fine on my system!
I can't imagine what might be making it run for me but not run for you..
Just a by-the-way: I think you should also be setting
the
I think that this whole issue (specifying configuration parameters
to web applications) needs some serious thought - possibly
at the level of the servlet spec development group, even.
The problem is that two deployments of the same application are
not necessarily identical. The most obvious
Hi,
As has been stated many times in this email group,
tomcat 3.2 does *not* read the file
$TOMCAT_HOME/conf/web.xml any more.
I bet you defined your welcome-file there - you should
define the welcome-file entry in WEB-INF/web.xml
instead.
Note that the WEB-INF/web.xml file has always been
the
Tomcat 4 generates "access logs" of the kind you need
Tomcat 3.2 does not.
If you are using tomcat 3.2, either use a webserver like
apache as a front-end (apache does generate access
logs) or upgrade to tomcat 4.
For more information, search the email archives, as
this question has been asked
IL PROTECTED]]
Sent: Wednesday, January 03, 2001 4:30 PM
To: [EMAIL PROTECTED]
Subject: Re: Setting properties outside of the WAR
Oh good, it's not just me.
Thanks, I would appreciate it if you did forward me a copy of that script.
Cheers
Ritchie
- Original Message -----
F
The answer is all good news :-)
Tomcat is licenced under the Apache Software Licence.
You can find a copy of this licence in the tomcat version
you just downloaded - it is in a file called "LICENCE".
Basically, though, the licence says that tomcat is totally free
for any use at all. Tomcat is
loaded.
Any ideas?
Thanks for your help,
Nicolás
- Original Message -----
From: "Kitching Simon" [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Wednesday, December 27, 2000 7:16 AM
Subject: RE: context initialization
If I understand your question correctly, I do this sort
If I understand your question correctly, I do this sort of
thing currently, by having a servlet which instantiates
a bunch of objects, and adds them to the context.
This servlet is defined as "load-on-startup".
In the webapp's web.xml, I have:
!-- define a servlet/class that can be
thing very
similar to send email. You might want to provide for logging
the data to a file if the socket connection fails.
When the job is done, the Thread falls out of the run
method and dies - all very neat.
[Kitching Simon]
I have an alternative solution to suggest.
Crea
The stack-trace seems pretty clear to me - the
"sendIt" method of the IridiumSendMail class is
storing a null pointer into a hashtable.
What you may find is that the IridiumSendMail
class is expecting to load a resource file from
somewhere, but not finding it because you
forgot to install it, or
in the
classpath? In the case of commonly-used jars, like mail.jar for example,
why
would it be better to replicate this in each application's WEB-INF/lib
directory?
Thanks,
-Jeff
[Kitching Simon]
First of all, it makes it easier to install a webapp.
For example, if you migrate
I'm not sure what you mean by "build" tomcat.
It's enough just to *install* tomcat. There is a
"binary" release available pre-compiled, which is
all most people will ever need. Just follow the
relevant links from the jakarta.apache.org site,
and download the "jakarta-tomcat-3.2.1.zip"
if you are
What ted was pointing out is that you do *not* look in the "win32" directory
for tomcat, because tomcat is not platform-specific. The file you need is:
http://jakarta.apache.org/builds/jakarta-tomcat/release/v3.2.1/bin/jakarta-t
omcat-3.2.1.zip
What is in the win32 directory is just stuff like
As far as I am aware, Tomcat has *never* recognised
".zip" files in the lib directory, only .jars.
Perhaps in the past, you happened to have the zip in
a classpath...
Anyway, the fix is just to rename any .zip to .jar,
they are (currently) exactly the same internal format.
-Original
?
[Kitching Simon]
That's exactly right. When tomcat starts a webapp, it
checks the web.xml file for that webapp, and starts
any servlets specified as load-on-startup.
Also, if I had three sevlets to auto load would I specify
load-on-startup
3
/load-on-startup
irectory tree
structure
in that way ?
Tomcat is just complying with the SUN servlet and jsp specifications.
See the original sun documents (downloadable from the sun site).
Regards,
Simon
-Original Message-
From: Steven Liu [SMTP:[EMAIL PROTECTED]]
Sent: Wednesday, Dece
Hi Steven,
The problem you have with your new directory structure is that the
WEB-INF directory isn't immediately below the webapp root.
In the first case, you have a webapp root of "execution", and WEB-INF
is directly below that directory, so this is OK.
In the second case, you need WEB-INF
Hi Paul,
I disagree with Guy's email here. There are several very good
reasons why your servlet classes *should* be within your webapp,
and *not* within your CLASSPATH. Just follow the examples that
come with tomcat, and you shouldn't go far wrong.
The sun servlet specs say quite explicitly
Hi David,
Tomcat 3.2.1 no longer reads the file $TOMCAT_HOME/conf/web.xml.
It is a bit misleading that it is still in the distribution, but you can
ignore
anything in this file.
Do you perhaps have something in *your* webapp's web.xml
file that refers to DefaultServlet??
-Original
Hi,
Is it possible to try tomcat stand-alone instead of behind
apache? That will eliminate half the possible sources of
the redirect problems..
-Original Message-
From: Cato, Christopher [SMTP:[EMAIL PROTECTED]]
Sent: Tuesday, December 19, 2000 10:32 PM
To: '[EMAIL PROTECTED]'
Hi Bill.
I believe a "sealing violation" is when a class which was loaded under one
classloader tries to call a class loaded under a different classloader, in
circumstances where this isn't allowed.
I suggest that the problem is therefore something to do with classpaths,
ie your classpath
And of course, Ted has assumed that you are running on windows.
For unix, there are additional issues, as port 80 can be listened on
only by programs running as "root".
-Original Message-
From: Ted Husted [SMTP:[EMAIL PROTECTED]]
Sent: Wednesday, December 20, 2000 10:55 AM
To:
t.InvokerInterceptor"
debug="0" prefix="/login/" /
2) Defined mappings in web.xml (in webapps/root/.../web.xml) for all
servlets that are in packages.
This seems to work when I requests to Tomcat directly. I wanted to
know:
A) whether the above configurations
Hi,
If you want to generate lots of HTML, with a little bit of java logic code,
then use jsp, and embed your java logic "in-line".
If you want to do lots of logic/computation, then generate a small amount
of html output, you may wish to use servlets only, and use "print"
statements to create
Matt,
I gave your page a spin, and it compiled file.
The system I tested with was:
OS: HP-UX11
jdk: java version "1.2.2.04" HotSpot VM (1.0.1fcs, mixed mode, PA2.0 build
1.2.2.04-00/04/14-PA_RISC2.0)
Tomcat3.2.1 stand-alone
I'll try it on a solaris machine sometime, just need to remember my
Hi Andrew,
Sounds like a weird problem!
The only thing I know of that changed between 3.1 and 3.2 which
*might* have this effect is the way that classloaders are used.
Just as a wild guess, double-check your classpath, and make
sure you have the smallest possible classpath set up before
Hi Carlos,
I think it unlikely that anyone is "studying the problem".
What you *can* get from this email group is tips from people who
have encountered the same problem in the past, or suggestions from
other people about how you might go about solving this yourself.
Unfortunately, there is
I agree. I think the problem is that webservers normally set the
http content type attribute header by figuring it out from the
file suffix. However, in your case your servlet is serving the
code, not the webserver, so you need to do this in your servlet.
I guess that in the absence of any http
Hi,
It seems to be working fine. Tomcat doesn't have any kind of
GUI interface as part of the server.
There is a minimal interface for administering tomcat, but it is
web-based, ie tomcat itself runs without an interface, and you
connect with a web-browser to tomcat in order to change its
Hi Dave,
IN a webapp, you can structure the directories containing
.jsp and .html files however you wish. However, your java
.class files need to be in a single "unified" directory tree,
under WEB-INF/classes.
This doesn't mean your source code has to be structured
in the same way. As long as
Try running the "stop" command several times.
If you eventually get a bunch of socket exceptions on the screen,
you know that it worked (the errors appear if you run stop, and there
is no tomcat instance to stop).
I think there are some problems with some JVMs, which are not
stopping all threads
Hi Bruce,
I'm not entirely sure what your problem is.
I'm almost certain you cannot include files "across contexts"
using jsp:include (ie run-time include). That would involve
invoking a servlet in one context from a servlet in another
context.
I'm almost certain that %@ include url (ie
Hi,
I suggest thinking of your mappings in two steps:
(a) get the mappings right *within* a context
(b) decide what context prefix you want.
If you ve a context with a path (ie url prefix) of
"mywebapp", then you can set up URLs as you desire
*within* that webapp.
Configuring the url-servlet
I can see a typo in there - you don't have a "" before PARAM
To check the output of your servlet, are you running it, using
"view source", saving the results then trying to run *that*?
This procedure will ensure you are testing exactly what
your servlet is generating...
-Original
to the parent directory which
includes "app1", "app2", and "include".
But in 3.2 when I do this I get 404's.
Kitching Simon wrote:
Hi Bruce,
I'm not entirely sure what your problem is.
I'm almost certain you cannot include files "across contexts"
staring to hard..
Is there a document anywhere that describes error messages? The error
message was not clear to me, but then again I am new to this.
[Kitching Simon]
For this type of error, probably not. As I said, tomcat uses an XML
parser (probably
Xerces, as it's from
If tomcat is running, the easiest way to find the version
is to get a directory listing (ie ask for any directory name
where there isn't an index file), and look at the bottom
for the server version.
-Original Message-
From: Craig R. McClanahan [SMTP:[EMAIL PROTECTED]]
Sent: Thursday,
Hi,
I just have a little bit extra to add to Andrea's email:
The problem is that when a browser has loaded a page containing
relative urls to other files, the *browser* resolves these into absolute
references by merging them with the URL that it *thinks* the
parent page was loaded from.
Hi Jay,
Why would you want to do this?
As far as I can see, having one object with 21 threads
is *more* efficient than 21 threads distributed across
two objects.
If you have some kind of lock contention, then using two
objects is not going to improve this; by definition, a lock is
only
Hi,
I think this answer is to a slightly different
question than the one that was asked...
The config example below limits the number of
threads handling client requests to 3. However,
any further clients that connect *wait* for an
earlier request to finish (freeing the thread).
The original
Hi,
No, 3.1 is not production quality - I know, I tried :-(
However, 3.2 is due out in a matter of a week or two.
I am using 3.2beta6 for a small-medium volume
business-to-business web site, and it is ok. Not
the fastest webserver in the world, but adequate,
open-source, free,
.
Also, in 3.2 beta 6 I could do an include() then a forward().
Now in 3.2 beta 7 I get an illegalState error on the forward()
because of an open outputstream. I'm not opening an output stream.
The include() must be doing it.
[Kitching Simon]
I don't think that it is valid
Simon]
Yes, no problem with this as far as I know.
Cheers,
Simon
Thanks.
--- Kitching Simon [EMAIL PROTECTED] wrote:
-Original Message-
From: Wyn Easton [SMTP:[EMAIL PROTECTED]]
Sent: Tuesday, November 14, 2000 12:24 PM
ContextInterceptor in server.xml?
[Kitching Simon]
I presume you mean *comment out* the AutoSetup.
This is exactly what needs to be done.
Will this effect anything else?
thanks!
[Kitching Simon]
Cheers,
Simon
Hi,
I really can't see what you are trying to achieve here.
What you have here appears to me to be infinite
recursion.
Maybe you need to look at the definition of what
jsp:forward does (see the sun jsp/servlet specs).
Maybe you really meant to use jsp:include??
or you just are trying to set
.
Is
there any way to cause an arbitrary file somewhere to be read by the Jsp
engine and returned to the client?
Richard
[Kitching Simon]
If you mean that you want to only allow access
to the jsps "via" the servlet, I think the correct
way to do this is t
://localhost/servlet/servletApp/ and I would like to access through
this
one http://localhost/servletAppAlias/.
Can I do this? How?
[Kitching Simon]
in yourwebapp/WEB-INF/web.xml,
(a) add a servlet entry
(b) add a servlet-mapping entry
I'm sure this is in either
Hi Jim,
[[ Everybody **PLEASE** specify your tomcat version in your questions ]]
I guess you aren't talking tomcat4, because you mention Interceptor.
If you are talking tomcat3.2, then there *isn't* a global web.xml file
anymore
(actually, it still exists in the downloaded code, but is
different from mine already uses a
class x contained in a JAR in its /lib dir. I also want to use that
class but my /lib dir contains a newer version. What will happen? Does
it depend on which servlet is loaded earlier or does each servlet get
the class from its /lib dir?
[Kitching Simon
Hi Zsolt,
The jsp:forward tag makes an internal "function call" to the
servlet corresponding to the page you specify. Clearly, this
doesn't make sense for a different site.
Instead, use jsp:redirect (I might not have got that name
quite right, I use scriptlet code
%
Hi Betty,
Actually, I *do* think that this information is available as part of a
normal HTTP request
(at least under some conditions, like if redirected by a page whose status
code is
"temporarily moved" or "permanently moved").
I have vague memories of using this feature from CGI about 4 years
Yes, but that's not really what Robert was asking.
The original question (as I read it) is really
* How can I find out what directories classes can be loaded from for a given
webapp.
I presume that if you call YourClassName.class.getClassLoader() for any
class inside
your webapp (eg from a
Actually, you can just rename it.
Jar currently uses the same format as zip.
-Original Message-
From: Ismael Blesa Part [SMTP:[EMAIL PROTECTED]]
Sent: Tuesday, November 07, 2000 12:17 PM
To: [EMAIL PROTECTED]
Subject: Re: Deploying a WAR with tomcat
No, It only takes jar
Hi,
This is one I'm having problems with too.
When using HPUX11.00 and java 1.2.2_04:
* With tomcat3.1, I needed 2 shutdown commands.
* With tomcat3.2b6, I now need 3 shutdown commands.
This difference is without changing the JVM, so it's
clearly something to do with tomcat code. It's very
Well, the real fix is to upgrade your Java Virtual Machine.
A segmentation violation can only be as a result of a bug
in the jvm.
If this jvm is the very latest release, then
(a) you might want to consider *downgrading* to an
earlier jvm version, and
(b) I think the jvm developers (blackdown?)
examples. (And from what I've seen this directory cannot be
inside the httpd/htdocs directory either. True?)
For example:
Add to tomcat-apache.conf file:
ApJServMount /MYDIRECTORY ajpv12://127.0.0.1:8007
Create a directory inside
/usr/local/tomcat/webapps/MYDIRECTORY
[Kitching Simon
Hi Tomcat developers,
I'd love to see some info on the release plans
for these products too. I presume that those of
you with "committer" status have some
general long-term plans
I understand that software development schedules
(and esp. open-source projects) are difficult to
estimate, but
Hi,
Maybe this is a file permissions or paths problem...
Check what user tomcat runs as when started from inittab.
Is this the same user you use when you "log in to linux" to
start tomcat? If not, does this user have access permissions
to the WEB-INF/classes directory, the web.xml file, etc?
Hi Paul,
When you say "the servlet's getInitParameter("test")" what *exactly* do you
mean?
Do you mean that your servlet's init method is like:
public void init(ServletConfig config) throws ServletException {
super.init(config);
Object o = config.getInitParameter("test");
If
Hi Ted,
This functionality works fine in tomcat3.1.
I (and many others on this email list) use
this without problems. I am sure that tomcat3.2
also does this, as this behaviour is defined in
sun's servlet specification.
The files should be in application/WEB-INF/lib.
Tomcat *does* add these to
What url did you type into your browser?
Assuming that your tomcat instance is installed
on the same PC as the browser you are using,
you should try:
http://localhost:8080
-Original Message-
From: [EMAIL PROTECTED] [SMTP:[EMAIL PROTECTED]]
Sent: Wednesday, October 25, 2000 1:14 PM
Just a thought - is Cocoon itself in your classpath, or
your WEB-INF/lib?
If the former, then the ClassLoader associated with
cocoon's code will be the standard classloader, and
may not find classes which are in the WEB-INF/classes
directory (accessable via the context's ClassLoader).
To: [EMAIL PROTECTED]
Subject: RE: WEB-INF/lib
I am doing everything according to the docs and sun spec. But the classes
in the jar file are unavailable. Is there a servlet variable I can check
at runtime to display my classpath?
Thanks,
Ted.
Kitc
Hi,
I guess that this is generated because
tomcat has seen that your jsp file has
been updated (its timestamp is newer
than the generated .class file), and so
is trying to move the class file generated
from the old .jsp file out of the way so
it can generate a .class file for the newer
version
Hi,
Just to spell things out a bit clearer:
The code for a servlet class, and any non-library
classes it uses, must be in the classpath. Your
best options are:
(a) put them under {yourwebapp}/WEB-INF/classes,
in a subdirectory that matches your package structure.
(b) put them in a jar file, in
90 matches
Mail list logo