您好,我已经开发了使用 JAXB 编码和解码的 Web 应用程序。 Web 应用程序在 tomcat 中正常运行,没有任何问题。但是当我在 Websphere 7.0.0.13 中尝试时,它返回空对象。请帮助我解决这个问题。
最佳答案
我遇到了同样的问题。这下link是对我有帮助的解决方案。
我做了什么:
1. 在管理控制台中,单击应用程序 > 应用程序类型 > WebSphere 企业应用程序 > app-name > 类加载和更新检测。
2. 在 Class reloading options 下,选择 Override class reloading settings for web and EJB modules 。
3. 在 Class loader order 下,选择 Class loader order 属性为 Classes loaded with local class loader first (parent last)。
4. 单击确定,然后单击保存以保存您的更改。
之后:
1. 在管理控制台中选择服务器
2. 展开Server Type 并选择* WebSphere application servers *
3. 点击你的服务器名称
4. 展开Java and Process Management并选择* Process Definition。*
5. 在 Additional Properties 部分下,单击 Java Virtual
机器。
6. 向下滚动并找到Generic JVM arguments 的文本框。
添加:-Djavax.xml.bind.JAXBContext=com.sun.xml.internal.bind.v2.ContextFactory
最后重启网络服务器和集群。
关于java - websphere 中的 Jaxb,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34762565/