You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by "Ellwood, Pifen" <pe...@cms.cendant.com> on 2000/11/22 17:05:06 UTC

RE: Changing root webapp-Can you take a look of my server.xml fil e?

Sorry to butt in, but I have the same issue and not been able to solve it
for several days.
It is driving my crazy

I'm using Tomcat3.2 bata7, Apache 1.3, ant 1.2 
I set up my web application in myhome/webapps/myapp created by build.xml.
I update the tomcat.conf file in the TOMCAT_HOME/conf add alias and
directory
as in the attached file 
I update the server.xml  file in the TOMCAT_HOME/conf add context path as
the documentation stated
   <Context path = "/myapp"
                  docbase="webapps/myapp"
                  debug="9"
                  reloadable="true">
   </Context>
      
When I start Tomcat, I got the error message:


Starting tomcat. Check logs/tomcat.log for error messages
2000-11-22 10:53:17 - ContextManager: Adding context Ctx(  )
2000-11-22 10:53:17 - ContextManager: Adding context Ctx( /test )
2000-11-22 10:53:18 - Ctx( /myapp ): XmlReader - init  /myapp null
2000-11-22 10:53:18 - Ctx( /myapp ): Loading -2147483646 jsp
Error generating automatic apache configuration
java.lang.NullPointerException
java.lang.NullPointerException
        at org.apache.tomcat.util.FileUtil.isAbsolute(FileUtil.java:289)
        at
org.apache.tomcat.task.ApacheConfig.execute(ApacheConfig.java:219)
        at
org.apache.tomcat.startup.Tomcat.generateServerConfig(Tomcat.java:219
)
        at org.apache.tomcat.startup.Tomcat.execute(Tomcat.java:202)
        at org.apache.tomcat.startup.Tomcat.main(Tomcat.java:237)
Error generating automatic Netscape configuration
java.lang.NullPointerException

java.lang.NullPointerException
        at org.apache.tomcat.util.FileUtil.isAbsolute(FileUtil.java:289)
        at org.apache.tomcat.task.NSConfig.execute(NSConfig.java:136)
        at
org.apache.tomcat.startup.Tomcat.generateServerConfig(Tomcat.java:231
)
        at org.apache.tomcat.startup.Tomcat.execute(Tomcat.java:202)
        at org.apache.tomcat.startup.Tomcat.main(Tomcat.java:237)
2000-11-22 10:53:19 - PoolTcpConnector: Starting HttpConnectionHandler on
8080
2000-11-22 10:53:19 - PoolTcpConnector: Starting Ajp12ConnectionHandler on
8007


Could you tell me what did I miss??

Thanks a lot

PiFen Ellwood


-----Original Message-----
From: Julio Serje (@canada.com) [mailto:jserje@home.com]
Sent: Tuesday, November 21, 2000 9:02 PM
To: tomcat-user@jakarta.apache.org
Subject: Re: Changing root webapp


You may define your root app in a different location than webapps. Just move
it to another directory and give the absolute path in your server.xml:


         <Context path=""
                  docBase="/absolutepath/main"
                  debug="1"
                  reloadable="true"
                  trusted="true" >
         </Context>

I have a setup like this and works fine.

Julio


----- Original Message -----
From: Richard Evans <rd...@webtrak.co.uk>
To: <to...@jakarta.apache.org>
Sent: Tuesday, November 21, 2000 11:22 AM
Subject: Changing root webapp


> In the default tomcat build there is a ROOT webapp which maps to /.  Now I
> would like to map the pages and servlets in ROOT to some other path and
have a
> webapp of my own which handles /.
>
> I tried something like this in server.xml:
>
>         <Context path="/root"
>                  docBase="webapps/ROOT"
>                  debug="0"
>                  reloadable="true"
>                  trusted="true" >
>         </Context>
>
> <!-- Main applications and servlets -->
>
>         <Context path=""
>                  docBase="webapps/main"
>                  debug="1"
>                  reloadable="true"
>                  trusted="true" >
>         </Context>
>
> In other words, /root will map to the tomcat home page, etc.  It works
fine
> except of course my main web app is loaded twice: once when server.xml is
read
> and once at autosetup time.  AutoSetup scans the webapps directory, finds
> "main" and because there isn't a /main context, loads the context again.
This
> means that my load-on-startup servlets get loaded twice.
>
> Is there a better way of doing this?
>
> Richard


Re: Changing root webapp-Can you take a look of my server.xml file?

Posted by "Julio Serje (@canada.com)" <js...@home.com>.
Oops,  I mean use normal slashes....  ///// !!!

Julio

----- Original Message -----
From: Julio Serje (@canada.com) <js...@home.com>
To: <to...@jakarta.apache.org>
Cc: <pe...@cms.cendant.com>
Sent: Wednesday, November 22, 2000 12:26 PM
Subject: Re: Changing root webapp-Can you take a look of my server.xml file?


> Hi, PiFen,
>
> I think you are making two mistakes:
>
> - a typo:      docbase="d:....."      should be docBase="d:...."
(capital
> B...)
> - do not use windows backslashes:    use instead normal backslashes  :
> d:/dev/etc/yourpath/myapp
>
> Hope it helps,
>
> Julio
>
>
> ----- Original Message -----
> From: Ellwood, Pifen <pe...@cms.cendant.com>
> To: <to...@jakarta.apache.org>
> Sent: Wednesday, November 22, 2000 11:05 AM
> Subject: RE: Changing root webapp-Can you take a look of my server.xml
file?
>
>
> > Sorry to butt in, but I have the same issue and not been able to solve
it
> > for several days.
> > It is driving my crazy
> >
> > I'm using Tomcat3.2 bata7, Apache 1.3, ant 1.2
> > I set up my web application in myhome/webapps/myapp created by
build.xml.
> > I update the tomcat.conf file in the TOMCAT_HOME/conf add alias and
> > directory
> > as in the attached file
> > I update the server.xml  file in the TOMCAT_HOME/conf add context path
as
> > the documentation stated
> >    <Context path = "/myapp"
> >                   docbase="webapps/myapp"
> >                   debug="9"
> >                   reloadable="true">
> >    </Context>
> >
> > When I start Tomcat, I got the error message:
> >
> >
> > Starting tomcat. Check logs/tomcat.log for error messages
> > 2000-11-22 10:53:17 - ContextManager: Adding context Ctx(  )
> > 2000-11-22 10:53:17 - ContextManager: Adding context Ctx( /test )
> > 2000-11-22 10:53:18 - Ctx( /myapp ): XmlReader - init  /myapp null
> > 2000-11-22 10:53:18 - Ctx( /myapp ): Loading -2147483646 jsp
> > Error generating automatic apache configuration
> > java.lang.NullPointerException
> > java.lang.NullPointerException
> >         at org.apache.tomcat.util.FileUtil.isAbsolute(FileUtil.java:289)
> >         at
> > org.apache.tomcat.task.ApacheConfig.execute(ApacheConfig.java:219)
> >         at
> > org.apache.tomcat.startup.Tomcat.generateServerConfig(Tomcat.java:219
> > )
> >         at org.apache.tomcat.startup.Tomcat.execute(Tomcat.java:202)
> >         at org.apache.tomcat.startup.Tomcat.main(Tomcat.java:237)
> > Error generating automatic Netscape configuration
> > java.lang.NullPointerException
> >
> > java.lang.NullPointerException
> >         at org.apache.tomcat.util.FileUtil.isAbsolute(FileUtil.java:289)
> >         at org.apache.tomcat.task.NSConfig.execute(NSConfig.java:136)
> >         at
> > org.apache.tomcat.startup.Tomcat.generateServerConfig(Tomcat.java:231
> > )
> >         at org.apache.tomcat.startup.Tomcat.execute(Tomcat.java:202)
> >         at org.apache.tomcat.startup.Tomcat.main(Tomcat.java:237)
> > 2000-11-22 10:53:19 - PoolTcpConnector: Starting HttpConnectionHandler
on
> > 8080
> > 2000-11-22 10:53:19 - PoolTcpConnector: Starting Ajp12ConnectionHandler
on
> > 8007
> >
> >
> > Could you tell me what did I miss??
> >
> > Thanks a lot
> >
> > PiFen Ellwood
> >
> >
> > -----Original Message-----
> > From: Julio Serje (@canada.com) [mailto:jserje@home.com]
> > Sent: Tuesday, November 21, 2000 9:02 PM
> > To: tomcat-user@jakarta.apache.org
> > Subject: Re: Changing root webapp
> >
> >
> > You may define your root app in a different location than webapps. Just
> move
> > it to another directory and give the absolute path in your server.xml:
> >
> >
> >          <Context path=""
> >                   docBase="/absolutepath/main"
> >                   debug="1"
> >                   reloadable="true"
> >                   trusted="true" >
> >          </Context>
> >
> > I have a setup like this and works fine.
> >
> > Julio
> >
> >
> > ----- Original Message -----
> > From: Richard Evans <rd...@webtrak.co.uk>
> > To: <to...@jakarta.apache.org>
> > Sent: Tuesday, November 21, 2000 11:22 AM
> > Subject: Changing root webapp
> >
> >
> > > In the default tomcat build there is a ROOT webapp which maps to /.
Now
> I
> > > would like to map the pages and servlets in ROOT to some other path
and
> > have a
> > > webapp of my own which handles /.
> > >
> > > I tried something like this in server.xml:
> > >
> > >         <Context path="/root"
> > >                  docBase="webapps/ROOT"
> > >                  debug="0"
> > >                  reloadable="true"
> > >                  trusted="true" >
> > >         </Context>
> > >
> > > <!-- Main applications and servlets -->
> > >
> > >         <Context path=""
> > >                  docBase="webapps/main"
> > >                  debug="1"
> > >                  reloadable="true"
> > >                  trusted="true" >
> > >         </Context>
> > >
> > > In other words, /root will map to the tomcat home page, etc.  It works
> > fine
> > > except of course my main web app is loaded twice: once when server.xml
> is
> > read
> > > and once at autosetup time.  AutoSetup scans the webapps directory,
> finds
> > > "main" and because there isn't a /main context, loads the context
again.
> > This
> > > means that my load-on-startup servlets get loaded twice.
> > >
> > > Is there a better way of doing this?
> > >
> > > Richard
> >
> >
>


Re: Changing root webapp-Can you take a look of my server.xml file?

Posted by "Julio Serje (@canada.com)" <js...@home.com>.
Hi, PiFen,

I think you are making two mistakes:

- a typo:      docbase="d:....."      should be docBase="d:...."    (capital
B...)
- do not use windows backslashes:    use instead normal backslashes  :
d:/dev/etc/yourpath/myapp

Hope it helps,

Julio


----- Original Message -----
From: Ellwood, Pifen <pe...@cms.cendant.com>
To: <to...@jakarta.apache.org>
Sent: Wednesday, November 22, 2000 11:05 AM
Subject: RE: Changing root webapp-Can you take a look of my server.xml file?


> Sorry to butt in, but I have the same issue and not been able to solve it
> for several days.
> It is driving my crazy
>
> I'm using Tomcat3.2 bata7, Apache 1.3, ant 1.2
> I set up my web application in myhome/webapps/myapp created by build.xml.
> I update the tomcat.conf file in the TOMCAT_HOME/conf add alias and
> directory
> as in the attached file
> I update the server.xml  file in the TOMCAT_HOME/conf add context path as
> the documentation stated
>    <Context path = "/myapp"
>                   docbase="webapps/myapp"
>                   debug="9"
>                   reloadable="true">
>    </Context>
>
> When I start Tomcat, I got the error message:
>
>
> Starting tomcat. Check logs/tomcat.log for error messages
> 2000-11-22 10:53:17 - ContextManager: Adding context Ctx(  )
> 2000-11-22 10:53:17 - ContextManager: Adding context Ctx( /test )
> 2000-11-22 10:53:18 - Ctx( /myapp ): XmlReader - init  /myapp null
> 2000-11-22 10:53:18 - Ctx( /myapp ): Loading -2147483646 jsp
> Error generating automatic apache configuration
> java.lang.NullPointerException
> java.lang.NullPointerException
>         at org.apache.tomcat.util.FileUtil.isAbsolute(FileUtil.java:289)
>         at
> org.apache.tomcat.task.ApacheConfig.execute(ApacheConfig.java:219)
>         at
> org.apache.tomcat.startup.Tomcat.generateServerConfig(Tomcat.java:219
> )
>         at org.apache.tomcat.startup.Tomcat.execute(Tomcat.java:202)
>         at org.apache.tomcat.startup.Tomcat.main(Tomcat.java:237)
> Error generating automatic Netscape configuration
> java.lang.NullPointerException
>
> java.lang.NullPointerException
>         at org.apache.tomcat.util.FileUtil.isAbsolute(FileUtil.java:289)
>         at org.apache.tomcat.task.NSConfig.execute(NSConfig.java:136)
>         at
> org.apache.tomcat.startup.Tomcat.generateServerConfig(Tomcat.java:231
> )
>         at org.apache.tomcat.startup.Tomcat.execute(Tomcat.java:202)
>         at org.apache.tomcat.startup.Tomcat.main(Tomcat.java:237)
> 2000-11-22 10:53:19 - PoolTcpConnector: Starting HttpConnectionHandler on
> 8080
> 2000-11-22 10:53:19 - PoolTcpConnector: Starting Ajp12ConnectionHandler on
> 8007
>
>
> Could you tell me what did I miss??
>
> Thanks a lot
>
> PiFen Ellwood
>
>
> -----Original Message-----
> From: Julio Serje (@canada.com) [mailto:jserje@home.com]
> Sent: Tuesday, November 21, 2000 9:02 PM
> To: tomcat-user@jakarta.apache.org
> Subject: Re: Changing root webapp
>
>
> You may define your root app in a different location than webapps. Just
move
> it to another directory and give the absolute path in your server.xml:
>
>
>          <Context path=""
>                   docBase="/absolutepath/main"
>                   debug="1"
>                   reloadable="true"
>                   trusted="true" >
>          </Context>
>
> I have a setup like this and works fine.
>
> Julio
>
>
> ----- Original Message -----
> From: Richard Evans <rd...@webtrak.co.uk>
> To: <to...@jakarta.apache.org>
> Sent: Tuesday, November 21, 2000 11:22 AM
> Subject: Changing root webapp
>
>
> > In the default tomcat build there is a ROOT webapp which maps to /.  Now
I
> > would like to map the pages and servlets in ROOT to some other path and
> have a
> > webapp of my own which handles /.
> >
> > I tried something like this in server.xml:
> >
> >         <Context path="/root"
> >                  docBase="webapps/ROOT"
> >                  debug="0"
> >                  reloadable="true"
> >                  trusted="true" >
> >         </Context>
> >
> > <!-- Main applications and servlets -->
> >
> >         <Context path=""
> >                  docBase="webapps/main"
> >                  debug="1"
> >                  reloadable="true"
> >                  trusted="true" >
> >         </Context>
> >
> > In other words, /root will map to the tomcat home page, etc.  It works
> fine
> > except of course my main web app is loaded twice: once when server.xml
is
> read
> > and once at autosetup time.  AutoSetup scans the webapps directory,
finds
> > "main" and because there isn't a /main context, loads the context again.
> This
> > means that my load-on-startup servlets get loaded twice.
> >
> > Is there a better way of doing this?
> >
> > Richard
>
>