tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mark Eggers <its_toas...@yahoo.com>
Subject Re: war file extraction issues in tomcat 5.5
Date Tue, 10 Jul 2012 19:25:37 GMT
Rajesh,

I'm not quite sure where to start with this. I'll make a few comments inline. The comments
will be bracketed with:

===== COMMENT =====

so that they're easier to see.

However, you really need to read and understand the following documentation.

http://tomcat.apache.org/tomcat-5.5-doc/index.html


Please note that Tomcat 5.5 is rapidly approaching EOL. It would be a good idea to move to
at least Tomcat 6 (and preferably Tomcat 7) if at all possible.

----- Original Message -----
> From: Rajesh Kumar <rajeshkumarmahto84@gmail.com>
> To: users@tomcat.apache.org
> Cc: 
> Sent: Monday, July 9, 2012 11:56 PM
> Subject: war file extraction issues in tomcat 5.5
> 
> I am finding many issues in it but still not able to resolve this. Is there
> any expert opinion on this... I have this setup in Cpanel.
> 
> Apache Tomcat/5.5.35 OS - Linux 2.6.18-028stab099.3 JVM Version:
> 1.6.0_29-b11
> 
> I have added export JAVA_OPTS="-XX:PermSize=128M -XX:MaxPermSize=524M" 
> in
> catlina.sh but dint help.

===== COMMENT =====

This has nothing to do with your problem. This doesn't even increase heap memory. It increases
permgen memory, which is a permanent storage space for the JVM. For example, class definitions
are stored here.

You probably wanted to expand heap memory. However by default heap memory is 256 M and should
be enough for small to medium sized applications.

Don't add this to JAVA_OPTS, because this will add memory to both the Tomcat process and the
shutdown process. Add it to CATALINA_OPTS instead.

Finally, don't edit catalina.sh. Create a file called setenv.sh in $CATALINA_HOME/bin. Add
your options there.

===== COMMENT =====


> 
> 
> *Log file info in catalina.err*
> 
> 
> **
> 
> Jul 10, 2012 3:23:16 AM org.apache.catalina.core.AprLifecycleListener init
>     INFO: The APR based Apache Tomcat Native library which allows
> optimal performance in production environments was not found on the
> java.library.path:
> /usr/local/jdk/jre/lib/i386/client:/usr/local/jdk/jre/lib/i386:/usr/java/packages/lib/i386:/lib:/usr/lib
>     Jul 10, 2012 3:23:17 AM org.apache.coyote.http11.Http11BaseProtocol init
>     INFO: Initializing Coyote HTTP/1.1 on http-8080
>     Jul 10, 2012 3:23:17 AM org.apache.catalina.startup.Catalina load
>     INFO: Initialization processed in 434 ms
>     Jul 10, 2012 3:23:17 AM org.apache.catalina.core.StandardService start
>     INFO: Starting service Catalina
>     Jul 10, 2012 3:23:17 AM org.apache.catalina.core.StandardEngine start
>     INFO: Starting Servlet Engine: Apache Tomcat/5.5.35
>     Jul 10, 2012 3:23:17 AM org.apache.catalina.core.StandardHost start
>     INFO: XML validation disabled
>     Jul 10, 2012 3:23:17 AM org.apache.catalina.startup.HostConfig deployWAR
>     INFO: Deploying web application archive sample.war
>     Jul 10, 2012 3:23:17 AM org.apache.catalina.startup.ContextConfig init
>     SEVERE: Exception fixing docBase: {0}


===== COMMENT ===== 


From the above line, it looks like you've not specified the docBase properly.


===== COMMENT ===== 


>     java.io.FileNotFoundException:
> /home/surgnet/public_html/sample/META-INF/MANIFEST.MF (No such file or
> directory)
>             at java.io.FileOutputStream.open(Native Method)
>             at java.io.FileOutputStream.<init>(FileOutputStream.java:194)
>             at java.io.FileOutputStream.<init>(FileOutputStream.java:145)
>             at org.apache.catalina.startup.ExpandWar.expand(ExpandWar.java:457)
>             at org.apache.catalina.startup.ExpandWar.expand(ExpandWar.java:173)
>             at 
> org.apache.catalina.startup.ContextConfig.fixDocBase(ContextConfig.java:864)
>             at 
> org.apache.catalina.startup.ContextConfig.init(ContextConfig.java:999)
>             at 
> org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:279)
>             at 
> org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:120)
>             at 
> org.apache.catalina.core.StandardContext.init(StandardContext.java:5095)
>             at 
> org.apache.catalina.core.StandardContext.start(StandardContext.java:4024)
>             at 
> org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:760)
>             at 
> org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:740)
>             at 
> org.apache.catalina.core.StandardHost.addChild(StandardHost.java:544)
>             at 
> org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:884)
>             at 
> org.apache.catalina.startup.HostConfig.deployWARs(HostConfig.java:737)
>             at 
> org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:498)
>             at 
> org.apache.catalina.startup.HostConfig.start(HostConfig.java:1203)
>             at 
> org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:319)
>             at 
> org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:120)
>             at 
> org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1022)
>             at 
> org.apache.catalina.core.StandardHost.start(StandardHost.java:736)
>             at 
> org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1014)
>             at 
> org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
>             at 
> org.apache.catalina.core.StandardService.start(StandardService.java:448)
>             at 
> org.apache.catalina.core.StandardServer.start(StandardServer.java:700)
>             at org.apache.catalina.startup.Catalina.start(Catalina.java:552)
>             at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>             at 
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>             at 
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>             at java.lang.reflect.Method.invoke(Method.java:597)
>             at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:295)
>             at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>             at 
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>             at 
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>             at java.lang.reflect.Method.invoke(Method.java:597)
>             at 
> org.apache.commons.daemon.support.DaemonLoader.start(DaemonLoader.java:243)

===== COMMENT ===== 

From the above stack trace, it doesn't look like Tomcat is finding a WAR file where you said
it should be found. This could be due to permissions problems, it could be due to configuration
problems, it could be due to the fact that what you've pointed to is not a WAR file (or an
exploded WAR file).

===== COMMENT =====

>     Jul 10, 2012 3:23:17 AM org.apache.catalina.startup.HostConfig deployWAR
>     INFO: Deploying web application archive surgeryplanet.war
>     Jul 10, 2012 3:23:17 AM org.apache.catalina.startup.ContextConfig init
>     SEVERE: Exception fixing docBase: {0}
>     java.io.FileNotFoundException:
> /home/surgnet/public_html/surgeryplanet/META-INF/MANIFEST.MF (No such
> file or directory)
>             at java.io.FileOutputStream.open(Native Method)
>             at java.io.FileOutputStream.<init>(FileOutputStream.java:194)
>             at java.io.FileOutputStream.<init>(FileOutputStream.java:145)
>             at org.apache.catalina.startup.ExpandWar.expand(ExpandWar.java:457)
>             at org.apache.catalina.startup.ExpandWar.expand(ExpandWar.java:173)
>             at 
> org.apache.catalina.startup.ContextConfig.fixDocBase(ContextConfig.java:864)
>             at 
> org.apache.catalina.startup.ContextConfig.init(ContextConfig.java:999)
>             at 
> org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:279)
>             at 
> org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:120)
>             at 
> org.apache.catalina.core.StandardContext.init(StandardContext.java:5095)
>             at 
> org.apache.catalina.core.StandardContext.start(StandardContext.java:4024)
>             at 
> org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:760)
>             at 
> org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:740)
>             at 
> org.apache.catalina.core.StandardHost.addChild(StandardHost.java:544)
>             at 
> org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:884)
>             at 
> org.apache.catalina.startup.HostConfig.deployWARs(HostConfig.java:737)
>             at 
> org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:498)
>             at 
> org.apache.catalina.startup.HostConfig.start(HostConfig.java:1203)
>             at 
> org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:319)
>             at 
> org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:120)
>             at 
> org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1022)
>             at 
> org.apache.catalina.core.StandardHost.start(StandardHost.java:736)
>             at 
> org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1014)
>             at 
> org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
>             at 
> org.apache.catalina.core.StandardService.start(StandardService.java:448)
>             at 
> org.apache.catalina.core.StandardServer.start(StandardServer.java:700)
>             at org.apache.catalina.startup.Catalina.start(Catalina.java:552)
>             at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>             at 
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>             at 
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>             at java.lang.reflect.Method.invoke(Method.java:597)
>             at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:295)
>             at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>             at 
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>             at 
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>             at java.lang.reflect.Method.invoke(Method.java:597)
>             at 
> org.apache.commons.daemon.support.DaemonLoader.start(DaemonLoader.java:243)
>     Jul 10, 2012 3:23:18 AM

===== COMMENT =====

This is either a double deployment, or you've tried deploying your web application twice.
I suspect the former, which would match hints at your configuration problems.

===== COMMENT =====

> org.apache.catalina.loader.WebappClassLoader validateJarFile
>     INFO: 
> validateJarFile(/usr/local/jakarta/apache-tomcat-5.5.35/work/Catalina/surgeryplanet.net/surgeryplanet/WEB-INF/lib/javaee.jar)
> - jar not loaded. See Servlet Spec 2.3, section 9.7.2. Offending
> class: javax/servlet/Servlet.class
>     Jul 10, 2012 3:23:18 AM
> org.apache.catalina.loader.WebappClassLoader validateJarFile
>     INFO: 
> validateJarFile(/usr/local/jakarta/apache-tomcat-5.5.35/work/Catalina/surgeryplanet.net/surgeryplanet/WEB-INF/lib/jsp-api.jar)

===== COMMENT =====

Don't put servlet, jsp, jstl JARs in your WEB-INF/lib. I suspect that you're using Eclipse
to write code, and you've not defined a local Tomcat server. If you use Eclipse and need these
JARs on your classpath, then do the following:

1. Install a local copy of Tomcat 5.5.35 by unzipping the zip file downloaded from tomcat.apache.org
2. Add the server to Eclipse
3. Associate your project with the server in Eclipse

Now Eclipse will add the JAR files in at least common/lib to your classpath. Eclipse may include
the JAR files in server/lib and shared/lib, but I don't know since I don't write for Tomcat
5.5 or use Eclipse much.

===== COMMENT =====

> - jar not loaded. See Servlet Spec 2.3, section 9.7.2. Offending
> class: javax/servlet/jsp/JspPage.class
>     Jul 10, 2012 3:23:34 AM org.apache.catalina.core.StandardContext start
>     SEVERE: Error listenerStart
>     Jul 10, 2012 3:23:34 AM org.apache.catalina.core.StandardContext start
>     SEVERE: Context [/surgeryplanet] startup failed due to previous errors
>     Jul 10, 2012 3:23:35 AM org.apache.catalina.core.StandardHost start
>     INFO: XML validation disabled
>     Jul 10, 2012 3:23:35 AM org.apache.catalina.core.ApplicationContext log
>     INFO: ContextListener: contextInitialized()
>     Jul 10, 2012 3:23:35 AM org.apache.catalina.core.ApplicationContext log
>     INFO: SessionListener: contextInitialized()
>     Jul 10, 2012 3:23:35 AM org.apache.catalina.core.ApplicationContext log
>     INFO: ContextListener: contextInitialized()
>     Jul 10, 2012 3:23:35 AM org.apache.catalina.core.ApplicationContext log
>     INFO: SessionListener: contextInitialized()
>     Jul 10, 2012 3:23:35 AM org.apache.catalina.core.ApplicationContext log
>     INFO: org.apache.webapp.balancer.BalancerFilter: init():
> ruleChain: [org.apache.webapp.balancer.RuleChain:
> [org.apache.webapp.balancer.rules.URLStringMatchRule: Target string:
> News / Redirect URL: http://www.cnn.com],
> [org.apache.webapp.balancer.rules.RequestParameterRule: Target param
> name: paramName / Target param value: paramValue / Redirect URL:
> http://www.yahoo.com],
> [org.apache.webapp.balancer.rules.AcceptEverythingRule: Redirect URL:
> http://jakarta.apache.org]]
>     Jul 10, 2012 3:23:35 AM org.apache.coyote.http11.Http11BaseProtocol start
>     INFO: Starting Coyote HTTP/1.1 on http-8080
>     Jul 10, 2012 3:23:35 AM org.apache.jk.common.ChannelSocket init
>     INFO: JK: ajp13 listening on /0.0.0.0:8009
>     Jul 10, 2012 3:23:35 AM org.apache.jk.server.JkMain start
>     INFO: Jk running ID=0 time=0/14  config=null
>     Jul 10, 2012 3:23:35 AM org.apache.catalina.storeconfig.StoreLoader load
>     INFO: Find registry server-registry.xml at classpath resource
>     Jul 10, 2012 3:23:36 AM org.apache.catalina.startup.Catalina start
>     INFO: Server startup in 19200 ms
>     Jul 10, 2012 3:25:29 AM org.apache.catalina.core.ApplicationContext log
>     INFO: HTMLManager: init: Associated with Deployer
> 'Catalina:type=Deployer,host=surgeryplanet.net'
>     Jul 10, 2012 3:25:29 AM org.apache.catalina.core.ApplicationContext log
>     INFO: HTMLManager: init: Global resources are available
>     Jul 10, 2012 3:25:29 AM org.apache.catalina.core.ApplicationContext log
>     INFO: HTMLManager: list: Listing contexts for virtual host
> 'surgeryplanet.net'
>     Jul 10, 2012 3:25:34 AM org.apache.catalina.core.ApplicationContext log
>     INFO: HTMLManager: start: Starting web application at 
> '/surgeryplanet'
>     Jul 10, 2012 3:25:35 AM
> org.apache.catalina.loader.WebappClassLoader validateJarFile
>     INFO: 
> validateJarFile(/usr/local/jakarta/apache-tomcat-5.5.35/work/Catalina/surgeryplanet.net/surgeryplanet/WEB-INF/lib/javaee.jar)
> - jar not loaded. See Servlet Spec 2.3, section 9.7.2. Offending
> class: javax/servlet/Servlet.class
>     Jul 10, 2012 3:25:35 AM
> org.apache.catalina.loader.WebappClassLoader validateJarFile
>     INFO: 
> validateJarFile(/usr/local/jakarta/apache-tomcat-5.5.35/work/Catalina/surgeryplanet.net/surgeryplanet/WEB-INF/lib/jsp-api.jar)
> - jar not loaded. See Servlet Spec 2.3, section 9.7.2. Offending
> class: javax/servlet/jsp/JspPage.class
>     Jul 10, 2012 3:25:51 AM org.apache.catalina.core.StandardContext start
>     SEVERE: Error listenerStart
>     Jul 10, 2012 3:25:51 AM org.apache.catalina.core.StandardContext start
>     SEVERE: Context [/surgeryplanet] startup failed due to previous errors
>     Jul 10, 2012 3:25:52 AM org.apache.catalina.core.ApplicationContext log
>     INFO: HTMLManager: list: Listing contexts for virtual host
> 'surgeryplanet.net'
> 
===== COMMENT ===== 


If this is all from a single start up, it appears that there are multiple copies of your WAR
file.

It also appears that your server.xml is not functioning.

It also appears that you have the example applications running.

It also appears that your web application needs some serious modifications.

If you are going to use virtual hosts with Tomcat 5.5.x, then add this to your server.xml:

<Host name="surgeryplanet.net"
      appBase="/home/surgnet/public_html"
      unpackWARs="true"
      autoDeploy="true"
      xmlValidation="false"
      xmlNamespaceAware="false">
</Host>

This is an additional Host element and goes right below the original host element. Make sure
that the user running Tomcat has read/execute access to this directory read access to all
the WAR files inside.

Now, just drop all of your WAR files into /home/surgnet/public_html.

If you want a default application for this site, just drop a ROOT.war (case is important)
file into /home/surgnet/public_html.

One last note: I hope that you are not also allowing Apache HTTPD to serve this area via http://hostname/~surgnet/.
This will create a potential security problem, and will end up serving your JSP files as plain
text.

===== COMMENT =====


. . . . just my nickel
/mde/

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


Mime
View raw message