Java Update 1.6.0_26 Causes SOAP Exception - NoClassDefFoundError:Could not initialize FastInfosetReflection

狂风中的少年 提交于 2020-01-05 07:19:33

问题


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.


回答1:


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



来源:https://stackoverflow.com/questions/6455022/java-update-1-6-0-26-causes-soap-exception-noclassdeffounderrorcould-not-init

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!