You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by St...@asknet.de on 2001/07/18 19:36:05 UTC
Multiple virtual host with individual webapp dirs , one tomcat
Hi guys,
maybe this is obvious, but I just don't get it.
I configured several virtual hosts with several individual contexts defined
in server.xml.
Works fine.
Is it possible to give every single vhost his own webapp-dir where
developpers can put
new contexts, which are automatically added after restarting tomcat so no
editing of server.xml
is required.
I understand that I can configure the base location with home in
<ContextManager>. Is
there a similar way to solve my problem.
Thanks for your input and take care,
stefan
Re: JSP's not finding classes in WEB-INF
Posted by Will England <wi...@mylanders.com>.
On Wed, 18 Jul 2001, Aditya Anand wrote:
> this seems stupid but did u restart the server!...
> also you do have the servlets defined in
> web.xml..right?
>
Yes, I restared the server. <grin>
> My servlets and Beans are in separate jar files under
> WEB-INF/lib, which also contains other jars need,
> Ihave never touched the classpath setup by Tomcat, and
> it orks just fine....
Look at your classpath as echoed by the tomcat script - most likely you
have pointers in there to the servlets and beans directories. The tomcat
script adds your environment classpath to the end of the classpath it
dynamically generates.
I've taken that part of the script out, so that the only things in the
classpath are the jar files in TOMCAT_HOME/lib.
> Can I have a peek at the logs?
No logs, just the errors. If you want the whole error text I can send it
to you. Won't be very helpful, tho, all it boils down to is "I can't find
your classes!"
Will
Re: JSP's not finding classes in WEB-INF
Posted by Aditya Anand <ad...@yahoo.com>.
this seems stupid but did u restart the server!...
also you do have the servlets defined in
web.xml..right?
I use 4.0 b-5, and I haven't come across this problem,
My servlets and Beans are in separate jar files under
WEB-INF/lib, which also contains other jars need,
Ihave never touched the classpath setup by Tomcat, and
it orks just fine....
Can I have a peek at the logs?
--- Will England <wi...@mylanders.com> wrote:
> On Wed, 18 Jul 2001, Aditya Anand wrote:
>
> > > However, every time I hit a JSP page, it gives a
> 500
> > > error about how it
> > > cannot find classes to compile. Those classes
> are
> > > located in the WEB-INF
> > > directory, under the /classes folder.
> >
> > I assume these are your bean classes. These should
> be
> > put under the WEB-INF/lib directory rather than
> the
> > classes directory. The classes directory is ment
> only
> > for un-jarred servlet classes that have been
> declared
> > in the web.xml file.
>
> Actually, just to make things interesting, those
> *are* servlet
> classes. We have both servlets and JSP's that use
> library classes for
> various things. Currently, they live in
> WEB-INF/classes. One of these
> years we'll get things sorted out a bit better.
>
> > Put any servlet jars, beans, and required
> > non-statndard libraries under the lib folder (like
> > log4J, or xalan)
>
> Ok, so I created a jar file with the servlet classes
> and library classes
> in it and moved it to WEB-INF/lib.
>
> Didn't work.
>
> I cannot put this .jar file in TOMCAT_HOME/lib --
> each context / virtual
> host will have slightly different bits in the
> servlets.
>
> Will
>
__________________________________________________
Do You Yahoo!?
Get personalized email addresses from Yahoo! Mail
http://personal.mail.yahoo.com/
Re: JSP's not finding classes in WEB-INF
Posted by Will England <wi...@mylanders.com>.
On Wed, 18 Jul 2001, Aditya Anand wrote:
> > However, every time I hit a JSP page, it gives a 500
> > error about how it
> > cannot find classes to compile. Those classes are
> > located in the WEB-INF
> > directory, under the /classes folder.
>
> I assume these are your bean classes. These should be
> put under the WEB-INF/lib directory rather than the
> classes directory. The classes directory is ment only
> for un-jarred servlet classes that have been declared
> in the web.xml file.
Actually, just to make things interesting, those *are* servlet
classes. We have both servlets and JSP's that use library classes for
various things. Currently, they live in WEB-INF/classes. One of these
years we'll get things sorted out a bit better.
> Put any servlet jars, beans, and required
> non-statndard libraries under the lib folder (like
> log4J, or xalan)
Ok, so I created a jar file with the servlet classes and library classes
in it and moved it to WEB-INF/lib.
Didn't work.
I cannot put this .jar file in TOMCAT_HOME/lib -- each context / virtual
host will have slightly different bits in the servlets.
Will
Re: JSP's not finding classes in WEB-INF
Posted by Aditya Anand <ad...@yahoo.com>.
> Greetings!
>
> Ok - running Tomcat 3.2 on SunOS 2.7, with Java 1.2.
>
>
> I have a working application with servlets and JSP
> pages running under
> Tomcat 3.1. I'm trying to port it to 3.2.
>
> However, every time I hit a JSP page, it gives a 500
> error about how it
> cannot find classes to compile. Those classes are
> located in the WEB-INF
> directory, under the /classes folder.
I assume these are your bean classes. These should be
put under the WEB-INF/lib directory rather than the
classes directory. The classes directory is ment only
for un-jarred servlet classes that have been declared
in the web.xml file.
> The classpath does *not* contain the WEB-INF/classes
> directory.
you donot have to specify WEB-INF/classes in the
system classpath
> If I hard-code the WEB-INF/classes directory into
> the classpath, they
> work. However, I do not want to do this.
>
> What is the problem, and how can I resolve it?
>
> I have tried settiing the environment variables
> TOMCAT_HOME and JAVA_HOME,
> and moving tools.jar into TOMCAT_HOME/lib.
Put any servlet jars, beans, and required
non-statndard libraries under the lib folder (like
log4J, or xalan)
cheers
Adi
__________________________________________________
Do You Yahoo!?
Get personalized email addresses from Yahoo! Mail
http://personal.mail.yahoo.com/
JSP's not finding classes in WEB-INF
Posted by Will England <wi...@mylanders.com>.
Greetings!
Ok - running Tomcat 3.2 on SunOS 2.7, with Java 1.2.
I have a working application with servlets and JSP pages running under
Tomcat 3.1. I'm trying to port it to 3.2.
However, every time I hit a JSP page, it gives a 500 error about how it
cannot find classes to compile. Those classes are located in the WEB-INF
directory, under the /classes folder.
The classpath does *not* contain the WEB-INF/classes directory.
If I hard-code the WEB-INF/classes directory into the classpath, they
work. However, I do not want to do this.
What is the problem, and how can I resolve it?
I have tried settiing the environment variables TOMCAT_HOME and JAVA_HOME,
and moving tools.jar into TOMCAT_HOME/lib.
Thanks for any tips or pointers!
Will
--
/~>'find `funny quote`': Command not found; humor not installed.
1986 Concours 72,xxx 1982 Maxim 12,xxx (For Sale!) CDA #00046
Overland Park, KS will@mylanders.com PCS: 316-371-FOAD
http://will.mylanders.com/
Re: Multiple virtual host with individual webapp dirs , one tomcat
Posted by "Craig R. McClanahan" <cr...@apache.org>.
On Wed, 18 Jul 2001 Stefan.Raschke@asknet.de wrote:
>
> Hi guys,
>
> maybe this is obvious, but I just don't get it.
>
>
> I configured several virtual hosts with several individual contexts defined
> in server.xml.
> Works fine.
>
> Is it possible to give every single vhost his own webapp-dir where
> developpers can put
> new contexts, which are automatically added after restarting tomcat so no
> editing of server.xml
> is required.
>
> I understand that I can configure the base location with home in
> <ContextManager>. Is
> there a similar way to solve my problem.
>
>
> Thanks for your input and take care,
>
>
> stefan
>
>
It's not feasible in 3.2, but 4.0 works exactly the way you
describe. Each virtual host has a directory configured with the
"appBase" attribute of the <Host> element, and webapps for that virtual
host are automatically configured (the way that "webapps" works in 3.2).
Craig McClanahan
Re: Multiple virtual host with individual webapp dirs , one tomcat
Posted by Gary Dale <ga...@mail1.moh.gov.on.ca>.
Actually, if you put your hosts in webapps, Tomcat will automatically
create contexts for them, However, these will be in the form
http://server.domain..com/appname/. This is essentially the same as your
.war suggesting.
Creating virtual hosts out of them is a different kettle of fish.
However, it seems that a simple shell script would do the trick - just
find each directory and generate a virtual host entry for it.
Will England wrote:
>On Wed, 18 Jul 2001 Stefan.Raschke@asknet.de wrote:
>
>>Is it possible to give every single vhost his own webapp-dir where
>>developpers can put
>>new contexts, which are automatically added after restarting tomcat so no
>>editing of server.xml
>>is required.
>>
>
>If you want to *change* the code in a context, you can do this just by
>adding the new class files under the WEB-INF directory.
>
>If you want to add a *new* context that didn't already exist, you have to
>edit the server.xml file.
>
>One other option is to have the developers jar up the whole application
>and deploy it to TOMCAT_HOME/webapps as a .war file.
>
>Then, no changes are needed to server.xml; tomcat just reads and expands
>the .war file and runs with it. Never did this, not sure how well it
>works.
>
>Will
>
>
>
>
Re: Multiple virtual host with individual webapp dirs , one tomcat
Posted by Will England <wi...@mylanders.com>.
On Wed, 18 Jul 2001 Stefan.Raschke@asknet.de wrote:
> Is it possible to give every single vhost his own webapp-dir where
> developpers can put
> new contexts, which are automatically added after restarting tomcat so no
> editing of server.xml
> is required.
If you want to *change* the code in a context, you can do this just by
adding the new class files under the WEB-INF directory.
If you want to add a *new* context that didn't already exist, you have to
edit the server.xml file.
One other option is to have the developers jar up the whole application
and deploy it to TOMCAT_HOME/webapps as a .war file.
Then, no changes are needed to server.xml; tomcat just reads and expands
the .war file and runs with it. Never did this, not sure how well it
works.
Will