简体   繁体   English

JRockit vs HotSpot类加载问题-META-INF / services

[英]JRockit vs HotSpot classloading issue - META-INF/services

According to the javadoc of javax.xml.validation.SchemaFactory#newInstance, I can specify which implementation of SchemaFactory I want, by placing a file in META-INF/services called javax.xml.validation.SchemaFactory with the required class (in my case org.apache.xerces.jaxp.validation.XMLSchemaFactory). 根据javax.xml.validation.SchemaFactory#newInstance的javadoc,我可以通过在META-INF / services中放置一个带有所需类的文件javax.xml.validation.SchemaFactory来指定所需的SchemaFactory实现。案例org.apache.xerces.jaxp.validation.XMLSchemaFactory)。

This works fine when I run Weblogic using the HotSpot JVM, but when using the JRockit JVM, it doesn't find anything in the META-INF/services directory (I've stepped through the code on the server and in javax.xml.validation.SchemaFactoryFinder#createServiceFileIterator, the Enumeration returns empty for JRockit but the correct resouce for HotSpot). 当我使用HotSpot JVM运行Weblogic时,此方法工作正常,但是当使用JRockit JVM时,它在META-INF / services目录中找不到任何内容(我已经遍历了服务器和javax.xml中的代码。 validate.SchemaFactoryFinder#createServiceFileIterator,对于JRockit,枚举返回空,但对于HotSpot,正确枚举返回。 I think it might be because it is using a different classloader. 我认为可能是因为它使用了不同的类加载器。

Any suggestions? 有什么建议么?

最后,我通过在weblogic启动脚本中设置-Djavax.xml.validation.SchemaFactory = org.apache.xerces.jaxp.validation.XMLSchemaFactory来解决此问题。

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

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