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

标签 java web-services soap jboss

我从 WSDL 自动生成了一个 SOAP Web 服务客户端(我使用 JAVA 1.6),它在 Tomcat 6 上运行良好。但是,当我将客户端置于 war 状态并尝试将其部署到 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);
    }

最佳答案

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

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

参见http://www.jboss.org/jbossws .

关于java - Web 服务可以在 Tomcat 6 上运行,但不能在 JBoss AS 6 上运行,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8404628/

相关文章:

java - 编排设计模式

java - Android - 使用应用的 PorterDuffColorFilter 压缩位图

java - Spring Properties 文件不 Autowiring ,@Value 值始终为 NULL

javascript - JQuery 无法处理 soap 响应

java - 使用java代码创建derby数据库、表

java - 确保字符串具有特定的模式

web-services - 是否有提供纬度/经度地形类型的 Web 服务?

web-services - 我的 iframe 内容如何继承托管域 CSS?

java - 如何在 IBM Lotus Notes 中运行 CoSign Signature SOAP API?

java - SOAP 消息不得包含文档类型声明 (DTD)