Web服务可在Tomcat 6上运行,但不能在JBoss AS 6上运行 [英] Web service works on Tomcat 6 but not on JBoss AS 6

查看:124
本文介绍了Web服务可在Tomcat 6上运行,但不能在JBoss AS 6上运行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

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

这是自动生成的getEWCITYServices函数

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);
    }

推荐答案

看来您必须坚持JBoss(本地,CXF或Metro)支持的WS实现.

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

尝试仅从类路径中删除包含sun的实现的所有jar(com.sun.xml.ws. *等).无论如何,它已经很老了,被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.

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

这篇关于Web服务可在Tomcat 6上运行,但不能在JBoss AS 6上运行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆