基于cxf-webservice的项目业务分离,cxf客户端jar包冲突

现在项目做业务的分离,webservice接口是基于apache cxf实现的,以及生成客户端。因为项目彼此间有不同业务的调用,所以打的客户端jar包有很多class类会冲突
冲突提示如下:
Caused by: org.apache.cxf.service.factory.ServiceConstructionException
at org.apache.cxf.jaxb.JAXBDataBinding.initialize(JAXBDataBinding.java:338)
at org.apache.cxf.service.factory.AbstractServiceFactoryBean.initializeDataBindings(AbstractServiceFactoryBean.java:86)
at org.apache.cxf.service.factory.ReflectionServiceFactoryBean.buildServiceFromClass(ReflectionServiceFactoryBean.java:490)
。。。。。。。
Caused by: com.sun.xml.bind.v2.runtime.IllegalAnnotationsException: 19 counts of IllegalAnnotationExceptions
。。。。。。
Two classes have the same XML type name "{http://inner.cxf.com/}wsPolicyData". Use @XmlType.name and @XmlType.namespace to assign different names to them.
this problem is related to the following location:
at com.cxf.client.outserver.WsPolicyData
at protected com.cxf.client.outserver.WsPolicyData com.cxf.client.outserver.WsSeatWithPriceAndComisionItem.policyData
at com.cxf.client.outserver.WsSeatWithPriceAndComisionItem
at protected java.util.List com.cxf.client.outserver.WsFlightWithPriceAndCommision.seatItems
at com.cxf.client.outserver.WsFlightWithPriceAndCommision
at protected java.util.List com.cxf.client.outserver.WsFlightWithPriceAndCommisionItem.flights
at com.cxf.client.outserver.WsFlightWithPriceAndCommisionItem
at protected java.util.List com.cxf.client.outserver.AvailableFlightWithPriceAndCommisionReply.flightItems
at com.cxf.client.outserver.AvailableFlightWithPriceAndCommisionReply
at @javax.xml.bind.annotation.XmlSeeAlso(value=[class com.yl.domain.PublicOfTicketMsg, class com.yl.domain.PublicOfStore, class com.yl.cxf.domain.PublicOfWebTicket, class com.yl.domain.PublicOfPagination, class com.yl.domain.PublicOfTicket, class com.yl.domain.PublicOfMessageDomain, class com.yl.cxf.domain.PublicOfWebMerchant, class com.cxf.client.outserver.AvailableFlightWithPriceAndCommisionReply, class com.cxf.order.PyAccount, class com.cxf.client.outserver.TcGetSceneryTrafficInfoResponse, class com.cxf.client.outserver.TcGetSceneryResponse, class com.cxf.client.outserver.ArrayOfTcSimpleScenery, class com.cxf.client.outserver.ArrayOfTcTheme, class com.cxf.client.outserver.ArrayOfTcImpression, class com.cxf.client.outserver.ArrayOfTcSuitherd, class com.cxf.client.outserver.TcSimpleScenery, class com.yl.cxf.domain.PublicOfWebMerchant, class java.util.ArrayList, class com.cxf.client.outserver.AvailableFlightWithPriceAndCommisionReply, class com.cxf.order.PyAccount, class com.cxf.client.outserver.TcGetSceneryTrafficInfoResponse, class com.yl.domain.UnionPayOrder, class com.yl.core.page.PublicOfPager])
at private com.yl.cxf.domain.PublicOutDomain com.yl.cxf.publicservice.jaxws_asm.DoAccquireRefundResponse._return
at com.yl.cxf.publicservice.jaxws_asm.DoAccquireRefundResponse
this problem is related to the following location:
at com.cxf.order.WsPolicyData
at protected com.cxf.order.WsPolicyData com.cxf.order.WsSeatWithPriceAndComisionItem.policyData
at com.cxf.order.WsSeatWithPriceAndComisionItem
at protected java.util.List com.cxf.order.WsFlightWithPriceAndCommision.seatItems
at com.cxf.order.WsFlightWithPriceAndCommision
at protected java.util.List com.cxf.order.WsFlightWithPriceAndCommisionItem.flights
at com.cxf.order.WsFlightWithPriceAndCommisionItem
at protected java.util.List com.cxf.order.AvailableFlightWithPriceAndCommisionReply.flightItems
at com.cxf.order.AvailableFlightWithPriceAndCommisionReply
at protected com.cxf.order.AvailableFlightWithPriceAndCommisionReply com.cxf.order.GetAvailableFlightResponse._return
at com.cxf.order.GetAvailableFlightResponse
at public com.cxf.order.GetAvailableFlightResponse com.cxf.order.ObjectFactory.createGetAvailableFlightResponse()
at com.cxf.order.ObjectFactory
不知道大家做项目分离时,有没有遇到过此类问题,以及解决方法,希望大家能指教一二。

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
其他相关推荐
Cxf Webservice 请求超时 响应超时等异常怎么捕获?
与其他公司做接口对接 他们要求我提供客户端jar包 我就用CXF生成的客户端 既然提供客户端 那么异常也要处理啊 问题是cxf客户端的 请求超时 响应超时等异常怎么捕获啊
jboss5环境下,cxf调用webservice不返回内容,也不报错
有谁碰到过这种情况,cxf调用webservice在jar包运行下没问题, 换到jboss5下面就会有问题,但是不报错,也不返回任何东西
webservice客户端求助
因为项目中对接多个webservice,第一个无法生成客户端代码,所有用cxf动态调用做处理;第二个可以生成客户端代码,但是用cxf调用会报错,所以用客户端代码做调用; 问题来了,两个客户分别好好的,一把它放到同一web项目时,每次调用第二个客户端(jdk原生)时,都报cxf错误,把cxf相关jar去掉就没问题。 补充:jdk1.6 1.7都试过了都有同样问题 在这里请教下大家有没遇到过相同问题,或该怎样处理。
java cxf swing 结合发布webservice
在一个桌面程序中需要用到webservice,使用swing编写桌面程序,用cxf及内置的jetty发布webservice,目前在eclipse中可以正常运行, 但是一旦打包成jar文件就会报错: [main] DEBUG org.apache.cxf.common.logging.LogUtils - Using org.apache.cxf.common.logging.Log4jLogger for logging. [main] INFO org.apache.cxf.wsdl.service.factory.ReflectionServiceFactoryBean - Creating Service {http://schemas.xmlsoap.org/soap/}WebserviceImplService from class com.test.IWebservice [main] DEBUG org.apache.cxf.jaxb.JAXBDataBinding - Created JAXBContext "jar:file:/E:/am-win-x86/AMStartup.jar!/com/sun/xml/bind/v2/runtime/JAXBContextImpl.class Build-Id: null Classes known to this context: [B boolean byte char com.sun.xml.bind.api.CompositeStructure com.test.jaxws_asm.SayHello com.test.jaxws_asm.SayHelloResponse double float int java.awt.Image java.io.File java.lang.Boolean java.lang.Byte java.lang.Character java.lang.Class java.lang.Double java.lang.Float java.lang.Integer java.lang.Long java.lang.Object java.lang.Short java.lang.String java.lang.Void java.math.BigDecimal java.math.BigInteger java.net.URI java.net.URL java.util.Calendar java.util.Date java.util.GregorianCalendar java.util.UUID javax.activation.DataHandler javax.xml.bind.JAXBElement javax.xml.datatype.Duration javax.xml.datatype.XMLGregorianCalendar javax.xml.namespace.QName javax.xml.transform.Source long short void " with classes [class com.test.jaxws_asm.SayHello, class com.test.jaxws_asm.SayHelloResponse]. [main] INFO com.test.Test - webService发布失败 org.apache.cxf.service.factory.ServiceConstructionException: Could not resolve a binding for http://schemas.xmlsoap.org/wsdl/soap/ at org.apache.cxf.frontend.AbstractWSDLBasedEndpointFactory.createBindingInfo(AbstractWSDLBasedEndpointFactory.java:352) at org.apache.cxf.jaxws.JaxWsServerFactoryBean.createBindingInfo(JaxWsServerFactoryBean.java:182) at org.apache.cxf.frontend.AbstractWSDLBasedEndpointFactory.createEndpointInfo(AbstractWSDLBasedEndpointFactory.java:259) at org.apache.cxf.frontend.AbstractWSDLBasedEndpointFactory.createEndpoint(AbstractWSDLBasedEndpointFactory.java:144) at org.apache.cxf.frontend.ServerFactoryBean.create(ServerFactoryBean.java:168) at org.apache.cxf.jaxws.JaxWsServerFactoryBean.create(JaxWsServerFactoryBean.java:211) at com.test.Test.publishWebservice(Test.java:51) at com.test.Test.<init>(Test.java:31) at com.test.Test.main(Test.java:71) Caused by: org.apache.cxf.BusException: No binding factory for namespace http://schemas.xmlsoap.org/wsdl/soap/ registered. at org.apache.cxf.bus.managers.BindingFactoryManagerImpl.getBindingFactory(BindingFactoryManagerImpl.java:93) at org.apache.cxf.frontend.AbstractWSDLBasedEndpointFactory.createBindingInfo(AbstractWSDLBasedEndpointFactory.java:339) ... 8 more 不知道具体是什么原因,另外我使用的打包工具是fatjar,求大婶帮助
cxf发布webService报错Could not resolve a binding for http://schemas.xmlsoap.org/wsdl/soap/
我在本地调试运行都是正常的,但是当我把程序放在linux服务器运行时就会报错, 我是使用jersey框架和glassfish服务器,没有使用到spring框架,错误信息如下: com.heren.his.commons.filters.SecurityFilter -** javax.xml.ws.WebServiceException: org.apache.cxf.service.factory.ServiceConstructionException: Could not resolve a binding for http://schemas.xmlsoap.org/wsdl/soap/** javax.servlet.ServletException: javax.xml.ws.WebServiceException: org.apache.cxf.service.factory.ServiceConstructionException: Could not resolve a binding for http://schemas.xmlsoap.org/wsdl/soap/ at org.glassfish.jersey.servlet.WebComponent.service(WebComponent.java:421) ~[heren-main-disease-report-1.0.0-SNAPSHOT.jar:na] at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:386) ~[heren-main-disease-report-1.0.0-SNAPSHOT.jar:na] at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:335) ~[heren-main-disease-report-1.0.0-SNAPSHOT.jar:na] at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:222) ~[heren-main-disease-report-1.0.0-SNAPSHOT.jar:na] at com.google.inject.servlet.ServletDefinition.doServiceImpl(ServletDefinition.java:287) ~[heren-main-disease-report-1.0.0-SNAPSHOT.jar:na] at com.google.inject.servlet.ServletDefinition.doService(ServletDefinition.java:277) ~[heren-main-disease-report-1.0.0-SNAPSHOT.jar:na] at com.google.inject.servlet.ServletDefinition.service(ServletDefinition.java:182) ~[heren-main-disease-report-1.0.0-SNAPSHOT.jar:na] at com.google.inject.servlet.ManagedServletPipeline.service(ManagedServletPipeline.java:91) ~[heren-main-disease-report-1.0.0-SNAPSHOT.jar:na] at com.heren.his.commons.filters.UTF8Encoding.doFilter(UTF8Encoding.java:22) ~[heren-main-disease-report-1.0.0-SNAPSHOT.jar:na] at com.heren.his.commons.filters.SecurityFilter.filterChainDoFilter(SecurityFilter.java:92) ~[heren-main-disease-report-1.0.0-SNAPSHOT.jar:na] at com.heren.his.commons.filters.SecurityFilter.doFilter(SecurityFilter.java:86) ~[heren-main-disease-report-1.0.0-SNAPSHOT.jar:na] at com.heren.his.commons.filters.RouterFilter.doFilter(RouterFilter.java:52) ~[heren-main-disease-report-1.0.0-SNAPSHOT.jar:na] at com.alibaba.druid.support.http.WebStatFilter.doFilter(WebStatFilter.java:123) ~[heren-main-disease-report-1.0.0-SNAPSHOT.jar:na] at com.heren.his.commons.filters.HerenWebStatFilter.doFilter(HerenWebStatFilter.java:77) ~[heren-main-disease-report-1.0.0-SNAPSHOT.jar:na] at com.heren.his.commons.filters.ForwardFilter.doFilter(ForwardFilter.java:85) ~[heren-main-disease-report-1.0.0-SNAPSHOT.jar:na] at com.heren.i0.jpa.PersistFilter.doFilter(PersistFilter.java:98) ~[heren-main-disease-report-1.0.0-SNAPSHOT.jar:na] at com.google.inject.servlet.ManagedFilterPipeline.dispatch(ManagedFilterPipeline.java:119) [heren-main-disease-report-1.0.0-SNAPSHOT.jar:na] at com.google.inject.servlet.GuiceFilter$1.call(GuiceFilter.java:133) [heren-main-disease-report-1.0.0-SNAPSHOT.jar:na] at com.google.inject.servlet.GuiceFilter$1.call(GuiceFilter.java:130) [heren-main-disease-report-1.0.0-SNAPSHOT.jar:na] at com.google.inject.servlet.GuiceFilter$Context.call(GuiceFilter.java:203) [heren-main-disease-report-1.0.0-SNAPSHOT.jar:na] at com.google.inject.servlet.GuiceFilter.doFilter(GuiceFilter.java:130) [heren-main-disease-report-1.0.0-SNAPSHOT.jar:na] at org.glassfish.grizzly.servlet.FilterChainImpl.doFilter(FilterChainImpl.java:137) [heren-main-disease-report-1.0.0-SNAPSHOT.jar:na] at org.glassfish.grizzly.servlet.FilterChainImpl.invokeFilterChain(FilterChainImpl.java:106) [heren-main-disease-report-1.0.0-SNAPSHOT.jar:na] at org.glassfish.grizzly.servlet.ServletHandler.doServletService(ServletHandler.java:226) [heren-main-disease-report-1.0.0-SNAPSHOT.jar:na] at org.glassfish.grizzly.servlet.ServletHandler.service(ServletHandler.java:173) [heren-main-disease-report-1.0.0-SNAPSHOT.jar:na] at org.glassfish.grizzly.http.server.HttpHandler$1.run(HttpHandler.java:224) [heren-main-disease-report-1.0.0-SNAPSHOT.jar:na] at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:593) [heren-main-disease-report-1.0.0-SNAPSHOT.jar:na] at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.run(AbstractThreadPool.java:573) [heren-main-disease-report-1.0.0-SNAPSHOT.jar:na] at java.lang.Thread.run(Thread.java:745) [na:1.8.0_60] Caused by: javax.xml.ws.WebServiceException: org.apache.cxf.service.factory.ServiceConstructionException: Could not resolve a binding for http://schemas.xmlsoap.org/wsdl/soap/ at org.apache.cxf.jaxws.EndpointImpl.doPublish(EndpointImpl.java:371) ~[heren-main-disease-report-1.0.0-SNAPSHOT.jar:na] at org.apache.cxf.jaxws.EndpointImpl.publish(EndpointImpl.java:251) ~[heren-main-disease-report-1.0.0-SNAPSHOT.jar:na] at org.apache.cxf.jaxws.spi.ProviderImpl.createAndPublishEndpoint(ProviderImpl.java:155) ~[heren-main-disease-report-1.0.0-SNAPSHOT.jar:na] at javax.xml.ws.Endpoint.publish(Endpoint.java:240) ~[na:1.8.0_60] at com.heren.his.diseasereport.api.InfectionWebResource.pointService(InfectionWebResource.java:41) ~[heren-main-disease-report-1.0.0-SNAPSHOT.jar:na] at sun.reflect.GeneratedMethodAccessor48.invoke(Unknown Source) ~[na:na] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_60] at java.lang.reflect.Method.invoke(Method.java:497) ~[na:1.8.0_60] at org.glassfish.jersey.server.model.internal.ResourceMethodInvocationHandlerFactory$1.invoke(ResourceMethodInvocationHandlerFactory.java:81) ~[heren-main-disease-report-1.0.0-SNAPSHOT.jar:na] at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher$1.run(AbstractJavaResourceMethodDispatcher.java:164) ~[heren-main-disease-report-1.0.0-SNAPSHOT.jar:na] at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.invoke(AbstractJavaResourceMethodDispatcher.java:181) ~[heren-main-disease-report-1.0.0-SNAPSHOT.jar:na] at org.glassfish.jersey.server.model.internal.JavaResourceMethodDispatcherProvider$TypeOutInvoker.doDispatch(JavaResourceMethodDispatcherProvider.java:203) ~[heren-main-disease-report-1.0.0-SNAPSHOT.jar:na] at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.dispatch(AbstractJavaResourceMethodDispatcher.java:101) ~[heren-main-disease-report-1.0.0-SNAPSHOT.jar:na] at org.glassfish.jersey.server.model.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:389) ~[heren-main-disease-report-1.0.0-SNAPSHOT.jar:na] at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:347) ~[heren-main-disease-report-1.0.0-SNAPSHOT.jar:na] at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:102) ~[heren-main-disease-report-1.0.0-SNAPSHOT.jar:na] at org.glassfish.jersey.server.ServerRuntime$2.run(ServerRuntime.java:305) ~[heren-main-disease-report-1.0.0-SNAPSHOT.jar:na] at org.glassfish.jersey.internal.Errors$1.call(Errors.java:271) ~[heren-main-disease-report-1.0.0-SNAPSHOT.jar:na] at org.glassfish.jersey.internal.Errors$1.call(Errors.java:267) ~[heren-main-disease-report-1.0.0-SNAPSHOT.jar:na] at org.glassfish.jersey.internal.Errors.process(Errors.java:315) ~[heren-main-disease-report-1.0.0-SNAPSHOT.jar:na] at org.glassfish.jersey.internal.Errors.process(Errors.java:297) ~[heren-main-disease-report-1.0.0-SNAPSHOT.jar:na] at org.glassfish.jersey.internal.Errors.process(Errors.java:267) ~[heren-main-disease-report-1.0.0-SNAPSHOT.jar:na] at org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:317) ~[heren-main-disease-report-1.0.0-SNAPSHOT.jar:na] at org.glassfish.jersey.server.ServerRuntime.process(ServerRuntime.java:288) ~[heren-main-disease-report-1.0.0-SNAPSHOT.jar:na] at org.glassfish.jersey.server.ApplicationHandler.handle(ApplicationHandler.java:1110) ~[heren-main-disease-report-1.0.0-SNAPSHOT.jar:na] at org.glassfish.jersey.servlet.WebComponent.service(WebComponent.java:401) ~[heren-main-disease-report-1.0.0-SNAPSHOT.jar:na] ... 28 common frames omitted Caused by: org.apache.cxf.service.factory.ServiceConstructionException: Could not resolve a binding for http://schemas.xmlsoap.org/wsdl/soap/ at org.apache.cxf.frontend.AbstractWSDLBasedEndpointFactory.createBindingInfo(AbstractWSDLBasedEndpointFactory.java:352) ~[heren-main-disease-report-1.0.0-SNAPSHOT.jar:na] at org.apache.cxf.jaxws.JaxWsServerFactoryBean.createBindingInfo(JaxWsServerFactoryBean.java:182) ~[heren-main-disease-report-1.0.0-SNAPSHOT.jar:na] at org.apache.cxf.frontend.AbstractWSDLBasedEndpointFactory.createEndpointInfo(AbstractWSDLBasedEndpointFactory.java:259) ~[heren-main-disease-report-1.0.0-SNAPSHOT.jar:na] at org.apache.cxf.frontend.AbstractWSDLBasedEndpointFactory.createEndpoint(AbstractWSDLBasedEndpointFactory.java:144) ~[heren-main-disease-report-1.0.0-SNAPSHOT.jar:na] at org.apache.cxf.frontend.ServerFactoryBean.create(ServerFactoryBean.java:159) ~[heren-main-disease-report-1.0.0-SNAPSHOT.jar:na] at org.apache.cxf.jaxws.JaxWsServerFactoryBean.create(JaxWsServerFactoryBean.java:211) ~[heren-main-disease-report-1.0.0-SNAPSHOT.jar:na] at org.apache.cxf.jaxws.EndpointImpl.getServer(EndpointImpl.java:456) ~[heren-main-disease-report-1.0.0-SNAPSHOT.jar:na] at org.apache.cxf.jaxws.EndpointImpl.doPublish(EndpointImpl.java:334) ~[heren-main-disease-report-1.0.0-SNAPSHOT.jar:na] ... 53 common frames omitted Caused by: org.apache.cxf.BusException: No binding factory for namespace http://schemas.xmlsoap.org/wsdl/soap/ registered. at org.apache.cxf.bus.managers.BindingFactoryManagerImpl.getBindingFactory(BindingFactoryManagerImpl.java:123) ~[heren-main-disease-report-1.0.0-SNAPSHOT.jar:na] at org.apache.cxf.frontend.AbstractWSDLBasedEndpointFactory.createBindingInfo(AbstractWSDLBasedEndpointFactory.java:339) ~[heren-main-disease-report-1.0.0-SNAPSHOT.jar:na] ... 60 common frames omitted 恳求大佬们帮帮忙
cxf生成的webservice客户端程序在was8.5中运行报错,该排除错误还是另寻它法???
当我在使用cxf的工具 wsdl2java 生成web Service客户端时,在我本机debug运行测试时访问接口,获取返回xml,没有任何问题,但当我把war包发布到was8.5的服务器上时,报出异常,困扰两天了。 调用程序代码: ``` public static Map<String, Object> getKPYL (String saleTax) { AsyncInvoiceServiceService service = new AsyncInvoiceServiceService(); ZKInvoiceService zKInvoiceService = service.getAsyncInvoiceServicePort(); MessageHandleUtil MHUtil = new MessageHandleUtil(); String xml = "<?xml version=\"1.0\" encoding=\"UTF-8\"?><InvoInfo><saleTax>"+saleTax+"</saleTax></InvoInfo>"; String message = zKInvoiceService.getKPYL(xml); return MHUtil.xmlToMap(message, false); } ``` 本机debug没有任何问题,但在was8.5服务器上部署时,访问这个接口,则报出异常如下 ![图片说明](https://img-ask.csdn.net/upload/201902/20/1550676673_724443.jpg) ![图片说明](https://img-ask.csdn.net/upload/201902/20/1550676699_701791.jpg) 调用代码很简单了,感觉也没有什么可以修改的 最初以为是jar包冲突之类的问题,但是后来又发现不像冲突。was的那个共享jar,我也设置过了,但是并不好用,问题并没有得到解决。 所以在这想问问各位老板,这个问题能解决吗,怎么解决,或者,乃们用was服务器的时候,需使用webservice客户端的时候,是怎么实现的,如果有demo能给我看看那是极好的,能给我提供思路我也很高兴,我刚接触was,感觉这个比玩意真不好搞。。。
Axis ,CXF 调用webservice返回 : 设备未就绪 , IOException
但是 用 SoapUI 可以正常返回 ,使用Storm 也是返回 设备未就绪.很迷茫 ![图片说明](https://img-ask.csdn.net/upload/201908/04/1564903528_136500.png) ![图片说明](https://img-ask.csdn.net/upload/201908/04/1564903542_573585.png) 然后使用Call.invoke 可以返回了 ,但是缺返回 -3 ,接口对接人说 是一个传入参数值不对 ,然而那个值是一个固定值 ,怎么会不对.
Spring Boot + Spring Cloud + cxf + maven 启动报错
Springboot+SpringCloud微服务框架上用cxf搭建webservice服务端,启动时报NoSuchMethodError错误。 ``` org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'cxf' defined in class path resource [cn/ffcs/geye/crm/webService/server/ServiceConfig.class]: Initialization of bean failed; nested exception is java.lang.NoSuchMethodError: org.apache.cxf.bus.spring.SpringBeanLocator.<init>(Lorg/springframework/context/ApplicationContext;Lorg/apache/cxf/Bus;)V at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:564) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:483) at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197) at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:761) at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:867) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:543) at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:122) at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:693) at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:360) at org.springframework.boot.SpringApplication.run(SpringApplication.java:303) at org.springframework.boot.builder.SpringApplicationBuilder.run(SpringApplicationBuilder.java:134) at cn.ffcs.StartApplication.main(StartApplication.java:26) Caused by: java.lang.NoSuchMethodError: org.apache.cxf.bus.spring.SpringBeanLocator.<init>(Lorg/springframework/context/ApplicationContext;Lorg/apache/cxf/Bus;)V at org.apache.cxf.bus.spring.SpringBus.setApplicationContext(SpringBus.java:81) at org.springframework.context.support.ApplicationContextAwareProcessor.invokeAwareInterfaces(ApplicationContextAwareProcessor.java:121) at org.springframework.context.support.ApplicationContextAwareProcessor.postProcessBeforeInitialization(ApplicationContextAwareProcessor.java:97) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsBeforeInitialization(AbstractAutowireCapableBeanFactory.java:409) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1620) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:555) ... 14 common frames omitted ``` 代码参考 [http://blog.csdn.net/hj7jay/article/details/51130386 ](http://blog.csdn.net/hj7jay/article/details/51130386 "") 添加maven依赖cxf版本是3.1.6。webservice实现类中用@Resource注解注入MyBatis数据库模块(数据库调用在另一个micro server)。 查看错误栈发现,问题在于启动过程中初始化cxf对象,SpringBus类setApplicationContext方法调用SpringBeanLocator类构造方法SpringBeanLocator(ApplicationContext, Bus)。该版本的cxf依赖jar包cxf-rt-core-2.3.1.jar中只有单个参数的构造方法SpringBeanLocator(ApplicationContext)。 换较高和较低的cxf版本,报同样的错误,下载的jar包cxf-rt-core依然是2.3.1版本的。 之前单单搭webservice框架,没有自动注入和处理逻辑时曾经启动成功过并可以访问wsdl,现在怎么弄都启动不成功。大神帮忙。
CXF报错Does it exist in service WSDL?如何处理
我spring整合cxf(cxf-2.6.16.jar),然后发布了一个测试服务,在浏览器中可访问到发布的服务。 ![图片说明](https://img-ask.csdn.net/upload/201706/01/1496301158_771615.png) 然后我写了一个客户端去调用我发布的服务,一直报错 ``` 六月 01, 2017 3:03:10 下午 org.apache.catalina.core.StandardWrapperValve invoke SEVERE: Servlet.service() for servlet [springmvc] in context with path [/FeiBao] threw exception [Request processing failed; nested exception is javax.xml.ws.soap.SOAPFaultException: Message part {message.service.com}testStr was not recognized. (Does it exist in service WSDL?)] with root cause org.apache.cxf.binding.soap.SoapFault: Message part {message.service.com}testStr was not recognized. (Does it exist in service WSDL?) at org.apache.cxf.binding.soap.interceptor.Soap11FaultInInterceptor.unmarshalFault(Soap11FaultInInterceptor.java:84) at org.apache.cxf.binding.soap.interceptor.Soap11FaultInInterceptor.handleMessage(Soap11FaultInInterceptor.java:51) at org.apache.cxf.binding.soap.interceptor.Soap11FaultInInterceptor.handleMessage(Soap11FaultInInterceptor.java:40) at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:263) at org.apache.cxf.interceptor.AbstractFaultChainInitiatorObserver.onMessage(AbstractFaultChainInitiatorObserver.java:113) at org.apache.cxf.binding.soap.interceptor.CheckFaultInterceptor.handleMessage(CheckFaultInterceptor.java:69) at org.apache.cxf.binding.soap.interceptor.CheckFaultInterceptor.handleMessage(CheckFaultInterceptor.java:34) at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:263) at org.apache.cxf.endpoint.ClientImpl.onMessage(ClientImpl.java:845) at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponseInternal(HTTPConduit.java:1705) at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponse(HTTPConduit.java:1538) at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.close(HTTPConduit.java:1445) at org.apache.cxf.transport.AbstractConduit.close(AbstractConduit.java:56) at org.apache.cxf.transport.http.HTTPConduit.close(HTTPConduit.java:660) at org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage(MessageSenderInterceptor.java:62) at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:263) at org.apache.cxf.endpoint.ClientImpl.doInvoke(ClientImpl.java:570) at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:479) at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:382) at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:335) at org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:96) at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:137) ``` 我在百度上搜索问题答案,有说调用服务的接口和服务端不在同一命名空间下,于是我加上了在@WebService中加上了targetNamespace="message.service.com"属性,但是,依旧报同样的错误。找了几个小时,依旧未找到解决办法,跪求大神解答。 我服务端的cxf配置: ``` <bean id="MyTestServiceBean" class="com.webservice.message.impl.MyTestServiceImpl"/> <jaxws:endpoint id="MyTestService" implementor="#MyTestServiceBean" address="/MyTestService"> </jaxws:endpoint> ``` 服务端的接口文件: ``` package com.webservice.message; import javax.jws.WebService; import javax.jws.soap.SOAPBinding; import javax.jws.soap.SOAPBinding.Style; @WebService(targetNamespace="message.service.com") @SOAPBinding(style = Style.RPC) public interface MyTestService { public String testStr(String str); } ``` 服务端的接口实现: ``` package com.webservice.message.impl; import javax.jws.WebService; import com.webservice.message.MyTestService; @WebService (endpointInterface= "com.webservice.message.MyTestService",targetNamespace="message.service.com") public class MyTestServiceImpl implements MyTestService { @Override public String testStr(String str) { return "hello," + str; } } ``` 接下来是客户端的部分 客户端cxf的配置: ``` <jaxws:client id="MyTestService" serviceClass="com.buick.activity.webservice.service.MyTestService" address="http://127.0.0.1:8080/MessageService/ws/CheckVerifyCodeService?wsdl"> </jaxws:client> ``` 客户端的接口文件: ``` package com.buick.activity.webservice.service; import javax.jws.WebService; import javax.jws.soap.SOAPBinding; import javax.jws.soap.SOAPBinding.Style; @WebService(targetNamespace="message.service.com") @SOAPBinding(style = Style.RPC) public interface MyTestService { public String testStr(String str); } ``` 如果觉得我表意不清晰,欢迎追问。
CXF工程 RuntimeModelBuilder报错
1、我的JDK版本是1.7 2、我的CXF是在官网下载的,我把全部的jar包都加进去了 3、代码 ``` package demo.hw.server; import javax.jws.WebParam; import javax.jws.WebService; @WebService public interface HelloWorld { String sayHi(@WebParam(name="text") String text); } ``` ``` package demo.hw.server; import javax.jws.WebParam; import javax.jws.WebService; @WebService(serviceName="HelloWorld") public class HelloWorldImpl implements HelloWorld { public String sayHi(@WebParam(name="text") String text) { System.out.println("sayHi called"); return "Hello " + text; } } ``` ``` package demo.hw.server; import javax.xml.ws.Endpoint; public class Server { public Server() throws Exception { System.out.println("server start"); HelloWorld helloWorld = new HelloWorldImpl(); String address = "http://localhost:9000/HelloWorld"; Endpoint.publish(address, helloWorld); } public static void main(String args[]) throws Exception { new Server(); System.out.println("Server ready..."); Thread.sleep(5 * 60 * 1000); System.out.println("Server exiting"); System.exit(0); } } ``` 就这三个文件,然后报错。。我都崩溃了,网上说的那些方法不管用啊 报错截图 ![图片说明](https://img-ask.csdn.net/upload/201507/02/1435812727_897605.png) 求助
关于Java WebService 的几种实现方式
关于Java WebService,网上有许多例子(不过好多写的都有问题,照着做还出问题),简单了解了一下,主要AXIS、CXF及XFire比较多,还有Java自带的JAX-WS(必须JDK6及以上环境),其中JAX-WS比较简洁,其他几个都挺繁琐的,一大堆的Jar包,而且有些跟项目Jar包冲突,所以向各位请教一下JAX-WS实际项目中有人使用吗,它与其他几种相比有什么有缺点?谢谢,还有真正项目中,不知道大家都用的什么?求大神指点
webService发布到web项目上错误
11:10:54.279 [main] DEBUG o.apache.cxf.common.logging.LogUtils - Using org.apache.cxf.common.logging.Slf4jLogger for logging. 11:10:54.468 [main] INFO o.a.c.s.f.ReflectionServiceFactoryBean - Creating Service {http://webservice.test/}MyWebServiceImplService from class test.webservice.MyWebService 11:10:54.578 [main] DEBUG org.apache.cxf.jaxb.JAXBDataBinding - Created JAXBContext "jar:file:/E:/Program%20Files/Java/jre8/lib/rt.jar!/com/sun/xml/internal/bind/v2/runtime/JAXBContextImpl.class Build-Id: 1.8.0_11 Classes known to this context: [B boolean byte char com.sun.xml.internal.bind.api.CompositeStructure double float int java.awt.Image java.io.File java.lang.Boolean java.lang.Byte java.lang.Character java.lang.Class java.lang.Double java.lang.Float java.lang.Integer java.lang.Long java.lang.Object java.lang.Short java.lang.String java.lang.Void java.math.BigDecimal java.math.BigInteger java.net.URI java.net.URL java.util.Calendar java.util.Date java.util.GregorianCalendar java.util.UUID javax.activation.DataHandler javax.xml.bind.JAXBElement javax.xml.datatype.Duration javax.xml.datatype.XMLGregorianCalendar javax.xml.namespace.QName javax.xml.transform.Source long short test.webservice.jaxws_asm.GetProjectInfomation test.webservice.jaxws_asm.GetProjectInfomationResponse void " with classes [class test.webservice.jaxws_asm.GetProjectInfomation, class test.webservice.jaxws_asm.GetProjectInfomationResponse]. 11:10:54.686 [main] DEBUG o.a.c.r.DefaultResourceManager - resolving resource <org.apache.cxf.wsdl11.WSDLManagerImpl/bus> type <interface org.apache.cxf.Bus> 11:10:54.687 [main] DEBUG o.a.c.r.DefaultResourceManager - resolving resource <null> type <interface org.apache.cxf.Bus> 11:10:54.803 [main] DEBUG o.a.c.t.h.JettyHTTPServerEngineFactory - Creating Jetty HTTP Server Engine for port 8080. Exception in thread "main" java.lang.NoClassDefFoundError: org/eclipse/jetty/http/HttpBuffers at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClass(Unknown Source) at java.security.SecureClassLoader.defineClass(Unknown Source) at java.net.URLClassLoader.defineClass(Unknown Source) at java.net.URLClassLoader.access$100(Unknown Source) at java.net.URLClassLoader$1.run(Unknown Source) at java.net.URLClassLoader$1.run(Unknown Source) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) at org.apache.cxf.transport.http_jetty.JettyHTTPServerEngine.getHTTPConnectorFactory(JettyHTTPServerEngine.java:661) at org.apache.cxf.transport.http_jetty.JettyHTTPServerEngine.retrieveListenerFactory(JettyHTTPServerEngine.java:650) at org.apache.cxf.transport.http_jetty.JettyHTTPServerEngine.finalizeConfig(JettyHTTPServerEngine.java:702) at org.apache.cxf.transport.http_jetty.JettyHTTPServerEngineFactory.getOrCreate(JettyHTTPServerEngineFactory.java:121) at org.apache.cxf.transport.http_jetty.JettyHTTPServerEngineFactory.createJettyHTTPServerEngine(JettyHTTPServerEngineFactory.java:268) at org.apache.cxf.transport.http_jetty.JettyHTTPDestination.retrieveEngine(JettyHTTPDestination.java:127) at org.apache.cxf.transport.http_jetty.JettyHTTPDestination.finalizeConfig(JettyHTTPDestination.java:160) at org.apache.cxf.transport.http.HTTPTransportFactory.getDestination(HTTPTransportFactory.java:308) at org.apache.cxf.binding.soap.SoapTransportFactory.getDestination(SoapTransportFactory.java:142) at org.apache.cxf.endpoint.ServerImpl.initDestination(ServerImpl.java:83) at org.apache.cxf.endpoint.ServerImpl.<init>(ServerImpl.java:62) at org.apache.cxf.frontend.ServerFactoryBean.create(ServerFactoryBean.java:170) at org.apache.cxf.jaxws.JaxWsServerFactoryBean.create(JaxWsServerFactoryBean.java:211) at org.apache.cxf.jaxws.EndpointImpl.getServer(EndpointImpl.java:456) at org.apache.cxf.jaxws.EndpointImpl.doPublish(EndpointImpl.java:334) at org.apache.cxf.jaxws.EndpointImpl.publish(EndpointImpl.java:251) at org.apache.cxf.jaxws.spi.ProviderImpl.createAndPublishEndpoint(ProviderImpl.java:155) at javax.xml.ws.Endpoint.publish(Unknown Source) at test.webservice.MyWebServicePublish.main(MyWebServicePublish.java:9) Caused by: java.lang.ClassNotFoundException: org.eclipse.jetty.http.HttpBuffers at java.net.URLClassLoader$1.run(Unknown Source) at java.net.URLClassLoader$1.run(Unknown Source) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) ... 31 more 如果创建的是一个java project就没有问题,可以成功发布,但是在web项目里面就会出问题,我查了一下说是缺少jar包,但是jetty-util-7.5.4.v20111024.jar,cxf-2.7.18.jar,jetty-webapp-7.5.4.v20111024,jetty-server-7.5.4.v20111024,jetty-servlet-7.5.4.v20111024这几个jar包我都复制到本地的tomcat的lib里面了,依然不行,希望大神指点迷津
weblogic10.3.6集群 发布cxf2.7.1 webservice报错
测试环境发布两个节点都好好的,但到了正式环境就会有一个节点起不来,折腾一天了,jar包冲突的很多方法都试过了,还没解决
cxf2.7.0做RestFul时启动一直出问题
<div class="iteye-blog-content-contain" style="font-size: 14px;"> <p>最近使用cxf2.7.0做一个简单的restful例子,郁闷一直都在启动时出错,检查配置没发现有什么问题,大家帮忙看一下。</p> <p> </p> <p>出现的错误如下:</p> <pre name="code" class="xml">2013-3-11 15:25:33 org.apache.catalina.core.AprLifecycleListener init 信息: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: D:\Program Files\Java\jdk1.6.0_12\bin;D:\GXMCC\tools\tomcat7\bin 2013-3-11 15:25:33 org.apache.coyote.AbstractProtocolHandler init 信息: Initializing ProtocolHandler ["http-bio-9999"] 2013-3-11 15:25:33 org.apache.coyote.AbstractProtocolHandler init 信息: Initializing ProtocolHandler ["ajp-bio-8009"] 2013-3-11 15:25:33 org.apache.catalina.startup.Catalina load 信息: Initialization processed in 921 ms 2013-3-11 15:25:33 org.apache.catalina.core.StandardService startInternal 信息: Starting service Catalina 2013-3-11 15:25:33 org.apache.catalina.core.StandardEngine startInternal 信息: Starting Servlet Engine: Apache Tomcat/7.0.10 2013-3-11 15:25:33 org.apache.catalina.startup.HostConfig deployDirectory 信息: Deploying web application directory cxf 2013-3-11 15:25:34 org.apache.catalina.loader.WebappClassLoader validateJarFile 信息: validateJarFile(D:\GXMCC\tools\tomcat7\webapps\cxf\WEB-INF\lib\geronimo-servlet_3.0_spec-1.0.jar) - jar not loaded. See Servlet Spec 2.3, section 9.7.2. Offending class: javax/servlet/Servlet.class 2013-3-11 15:25:36 org.apache.catalina.core.ApplicationContext log 信息: Initializing Spring root WebApplicationContext 2013-3-11 15:25:36 org.springframework.web.context.ContextLoader initWebApplicationContext 信息: Root WebApplicationContext: initialization started 2013-3-11 15:25:36 org.springframework.context.support.AbstractApplicationContext prepareRefresh 信息: Refreshing Root WebApplicationContext: startup date [Mon Mar 11 15:25:36 CST 2013]; root of context hierarchy 2013-3-11 15:25:37 org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions 信息: Loading XML bean definitions from class path resource [spring/applicationContext.xml] 2013-3-11 15:25:37 org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions 信息: Loading XML bean definitions from class path resource [spring/integrationContext.xml] 2013-3-11 15:25:37 org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions 信息: Loading XML bean definitions from class path resource [META-INF/cxf/cxf.xml] 2013-3-11 15:25:37 org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions 信息: Loading XML bean definitions from class path resource [META-INF/cxf/cxf-extension-soap.xml] 2013-3-11 15:25:37 org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions 信息: Loading XML bean definitions from class path resource [META-INF/cxf/cxf-servlet.xml] 2013-3-11 15:25:38 org.springframework.beans.factory.support.DefaultListableBeanFactory preInstantiateSingletons 信息: Pre-instantiating singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@17e9134: defining beans [cxf,org.apache.cxf.bus.spring.BusWiringBeanFactoryPostProcessor,org.apache.cxf.bus.spring.Jsr250BeanPostProcessor,org.apache.cxf.bus.spring.BusExtensionPostProcessor,org.apache.cxf.binding.soap.SoapBindingFactory,org.apache.cxf.binding.soap.SoapTransportFactory,org.apache.cxf.binding.soap.customEditorConfigurer,userRS,userRsImpl]; root of factory hierarchy 2013-3-11 15:25:39 org.apache.cxf.bus.spring.OldSpringSupport logWarning 警告: Import of META-INF/cxf/cxf-extension-soap.xml has been deprecated and is unnecessary. UserRS constructor 2013-3-11 15:25:40 org.springframework.beans.factory.support.DefaultSingletonBeanRegistry destroySingletons 信息: Destroying singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@17e9134: defining beans [cxf,org.apache.cxf.bus.spring.BusWiringBeanFactoryPostProcessor,org.apache.cxf.bus.spring.Jsr250BeanPostProcessor,org.apache.cxf.bus.spring.BusExtensionPostProcessor,org.apache.cxf.binding.soap.SoapBindingFactory,org.apache.cxf.binding.soap.SoapTransportFactory,org.apache.cxf.binding.soap.customEditorConfigurer,userRS,userRsImpl]; root of factory hierarchy 2013-3-11 15:25:40 org.springframework.web.context.ContextLoader initWebApplicationContext 严重: Context initialization failed org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'userRS': Invocation of init method failed; nested exception is org.apache.cxf.service.factory.ServiceConstructionException at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1422) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:518) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:455) at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:293) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:290) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:192) at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:585) at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:895) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:425) at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:282) at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:204) at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:47) at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4651) at org.apache.catalina.core.StandardContext$1.call(StandardContext.java:5154) at org.apache.catalina.core.StandardContext$1.call(StandardContext.java:5149) at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303) at java.util.concurrent.FutureTask.run(FutureTask.java:138) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) at java.lang.Thread.run(Thread.java:619) Caused by: org.apache.cxf.service.factory.ServiceConstructionException at org.apache.cxf.jaxrs.JAXRSServerFactoryBean.create(JAXRSServerFactoryBean.java:201) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeCustomInitMethod(AbstractAutowireCapableBeanFactory.java:1546) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1487) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1419) ... 20 more Caused by: java.lang.RuntimeException: Resource class interface com.sky.oa.cxf.service.IUserRS has no valid constructor at org.apache.cxf.jaxrs.lifecycle.PerRequestResourceProvider.&lt;init&gt;(PerRequestResourceProvider.java:45) at org.apache.cxf.jaxrs.JAXRSServerFactoryBean.updateClassResourceProviders(JAXRSServerFactoryBean.java:387) at org.apache.cxf.jaxrs.JAXRSServerFactoryBean.create(JAXRSServerFactoryBean.java:151) ... 27 more 2013-3-11 15:25:40 org.apache.catalina.core.StandardContext listenerStart 严重: Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'userRS': Invocation of init method failed; nested exception is org.apache.cxf.service.factory.ServiceConstructionException at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1422) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:518) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:455) at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:293) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:290) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:192) at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:585) at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:895) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:425) at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:282) at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:204) at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:47) at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4651) at org.apache.catalina.core.StandardContext$1.call(StandardContext.java:5154) at org.apache.catalina.core.StandardContext$1.call(StandardContext.java:5149) at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303) at java.util.concurrent.FutureTask.run(FutureTask.java:138) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) at java.lang.Thread.run(Thread.java:619) Caused by: org.apache.cxf.service.factory.ServiceConstructionException at org.apache.cxf.jaxrs.JAXRSServerFactoryBean.create(JAXRSServerFactoryBean.java:201) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeCustomInitMethod(AbstractAutowireCapableBeanFactory.java:1546) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1487) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1419) ... 20 more Caused by: java.lang.RuntimeException: Resource class interface com.sky.oa.cxf.service.IUserRS has no valid constructor at org.apache.cxf.jaxrs.lifecycle.PerRequestResourceProvider.&lt;init&gt;(PerRequestResourceProvider.java:45) at org.apache.cxf.jaxrs.JAXRSServerFactoryBean.updateClassResourceProviders(JAXRSServerFactoryBean.java:387) at org.apache.cxf.jaxrs.JAXRSServerFactoryBean.create(JAXRSServerFactoryBean.java:151) ... 27 more 2013-3-11 15:25:40 org.apache.catalina.core.StandardContext startInternal 严重: Error listenerStart 2013-3-11 15:25:40 org.apache.catalina.core.StandardContext startInternal 严重: Context [/cxf] startup failed due to previous errors 2013-3-11 15:25:41 org.apache.catalina.core.ApplicationContext log 信息: Closing Spring root WebApplicationContext 2013-3-11 15:25:41 org.apache.catalina.startup.HostConfig deployDirectory 信息: Deploying web application directory docs 2013-3-11 15:25:41 org.apache.catalina.startup.HostConfig deployDirectory 信息: Deploying web application directory examples 2013-3-11 15:25:41 org.apache.catalina.core.ApplicationContext log 信息: ContextListener: contextInitialized() 2013-3-11 15:25:41 org.apache.catalina.core.ApplicationContext log 信息: SessionListener: contextInitialized() 2013-3-11 15:25:41 org.apache.catalina.startup.HostConfig deployDirectory 信息: Deploying web application directory host-manager 2013-3-11 15:25:41 org.apache.catalina.startup.HostConfig deployDirectory 信息: Deploying web application directory manager 2013-3-11 15:25:41 org.apache.catalina.startup.HostConfig deployDirectory 信息: Deploying web application directory Root 2013-3-11 15:25:41 org.apache.coyote.AbstractProtocolHandler start 信息: Starting ProtocolHandler ["http-bio-9999"] 2013-3-11 15:25:41 org.apache.coyote.AbstractProtocolHandler start 信息: Starting ProtocolHandler ["ajp-bio-8009"] 2013-3-11 15:25:41 org.apache.catalina.startup.Catalina start 信息: Server startup in 8064 ms </pre> <p> </p> <p>配置文件如下:</p> <p>Jar是从cxf2.7.0的lib中直接复制出来的,没有添加其他任何jar。</p> <p> </p> <p>web.xml</p> <pre name="code" class="xml">&lt;?xml version="1.0" encoding="UTF-8"?&gt; &lt;web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"&gt; &lt;welcome-file-list&gt; &lt;welcome-file&gt;index.jsp&lt;/welcome-file&gt; &lt;/welcome-file-list&gt; &lt;servlet&gt; &lt;servlet-name&gt;CXFServlet&lt;/servlet-name&gt; &lt;servlet-class&gt;org.apache.cxf.transport.servlet.CXFServlet&lt;/servlet-class&gt; &lt;/servlet&gt; &lt;servlet-mapping&gt; &lt;servlet-name&gt;CXFServlet&lt;/servlet-name&gt; &lt;url-pattern&gt;/*&lt;/url-pattern&gt; &lt;/servlet-mapping&gt; &lt;!-- 加载spring配置文件,文件路径设置在contextConfigLocation参数中 --&gt; &lt;listener&gt; &lt;listener-class&gt;org.springframework.web.context.ContextLoaderListener&lt;/listener-class&gt; &lt;/listener&gt; &lt;context-param&gt; &lt;param-name&gt;contextConfigLocation&lt;/param-name&gt; &lt;param-value&gt;classpath:/spring/applicationContext.xml&lt;/param-value&gt; &lt;/context-param&gt; &lt;!-- 字符过滤器 --&gt; &lt;filter&gt; &lt;filter-name&gt;encoding&lt;/filter-name&gt; &lt;filter-class&gt;org.springframework.web.filter.CharacterEncodingFilter&lt;/filter-class&gt; &lt;init-param&gt; &lt;param-name&gt;encoding&lt;/param-name&gt; &lt;param-value&gt;UTF-8&lt;/param-value&gt; &lt;/init-param&gt; &lt;init-param&gt; &lt;param-name&gt;forceEncoding&lt;/param-name&gt; &lt;param-value&gt;true&lt;/param-value&gt; &lt;/init-param&gt; &lt;/filter&gt; &lt;filter-mapping&gt; &lt;filter-name&gt;encoding&lt;/filter-name&gt; &lt;url-pattern&gt;*.action&lt;/url-pattern&gt; &lt;/filter-mapping&gt; &lt;filter-mapping&gt; &lt;filter-name&gt;encoding&lt;/filter-name&gt; &lt;url-pattern&gt;*.json&lt;/url-pattern&gt; &lt;/filter-mapping&gt; &lt;filter-mapping&gt; &lt;filter-name&gt;encoding&lt;/filter-name&gt; &lt;url-pattern&gt;*.jsp&lt;/url-pattern&gt; &lt;/filter-mapping&gt; &lt;/web-app&gt;</pre> <p> </p> <p>applicationContext.xml</p> <pre name="code" class="java">&lt;?xml version="1.0" encoding="UTF-8"?&gt; &lt;beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context" xsi:schemaLocation=" http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd" default-autowire="byName"&gt; &lt;import resource="classpath:/spring/integrationContext.xml" &gt;&lt;/import&gt; &lt;/beans&gt;</pre> <p> </p> <p>integrationContext.xml</p> <pre name="code" class="xml">&lt;?xml version="1.0" encoding="UTF-8"?&gt; &lt;beans xmlns="http://www.springframework.org/schema/beans" xmlns:context="http://www.springframework.org/schema/context" xmlns:jaxws="http://cxf.apache.org/jaxws" xmlns:jaxrs="http://cxf.apache.org/jaxrs" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd http://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxws.xsd http://cxf.apache.org/jaxrs http://cxf.apache.org/schemas/jaxrs.xsd"&gt; &lt;description&gt;Apache CXF的Web Service配置&lt;/description&gt; &lt;import resource="classpath:META-INF/cxf/cxf.xml" /&gt; &lt;import resource="classpath:META-INF/cxf/cxf-extension-soap.xml" /&gt; &lt;import resource="classpath:META-INF/cxf/cxf-servlet.xml" /&gt; &lt;jaxrs:server id="userRS" serviceClass="com.sky.oa.cxf.service.IUserRS" address="/userRSCXF"&gt; &lt;jaxrs:serviceBeans&gt; &lt;ref bean="userRsImpl"/&gt; &lt;/jaxrs:serviceBeans&gt; &lt;jaxrs:extensionMappings&gt; &lt;entry key="json" value="application/json"&gt;&lt;/entry&gt; &lt;entry key="xml" value="application/xml" /&gt; &lt;/jaxrs:extensionMappings&gt; &lt;/jaxrs:server&gt; &lt;bean id="userRsImpl" class="com.sky.oa.cxf.service.UserRS"&gt;&lt;/bean&gt; &lt;/beans&gt; </pre> <p> </p> <p>IUserRS</p> <pre name="code" class="java">package com.sky.oa.cxf.service; import javax.jws.WebMethod; import javax.jws.WebParam; import javax.jws.WebService; import javax.ws.rs.GET; import javax.ws.rs.Path; import javax.ws.rs.Produces; import javax.ws.rs.core.MediaType; @WebService @Path("/users/") @Produces(MediaType.APPLICATION_JSON) public interface IUserRS { @WebMethod @GET @Path("/user/{userId}") public String getUser(@WebParam(name = "userId")String userId); } </pre> <p> </p> <p>UserRS</p> <pre name="code" class="java">package com.sky.oa.cxf.service; import javax.jws.WebService; @WebService public class UserRS implements IUserRS { public String getUser(String userId){ System.out.println("----------"); System.out.println(" return xixihaha"); return "xixihaha"; } } </pre> <p> </p> <p> </p> <p> </p> </div>
连接webservice出下面异常
连接webservice public static void main(String[] args) { JaxWsProxyFactoryBean factory = new JaxWsProxyFactoryBean(); factory.setServiceClass(OuterService.class); factory.setAddress("http://www.aaaaaaaaa.com/ws/OuterService?wsdl"); factory.setUsername("aaaaaaa"); factory.setPassword("aaaaaaaa"); OuterService outerRegisterService = (OuterService) factory.create(); System.out.println(outerRegisterService.login("test", "123456")); } 出现下面异常,jar包jaxb-api-2.2.6.jar和jaxb-impl-2.2.6.jar都在web下的lib下面了 log4j:WARN No such property [conversionPattern] in org.apache.log4j.SimpleLayout. Exception in thread "main" java.lang.NoClassDefFoundError: Could not initialize class com.sun.xml.bind.v2.model.impl.RuntimeModelBuilder at com.sun.xml.bind.v2.runtime.JAXBContextImpl.getTypeInfoSet(JAXBContextImpl.java:455) at com.sun.xml.bind.v2.runtime.JAXBContextImpl.<init>(JAXBContextImpl.java:303) at com.sun.xml.bind.v2.runtime.JAXBContextImpl.<init>(JAXBContextImpl.java:142) at com.sun.xml.bind.v2.runtime.JAXBContextImpl$JAXBContextBuilder.build(JAXBContextImpl.java:1174) at com.sun.xml.bind.v2.ContextFactory.createContext(ContextFactory.java:162) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:601) at javax.xml.bind.ContextFinder.newInstance(ContextFinder.java:210) at javax.xml.bind.ContextFinder.find(ContextFinder.java:368) at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:574) at org.apache.cxf.common.jaxb.JAXBContextCache$2.run(JAXBContextCache.java:345) at org.apache.cxf.common.jaxb.JAXBContextCache$2.run(JAXBContextCache.java:343) at java.security.AccessController.doPrivileged(Native Method) at org.apache.cxf.common.jaxb.JAXBContextCache.createContext(JAXBContextCache.java:343) at org.apache.cxf.common.jaxb.JAXBContextCache.getCachedContextAndSchemas(JAXBContextCache.java:244) at org.apache.cxf.jaxb.JAXBDataBinding.createJAXBContextAndSchemas(JAXBDataBinding.java:484) at org.apache.cxf.jaxb.JAXBDataBinding.initialize(JAXBDataBinding.java:339) at org.apache.cxf.service.factory.AbstractServiceFactoryBean.initializeDataBindings(AbstractServiceFactoryBean.java:86) at org.apache.cxf.service.factory.ReflectionServiceFactoryBean.buildServiceFromClass(ReflectionServiceFactoryBean.java:490) at org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean.buildServiceFromClass(JaxWsServiceFactoryBean.java:704) at org.apache.cxf.service.factory.ReflectionServiceFactoryBean.initializeServiceModel(ReflectionServiceFactoryBean.java:550) at org.apache.cxf.service.factory.ReflectionServiceFactoryBean.create(ReflectionServiceFactoryBean.java:265) at org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean.create(JaxWsServiceFactoryBean.java:215) at org.apache.cxf.frontend.AbstractWSDLBasedEndpointFactory.createEndpoint(AbstractWSDLBasedEndpointFactory.java:102) at org.apache.cxf.frontend.ClientFactoryBean.create(ClientFactoryBean.java:91) at org.apache.cxf.frontend.ClientProxyFactoryBean.create(ClientProxyFactoryBean.java:157) at org.apache.cxf.jaxws.JaxWsProxyFactoryBean.create(JaxWsProxyFactoryBean.java:142) at com.celink.googfit.test.Tester.main(Tester.java:249)
WebSphere6.1成功部署了CXF应用,但不知道为什么要添加类装入器
在tomcat上部署了个CXF的WebServices是成功的,可以看到wsdl 但是部署到was上出问题,按照网上的搜的,是这样做的: [code="java"]将wsdl4j-1.6.3.jar放入服务器随便一个目录 在was控制台添加共享库,共享库的路径为服务器上的wsdl4j-1.6.3.jar 给server1的类装入器建立一个“类装入并且是先使用应用程序类装入器”的类装入器 重启was,测试ok[/code] [size=large]我的疑问: A. 为什么要这么做?这个wsdl4j-1.6.3.jar在我部署应用的war包里面是有的 B. 建立新的类装入器会不会对was上的其他应用造成影响?[/size]
java使用post请求webservice
我使用下面的方式请求 public static String postData1(String urlAddress, String encodedType, Map<String,String> params) { try { URL url = new URL(urlAddress); URLConnection conn = url.openConnection(); // 打开联接 // 使用POST请求,是否向connection输出/输入,因为这个是post请求,参数要放在http正文内,因此需要设为true conn.setDoOutput(true); conn.setDoInput(true); conn.setUseCaches(false); // Post请求不用设置缓存 // 发送域信息 OutputStreamWriter out = new OutputStreamWriter(conn.getOutputStream(), "utf-8"); StringBuffer stringBuffer = new StringBuffer(); if (params != null && !params.isEmpty()) { for (Map.Entry<String, String> entry : params.entrySet()) { try { stringBuffer .append(entry.getKey()) .append("=") .append(URLEncoder.encode(entry.getValue(), encodedType)).append("&"); } catch (UnsupportedEncodingException e) { // TODO Auto-generated catch block e.printStackTrace(); } } } // 删掉最后一个 & 字符 out.write(stringBuffer.toString()); out.flush(); out.close(); // 关闭流 // 获取返回数据 BufferedReader in = new BufferedReader(new InputStreamReader(conn.getInputStream(), "utf-8")); String line = null; StringBuffer sb = new StringBuffer(); while ((line = in.readLine()) != null) { sb.append(line); } in.close(); // 关闭流 return sb.toString(); } catch (Exception e) { e.printStackTrace(); } return ""; } 不带参数的时候,正确,访问加上参数,出现Server returned HTTP response code: 500 for URL,服务端报错: Interceptor for {http://service.cxf.myfund.com/}ServiceImplService has thrown exception, unwinding now java.lang.RuntimeException: Cannot create a secure XMLInputFactory at org.apache.cxf.staxutils.StaxUtils.createXMLInputFactory(StaxUtils.java:311) at org.apache.cxf.staxutils.StaxUtils.getXMLInputFactory(StaxUtils.java:261) at org.apache.cxf.staxutils.StaxUtils.createXMLStreamReader(StaxUtils.java:1412) ....... 网上查找,缺少jar包,可是我的都有呢! 这是什么问题呢?急求急求。。。。。。
cxf+rest 接口发布问题。
1.spring+cxf+rest 开发webservice接口 写发布的代码时 JAXRSServerFactoryBean 中找不到setAddress()这个方法怎么办? 提示: ![图片说明](https://img-ask.csdn.net/upload/201901/22/1548147547_778744.png) 怎么处理呢?我看网上大神贴出来的代码JAXRSServerFactoryBean 中都是有setAddress。
webservice启动问题,请指教
严重: Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener java.lang.NoClassDefFoundError: org/apache/commons/logging/LogFactory at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:184) at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:47) at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3827) ..... at org.apache.catalina.startup.Catalina.start(Catalina.java:566) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288) at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413) Caused by: java.lang.ClassNotFoundException: org.apache.commons.logging.LogFactory at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1358) at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1204) at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320) ... 26 more 2015-8-20 10:09:48 org.apache.catalina.core.StandardContext start 严重: Error listenerStart 2015-8-20 10:09:48 org.apache.catalina.core.StandardContext start 严重: Context [/cxfdemo] startup failed due to previous errors 2015-8-20 10:09:48 org.apache.catalina.core.ApplicationContext log 信息: Closing Spring root WebApplicationContext 2015-8-20 10:09:48 org.apache.catalina.core.StandardContext listenerStop 严重: Exception sending context destroyed event to listener instance of class org.springframework.web.context.ContextLoaderListener java.lang.NoClassDefFoundError: org/apache/commons/logging/LogFactory at org.springframework.web.context.ContextCleanupListener.<clinit>(ContextCleanupListener.java:43) at org.springframework.web.context.ContextLoaderListener.contextDestroyed(ContextLoaderListener.java:80) at org.apache.catalina.core.StandardContext.listenerStop(StandardContext.java:3866) ..... at org.apache.catalina.startup.Catalina.start(Catalina.java:566) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288) at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413) Caused by: java.lang.ClassNotFoundException: org.apache.commons.logging.LogFactory at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1358) at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1204) at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320) ... 27 more 2015-8-20 10:09:48 org.apache.catalina.loader.WebappClassLoader validateJarFile 信息: validateJarFile(F:\lianxi\.metadata\.me_tcat\webapps\cxf_demo_noSpring_1\WEB-INF\lib\servlet-api.jar) - jar not loaded. See Servlet Spec 2.3, section 9.7.2. Offending class: javax/servlet/Servlet.class 2015-8-20 10:09:48 org.apache.catalina.core.ApplicationContext log 严重: StandardWrapper.Throwable java.lang.NoClassDefFoundError: org/apache/neethi/builders/AssertionBuilder at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:621) at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124) at org.apache.catalina.loader.WebappClassLoader.findClassInternal(WebappClassLoader.java:1817) at org.apache.catalina.loader.WebappClassLoader.findClass(WebappClassLoader.java:872) at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1325) at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1204) at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320) at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:621) at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124) at org.apache.catalina.loader.WebappClassLoader.findClassInternal(WebappClassLoader.java:1817) at org.apache.catalina.loader.WebappClassLoader.findClass(WebappClassLoader.java:872) at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1325) at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1204) at org.apache.cxf.bus.extension.Extension.getClassObject(Extension.java:129) .... at org.apache.cxf.transport.servlet.CXFNonSpringServlet.loadBus(CXFNonSpringServlet.java:83) at com.test.server.WebServlet.loadBus(WebServlet.java:15) at org.apache.cxf.transport.servlet.CXFNonSpringServlet.init(CXFNonSpringServlet.java:54) at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1161) at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:981) 。。。。。 at org.apache.catalina.core.StandardServer.start(StandardServer.java:710) at org.apache.catalina.startup.Catalina.start(Catalina.java:566) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288) at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413) Caused by: java.lang.ClassNotFoundException: org.apache.neethi.builders.AssertionBuilder at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1358) at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1204) at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320) ... 55 more 2015-8-20 10:09:48 org.apache.catalina.core.StandardContext loadOnStartup 严重: Servlet /cxf_demo_noSpring_1 threw load() exception java.lang.ClassNotFoundException: org.apache.neethi.builders.AssertionBuilder at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1358) at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1204) at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320) at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:621) at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124) at org.apache.catalina.loader.WebappClassLoader.findClassInternal(WebappClassLoader.java:1817) .. at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1204) at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320) at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:621) at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124) at org.apache.catalina.loader.WebappClassLoader.findClassInternal(WebappClassLoader.java:1817) .. at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1204) at org.apache.cxf.bus.extension.Extension.getClassObject(Extension.java:129) ..... at com.test.server.WebServlet.loadBus(WebServlet.java:15) at org.apache.cxf.transport.servlet.CXFNonSpringServlet.init(CXFNonSpringServlet.java:54) at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1161) ...... at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288) at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413) 2015-8-20 10:09:48 org.apache.coyote.http11.Http11Protocol start * URL url = new URL("http://localhost:8081/Gz_hbjService?wsdl"); * //Qnameqname是qualified name 的简写 * //2.构成:由名字空间(namespace)前缀(prefix)以及冒号(:),还有一个元素名称构成 * //由发布的wsdl可知namespace为http://server.ws.platform.whaty.com/, * QName qname=new QName("http://ws.gz_hbj.wasoft.com/","Gz_hbjService"); * Service service=Service.create(url, qname); * IMyservice ms=service.getPort(IMyservice.class); * Gz_Hbj_Jjhz qc = new Gz_Hbj_Jjhz(); * qc.setA075("0102"); * qc.setP015(" "); * qc.setKsrq("2015-08-01"); * qc.setJsrq("2015-08-20"); * qc.setJkfs((short) 0); * Gz_Hbj_Jjhz[] gzHbjJjhzArray = new Gz_Hbj_Jjhz[20]; * gzHbjJjhzArray = ms.gz_Hbj_Jjhz(qc , 0, 0); <xsd:schema> <xsd:import namespace="http://ws.gz_hbj.wasoft.com/" schemaLocation="http://localhost:8081/Gz_hbjService?xsd=1"/> </xsd:schema> <xsd:schema> <xsd:import namespace="http://jaxb.dev.java.net/array" schemaLocation="http://localhost:8081/Gz_hbjService?xsd=2"/> </xsd:schema> </types> <message name="gz_Hbj_Jjhz"> <part name="gzHbjJjhz" type="tns:gzHbjJjhz"/> <part name="pagesize" type="xsd:int"/> <part name="pagenum" type="xsd:int"/> </message> <service name="Gz_hbjService"> <port name="Gz_hbjPort" binding="tns:Gz_hbjPortBinding"> <soap:address location="http://localhost:8081/Gz_hbjService"/> 服务器确实是起来了但是客户端访问出现问题不知道wei什么
终于明白阿里百度这样的大公司,为什么面试经常拿ThreadLocal考验求职者了
点击上面↑「爱开发」关注我们每晚10点,捕获技术思考和创业资源洞察什么是ThreadLocalThreadLocal是一个本地线程副本变量工具类,各个线程都拥有一份线程私有的数
程序员必须掌握的核心算法有哪些?
由于我之前一直强调数据结构以及算法学习的重要性,所以就有一些读者经常问我,数据结构与算法应该要学习到哪个程度呢?,说实话,这个问题我不知道要怎么回答你,主要取决于你想学习到哪些程度,不过针对这个问题,我稍微总结一下我学过的算法知识点,以及我觉得值得学习的算法。这些算法与数据结构的学习大多数是零散的,并没有一本把他们全部覆盖的书籍。下面是我觉得值得学习的一些算法以及数据结构,当然,我也会整理一些看过...
《奇巧淫技》系列-python!!每天早上八点自动发送天气预报邮件到QQ邮箱
此博客仅为我业余记录文章所用,发布到此,仅供网友阅读参考,如有侵权,请通知我,我会删掉。 补充 有不少读者留言说本文章没有用,因为天气预报直接打开手机就可以收到了,为何要多此一举发送到邮箱呢!!!那我在这里只能说:因为你没用,所以你没用!!! 这里主要介绍的是思路,不是天气预报!不是天气预报!!不是天气预报!!!天气预报只是用于举例。请各位不要再刚了!!! 下面是我会用到的两个场景: 每日下
面试官问我:什么是消息队列?什么场景需要他?用了会出现什么问题?
你知道的越多,你不知道的越多 点赞再看,养成习惯 GitHub上已经开源 https://github.com/JavaFamily 有一线大厂面试点脑图、个人联系方式,欢迎Star和完善 前言 消息队列在互联网技术存储方面使用如此广泛,几乎所有的后端技术面试官都要在消息队列的使用和原理方面对小伙伴们进行360°的刁难。 作为一个在互联网公司面一次拿一次Offer的面霸,打败了无数
8年经验面试官详解 Java 面试秘诀
    作者 | 胡书敏 责编 | 刘静 出品 | CSDN(ID:CSDNnews) 本人目前在一家知名外企担任架构师,而且最近八年来,在多家外企和互联网公司担任Java技术面试官,前后累计面试了有两三百位候选人。在本文里,就将结合本人的面试经验,针对Java初学者、Java初级开发和Java开发,给出若干准备简历和准备面试的建议。   Java程序员准备和投递简历的实
究竟你适不适合买Mac?
我清晰的记得,刚买的macbook pro回到家,开机后第一件事情,就是上了淘宝网,花了500元钱,找了一个上门维修电脑的师傅,上门给我装了一个windows系统。。。。。。 表砍我。。。 当时买mac的初衷,只是想要个固态硬盘的笔记本,用来运行一些复杂的扑克软件。而看了当时所有的SSD笔记本后,最终决定,还是买个好(xiong)看(da)的。 已经有好几个朋友问我mba怎么样了,所以今天尽量客观
程序员一般通过什么途径接私活?
二哥,你好,我想知道一般程序猿都如何接私活,我也想接,能告诉我一些方法吗? 上面是一个读者“烦不烦”问我的一个问题。其实不止是“烦不烦”,还有很多读者问过我类似这样的问题。 我接的私活不算多,挣到的钱也没有多少,加起来不到 20W。说实话,这个数目说出来我是有点心虚的,毕竟太少了,大家轻喷。但我想,恰好配得上“一般程序员”这个称号啊。毕竟苍蝇再小也是肉,我也算是有经验的人了。 唾弃接私活、做外
大学四年自学走来,这些珍藏的「实用工具/学习网站」我全贡献出来了
知乎高赞:文中列举了互联网一线大厂程序员都在用的工具集合,涉及面非常广,小白和老手都可以进来看看,或许有新收获。
《阿里巴巴开发手册》读书笔记-编程规约
Java编程规约命名风格 命名风格 类名使用UpperCamelCase风格 方法名,参数名,成员变量,局部变量都统一使用lowerCamelcase风格 常量命名全部大写,单词间用下划线隔开, 力求语义表达完整清楚,不要嫌名字长 ...
Python爬虫爬取淘宝,京东商品信息
小编是一个理科生,不善长说一些废话。简单介绍下原理然后直接上代码。 使用的工具(Python+pycharm2019.3+selenium+xpath+chromedriver)其中要使用pycharm也可以私聊我selenium是一个框架可以通过pip下载 pip install selenium -i https://pypi.tuna.tsinghua.edu.cn/simple/ 
阿里程序员写了一个新手都写不出的低级bug,被骂惨了。
你知道的越多,你不知道的越多 点赞再看,养成习惯 本文 GitHub https://github.com/JavaFamily 已收录,有一线大厂面试点思维导图,也整理了很多我的文档,欢迎Star和完善,大家面试可以参照考点复习,希望我们一起有点东西。 前前言 为啥今天有个前前言呢? 因为你们的丙丙啊,昨天有牌面了哟,直接被微信官方推荐,知乎推荐,也就仅仅是还行吧(心里乐开花)
Java工作4年来应聘要16K最后没要,细节如下。。。
前奏: 今天2B哥和大家分享一位前几天面试的一位应聘者,工作4年26岁,统招本科。 以下就是他的简历和面试情况。 基本情况: 专业技能: 1、&nbsp;熟悉Sping了解SpringMVC、SpringBoot、Mybatis等框架、了解SpringCloud微服务 2、&nbsp;熟悉常用项目管理工具:SVN、GIT、MAVEN、Jenkins 3、&nbsp;熟悉Nginx、tomca
Python爬虫精简步骤1 获取数据
爬虫的工作分为四步: 1.获取数据。爬虫程序会根据我们提供的网址,向服务器发起请求,然后返回数据。 2.解析数据。爬虫程序会把服务器返回的数据解析成我们能读懂的格式。 3.提取数据。爬虫程序再从中提取出我们需要的数据。 4.储存数据。爬虫程序把这些有用的数据保存起来,便于你日后的使用和分析。 这一篇的内容就是:获取数据。 首先,我们将会利用一个强大的库——requests来获取数据。 在电脑上安装
Python绘图,圣诞树,花,爱心 | Turtle篇
1.画圣诞树 import turtle screen = turtle.Screen() screen.setup(800,600) circle = turtle.Turtle() circle.shape('circle') circle.color('red') circle.speed('fastest') circle.up() square = turtle.Turtle()
作为一个程序员,CPU的这些硬核知识你必须会!
CPU对每个程序员来说,是个既熟悉又陌生的东西? 如果你只知道CPU是中央处理器的话,那可能对你并没有什么用,那么作为程序员的我们,必须要搞懂的就是CPU这家伙是如何运行的,尤其要搞懂它里面的寄存器是怎么一回事,因为这将让你从底层明白程序的运行机制。 随我一起,来好好认识下CPU这货吧 把CPU掰开来看 对于CPU来说,我们首先就要搞明白它是怎么回事,也就是它的内部构造,当然,CPU那么牛的一个东
破14亿,Python分析我国存在哪些人口危机!
2020年1月17日,国家统计局发布了2019年国民经济报告,报告中指出我国人口突破14亿。 猪哥的朋友圈被14亿人口刷屏,但是很多人并没有看到我国复杂的人口问题:老龄化、男女比例失衡、生育率下降、人口红利下降等。 今天我们就来分析一下我们国家的人口数据吧! 更多有趣分析教程,扫描下方二维码关注vx公号「裸睡的猪」 即可查看! 一、背景 1.人口突破14亿 2020年1月17日,国家统计局发布
听说想当黑客的都玩过这个Monyer游戏(1~14攻略)
第零关 进入传送门开始第0关(游戏链接) 请点击链接进入第1关: 连接在左边→ ←连接在右边 看不到啊。。。。(只能看到一堆大佬做完的留名,也能看到菜鸡的我,在后面~~) 直接fn+f12吧 &lt;span&gt;连接在左边→&lt;/span&gt; &lt;a href="first.php"&gt;&lt;/a&gt; &lt;span&gt;←连接在右边&lt;/span&gt; o
在家远程办公效率低?那你一定要收好这个「在家办公」神器!
相信大家都已经收到国务院延长春节假期的消息,接下来,在家远程办公可能将会持续一段时间。 但是问题来了。远程办公不是人在电脑前就当坐班了,相反,对于沟通效率,文件协作,以及信息安全都有着极高的要求。有着非常多的挑战,比如: 1在异地互相不见面的会议上,如何提高沟通效率? 2文件之间的来往反馈如何做到及时性?如何保证信息安全? 3如何规划安排每天工作,以及如何进行成果验收? ......
作为一个程序员,内存和磁盘的这些事情,你不得不知道啊!!!
截止目前,我已经分享了如下几篇文章: 一个程序在计算机中是如何运行的?超级干货!!! 作为一个程序员,CPU的这些硬核知识你必须会! 作为一个程序员,内存的这些硬核知识你必须懂! 这些知识可以说是我们之前都不太重视的基础知识,可能大家在上大学的时候都学习过了,但是嘞,当时由于老师讲解的没那么有趣,又加上这些知识本身就比较枯燥,所以嘞,大家当初几乎等于没学。 再说啦,学习这些,也看不出来有什么用啊!
别低估自己的直觉,也别高估自己的智商
所有群全部吵翻天,朋友圈全部沦陷,公众号疯狂转发。这两周没怎么发原创,只发新闻,可能有人注意到了。我不是懒,是文章写了却没发,因为大家的关注力始终在这次的疫情上面,发了也没人看。当然,我...
这个世界上人真的分三六九等,你信吗?
偶然间,在知乎上看到一个问题 一时间,勾起了我深深的回忆。 以前在厂里打过两次工,做过家教,干过辅导班,做过中介。零下几度的晚上,贴过广告,满脸、满手地长冻疮。   再回首那段岁月,虽然苦,但让我学会了坚持和忍耐。让我明白了,在这个世界上,无论环境多么的恶劣,只要心存希望,星星之火,亦可燎原。   下文是原回答,希望能对你能有所启发。   如果我说,这个世界上人真的分三六九等,
为什么听过很多道理,依然过不好这一生?
记录学习笔记是一个重要的习惯,不希望学习过的东西成为过眼云烟。做总结的同时也是一次复盘思考的过程。 本文是根据阅读得到 App上《万维钢·精英日课》部分文章后所做的一点笔记和思考。学习是一个系统的过程,思维模型的建立需要相对完整的学习和思考过程。以下观点是在碎片化阅读后总结的一点心得总结。
B 站上有哪些很好的学习资源?
哇说起B站,在小九眼里就是宝藏般的存在,放年假宅在家时一天刷6、7个小时不在话下,更别提今年的跨年晚会,我简直是跪着看完的!! 最早大家聚在在B站是为了追番,再后来我在上面刷欧美新歌和漂亮小姐姐的舞蹈视频,最近两年我和周围的朋友们已经把B站当作学习教室了,而且学习成本还免费,真是个励志的好平台ヽ(.◕ฺˇд ˇ◕ฺ;)ノ 下面我们就来盘点一下B站上优质的学习资源: 综合类 Oeasy: 综合
如何优雅地打印一个Java对象?
你好呀,我是沉默王二,一个和黄家驹一样身高,和刘德华一样颜值的程序员。虽然已经写了十多年的 Java 代码,但仍然觉得自己是个菜鸟(请允许我惭愧一下)。 在一个月黑风高的夜晚,我思前想后,觉得再也不能这么蹉跎下去了。于是痛下决心,准备通过输出的方式倒逼输入,以此来修炼自己的内功,从而进阶成为一名真正意义上的大神。与此同时,希望这些文章能够帮助到更多的读者,让大家在学习的路上不再寂寞、空虚和冷。 ...
雷火神山直播超两亿,Web播放器事件监听是怎么实现的?
Web播放器解决了在手机浏览器和PC浏览器上播放音视频数据的问题,让视音频内容可以不依赖用户安装App,就能进行播放以及在社交平台进行传播。在视频业务大数据平台中,播放数据的统计分析非常重要,所以Web播放器在使用过程中,需要对其内部的数据进行收集并上报至服务端,此时,就需要对发生在其内部的一些播放行为进行事件监听。 那么Web播放器事件监听是怎么实现的呢? 01 监听事件明细表 名
3万字总结,Mysql优化之精髓
本文知识点较多,篇幅较长,请耐心学习 MySQL已经成为时下关系型数据库产品的中坚力量,备受互联网大厂的青睐,出门面试想进BAT,想拿高工资,不会点MySQL优化知识,拿offer的成功率会大大下降。 为什么要优化 系统的吞吐量瓶颈往往出现在数据库的访问速度上 随着应用程序的运行,数据库的中的数据会越来越多,处理时间会相应变慢 数据是存放在磁盘上的,读写速度无法和内存相比 如何优化 设计
Linux 命令(122)—— watch 命令
1.命令简介 2.命令格式 3.选项说明 4.常用示例 参考文献 [1] watch(1) manual
Linux 命令(121)—— cal 命令
1.命令简介 2.命令格式 3.选项说明 4.常用示例 参考文献 [1] cal(1) manual
记jsp+servlet+jdbc实现的新闻管理系统
1.工具:eclipse+SQLyog 2.介绍:实现的内容就是显示新闻的基本信息,然后一个增删改查的操作。 3.数据库表设计 列名 中文名称 数据类型 长度 非空 newsId 文章ID int 11 √ newsTitle 文章标题 varchar 20 √ newsContent 文章内容 text newsStatus 是否审核 varchar 10 news...
Python新型冠状病毒疫情数据自动爬取+统计+发送报告+数据屏幕(三)发送篇
今天介绍的项目是使用 Itchat 发送统计报告 项目功能设计: 定时爬取疫情数据存入Mysql 进行数据分析制作疫情报告 使用itchat给亲人朋友发送分析报告(本文) 基于Django做数据屏幕 使用Tableau做数据分析 来看看最终效果 目前已经完成,预计2月12日前更新 使用 itchat 发送数据统计报告 itchat 是一个基于 web微信的一个框架,但微信官方并不允
相关热词 c#导入fbx c#中屏蔽键盘某个键 c#正态概率密度 c#和数据库登陆界面设计 c# 高斯消去法 c# codedom c#读取cad文件文本 c# 控制全局鼠标移动 c# temp 目录 bytes初始化 c#
立即提问