You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by John Le <Jo...@PACCAR.com> on 2008/01/28 17:49:16 UTC

ROOT not working

Hi,
I am trying to use a 3rd party web application in the webapps/ROOT
folder so my domain name will just be localhost:8080. However for some
reason it doesn't work, I get an error status 500 when I try to load up
the website. The web application came as a WAR file, let's say MyApp.WAR
and when I place it in the webapps folder and have tomcat (version
5.5.2) auto extract it to the default webapps/MyApp it works fine. Any
ideas?
It's a Java web app and I have JDK 1.5.0_07.

 

Here is the error I get on the web, they aren't showing up in the tomcat
logs:
type Exception report

message 

description The server encountered an internal error () that prevented
it from fulfilling this request.

exception 

org.apache.jasper.JasperException

 
org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServle
tWrapper.java:512)

 
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.ja
va:377)

 
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)

 
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)

        javax.servlet.http.HttpServlet.service(HttpServlet.java:802)

        sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.jav
a:39)

 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessor
Impl.java:25)

        java.lang.reflect.Method.invoke(Method.java:585)

 
org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java:243)

        java.security.AccessController.doPrivileged(Native Method)

        javax.security.auth.Subject.doAsPrivileged(Subject.java:517)

 
org.apache.catalina.security.SecurityUtil.execute(SecurityUtil.java:275)

 
org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.jav
a:161)

root cause 

javax.servlet.ServletException

 
org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageCont
extImpl.java:843)

 
org.apache.jasper.runtime.PageContextImpl.access$1100(PageContextImpl.ja
va:65)

 
org.apache.jasper.runtime.PageContextImpl$12.run(PageContextImpl.java:76
3)

        java.security.AccessController.doPrivileged(Native Method)

 
org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContex
tImpl.java:761)

        org.apache.jsp.Default_jsp._jspService(Default_jsp.java:558)

 
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)

        javax.servlet.http.HttpServlet.service(HttpServlet.java:802)

 
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.ja
va:334)

 
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)

 
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)

        javax.servlet.http.HttpServlet.service(HttpServlet.java:802)

        sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.jav
a:39)

 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessor
Impl.java:25)

        java.lang.reflect.Method.invoke(Method.java:585)

 
org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java:243)

        java.security.AccessController.doPrivileged(Native Method)

        javax.security.auth.Subject.doAsPrivileged(Subject.java:517)

 
org.apache.catalina.security.SecurityUtil.execute(SecurityUtil.java:275)

 
org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.jav
a:161)

root cause 

java.lang.ExceptionInInitializerError

        org.apache.jsp.Default_jsp._jspService(Default_jsp.java:90)

 
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)

        javax.servlet.http.HttpServlet.service(HttpServlet.java:802)

 
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.ja
va:334)

 
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)

 
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)

        javax.servlet.http.HttpServlet.service(HttpServlet.java:802)

        sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.jav
a:39)

 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessor
Impl.java:25)

        java.lang.reflect.Method.invoke(Method.java:585)

 
org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java:243)

        java.security.AccessController.doPrivileged(Native Method)

        javax.security.auth.Subject.doAsPrivileged(Subject.java:517)

 
org.apache.catalina.security.SecurityUtil.execute(SecurityUtil.java:275)

 
org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.jav
a:161)

note The full stack trace of the root cause is available in the Apache
Tomcat/5.5.20 logs.

 

 

 

Thanks,

John Le


RE: ROOT not working

Posted by John Le <Jo...@PACCAR.com>.
Yeah a redirect page will be my last resort. It has a minor drawback of
making the back button a little bit harder to use since it will auto
forward. I'll see if I can have the IT group change the domain name to
serverip/AppName verses just serverip before doing a redirect. 

- John Le

-----Original Message-----
From: Caldarale, Charles R [mailto:Chuck.Caldarale@unisys.com] 
Sent: Monday, January 28, 2008 11:55 AM
To: Tomcat Users List
Subject: RE: ROOT not working

> From: John Le [mailto:John.Le@PACCAR.com] 
> Subject: RE: ROOT not working
> 
> When I asked the vender if I could deploy it to root last
> week the rep said he didn't think so, but would ask his 
> techs.

If the webapp has hard-coded embedded absolute URLs, you won't be able
to change that behavior.  You could deploy a tiny default ROOT webapp
that does nothing but redirect to the real one.

> If I deploy it to the default location and modify the 
> conf/server.xml to add in the Context docBase path tag

That's a bad idea, if for no other reason than what you found.

Another thing to try is to keep the .war file outside of Tomcat's
webapps directory, and create the file conf/Catalina/[host]/ROOT.xml
containing a <Context> element with a docBase attribute pointing to the
absolute location of the .war file.  (Do not use a path attribute.)
This will override any META-INF/context.xml file that's inside the .war,
so you may have to add additional <Resource> elements or whatever if the
.war needs them.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY
MATERIAL and is thus for use only by the intended recipient. If you
received this in error, please contact the sender and delete the e-mail
and its attachments from all computers.

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org




---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


RE: ROOT not working

Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: John Le [mailto:John.Le@PACCAR.com] 
> Subject: RE: ROOT not working
> 
> When I asked the vender if I could deploy it to root last
> week the rep said he didn't think so, but would ask his 
> techs.

If the webapp has hard-coded embedded absolute URLs, you won't be able
to change that behavior.  You could deploy a tiny default ROOT webapp
that does nothing but redirect to the real one.

> If I deploy it to the default location and modify the 
> conf/server.xml to add in the Context docBase path tag

That's a bad idea, if for no other reason than what you found.

Another thing to try is to keep the .war file outside of Tomcat's
webapps directory, and create the file conf/Catalina/[host]/ROOT.xml
containing a <Context> element with a docBase attribute pointing to the
absolute location of the .war file.  (Do not use a path attribute.)
This will override any META-INF/context.xml file that's inside the .war,
so you may have to add additional <Resource> elements or whatever if the
.war needs them.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY
MATERIAL and is thus for use only by the intended recipient. If you
received this in error, please contact the sender and delete the e-mail
and its attachments from all computers.

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


RE: ROOT not working

Posted by John Le <Jo...@PACCAR.com>.
Thanks for the response, but it's still not working. I renamed the WAR
file as ROOT and deleted the old ROOT before running Tomcat to auto
deploy it. When I asked the vender if I could deploy it to root last
week the rep said he didn't think so, but would ask his techs. It's odd
because it works fine in its default location, but not in ROOT.

If I deploy it to the default location and modify the conf/server.xml to
add in the Context docBase path tag it works but it causes system
instability after a while, possibly because it deploys the application
twice. 

- John Le

-----Original Message-----
From: Caldarale, Charles R [mailto:Chuck.Caldarale@unisys.com] 
Sent: Monday, January 28, 2008 9:51 AM
To: Tomcat Users List
Subject: RE: ROOT not working

> From: Caldarale, Charles R 
> Subject: RE: ROOT not working
> 
> All you should have to do is copy MyApp.war to 
> webapps/ROOT.war and delete the webapps/ROOT folder and 
> conf/Catalina/[host]/ROOT.xml (if it exists, which it 
> probably doesn't).  Did you do just that?  Did you do something else.
> 
> Make sure the case is correct, regardless of platform.  And, 
> if the webapp has a META-INF/context.xml file in it, verify 
> that it does not use the path or docBase attributes in its 
> <Context> element.

And make sure you clear the browser cache; failure to do so can have
some odd side effects.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY
MATERIAL and is thus for use only by the intended recipient. If you
received this in error, please contact the sender and delete the e-mail
and its attachments from all computers.

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org




---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


RE: ROOT not working

Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: Caldarale, Charles R 
> Subject: RE: ROOT not working
> 
> All you should have to do is copy MyApp.war to 
> webapps/ROOT.war and delete the webapps/ROOT folder and 
> conf/Catalina/[host]/ROOT.xml (if it exists, which it 
> probably doesn't).  Did you do just that?  Did you do something else.
> 
> Make sure the case is correct, regardless of platform.  And, 
> if the webapp has a META-INF/context.xml file in it, verify 
> that it does not use the path or docBase attributes in its 
> <Context> element.

And make sure you clear the browser cache; failure to do so can have
some odd side effects.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY
MATERIAL and is thus for use only by the intended recipient. If you
received this in error, please contact the sender and delete the e-mail
and its attachments from all computers.

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


RE: ROOT not working

Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: John Le [mailto:John.Le@PACCAR.com] 
> Subject: ROOT not working
> 
> I am trying to use a 3rd party web application in the webapps/ROOT
> folder so my domain name will just be localhost:8080.

All you should have to do is copy MyApp.war to webapps/ROOT.war and
delete the webapps/ROOT folder and conf/Catalina/[host]/ROOT.xml (if it
exists, which it probably doesn't).  Did you do just that?  Did you do
something else.

Make sure the case is correct, regardless of platform.  And, if the
webapp has a META-INF/context.xml file in it, verify that it does not
use the path or docBase attributes in its <Context> element.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY
MATERIAL and is thus for use only by the intended recipient. If you
received this in error, please contact the sender and delete the e-mail
and its attachments from all computers.

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org