Java 更新 1.6.0_26 导致 SOAP 异常 - NoClassDefFoundError:无法初始化 FastInfosetReflection
我有一个向 Web 服务发出 SOAP 请求的小程序。它没有证书或特殊的安全考虑,只是一个基本的小程序和网络服务。将几台计算机上的 Java 更新到 1.6.0_26 后,我可以毫无疑问地说更新会导致以下异常。 (以前版本的 Java 仍然有效)
com.sun.xml.internal.messaging.saaj.soap.MessageImpl saveChanges
SEVERE: SAAJ0540: Error during saving a multipart message
com.sun.xml.internal.messaging.saaj.SOAPExceptionImpl: com.sun.xml.internal.messaging.saaj.SOAPExceptionImpl: Error during saving a multipart message
at com.sun.xml.internal.messaging.saaj.client.p2p.HttpSOAPConnection.call(Unknown Source)
...
java.lang.NoClassDefFoundError: Could not initialize class com.sun.xml.internal.messaging.saaj.util.FastInfosetReflection
at com.sun.xml.internal.messaging.saaj.util.transform.EfficientStreamingTransformer.transform(Unknown Source)
at com.sun.xml.internal.messaging.saaj.soap.impl.EnvelopeImpl.output(Unknown Source)
at com.sun.xml.internal.messaging.saaj.soap.impl.EnvelopeImpl.output(Unknown Source)
at com.sun.xml.internal.messaging.saaj.soap.SOAPPartImpl.getContentAsStream(Unknown Source)
at com.sun.xml.internal.messaging.saaj.soap.MessageImpl.getHeaderBytes(Unknown Source)
at com.sun.xml.internal.messaging.saaj.soap.MessageImpl.saveChanges(Unknown Source)
at com.sun.xml.internal.messaging.saaj.client.p2p.HttpSOAPConnection.post(Unknown Source)
at com.sun.xml.internal.messaging.saaj.client.p2p.HttpSOAPConnection.call(Unknown Source)
有谁知道是什么原因造成的或有任何解决方法吗?
如果有必要,我可以发布更长的异常堆栈跟踪。
谢谢。
I have an applet that makes a SOAP request to a web service. It has no certificates or special security considerations, just a basic applet and webservice. After updating Java on a few computers to 1.6.0_26 I can say without a doubt that the update causes the following exception. (Previous versions of Java still work)
com.sun.xml.internal.messaging.saaj.soap.MessageImpl saveChanges
SEVERE: SAAJ0540: Error during saving a multipart message
com.sun.xml.internal.messaging.saaj.SOAPExceptionImpl: com.sun.xml.internal.messaging.saaj.SOAPExceptionImpl: Error during saving a multipart message
at com.sun.xml.internal.messaging.saaj.client.p2p.HttpSOAPConnection.call(Unknown Source)
...
java.lang.NoClassDefFoundError: Could not initialize class com.sun.xml.internal.messaging.saaj.util.FastInfosetReflection
at com.sun.xml.internal.messaging.saaj.util.transform.EfficientStreamingTransformer.transform(Unknown Source)
at com.sun.xml.internal.messaging.saaj.soap.impl.EnvelopeImpl.output(Unknown Source)
at com.sun.xml.internal.messaging.saaj.soap.impl.EnvelopeImpl.output(Unknown Source)
at com.sun.xml.internal.messaging.saaj.soap.SOAPPartImpl.getContentAsStream(Unknown Source)
at com.sun.xml.internal.messaging.saaj.soap.MessageImpl.getHeaderBytes(Unknown Source)
at com.sun.xml.internal.messaging.saaj.soap.MessageImpl.saveChanges(Unknown Source)
at com.sun.xml.internal.messaging.saaj.client.p2p.HttpSOAPConnection.post(Unknown Source)
at com.sun.xml.internal.messaging.saaj.client.p2p.HttpSOAPConnection.call(Unknown Source)
Does anyone know what is causing this or have any workarounds?
If necessary, I have a longer exception stack trace that I can post.
Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这是来自 http://java.net/node/701033
我必须知道我需要签署小程序使用的所有 .jar 文件,并且它们都必须使用相同的证书进行签名(即,即使我使用的库文件已经签名 - 但由其他签名机构签名 - 我需要重新签名它们与我相同的证书用于签署小程序的主 jar)。之后,小程序现在可以正常启动,不会尝试访问任何非法系统属性,也不会尝试查找任何丢失的类,从而避免这些异常。
我不是 100% 肯定这是否是先决条件:在尝试运行此程序的过程中,我还迁移到了最新的 Java 6 JRE(即,对于 Sun JRE 为 1.6.0_17,对于 IBM JRE 为 1.6) .0sr7)。
通过这两个步骤,我的小程序现在可以正常工作,使用 SOAP 与服务器进行通信,并且它可以使用提到的两个 JRE 进行通信。
HTH,
迈克尔
This was from http://java.net/node/701033
I had to learn that I need to sign ALL .jar files that the applet uses AND they all have to be signed with the same certificate (i.e. even though the library files I were using WERE already signed - but by an other signing authority - I needed to re-sign them with the same certificate that I use to sign the applet's main-jar). After that the applet now starts up fine and does not try to access any illegal system property nor does it try to locate any missing class thereby avoiding these exceptions.
I am not 100% positive whether that's a prereq or not: in the process of trying to get this running I also migrated to the very latest Java 6 JRE (i.e. for Sun JRE that's 1.6.0_17, for an IBM JRE that would be 1.6.0sr7).
With these both steps my applet is now working fine using SOAP to communicate with the server and it does so with both mentioned JREs.
HTH,
Michael