mty*_*son 31 servlet-3.0 tomcat7
我刚刚将web.xml切换到servlet 3.0(来自之前运行2.4的应用程序),现在我看到以下错误(打开了org.apache.tomcat.util的精细日志记录):
mtyson FINE: Scanning JAR [file:/usr/java/jdk1.6.0_22/jre/lib/ext/jcharset.jar] from classpath
mtyson Jul 19, 2011 10:04:40 AM org.apache.catalina.startup.HostConfig deployDirectory
mtyson SEVERE: Error deploying web application directory ROOT
mtyson org.apache.tomcat.util.bcel.classfile.ClassFormatException: Invalid byte tag in constant pool: 60
Run Code Online (Sandbox Code Playgroud)
更新:刚试过tomcat 7.0.19 - 结果相同
小智 31
添加
metadata-complete="true"
Run Code Online (Sandbox Code Playgroud)
你的web.xml应该排序问题
<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">
Run Code Online (Sandbox Code Playgroud)
这告诉Tomcat不扫描注释类:http://www.tomcatexpert.com/blog/2011/10/12/how-use-fragments-and-annotations-configure-your-web-application
小智 19
感谢James A Wilson的回答 - 更新icu4j,因为你建议为我工作,并允许我在我的web.xml中保留version ="3.0"(从长远来看,我更喜欢).
icu4j 2.6.1是没有用的版本,升级到NEXT版本3.4.4将解决这个问题.我没有使用最新版本的icu4j(49.1),因为它比版本3.4.4大4MB.
这是一个Maven配置代码段,用于锁定传递依赖关系版本(不添加显式依赖关系):
<dependencyManagement>
<dependencies>
<dependency>
<groupId>com.ibm.icu</groupId>
<artifactId>icu4j</artifactId>
<version>3.4.4</version>
</dependency>
</dependencies>
</dependencyManagement>
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
84779 次 |
| 最近记录: |