at org.apache.cxf.jaxws.EndpointImpl.doPublish(EndpointImpl.java:370) 异常

来源:互联网 发布:java构造器和构造函数 编辑:程序博客网 时间:2024/06/05 08:44
 

at org.apache.cxf.jaxws.EndpointImpl.doPublish(EndpointImpl.java:370) 异常

标签: Exception in threadat org.apache.cxf.jaat org.apache.cxf.ja
 107人阅读 评论(0) 收藏 举报

    遇到异常如下,

Exception in thread "main" javax.xml.ws.WebServiceException: Java.lang.NullPointerException

at org.apache.cxf.jaxws.EndpointImpl.doPublish(EndpointImpl.java:370)
at org.apache.cxf.jaxws.EndpointImpl.publish(EndpointImpl.java:250)
at org.apache.cxf.jaxws.spi.ProviderImpl.createAndPublishEndpoint(ProviderImpl.java:152)
at javax.xml.ws.Endpoint.publish(Endpoint.java:240)
at com.demo.test.main(test.java:13)
Caused by: java.lang.NullPointerException
at java.util.concurrent.ConcurrentHashMap.put(ConcurrentHashMap.java:1124)
at org.apache.cxf.bus.CXFBusImpl.getExtension(CXFBusImpl.java:111)
at org.apache.cxf.transport.http.HTTPTransportFactory.getDestination(HTTPTransportFactory.java:272)
at org.apache.cxf.binding.soap.SoapTransportFactory.getDestination(SoapTransportFactory.java:134)
at org.apache.cxf.endpoint.ServerImpl.initDestination(ServerImpl.java:93)
at org.apache.cxf.endpoint.ServerImpl.<init>(ServerImpl.java:72)
at org.apache.cxf.frontend.ServerFactoryBean.create(ServerFactoryBean.java:160)
at org.apache.cxf.jaxws.JaxWsServerFactoryBean.create(JaxWsServerFactoryBean.java:211)
at org.apache.cxf.jaxws.EndpointImpl.getServer(EndpointImpl.java:455)
at org.apache.cxf.jaxws.EndpointImpl.doPublish(EndpointImpl.java:333)

... 4 more


在学习webService  CXF,利用Endpoint,publish("xxxxxxxxxx"),进行测试时,报了以上错误,原因查明,是因为Jar冲突,有的说是版本问题,

具体解决问题,清空旧的jar,将all的包放入bli下测试即可。。。   CFX下载地址: http://cxf.apache.org/download.html

  

注:Endpoint是jdk提供的一个专门用于发布服务的类,它的publish方法接收两个参数,一个是本地的服务地址,二是提供服务的类。它位于javax.xml.ws.*包中。 
static Endpoint.publish(String address, Object implementor) 在给定地址处针对指定的实现者对象创建并发布端点。stop方法用于停止服务。

事实证明,除却测试时,在正式webService中并不能直接使用全部的CFX包。

0 0
原创粉丝点击