Tomcat報錯Invalid byte tag in constant pool: 60

問題:

  信息: Deploying web application directory /opt/tomcat/webapps/ROOT
  一月 05, 2016 3:29:29 下午 org.apache.catalina.core.ContainerBase addChildInternal
  嚴重: ContainerBase.addChild: start:
  org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[]]
      at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:154)
      at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:895)
      at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:871)
      at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:615)
      at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1099)
      at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:1621)
      at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
      at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
      at java.util.concurrent.FutureTask.run(FutureTask.java:166)
      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
      at java.lang.Thread.run(Thread.java:722)
  Caused by: org.apache.tomcat.util.bcel.classfile.ClassFormatException: Invalid byte tag in constant pool: 60
      at org.apache.tomcat.util.bcel.classfile.Constant.readConstant(Constant.java:131)
      at org.apache.tomcat.util.bcel.classfile.ConstantPool.<init>(ConstantPool.java:60)
      at org.apache.tomcat.util.bcel.classfile.ClassParser.readConstantPool(ClassParser.java:209)
      at org.apache.tomcat.util.bcel.classfile.ClassParser.parse(ClassParser.java:119)
      at org.apache.catalina.startup.ContextConfig.processAnnotationsStream(ContextConfig.java:2032)
      at org.apache.catalina.startup.ContextConfig.processAnnotationsJar(ContextConfig.java:1923)
      at org.apache.catalina.startup.ContextConfig.processAnnotationsStream(ContextConfig.java:2032)
      at org.apache.catalina.startup.ContextConfig.processAnnotationsJar(ContextConfig.java:1923)
      at org.apache.catalina.startup.ContextConfig.processAnnotationsUrl(ContextConfig.java:1891)
      at org.apache.catalina.startup.ContextConfig.processAnnotations(ContextConfig.java:1877)
      at org.apache.catalina.startup.ContextConfig.webConfig(ContextConfig.java:1270)
      at org.apache.catalina.startup.ContextConfig.configureStart(ContextConfig.java:855)
      at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:345)
      at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
      at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90)
      at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5161)
      at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
      ... 11 more
 
  一月 05, 2016 3:29:29 下午 org.apache.catalina.startup.HostConfig deployDirectory
  嚴重: Error deploying web application directory /opt/tomcat/webapps/ROOT
  java.lang.IllegalStateException: ContainerBase.addChild: start: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[]]
      at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:898)
      at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:871)
      at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:615)
      at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1099)
      at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:1621)
      at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
      at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
      at java.util.concurrent.FutureTask.run(FutureTask.java:166)
      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
      at java.lang.Thread.run(Thread.java:722)
java

解決:

Thanks James A Wilson for your answer - updating icu4j as you suggested worked for me and allows me to keep version="3.0" in my web.xml (which I prefer for the long run).web

icu4j 2.6.1 was the version which did not work, upgrading to the NEXT version 3.4.4 will solve this problem. I did NOT go to the latest version of icu4j (49.1) because it is 4MB larger than version 3.4.4.apache

Here is a Maven configuration snippet to lock in your transitive dependency version (without adding an explicit dependency):tomcat

<dependencyManagement>
    <dependencies>
        <dependency>
            <groupId>com.ibm.icu</groupId>
            <artifactId>icu4j</artifactId>
            <version>3.4.4</version>
        </dependency>
    </dependencies>
</dependencyManagement>

   

shareimprove this answerapp

edited Apr 25 '12 at 22:24    webapp

answered Apr 25 '12 at 22:12    post

   

Steve Jones        this

71478        spa



add a comment                    code

                       

up vote        12        down vote

Adding

metadata-complete="true"

to your web.xml should sort the issue

<web-app version="3.0"
         xmlns="http://java.sun.com/xml/ns/javaee"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
         metadata-complete="true">

This tells tomcat not to scan classes for annotations: http://www.tomcatexpert.com/blog/2011/10/12/how-use-fragments-and-annotations-configure-your-web-application


參考:http://stackoverflow.com/questions/6751920/tomcat-7-servlet-3-0-invalid-byte-tag-in-constant-pool

相關文章
相關標籤/搜索