简体   繁体   English

使用Java 1.6时在tomcat上启动错误滤镜

[英]Error filterStart on tomcat when using java 1.6

Let me start with what I use: 让我从我使用的内容开始:
- ubuntu 11.04 -Ubuntu 11.04
- apache-tomcat-6.0.33 -apache-tomcat-6.0.33

some details on my java: 我的Java上的一些细节:

adam@adam-1215N:~$ java -version
java version "1.6.0_22"
OpenJDK Runtime Environment (IcedTea6 1.10.2) (6b22-1.10.2-0ubuntu1~11.04.1)
OpenJDK Server VM (build 20.0-b11, mixed mode)

adam@adam-1215N:~$ ll /usr/lib/jvm
total 84
drwxr-xr-x   3 root root  4096 2011-08-28 10:09 ./
drwxr-xr-x 229 root root 69632 2011-08-28 13:13 ../
lrwxrwxrwx   1 root root    14 2011-08-27 21:03 default-java -> java-6-openjdk/
lrwxrwxrwx   1 root root    14 2011-08-27 21:03 java-1.6.0-openjdk -> java-6-openjdk/
drwxr-xr-x   7 root root  4096 2011-08-27 21:11 java-6-openjdk/
-rw-r--r--   1 root root  2164 2011-06-11 11:07 .java-6-openjdk.jinfo

How I deploy an application: I build it using mvn clean install . 如何部署应用程序:我使用mvn clean install构建它。 Then I extract the content of created .war file and copy it to my directory in webapps in tomcat. 然后,我提取创建的.war文件的内容,并将其复制到tomcat的webapps中的目录中。 It worked initially. 它最初起效。

Now, the meritum: Project that I try to deploy is quite simple. 现在,优点是:我尝试部署的项目非常简单。 Everything worked until I wanted one method to return Set of objects. 一切正常,直到我想要一个方法返回对象集。 When building I got error that generics are not supported in java 1.3. 构建时出现错误,指出Java 1.3不支持泛型。 I googled, and found that I need to add maven-compiler-plugin to my pom.xml pointing which java I want to use. 我用谷歌搜索,发现我需要将maven-compiler-plugin添加到我的pom.xml中,以指向要使用的Java。 So I added, pointing at 1.6. 因此我添加了指向1.6。 And here it comes: 它来了:

Aug 28, 2011 6:25:50 PM org.apache.catalina.startup.HostConfig checkResources
INFO: Reloading context [/myproject]
Aug 28, 2011 6:25:50 PM org.apache.catalina.core.StandardContext start
SEVERE: Error filterStart
Aug 28, 2011 6:25:50 PM org.apache.catalina.core.StandardContext start
SEVERE: Context [/myproject] startup failed due to previous errors

Now the bad news I tried to return to initial maven configuration, deleted generics that made me use java 1.6 and problem still exists... I was messing with jdk, installing and removing different versions, that is why I gave you same details on what I have in the beginning. 现在,我试图返回初始Maven配置的坏消息 ,删除了使我使用Java 1.6的泛型,但问题仍然存在...我搞砸了jdk,安装和删除了不同的版本,这就是为什么我为您提供了相同详细信息的原因我刚开始。

Tomcat also gives one more warning, I thought it is irrelevant but I didn't see it before (or didn't notice) so I'm putting it here: Tomcat还发出了另一条警告,我认为这是无关紧要的,但是我之前(或没有注意到)没有看到它,因此将其放在此处:

Aug 28, 2011 6:15:13 PM 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/lib/jvm/java-6-openjdk/jre/lib/i386/server:/usr/lib/jvm/java-6-openjdk/jre/lib/i386:/usr/lib/jvm/java-6-openjdk/jre/../lib/i386:/usr/java/packages/lib/i386:/usr/lib/i386-linux-gnu/jni:/lib/i386-linux-gnu:/usr/lib/i386-linux-gnu:/usr/lib/jni:/lib:/usr/lib

I'm confused and tired, after fighting with it almost 2 days. 与它抗争了将近2天后,我感到困惑和疲倦。 Any help appreciated. 任何帮助表示赞赏。

Edit I have found reason: I have changed name of class that was referenced in web.xml and "Refactor" tool in Eclipse didn't change it. 编辑我发现了原因:我已经更改了web.xml中引用的类的名称,而Eclipse中的“重构”工具并未更改它。
Leaving it here in case someone find it useful :) 如果有人发现它有用,就把它留在这里:)

I was getting this error when deploying a spring mvc app from eclipse. 从eclipse部署spring mvc应用程序时出现此错误。 The maven build included all the dependent jars for spring under WEB-INF/lib and that worked fine when deployed to Tomcat. Maven构建包括WEB-INF / lib下所有spring依赖的jar,并且在部署到Tomcat时可以很好地运行。 The eclipse Indigo export-war functionality was not exporting the dependent spring jars presumably because of the maven directory structure, even though it was in the build path and all the jars were displayed under the Libraries tag. Eclipse的Indigo export-war功能可能没有导出依赖的Spring jar,这是因为Maven目录结构,即使它在构建路径中并且所有jar都显示在Libraries标签下。

我在logs/localhost.2011-08-28.log ,发现java.lang.ClassNotFoundException导致我进入web.xml,其中包含对已重命名的类的引用

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM