Jaxb in websphere

拈花ヽ惹草 提交于 2020-01-06 04:14:27

问题


Hi I have developed the web application to marshall and unmarshall using JAXB. The web application is working in tomcat without any issues. But when I tried in Websphere 7.0.0.13 its returning null object.Please help me on this issue.


回答1:


I had the same problem. Under this link is solution that help me.

What i did:
1. In the administrative console, click Applications > Application Types > WebSphere enterprise applications > app-name > Class loading and update detection.
2. Under Class reloading options, select Override class reloading settings for web and EJB modules .
3. Under Class loader order, select Class loader order property to Classes loaded with local class loader first (parent last).
4. Click OK, and then Save to save your changes.

After that:
1. In the Administration Console select Servers
2. Expand Server Type and select* WebSphere application servers *
3. Click on the name of your server
4. Expand Java and Process Management and select* Process Definition.*
5. Under the Additional Properties section, click Java Virtual Machine.
6. Scroll down and locate the textbox for Generic JVM arguments.
ADD: -Djavax.xml.bind.JAXBContext=com.sun.xml.internal.bind.v2.ContextFactory

In the end restar web server and cluster.




回答2:


WebSphere Application Server v7+ contains an optimized JAXB implementation that will often be used instead of the JAXB implementation that's built into the Java SDK. If you notice a difference in behaviour between WebSphere and Tomcat (or some other runtime) that is affecting your application, as a workaround you can often resolve the issue by setting the system property com.ibm.xml.xlxp.jaxb.opti.level=0 in WebSphere. Using this setting will cause the JAXB reference implemenation to be used for unmarshalling and marshalling instead of the WebSphere JAXB implementation.

More information on the com.ibm.xml.xlxp.jaxb.opti.level system property is available here.



来源:https://stackoverflow.com/questions/34762565/jaxb-in-websphere

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