将 Web 服务导出到不同环境后出现运行时错误

发布于 2024-12-14 06:36:48 字数 3513 浏览 1 评论 0原文

我在 Eclipse IDE 上开发 Web 服务已经有一段时间了,完成后我将其导出到运行 Windows Server 2008 R2 的服务器。成功部署后,我遇到运行时错误:

16:03:39,358 ERROR [STDERR] java.lang.ClassCastException: org.jboss.ws.core.jaxrpc.client.ServiceFactoryImpl 无法转换为 javax.xml.rpc.ServiceFactory 16:03:39,358 错误 [STDERR] 在 javax.xml.rpc.ServiceFactory.newInstance(ServiceFactory.java:63) 16:03:39,358 错误 [STDERR] 在 org.apache.jsp.GetDocuments_jsp._jspService(GetDocuments_jsp.java:86) 16:03:39,358 错误 [STDERR] 在 org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70) 16:03:39,358 错误 [STDERR] 在 javax.servlet.http.HttpServlet.service(HttpServlet.java:717) 16:03:39,358 错误 [STDERR] 在 org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:369) 16:03:39,358 错误 [STDERR] 在 org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:322) 16:03:39,358 错误 [STDERR] 在 org.apache.jasper.servlet.JspServlet.service(JspServlet.java:249) 16:03:39,358 错误 [STDERR] 在 javax.servlet.http.HttpServlet.service(HttpServlet.java:717) 16:03:39,358 错误 [STDERR] 在 org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290) 16:03:39,358 错误 [STDERR] 在 org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) 16:03:39,358 错误 [STDERR] 在 org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96) 16:03:39,358 错误 [STDERR] 在 org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) 16:03:39,358 错误 [STDERR] 在 org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) 16:03:39,358 错误 [STDERR] 在 org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:235) 16:03:39,358 错误 [STDERR] 在 org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191) 16:03:39,358 错误 [STDERR] 在 org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:183) 16:03:39,358 错误 [STDERR] 在 org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:95) 16:03:39,358 错误 [STDERR] 在 org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.process(SecurityContextEstablishmentValve.java:126) 16:03:39,358 错误 [STDERR] 在 org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.invoke(SecurityContextEstablishmentValve.java:70) 16:03:39,358 错误 [STDERR] 在 org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127) 16:03:39,358 错误 [STDERR] 在 org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) 16:03:39,358 错误 [STDERR] 在 org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:158) 16:03:39,358 错误 [STDERR] 在 org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) 16:03:39,358 错误 [STDERR] 在 org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:330) 16:03:39,358 错误 [STDERR] 在 org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:829) 16:03:39,358 错误 [STDERR] 在 org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:599) 16:03:39,358 错误 [STDERR] 在 org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:451) 16:03:39,358 ERROR [STDERR] at java.lang.Thread.run(Unknown Source)

当我尝试访问 Web 方法时会发生这种情况,在本例中 GetDocuments 是 Web 方法。客户端使用 JSP 创建绑定存根以与服务进行通信。这些存根由 Eclipse IDE 自动生成。我对 Web 服务了解不多,也不知道如何进一步研究这些问题,因为错误没有指向我的项目中的任何实际类。

我最大的问题是为什么在导出项目之前我没有收到任何错误。我认为这可能是 JRE 或编译器的问题,但它们在两个平台上都是相同的。我将不胜感激任何帮助。

I have been developing a Web Service for some time now on my Eclipse IDE and after I finished it I exported it to a Server running Windows server 2008 R2. After deploying it successfully I run into runtime errors :

16:03:39,358 ERROR [STDERR] java.lang.ClassCastException: org.jboss.ws.core.jaxrpc.client.ServiceFactoryImpl cannot be cast to javax.xml.rpc.ServiceFactory
16:03:39,358 ERROR [STDERR] at javax.xml.rpc.ServiceFactory.newInstance(ServiceFactory.java:63)
16:03:39,358 ERROR [STDERR] at org.apache.jsp.GetDocuments_jsp._jspService(GetDocuments_jsp.java:86)
16:03:39,358 ERROR [STDERR] at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
16:03:39,358 ERROR [STDERR] at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
16:03:39,358 ERROR [STDERR] at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:369)
16:03:39,358 ERROR [STDERR] at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:322)
16:03:39,358 ERROR [STDERR] at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:249)
16:03:39,358 ERROR [STDERR] at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
16:03:39,358 ERROR [STDERR] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
16:03:39,358 ERROR [STDERR] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
16:03:39,358 ERROR [STDERR] at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
16:03:39,358 ERROR [STDERR] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
16:03:39,358 ERROR [STDERR] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
16:03:39,358 ERROR [STDERR] at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:235)
16:03:39,358 ERROR [STDERR] at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
16:03:39,358 ERROR [STDERR] at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:183)
16:03:39,358 ERROR [STDERR] at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:95)
16:03:39,358 ERROR [STDERR] at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.process(SecurityContextEstablishmentValve.java:126)
16:03:39,358 ERROR [STDERR] at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.invoke(SecurityContextEstablishmentValve.java:70)
16:03:39,358 ERROR [STDERR] at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
16:03:39,358 ERROR [STDERR] at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
16:03:39,358 ERROR [STDERR] at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:158)
16:03:39,358 ERROR [STDERR] at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
16:03:39,358 ERROR [STDERR] at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:330)
16:03:39,358 ERROR [STDERR] at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:829)
16:03:39,358 ERROR [STDERR] at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:599)
16:03:39,358 ERROR [STDERR] at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:451)
16:03:39,358 ERROR [STDERR] at java.lang.Thread.run(Unknown Source)

This happens when I try to access the Web Methods, in this example GetDocuments is the Web Method. The client is using JSP to create Binding Stubs to communication with the Service. These stubs are automatic generate by the Eclipse IDE. I don't know too much else about Web Services or how look into these problem further as it the errors do not point to any real class in my project.

My big question would be why I received no errors until I exported the project. I was thinking that it might be an issue with THe JRE or compiler but they are the same on both platforms. I would appreciate any help.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

幸福%小乖 2024-12-21 06:36:48

javax.xml.rpc.ServiceFactory 最有可能包含在 jboss-jaxrpc.jarjavaee-api-*.jar 中(* 是版本)。

org.jboss.ws.core.jaxrpc.client.ServiceFactoryImpl 包含在 jbossws 库中。

因此,您必须确保您的 JBoss 使用这些库的兼容版本,这在您的 eclipse 设置中似乎就是这种情况。

对于未来的读者:解决方案是确保 JBoss 使用的库与 Eclipse 使用的库相匹配,而 Eclipse 使用的库显然是兼容版本。

javax.xml.rpc.ServiceFactory is most likely contained in either jboss-jaxrpc.jar or javaee-api-*.jar (* being the version).

org.jboss.ws.core.jaxrpc.client.ServiceFactoryImpl is contained in a jbossws library.

Thus you have to make sure that your JBoss uses compatible versions of those libraries, which seems to be the case in your eclipse setup.

For future readers: the solution was to make sure that the libraries used by JBoss matched those used by Eclipse which apparently were of compatible versions.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文