Well, AFAIK, each directory in the webapps folder is treated as a context,
and tomcat searches for web.xml inside the WEB-INF folder (if not found it
uses the "default" web.xml - i'd like the experts to interject, if i am
mistaken). so, the assumption of your program running without a context is
not valid - there is indeed a context created for your application.

You need to create a context specifically in server.xml if you want some
default initializations to happen - configuration of datasources for
example, prior to the context loading. most applications, while being
deployed, do not need an explicit context (again, i suggest you also read up
the opinion of other experts on the list - i'm not that good at tomcat,
yet).

~manav.
----- Original Message -----
From: "eric" <[EMAIL PROTECTED]>
To: "Tomcat Users List" <[EMAIL PROTECTED]>
Sent: Sunday, January 19, 2003 6:49 AM
Subject: Re: WAR Problem - That was it


> Manav,
>
> Your suggestion did the trick.  I commented out the context for apress in
> server.xml and the war was unpacked.
>
> Next question is:  The program seems to be running ok without a Context.
What
> happened?  Suppose I just leave the Context for apress commented out.
What
> will be the effect of that?
>
> Thanks for your help!!
> Eric
>
> On Monday 20 January 2003 02:53, Manavendra Gupta wrote:
> > Hi Eric,
> >
> > I'm not sure what has happened. I see two things in error.log that you
> > posted:
> >
> > 1. tomcat tries to remove the child while shutting down, and gets an
error
> > that the context /apress has not been started yet.
> > 2. while starting up, tomcat again tries to bring up the context /apress
> > but encounters an error while trying to configure resources, and does
not
> > load the context.
> >
> > Also, you mentioned you have that context mentioned in the server.xml -
i
> > don't think you need to do that. maybe, while starting up, tomcat sees
that
> > context in server.xml and tries to load it and finds nothing and fails.
> > when it next finds the apress.war maybe it doesn't load it since it
assumes
> > that a context with the same name had to failed to start.
> >
> > could you try cleaning up your work folders, removing the entry from the
> > server.xml about the context apress and try again?
> >
> > ~manav.
> > ----- Original Message -----
> > From: "eric" <[EMAIL PROTECTED]>
> > To: "Tomcat Users List" <[EMAIL PROTECTED]>
> > Sent: Sunday, January 19, 2003 1:45 AM
> > Subject: Re: WAR Problem - No Go
> >
> > > Mark,
> > >
> > > Tried that and it still didn't work.  Here's the output of the error
log.
> > > Perhaps I need to disable the context /apress in server.xml?  Doesn't
> > > make much sense though.
> > >
> > > 2003-01-19 10:39:46 StandardHost[localhost]: Removing web application
at
> > > context path /admin
> > > 2003-01-19 10:39:46 StandardHost[localhost]: Removing web application
at
> > > context path /webdav
> > > 2003-01-19 10:39:46 StandardHost[localhost]: Removing web application
at
> > > context path /apress
> > > 2003-01-19 10:39:46 StandardHost[localhost]:
ContainerBase.removeChild:
> >
> > stop:
> > > LifecycleException:  Container StandardContext[/apress] has not been
> >
> > started
> >
> > > at
> >
> > org.apache.catalina.core.StandardContext.stop(StandardContext.java:3643)
> >
> > > at
> >
> >
org.apache.catalina.core.ContainerBase.removeChild(ContainerBase.java:1036)
> >
> > > at
> >
> >
org.apache.catalina.core.StandardHostDeployer.remove(StandardHostDeployer.j
> >a va:420)
> >
> > > at org.apache.catalina.core.StandardHost.remove(StandardHost.java:852)
> > > at
> >
> > org.apache.catalina.startup.HostConfig.undeployApps(HostConfig.java:919)
> >
> > > at org.apache.catalina.startup.HostConfig.stop(HostConfig.java:899)
> > > at
> >
> >
org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:370)
> >
> > > at
> >
> >
org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSuppo
> >r t.java:166)
> >
> > > at
org.apache.catalina.core.ContainerBase.stop(ContainerBase.java:1221)
> > > at
org.apache.catalina.core.ContainerBase.stop(ContainerBase.java:1233)
> > > at
> > >
org.apache.catalina.core.StandardService.stop(StandardService.java:554)
> > > at
org.apache.catalina.core.StandardServer.stop(StandardServer.java:2224)
> > > at org.apache.catalina.startup.Catalina.start(Catalina.java:543) at
> > > org.apache.catalina.startup.Catalina.execute(Catalina.java:400) at
> > > org.apache.catalina.startup.Catalina.process(Catalina.java:180) at
> > > sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> > > at
> >
> >
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:3
> >9 )
> >
> > > at
> >
> >
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImp
> >l .java:25)
> >
> > > at java.lang.reflect.Method.invoke(Method.java:324)
> > > at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:203)
> > >
> > > 2003-01-19 10:39:46 StandardHost[localhost]: Removing web application
at
> > > context path /examples
> > > 2003-01-19 10:39:46 StandardHost[localhost]: Removing web application
at
> > > context path /tomcat-docs
> > > 2003-01-19 10:39:46 StandardHost[localhost]: Removing web application
at
> > > context path
> > > 2003-01-19 10:39:46 StandardHost[localhost]: Removing web application
at
> > > context path /manager
> > > 2003-01-19 10:39:46 StandardHost[localhost]: Removing web application
at
> > > context path /ch03
> > > 2003-01-19 10:39:53 StandardContext[/apress]: Starting
> > > 2003-01-19 10:39:53 StandardContext[/apress]: Processing start(),
current
> > > available=false
> > > 2003-01-19 10:39:53 StandardContext[/apress]: Configuring default
> >
> > Resources
> >
> > > 2003-01-19 10:39:53 StandardContext[/apress]: Resources start failed:
> > > 2003-01-19 10:39:53 StandardContext[/apress]: Configuring
non-privileged
> > > default Loader
> > > 2003-01-19 10:39:53 StandardContext[/apress]: Configuring default
Manager
> > > 2003-01-19 10:39:53 StandardContext[/apress]: Processing standard
> >
> > container
> >
> > > startup
> > > 2003-01-19 10:39:53 StandardContext[/apress]: Context startup failed
due
> >
> > to
> >
> > > previous errors
> > > 2003-01-19 10:39:53 StandardContext[/apress]: Exception during cleanup
> >
> > after
> >
> > > start failed
> > > LifecycleException:  Container StandardContext[/apress] has not been
> >
> > started
> >
> > > at
> >
> > org.apache.catalina.core.StandardContext.stop(StandardContext.java:3643)
> >
> > > at
> >
> >
org.apache.catalina.core.StandardContext.start(StandardContext.java:3621)
> >
> > > at
org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1188)
> > > at org.apache.catalina.core.StandardHost.start(StandardHost.java:738)
> > > at
org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1188)
> > > at
org.apache.catalina.core.StandardEngine.start(StandardEngine.java:347)
> > > at
> >
> > org.apache.catalina.core.StandardService.start(StandardService.java:497)
> >
> > > at
> > >
org.apache.catalina.core.StandardServer.start(StandardServer.java:2189)
> > > at org.apache.catalina.startup.Catalina.start(Catalina.java:512) at
> > > org.apache.catalina.startup.Catalina.execute(Catalina.java:400) at
> > > org.apache.catalina.startup.Catalina.process(Catalina.java:180) at
> > > sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> > > at
> >
> >
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:3
> >9 )
> >
> > > at
> >
> >
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImp
> >l .java:25)
> >
> > > at java.lang.reflect.Method.invoke(Method.java:324)
> > > at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:203)
> > >
> > > 2003-01-19 10:39:54 HostConfig[localhost]: HostConfig: Processing
START
> > > 2003-01-19 10:39:54 HostConfig[localhost]: Deploying discovered web
> > > applications
> > > 2003-01-19 10:39:54 HostConfig[localhost]: Deploying configuration
> >
> > descriptor
> >
> > > manager.xml
> > > 2003-01-19 10:39:54 WebappLoader[/manager]: Deploying class
repositories
> >
> > to
> >
> > > work directory
> >
> >
/usr/local/jakarta-tomcat-4.1.18-LE-jdk14/work/Standalone/localhost/manager
> >
> > > 2003-01-19 10:39:54 ContextConfig[/manager]: Configured an
authenticator
> >
> > for
> >
> > > method BASIC
> > > 2003-01-19 10:39:54 StandardManager[/manager]: Seeding random number
> >
> > generator
> >
> > > class java.security.SecureRandom
> > > 2003-01-19 10:39:54 StandardManager[/manager]: Seeding of random
number
> > > generator has been completed
> > > 2003-01-19 10:39:54 StandardWrapper[/manager:default]: Loading
container
> > > servlet default
> > > 2003-01-19 10:39:54 StandardWrapper[/manager:invoker]: Loading
container
> > > servlet invoker
> > > 2003-01-19 10:39:54 HostConfig[localhost]: Deploying configuration
> >
> > descriptor
> >
> > > admin.xml
> > > 2003-01-19 10:39:57 HostConfig[localhost]: Deploying web application
> >
> > directory
> >
> > > ROOT
> > > 2003-01-19 10:39:57 StandardHost[localhost]: Installing web
application
> > > at context path  from URL
> > > file:/usr/local/jakarta-tomcat-4.1.18-LE-jdk14/webapps/ROOT
> > > 2003-01-19 10:39:57 WebappLoader[]: Deploying class repositories to
work
> > > directory
> > > /usr/local/jakarta-tomcat-4.1.18-LE-jdk14/work/Standalone/localhost/_
> > > 2003-01-19 10:39:57 StandardManager[]: Seeding random number generator
> >
> > class
> >
> > > java.security.SecureRandom
> > > 2003-01-19 10:39:57 StandardManager[]: Seeding of random number
generator
> >
> > has
> >
> > > been completed
> > > 2003-01-19 10:39:57 StandardWrapper[:default]: Loading container
servlet
> > > default
> > > 2003-01-19 10:39:57 StandardWrapper[:invoker]: Loading container
servlet
> > > invoker
> > > 2003-01-19 10:39:57 HostConfig[localhost]: Deploying web application
> >
> > directory
> >
> > > tomcat-docs
> > > 2003-01-19 10:39:57 StandardHost[localhost]: Installing web
application
> > > at context path /tomcat-docs from URL
> > > file:/usr/local/jakarta-tomcat-4.1.18-LE-jdk14/webapps/tomcat-docs
> > > 2003-01-19 10:39:57 WebappLoader[/tomcat-docs]: Deploying class
> >
> > repositories
> >
> > > to work directory
> >
> >
/usr/local/jakarta-tomcat-4.1.18-LE-jdk14/work/Standalone/localhost/tomcat-
> >d ocs
> >
> > > 2003-01-19 10:39:57 StandardManager[/tomcat-docs]: Seeding random
number
> > > generator class java.security.SecureRandom
> > > 2003-01-19 10:39:57 StandardManager[/tomcat-docs]: Seeding of random
> >
> > number
> >
> > > generator has been completed
> > > 2003-01-19 10:39:57 StandardWrapper[/tomcat-docs:default]: Loading
> >
> > container
> >
> > > servlet default
> > > 2003-01-19 10:39:57 StandardWrapper[/tomcat-docs:invoker]: Loading
> >
> > container
> >
> > > servlet invoker
> > > 2003-01-19 10:39:57 HostConfig[localhost]: Deploying web application
> >
> > directory
> >
> > > webdav
> > > 2003-01-19 10:39:57 StandardHost[localhost]: Installing web
application
> > > at context path /webdav from URL
> > > file:/usr/local/jakarta-tomcat-4.1.18-LE-jdk14/webapps/webdav
> > > 2003-01-19 10:39:57 WebappLoader[/webdav]: Deploying class
repositories
> > > to work directory
> > >
/usr/local/jakarta-tomcat-4.1.18-LE-jdk14/work/Standalone/localhost/webda
> > >v 2003-01-19 10:39:57 StandardManager[/webdav]: Seeding random number
> >
> > generator
> >
> > > class java.security.SecureRandom
> > > 2003-01-19 10:39:57 StandardManager[/webdav]: Seeding of random number
> > > generator has been completed
> > > 2003-01-19 10:39:57 StandardWrapper[/webdav:default]: Loading
container
> > > servlet default
> > > 2003-01-19 10:39:57 StandardWrapper[/webdav:invoker]: Loading
container
> > > servlet invoker
> > > 2003-01-19 10:39:57 HostConfig[localhost]:  Starting background thread
> > > 2003-01-19 10:39:57 HostConfig[localhost]: BACKGROUND THREAD Starting
> > > 2003-01-19 10:40:12 HostConfig[localhost]: Deploying discovered web
> > > applications
> > > 2003-01-19 10:40:27 HostConfig[localhost]: Deploying discovered web
> > > applications
> > > default
> > >
> > > On Sunday 19 January 2003 10:08, Mark Eggers wrote:
> > > > Try stomping the work file directory found in:
> > > >
> > > > /usr/local/tomcat/work/Standalone/localhost
> > > >
> > > > Then restart and see what happens.
> > > >
> > > > Oops - just reread your message.
> > > >
> > > > You need to change to /usr/local/tomcat/webapps.
> > > >
> > > > Then execute the following command:
> > > >
> > > > jar cvf apress.war apress/*
> > > >
> > > > The problem is you don't have your top level directory
> > > > name when you change into the directory and jar the
> > > > application.
> > > >
> > > > To convince yourself of this take your file and do a
> > > > jar tf apress.war.  Then remove the war file, change
> > > > to the webapps directory, issue the jar cvf apress/*
> > > > command and verify it with jar tf apress.war.
> > > >
> > > > HTH
> > > >
> > > > /mde/
> > > > just my two cents . . . .
> > > >
> > > > At 09:40 AM 1/19/2003 +0100, you wrote:
> > > > Greetings!
> > > >
> > > > New to Jakarta and I'm stuck.  Again, most likely
> > > > an easy solution but I can't find it.
> > > >
> > > > I'm following the instructions in a book on deploying
> > > > a war file yet it won't automatically expand when I
> > > > restart Tomcat.  Here's the steps I took and some
> > > > config stuff:
> > > >
> > > > I cd to the working directory of the application, in
> > > > this case
> > > >
> > > > /usr/local/tomcat/webapps/apress
> > > > jar cvf apress.war .
> > > >
> > > > I then move apress.war to
> > > > /usr/local/tomcat/webapps and delete the apress
> > > > directory.
> > > >
> > > > Yet when I restart Tomcat the apress.war file remains
> > > > and there is no directory called apress.
> > > >
> > > > I've read that Tomcat can use the war file rather than
> > > > a directory but there are some problems.  In my case
> > > > the first page (jsp) appears ok, but it chokes when
> > > > calling the servlet.
> > > >
> > > > __________________________________________________
> > > > Do you Yahoo!?
> > > > Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
> > > > http://mailplus.yahoo.com
> > >
> > > --
> > > To unsubscribe, e-mail:
> >
> > <mailto:[EMAIL PROTECTED]>
> >
> > > For additional commands, e-mail:
> >
> > <mailto:[EMAIL PROTECTED]>
>
>
> --
> To unsubscribe, e-mail:
<mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail:
<mailto:[EMAIL PROTECTED]>
>


--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to