
@Sanjeeva - thanks for letting me know. Were you running Java 1.6? I believe all of the code I tested was running Java 1.5.
with was 7.0.07 i was getting following exection, by remonving jaxb-impl-2.1.13.jar from workspace resolved issue.
java.lang.ClassCastException: com.XXX.XXXX.XXXX.dto.soap.SoapParam$JaxbAccessorM_getKey_setKey_java_lang_String incompatible with com.sun.xml.bind.v2.runtime.reflect.Accessor
at com.sun.xml.bind.v2.runtime.reflect.opt.OptimizedAccessorFactory.instanciate(OptimizedAccessorFactory.java:190)
at com.sun.xml.bind.v2.runtime.reflect.opt.OptimizedAccessorFactory.get(OptimizedAccessorFactory.java:135)
at com.sun.xml.bind.v2.runtime.reflect.Accessor$GetterSetterReflection.optimize(Accessor.java:392)
at com.sun.xml.bind.v2.runtime.reflect.TransducedAccessor$CompositeTransducedAccessorImpl.<init>(TransducedAccessor.java:233)
at com.sun.xml.bind.v2.runtime.reflect.TransducedAccessor.get(TransducedAccessor.java:173)
at com.sun.xml.bind.v2.runtime.property.AttributeProperty.<init>(AttributeProperty.java:87)
at com.sun.xml.bind.v2.runtime.property.PropertyFactory.create(PropertyFactory.java:104)
at com.sun.xml.bind.v2.runtime.ClassBeanInfoImpl.<init>(ClassBeanInfoImpl.java:179)
at com.sun.xml.bind.v2.runtime.JAXBContextImpl.getOrCreate(JAXBContextImpl.java:515)
at com.sun.xml.bind.v2.runtime.JAXBContextImpl.getOrCreate(JAXBContextImpl.java:534)
at com.sun.xml.bind.v2.runtime.ArrayBeanInfoImpl.<init>(ArrayBeanInfoImpl.java:74)
at com.sun.xml.bind.v2.runtime.JAXBContextImpl.getOrCreate(JAXBContextImpl.java:524)
at com.sun.xml.bind.v2.runtime.JAXBContextImpl.<init>(JAXBContextImpl.java:324)
at com.sun.xml.bind.v2.runtime.JAXBContextImpl$JAXBContextBuilder.build(JAXBContextImpl.java:1140)
at com.sun.xml.bind.v2.ContextFactory.createContext(ContextFactory.java:154)
at com.sun.xml.bind.v2.ContextFactory.createContext(ContextFactory.java:121)
Please submit a working example project. I try this and always getting error:
Caused by: java.lang.ClassCastException: my.project.services.Request$JaxbAccessorM_getApplicationName_setApplicationName_java_lang_String incompatible with com.sun.xml.bind.v2.runtime.reflect.Accessor
at com.sun.xml.bind.v2.runtime.reflect.opt.OptimizedAccessorFactory.instanciate(OptimizedAccessorFactory.java:190)
at com.sun.xml.bind.v2.runtime.reflect.opt.OptimizedAccessorFactory.get(OptimizedAccessorFactory.java:135)
at com.sun.xml.bind.v2.runtime.reflect.Accessor$GetterSetterReflection.optimize(Accessor.java:392)
at com.sun.xml.bind.v2.runtime.property.SingleElementLeafProperty.<init>(SingleElementLeafProperty.java:82)
We got the whole thing running _without_ changing the classloader order.
We also needed a Shared Library:
bcel-5.2.jar
serializer-2.7.1.jar
wsdl4j-1.6.2.jar
xalan-2.7.1.jar
xercesImpl-2.8.1.jar
XmlSchema-1.4.5.jar
saaj-impl-1.3.4.jar
jaxb-impl-2.1.13.jar
jaxp-ri-1.4.2.jar
The Shared Libraray must be assigned to the application.
The following JVM Custom properties are set:
| javax.xml.transform.TransformerFactory | org.apache.xalan.processor.TransformerFactoryImpl |
| javax.xml.xpath.XPathFactory | org.apache.xpath.jaxp.XPathFactoryImpl |
| javax.xml.parsers.SAXParserFactory | org.apache.xerces.jaxp.SAXParserFactoryImpl |
| javax.xml.parsers.DocumentBuilderFactory | org.apache.xerces.jaxp.DocumentBuilderFactoryImpl |
| javax.xml.stream.XMLOutputFactory | com.sun.xml.internal.stream.XMLOutputFactoryImpl |
Additionally we set DisableIBMJAXWSEngine: true in META-INF/MANIFEST.MF, because it is documented to do so. (It did run without on my machine)
The functionality we need runs fine. Whether everything works: try out yourself.
Remarks:
I assume that the shared libraries could be as well provided as utility Jars in an EAR file. But i did not try this out.
The properties could be set alternatively in META-INF/services/ and be provided in a shared lib or utility jar. Please see API documentation. (Did not try this myself either)
I forgot...
Server version was IBM WebSphere Application Server v7.0.0.9
@Hayo - You don't need to take these steps to work with WAS 7.0 and above. Thanks for your comments, though. @Voji - When I wrote this, all of the example code worked on WAS 6.1.0.29 with JDK 5. Feel free to contact me for more specifics.