Java EE 6 向后兼容 Java EE 5?
我们有一个使用 Netbeans 6.7.1 和 Glassfish v2.1 开发的 Java EE 5 项目。尝试使用 Netbeans 6.9.1 和 Glassfish v3.1 打开此项目时,会出现许多与缺少类型有关的错误。
Java EE 6 向后兼容 Java EE 5 吗?
缺失的库通常围绕:
javax.xml.rpc.ServiceException;
javax.xml.rpc.Stub;
org.jvnet.staxex.StreamingDataHandler;
com.sun.xml.ws.fault.SOAPFaultBuilder;
有什么想法吗?
[更新]
似乎并非所有必需的库都会自动添加到 Glassfish 3.1 项目的类路径中。主要缺少的 jar 是glasshfish3/glassfish/modules/下的jaxrpc-api-osgi.jar
。如果我手动添加这个罐子,所有问题都会消失。为什么会出现这样的情况呢?为什么不能像使用 NetBeans 6.7.1 和 Glassfish 2.1 一样自动添加 jar?
[更新]
我成功地找到了org.jvnet.staxex.StreamingDataHandler;和 com.sun.xml.ws.fault.SOAPFaultBuilder;
通过:
- com.sun.xml.internal.org.jvnet.staxex.StreamingDataHandler;
- com.sun.xml.internal.ws.fault.SOAPFaultBuilder;
看起来有些包裹发生了变化。尽管如此,这并不能解决我的 javax.xml.rpc.Stub 问题;和 javax.xml.rpc.ServiceException; 没有正确添加到我的类路径中。我觉得手动添加 jar 是不对的。
沃夫加普罗
We have a Java EE 5 project developed using Netbeans 6.7.1 with Glassfish v2.1. Trying to open this project with Netbeans 6.9.1 with Glassfish v3.1 there are many errors concerning missing types.
Is Java EE 6 backward compatible with Java EE 5?
The missing libraries generally revolve around:
javax.xml.rpc.ServiceException;
javax.xml.rpc.Stub;
org.jvnet.staxex.StreamingDataHandler;
com.sun.xml.ws.fault.SOAPFaultBuilder;
Any ideas?
[Update]
It seems that not all of the required libraries are being added to the classpath for a Glassfish 3.1 project automatically. The main missing jar is jaxrpc-api-osgi.jar
under glasshfish3/glassfish/modules/. If I add this jar manually all the problems go away. Why would this be the case? Why isn't the jar added automatically as is done using NetBeans 6.7.1 with Glassfish 2.1?
[Update]
I managed to hunt down org.jvnet.staxex.StreamingDataHandler; and com.sun.xml.ws.fault.SOAPFaultBuilder;
via:
- com.sun.xml.internal.org.jvnet.staxex.StreamingDataHandler;
- com.sun.xml.internal.ws.fault.SOAPFaultBuilder;
Looks like some package changing went on. Still, this doesn't fix my problem with javax.xml.rpc.Stub; and javax.xml.rpc.ServiceException;
not being added to my classpath correctly. I don't feel it's right to add the jar manually.
Wulfgarpro
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
没有什么是完全向后兼容的,但是这些类根本不出现是值得怀疑的。至少前两个肯定是在 Java EE/Java 6 中。如果存在不兼容性,我预计会出现参数不匹配或未找到方法之类的情况。
我首先要查看的是 Netbeans 项目设置 - 我敢打赌,您的 classpath.search 路径不包含您需要的内容。
Nothing is ever completely backwards compatible, but having those classes not showing up at all is suspicious. At least the first two are definitely in Java EE/Java 6. If there were incompatibilities I'd expect something like parameter mismatches or methods not found.
First place I'd look is at the Netbeans project setup -- I'd bet a small amount of money that your classpath.search path doesn't include something you need.
javax.xml.rpc
存在于 EE 5 和 6 中。因此,这不可能与 API 版本不兼容有关。您的 Netbeans 项目的设置方式肯定有问题。javax.xml.rpc
is present in both EE 5 and 6. So this can't be about API version incompatibility. There must be a problem with the way your Netbeans project is set up.我通过卸载所有 JDK、JRE 和 NetBeans 解决了该问题。重新安装,问题已解决。
沃夫加Pro
I fixed the problem by uninstalling all JDK, JRE, and NetBeans. Reinstalling, the issue was rectified.
WulfgarPro