简体   繁体   English

Tomcat 6 Classloader:正在读取哪个Jar?

[英]Tomcat 6 Classloader : Which Jar is it reading?

I have a huge web application that I have to support. 我有一个必须支持的庞大的Web应用程序。 Recently when I downloaded the latest source from SVN and try to run it locally on Tomcat 6, I get the following error from one of the background batch jobs that the application runs... 最近,当我从SVN下载最新的源并尝试在Tomcat 6上本地运行时,我从应用程序运行的后台批处理作业之一中收到以下错误...

2014-12-23 18:08:27 [taskScheduler-4] TaskUtils$LoggingErrorHandler [ERROR] Unexpected error occurred in scheduled task.
java.lang.NoSuchMethodError: javax.xml.stream.XMLEventFactory.newFactory()Ljavax/xml/stream/XMLEventFactory;
at org.apache.cxf.binding.soap.interceptor.ReadHeadersInterceptor$HeadersProcessor.<clinit>(ReadHeadersInterceptor.java:275)

So I believe the problem is the Apache class ReadHeadersInterceptor which my application's code calls is trying to call the newFactory() method from XMLEventFactory but is not finding that method, probably because it is reading an older version of XMLEventFactory. 因此,我认为问题出在我的应用程序代码调用的Apache类ReadHeadersInterceptor试图从XMLEventFactory调用newFactory()方法,但没有找到该方法,可能是因为它正在读取XMLEventFactory的旧版本。

I think this is happening because there are some JARs in my lib folder I need to remove or add. 我认为发生这种情况是因为我的lib文件夹中有一些JAR需要删除或添加。 Problem is I don't know which one. 问题是我不知道哪一个。 I see there are several JARs which have XMLEventFactory including.. 我看到有几个包含XMLEventFactory的JAR,包括..

woodstox-core-asl-4.2.0 stax2-api-3.1.1 woodstox-core-asl-4.2.0 stax2-api-3.1.1

And it is also part of Java 6 in the rt.jar. 它也是rt.jar中Java 6的一部分。

So out of all these Jars which one is it trying to read and not find that method it needs? 因此,在所有这些Jar中,它是试图读取哪一个而找不到所需的方法?

Thanks. 谢谢。

This is a problem with specific version of JDK/JRE 1.6 (I mean the update). 这是特定版本的JDK / JRE 1.6(我的意思是更新)的问题。 It may looks weird but the JDK API change for specific major version. 看起来很奇怪,但是JDK API针对特定的主要版本进行了更改。

Please take a loot at the following link . 请通过以下链接抢劫。 You can see there that with change from version 1.6.0.17 to 1.6.0.18 the new methods have been added on the XMLEventFactory class. 您可以在那里看到,从1.6.0.17版本更改为1.6.0.18版本后,新方法已添加到XMLEventFactory类上。

Probably you have the JRE version less thank 1.6.0.18. 可能您的JRE版本要少一些,谢谢1.6.0.18。 I've had the same problem with Apache CXF and dynamic proxies. 我在Apache CXF和动态代理中遇到了相同的问题。 The update of JRE 1.6.0.14 to 1.6.0.19 fixed the issue. 将JRE 1.6.0.14更新到1.6.0.19修复了此问题。

I hope it helps. 希望对您有所帮助。

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

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