简体   繁体   English

找不到rt.jar的类

[英]Class from rt.jar not found

In JBOSS EAP 6 (AS 7): 在JBOSS EAP 6(AS 7)中:

I am making a call to Spring's WebServiceTemplate.marshalSendAndRecieve which in turn is having trouble finding a class that exisits in rt.jar 我正在调用Spring的WebServiceTemplate.marshalSendAndRecieve,这反过来又找不到在rt.jar中出现的类

Caused by: java.lang.ClassNotFoundException: com.sun.org.apache.xerces.internal.dom.DocumentImpl

I do not understand how this can happen? 我不明白这是怎么发生的? Surely everything that is in rt.jar gets loaded up on startup? 当然,rt.jar中的所有内容都会在启动时加载?

Any ideas? 有任何想法吗?

Thanks, 谢谢,

Kenny 肯尼

Ok I found a solution (not sure if its the correct way, but it works). 好的,我找到了一个解决方案(不确定它是否正确,但它有效)。

I noticed by running java -verbose:class that only some of the classes in rt.jar were loaded and not the one I needed (com.sun.org.apache.xerces.internal.dom.DocumentImpl) 我注意到通过运行java -verbose:class,只加载了rt.jar中的一些类而不是我需要的类(com.sun.org.apache.xerces.internal.dom.DocumentImpl)

So in JBoss EAP 6 (As 7) there is a modules directory ($JBOSS_HOME/modules/) And under here there is sun/jdk/main/modules.xml 所以在JBoss EAP 6(As 7)中有一个模块目录($ JBOSS_HOME / modules /),这里有sun / jdk / main / modules.xml

I added the following entries: 我添加了以下条目:

<path name="com/sun/org/apache/xerces/internal/dom"/>
<path name="com/sun/org/apache/xerces/internal/xni"/>
<path name="com/sun/org/apache/xerces/internal/jaxp"/>

(last 2 becuase of subsequent class not found exceptions after adding in dom) (最后2因为在dom中添加后未找到后续类别的例外)

As I said I'm not 100% sure if this is the correct way to do this. 正如我所说,我不能100%确定这是否是正确的方法。 Any input is welcome! 欢迎任何输入!

Thanks, 谢谢,

Kenny 肯尼

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

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