WebService常见异常(一)
Exception in thread "main" javax.xml.ws.WebServiceException: org.apache.cxf.service.factory.ServiceConstructionException at org.apache.cxf.jaxws.EndpointImpl.doPublish(EndpointImpl.java:375) at org.apache.cxf.jaxws.EndpointImpl.publish(EndpointImpl.java:255) at org.apache.cxf.jaxws.spi.ProviderImpl.createAndPublishEndpoint(ProviderImpl.java:134) at javax.xml.ws.Endpoint.publish(Endpoint.java:240) at top.simba1949.server.ServerApp.main(ServerApp.java:9) Caused by: org.apache.cxf.service.factory.ServiceConstructionException at org.apache.cxf.frontend.ServerFactoryBean.create(ServerFactoryBean.java:197) at org.apache.cxf.jaxws.JaxWsServerFactoryBean.create(JaxWsServerFactoryBean.java:211) at org.apache.cxf.jaxws.EndpointImpl.getServer(EndpointImpl.java:460) at org.apache.cxf.jaxws.EndpointImpl.doPublish(EndpointImpl.java:338) ... 4 more Caused by: java.io.IOException: Cannot find any registered HttpDestinationFactory from the Bus. at org.apache.cxf.transport.http.HTTPTransportFactory.getDestination(HTTPTransportFactory.java:276) at org.apache.cxf.binding.soap.SoapTransportFactory.getDestination(SoapTransportFactory.java:135) at org.apache.cxf.endpoint.ServerImpl.initDestination(ServerImpl.java:84) at org.apache.cxf.endpoint.ServerImpl.<init>(ServerImpl.java:63) at org.apache.cxf.frontend.ServerFactoryBean.create(ServerFactoryBean.java:182) ... 7 more ————————————————
解决方案:缺少cxf-rt-transports-http-jetty的jar
<!-- https://mvnrepository.com/artifact/org.apache.cxf/cxf-rt-transports-http-jetty --> <dependency> <groupId>org.apache.cxf</groupId> <artifactId>cxf-rt-transports-http-jetty</artifactId> <version>3.2.4</version> </dependency>