This week's book giveaway is in the Mac OS forum.
We're giving away four copies of a choice of "Take Control of Upgrading to Yosemite" or "Take Control of Automating Your Mac" and have Joe Kissell on-line!
See this thread for details.
The moose likes Tomcat and the fly likes Problems deploying the application on Tomcat 4.0.1 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Products » Tomcat
Bookmark "Problems deploying the application on Tomcat 4.0.1" Watch "Problems deploying the application on Tomcat 4.0.1" New topic
Author

Problems deploying the application on Tomcat 4.0.1

Abhi Shinde
Greenhorn

Joined: Aug 25, 2003
Posts: 1
Hi,
I am facing a problem while i m deploying my application on Tomcat 4.0.1,
I have deployed my JSPs'(under: /home/myhome/www/jsp/), Servlets (under: /WEB-INF/classes/), Jars' (under: /WEB-INF/lib/) But was unable to restart tomcat. And the following error was thrown:
Aug 24, 2003 2:44:55 PM org.apache.commons.digester.Digester error
SEVERE: Parse Error at line 58 column 11: The content of element type
"web-app" must match "(icon?,display-name?,description?
,distributable?,context-param*,servlet*,servlet-mapping*,session-config?,mime-mapping*,welcome-file-list?,error-page*,taglib*
,resource-ref*,security-constraint*,login-config?,security-role*,env-entry*,ejb-ref*)".
org.xml.sax.SAXParseException: The content of element type "web-app" must
match "(icon?,display-name?,description?,distributa
ble?,context-param*,servlet*,servlet-mapping*,session-config?,mime-mapping*,welcome-file-list?,error-page*,taglib*,resource-r
ef*,security-constraint*,login-config?,security-role*,env-entry*,ejb-ref*)".
at
org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Unknown
Source)
at org.apache.xerces.util.ErrorHandlerWrapper.error(Unknown Source)
at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
at
org.apache.xerces.impl.dtd.XMLDTDValidator.handleEndElement(Unknown Source)
at org.apache.xerces.impl.dtd.XMLDTDValidator.endElement(Unknown
Source)
at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanEndElement(Unknown
Source)
at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown
Source)
at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown
Source)
at org.apache.xerces.parsers.DTDConfiguration.parse(Unknown Source)
at org.apache.xerces.parsers.DTDConfiguration.parse(Unknown Source)
at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
at org.apache.commons.digester.Digester.parse(Digester.java:1543)
at
org.apache.catalina.startup.ContextConfig.applicationConfig(Unknown Source)
at org.apache.catalina.startup.ContextConfig.start(Unknown Source)
at
org.apache.catalina.startup.ContextConfig.lifecycleEvent(Unknown Source)
at
org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(Unknown Source)
at org.apache.catalina.core.StandardContext.start(Unknown Source)
at org.apache.catalina.core.ContainerBase.start(Unknown Source)
at org.apache.catalina.core.StandardHost.start(Unknown Source)
at org.apache.catalina.core.ContainerBase.start(Unknown Source)
at org.apache.catalina.core.StandardEngine.start(Unknown Source)
at org.apache.catalina.core.StandardService.start(Unknown Source)
at org.apache.catalina.core.StandardServer.start(Unknown Source)
at org.apache.catalina.startup.Catalina.start(Unknown Source)
at org.apache.catalina.startup.Catalina.execute(Unknown Source)
at org.apache.catalina.startup.Catalina.process(Unknown Source)
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:324)
at org.apache.catalina.startup.Bootstrap.main(Unknown Source)
Exception during startup processing
java.lang.reflect.InvocationTargetException
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:324)
at org.apache.catalina.startup.Bootstrap.main(Unknown Source)
Caused by: java.lang.InternalError: jzentry == 0,
jzfile = 140918512,
total = 3,
name = /var/tomcat4/temp/jar_cache50869.tmp,
i = 1,
message = invalid LOC header (bad signature)
at java.util.zip.ZipFile$2.nextElement(ZipFile.java:321)
at java.util.jar.JarFile$1.nextElement(JarFile.java:201)
at org.apache.catalina.startup.ContextConfig.tldScanJar(Unknown
Source)
at org.apache.catalina.startup.ContextConfig.tldScan(Unknown Source)
at org.apache.catalina.startup.ContextConfig.start(Unknown Source)
at
org.apache.catalina.startup.ContextConfig.lifecycleEvent(Unknown Source)
at
org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(Unknown Source)
at org.apache.catalina.core.StandardContext.start(Unknown Source)
at org.apache.catalina.core.ContainerBase.start(Unknown Source)
at org.apache.catalina.core.StandardHost.start(Unknown Source)
at org.apache.catalina.core.ContainerBase.start(Unknown Source)
at org.apache.catalina.core.StandardEngine.start(Unknown Source)
at org.apache.catalina.core.StandardService.start(Unknown Source)
at org.apache.catalina.core.StandardServer.start(Unknown Source)
at org.apache.catalina.startup.Catalina.start(Unknown Source)
at org.apache.catalina.startup.Catalina.execute(Unknown Source)
at org.apache.catalina.startup.Catalina.process(Unknown Source)
... 5 more
Then, after Renaming /home/myhome/www/WEB-INF/web.xml to web.xml.bak the following errors were thrown:
Aug 24, 2003 4:22:32 PM org.apache.coyote.http11.Http11Protocol init
INFO: Initializing Coyote HTTP/1.1 on port 8080
Starting service Tomcat-Standalone
Apache Tomcat/4.1
Exception during startup processing
java.lang.reflect.InvocationTargetException
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:324)
at org.apache.catalina.startup.Bootstrap.main(Unknown Source)
Caused by: java.lang.InternalError: jzentry == 0,
jzfile = 134868048,
total = 3,
name = /var/tomcat4/temp/jar_cache63221.tmp,
i = 1,
message = invalid LOC header (bad signature)
at java.util.zip.ZipFile$2.nextElement(ZipFile.java:321)
at java.util.jar.JarFile$1.nextElement(JarFile.java:201)
at org.apache.catalina.startup.ContextConfig.tldScanJar(Unknown
Source)
at org.apache.catalina.startup.ContextConfig.tldScan(Unknown Source)
at org.apache.catalina.startup.ContextConfig.start(Unknown Source)
at
org.apache.catalina.startup.ContextConfig.lifecycleEvent(Unknown Source)
at
org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(Unknown Source)
at org.apache.catalina.core.StandardContext.start(Unknown Source)
at org.apache.catalina.core.ContainerBase.start(Unknown Source)
at org.apache.catalina.core.StandardHost.start(Unknown Source)
at org.apache.catalina.core.ContainerBase.start(Unknown Source)
at org.apache.catalina.core.StandardEngine.start(Unknown Source)
at org.apache.catalina.core.StandardService.start(Unknown Source)
at org.apache.catalina.core.StandardServer.start(Unknown Source)
at org.apache.catalina.startup.Catalina.start(Unknown Source)
at org.apache.catalina.startup.Catalina.execute(Unknown Source)
at org.apache.catalina.startup.Catalina.process(Unknown Source)
... 5 more
Then, after tar of the jars, and removing the jar files, tomcat started without any problem:
Aug 24, 2003 4:32:18 PM org.apache.commons.modeler.Registry loadRegistry
INFO: Loading registry information
Aug 24, 2003 4:32:18 PM org.apache.commons.modeler.Registry getRegistry
INFO: Creating new Registry instance
Aug 24, 2003 4:32:20 PM org.apache.commons.modeler.Registry getServer
INFO: Creating MBeanServer
Aug 24, 2003 4:32:23 PM org.apache.coyote.http11.Http11Protocol init
INFO: Initializing Coyote HTTP/1.1 on port 8080
Starting service Tomcat-Standalone
Apache Tomcat/4.1
Aug 24, 2003 4:32:34 PM org.apache.coyote.http11.Http11Protocol start
INFO: Starting Coyote HTTP/1.1 on port 8080
Aug 24, 2003 4:32:34 PM org.apache.jk.common.ChannelSocket init
INFO: JK2: ajp13 listening on /0.0.0.0:8009
Aug 24, 2003 4:32:34 PM org.apache.jk.server.JkMain start
INFO: Jk running ID=0 time=3/382 config=/var/tomcat4/conf/jk2.properties
Now tomcat server has restarted successfully.
[ August 25, 2003: Message edited by: Abhi Shinde ]
[ August 25, 2003: Message edited by: Abhi Shinde ]
[ August 25, 2003: Message edited by: Abhi Shinde ]
[ August 25, 2003: Message edited by: Abhi Shinde ]
Carl Trusiak
Sheriff

Joined: Jun 13, 2000
Posts: 3340
Tomcat uses Strict xml parsing for the web.xml. The elements MUST be in the order supplied by the DTD.
"(icon?,display-name?,description?,distributable?,context-param*,servlet*,servlet-mapping*,session-config?,mime-mapping*,welcome-file-list?,error-page*,taglib*,resource-ref*,security-constraint*,login-config?,security-role*,env-entry*,ejb-ref*)".
Example, if you put any servlet-mapping elements before any servlet elements, this error will occur. (In the order supplied, servlet comes before servlet-mapping)


I Hope This Helps
Carl Trusiak, SCJP2, SCWCD
 
GeeCON Prague 2014
 
subject: Problems deploying the application on Tomcat 4.0.1