Web 服务可以在 Tomcat 6 上运行,但不能在 JBoss AS 6 上运行

发布于 2024-12-20 02:43:35 字数 2749 浏览 1 评论 0原文

我从 WSDL 自动生成了一个 SOAP Web 服务客户端(我使用 JAVA 1.6),它在 Tomcat 6 上运行良好。但是,当我将客户端置于战争中并尝试将其部署在 JBoss Application Server 6.1 中时,我收到以下错误:

Caused by: java.lang.ExceptionInInitializerError
    at com.sun.xml.ws.tx.common.Util.isJTAAvailable(Util.java:71) [:1.0]
    at com.sun.xml.ws.assembler.PipelineAssemblerFactoryImpl$WsitPipelineAssembler.isTransactionsEnabled(PipelineAssemblerFactoryImpl.java:468) [:1.0]
    at com.sun.xml.ws.assembler.PipelineAssemblerFactoryImpl$WsitPipelineAssembler.createClient(PipelineAssemblerFactoryImpl.java:271) [:1.0]
    at com.sun.xml.ws.api.pipe.TubelineAssemblerFactory$TubelineAssemblerAdapter.createClient(TubelineAssemblerFactory.java:136) [:1.0]
    at com.sun.xml.ws.client.WSServiceDelegate.createPipeline(WSServiceDelegate.java:423) [:1.0]
    at com.sun.xml.ws.client.WSServiceDelegate.createEndpointIFBaseProxy(WSServiceDelegate.java:589) [:1.0]
    at com.sun.xml.ws.client.WSServiceDelegate.getPort(WSServiceDelegate.java:329) [:1.0]
    at com.sun.xml.ws.client.WSServiceDelegate.getPort(WSServiceDelegate.java:311) [:1.0]
    at com.sun.xml.ws.client.WSServiceDelegate.getPort(WSServiceDelegate.java:304) [:1.0]
    **at javax.xml.ws.Service.getPort(Service.java:92) [:1.0.0.Final]**
    at com.ewave.meuhedet.ws.iclient.city.EWCITYServicesService.getEWCITYServices(EWCITYServicesService.java:74) [:]
    at com.ewave.meuhedet.ws.iclient.impl.PharmacyServiceIClientImpl.<init>(PharmacyServiceIClientImpl.java:58) [:]
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) [:1.6.0_26]
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39) [:1.6.0_26]
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27) [:1.6.0_26]
    at java.lang.reflect.Constructor.newInstance(Constructor.java:513) [:1.6.0_26]
    at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:126) [:3.0.1.RELEASE-A]
    ... 105 more
**Caused by: java.lang.ClassCastException: com.arjuna.ats.internal.jta.transaction.arjunacore.TransactionSynchronizationRegistryImple cannot be cast to javax.transaction.TransactionSynchronizationRegistry**
    at com.sun.xml.ws.tx.common.TransactionManagerImpl.<init>(TransactionManagerImpl.java:106) [:1.0]
    at com.sun.xml.ws.tx.common.TransactionManagerImpl.<clinit>(TransactionManagerImpl.java:62) [:1.0]
    ... 122 more

这是自动生成的 getEWCITYServices 函数

@WebEndpoint(name = "EW_CITYServices")
    public EWCITYServices getEWCITYServices() {
        return super.**getPort**(new QName("http://ew_city.wsbeans.iseries",
                "EW_CITYServices"), EWCITYServices.class);
    }

I autogenerated a SOAP webservice client from a WSDL (I use JAVA 1.6), and it works fine on Tomcat 6. However, when I put the client in a war and try to deploy it in JBoss Application Server 6.1 I get the following errors:

Caused by: java.lang.ExceptionInInitializerError
    at com.sun.xml.ws.tx.common.Util.isJTAAvailable(Util.java:71) [:1.0]
    at com.sun.xml.ws.assembler.PipelineAssemblerFactoryImpl$WsitPipelineAssembler.isTransactionsEnabled(PipelineAssemblerFactoryImpl.java:468) [:1.0]
    at com.sun.xml.ws.assembler.PipelineAssemblerFactoryImpl$WsitPipelineAssembler.createClient(PipelineAssemblerFactoryImpl.java:271) [:1.0]
    at com.sun.xml.ws.api.pipe.TubelineAssemblerFactory$TubelineAssemblerAdapter.createClient(TubelineAssemblerFactory.java:136) [:1.0]
    at com.sun.xml.ws.client.WSServiceDelegate.createPipeline(WSServiceDelegate.java:423) [:1.0]
    at com.sun.xml.ws.client.WSServiceDelegate.createEndpointIFBaseProxy(WSServiceDelegate.java:589) [:1.0]
    at com.sun.xml.ws.client.WSServiceDelegate.getPort(WSServiceDelegate.java:329) [:1.0]
    at com.sun.xml.ws.client.WSServiceDelegate.getPort(WSServiceDelegate.java:311) [:1.0]
    at com.sun.xml.ws.client.WSServiceDelegate.getPort(WSServiceDelegate.java:304) [:1.0]
    **at javax.xml.ws.Service.getPort(Service.java:92) [:1.0.0.Final]**
    at com.ewave.meuhedet.ws.iclient.city.EWCITYServicesService.getEWCITYServices(EWCITYServicesService.java:74) [:]
    at com.ewave.meuhedet.ws.iclient.impl.PharmacyServiceIClientImpl.<init>(PharmacyServiceIClientImpl.java:58) [:]
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) [:1.6.0_26]
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39) [:1.6.0_26]
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27) [:1.6.0_26]
    at java.lang.reflect.Constructor.newInstance(Constructor.java:513) [:1.6.0_26]
    at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:126) [:3.0.1.RELEASE-A]
    ... 105 more
**Caused by: java.lang.ClassCastException: com.arjuna.ats.internal.jta.transaction.arjunacore.TransactionSynchronizationRegistryImple cannot be cast to javax.transaction.TransactionSynchronizationRegistry**
    at com.sun.xml.ws.tx.common.TransactionManagerImpl.<init>(TransactionManagerImpl.java:106) [:1.0]
    at com.sun.xml.ws.tx.common.TransactionManagerImpl.<clinit>(TransactionManagerImpl.java:62) [:1.0]
    ... 122 more

this is the autogenerated getEWCITYServices function

@WebEndpoint(name = "EW_CITYServices")
    public EWCITYServices getEWCITYServices() {
        return super.**getPort**(new QName("http://ew_city.wsbeans.iseries",
                "EW_CITYServices"), EWCITYServices.class);
    }

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

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

发布评论

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

评论(1

赴月观长安 2024-12-27 02:43:35

看起来您必须坚持使用 JBoss 支持的 WS 实现(Native、CXF 或 Metro)。

尝试从类路径中删除所有包含 sun 实现的 jar(com.sun.xml.ws.* 等)。无论如何,它已经很旧了,已经被地铁取代了。

请参阅http://www.jboss.org/jbossws

It looks you would have to stick with WS implementation supported by JBoss (Native, CXF or Metro).

Try just removing from classpath all jars containing sun's implementation (com.sun.xml.ws.*, etc). It's pretty old anyway and was superseded by Metro.

See http://www.jboss.org/jbossws.

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