`

CXF WebService视频教程,自己录的(更新第7集 异步调用 2009.1.15)。

阅读更多
先录制了两集,SWF格式的。

以后会陆续添加,也希望大家给些意见和建议。

[2008.12.30]
由于工作比较忙,只有晚上回去才有时间录制视频,所以有些地方比较乱,还请大家谅解。我最初的想法是让每一集都不依赖于上一集,这样大家就可以从任何一集开始学习。

[2008.12.31]
接下来还会讲解JAXB,CXF中的Factory等。
分享到:
评论
45 楼 allqaida 2009-01-14  
学习中...谢谢分享
44 楼 wsbjwjt 2009-01-10  
21ca 写道
wsbjwjt 写道
在Client调用到这句:HelloWorld helloWorld = (HelloWorld) factory.create();

出现类转换异常:Exception in thread "main" java.lang.ClassCastException: org.apache.cxf.endpoint.ServerImpl
at com.wjt.test.HelloWorldClient.main(HelloWorldClient.java:22)

请帮助!谢谢


应该是你使用的Factory不正确.
ServerFactoryBean, JaxWsServerFactoryBean 用于服务器端.前者针对POJO,后者针对JAX-WS. 它们用于生成服务器端的Endpoint.

ClientProxyFactoryBean, JaxWsProxyFactoryBean 用于客户端,前者针对POJO,后者针对JAX-WS. 它们用于在客户端生成WebService的代理Proxy.

其实除了这些Factory, CXF客户端还有 ClientFactoryBean, JaxWsClientFactoryBean, 这两个Factory生成的不是WebService的代理, 而是一个Endpoint. 提供一些更高级的功能. 因为不太常用,而且麻烦容易混淆,所以视频里就没讲到.


谢谢讲解,我是按照视频第一集实现的,你的例子可以跑通,可是我的就不行,版本问题吗?
方便请把那个第一集的例子发给我,对比一下错在哪里?谢谢
我的邮箱: wsbjwjt@gmail.com
43 楼 21ca 2009-01-09  
wsbjwjt 写道
在Client调用到这句:HelloWorld helloWorld = (HelloWorld) factory.create();

出现类转换异常:Exception in thread "main" java.lang.ClassCastException: org.apache.cxf.endpoint.ServerImpl
at com.wjt.test.HelloWorldClient.main(HelloWorldClient.java:22)

请帮助!谢谢


应该是你使用的Factory不正确.
ServerFactoryBean, JaxWsServerFactoryBean 用于服务器端.前者针对POJO,后者针对JAX-WS. 它们用于生成服务器端的Endpoint.

ClientProxyFactoryBean, JaxWsProxyFactoryBean 用于客户端,前者针对POJO,后者针对JAX-WS. 它们用于在客户端生成WebService的代理Proxy.

其实除了这些Factory, CXF客户端还有 ClientFactoryBean, JaxWsClientFactoryBean, 这两个Factory生成的不是WebService的代理, 而是一个Endpoint. 提供一些更高级的功能. 因为不太常用,而且麻烦容易混淆,所以视频里就没讲到.
42 楼 dingst 2009-01-09  
支持lz,thanks for sharing
41 楼 WIN 2009-01-09  
hao ren a
40 楼 wsbjwjt 2009-01-09  
在Client调用到这句:HelloWorld helloWorld = (HelloWorld) factory.create();

出现类转换异常:Exception in thread "main" java.lang.ClassCastException: org.apache.cxf.endpoint.ServerImpl
at com.wjt.test.HelloWorldClient.main(HelloWorldClient.java:22)

请帮助!谢谢
39 楼 21ca 2009-01-09  
JDK1.6中的JAXB API为2.0。CXF中的JAXB Impl版本为2.1,不兼容。

试一下新版本的JDK1.6或者使用JDK1.5。JDK1.5不包含JAXB。
38 楼 lanmengxiaozi 2009-01-09  
请问下我这个是什么错啊 谢谢
2009-1-9 10:51:42 org.springframework.context.support.AbstractApplicationContext prepareRefresh
信息: Refreshing org.apache.cxf.bus.spring.BusApplicationContext@b162d5: display name [org.apache.cxf.bus.spring.BusApplicationContext@b162d5]; startup date [Fri Jan 09 10:51:42 CST 2009]; root of context hierarchy
2009-1-9 10:51:43 org.apache.cxf.bus.spring.BusApplicationContext getConfigResources
信息: No cxf.xml configuration file detected, relying on defaults.
2009-1-9 10:51:43 org.springframework.beans.factory.support.DefaultListableBeanFactory registerBeanDefinition
信息: Overriding bean definition for bean 'org.apache.cxf.transport.http.policy.HTTPClientAssertionBuilder': replacing [Root bean: class [org.apache.cxf.transport.http.policy.HTTPClientAssertionBuilder]; scope=singleton; abstract=false; lazyInit=false; autowireCandidate=true; autowireMode=0; dependencyCheck=0; factoryBeanName=null; factoryMethodName=null; initMethodName=null; destroyMethodName=null; defined in URL [jar:file:/D:/tomcat6.0.13/webapps/HelloWorld/WebRoot/WEB-INF/lib/cxf-2.1.3.jar!/META-INF/cxf/cxf-extension-http.fixml]] with [Root bean: class [org.apache.cxf.transport.http.policy.HTTPClientAssertionBuilder]; scope=singleton; abstract=false; lazyInit=false; autowireCandidate=true; autowireMode=0; dependencyCheck=0; factoryBeanName=null; factoryMethodName=null; initMethodName=null; destroyMethodName=null; defined in URL [jar:file:/D:/tomcat6.0.13/webapps/HelloWorld/WebRoot/WEB-INF/lib/cxf-2.1.3.jar!/META-INF/cxf/cxf-extension-http.fixml]]
2009-1-9 10:51:43 org.springframework.beans.factory.support.DefaultListableBeanFactory registerBeanDefinition
信息: Overriding bean definition for bean 'org.apache.cxf.transport.http.policy.HTTPServerAssertionBuilder': replacing [Root bean: class [org.apache.cxf.transport.http.policy.HTTPServerAssertionBuilder]; scope=singleton; abstract=false; lazyInit=false; autowireCandidate=true; autowireMode=0; dependencyCheck=0; factoryBeanName=null; factoryMethodName=null; initMethodName=null; destroyMethodName=null; defined in URL [jar:file:/D:/tomcat6.0.13/webapps/HelloWorld/WebRoot/WEB-INF/lib/cxf-2.1.3.jar!/META-INF/cxf/cxf-extension-http.fixml]] with [Root bean: class [org.apache.cxf.transport.http.policy.HTTPServerAssertionBuilder]; scope=singleton; abstract=false; lazyInit=false; autowireCandidate=true; autowireMode=0; dependencyCheck=0; factoryBeanName=null; factoryMethodName=null; initMethodName=null; destroyMethodName=null; defined in URL [jar:file:/D:/tomcat6.0.13/webapps/HelloWorld/WebRoot/WEB-INF/lib/cxf-2.1.3.jar!/META-INF/cxf/cxf-extension-http.fixml]]
2009-1-9 10:51:43 org.springframework.beans.factory.support.DefaultListableBeanFactory registerBeanDefinition
信息: Overriding bean definition for bean 'org.apache.cxf.transport.http.policy.NoOpPolicyInterceptorProvider': replacing [Root bean: class [org.apache.cxf.transport.http.policy.NoOpPolicyInterceptorProvider]; scope=singleton; abstract=false; lazyInit=false; autowireCandidate=true; autowireMode=0; dependencyCheck=0; factoryBeanName=null; factoryMethodName=null; initMethodName=null; destroyMethodName=null; defined in URL [jar:file:/D:/tomcat6.0.13/webapps/HelloWorld/WebRoot/WEB-INF/lib/cxf-2.1.3.jar!/META-INF/cxf/cxf-extension-http.fixml]] with [Root bean: class [org.apache.cxf.transport.http.policy.NoOpPolicyInterceptorProvider]; scope=singleton; abstract=false; lazyInit=false; autowireCandidate=true; autowireMode=0; dependencyCheck=0; factoryBeanName=null; factoryMethodName=null; initMethodName=null; destroyMethodName=null; defined in URL [jar:file:/D:/tomcat6.0.13/webapps/HelloWorld/WebRoot/WEB-INF/lib/cxf-2.1.3.jar!/META-INF/cxf/cxf-extension-http.fixml]]
2009-1-9 10:51:43 org.springframework.beans.factory.support.DefaultListableBeanFactory registerBeanDefinition
信息: Overriding bean definition for bean 'org.apache.cxf.transport.http.ClientOnlyHTTPTransportFactory': replacing [Root bean: class [org.apache.cxf.transport.http.ClientOnlyHTTPTransportFactory]; scope=singleton; abstract=false; lazyInit=true; autowireCandidate=true; autowireMode=0; dependencyCheck=0; factoryBeanName=null; factoryMethodName=null; initMethodName=null; destroyMethodName=null; defined in URL [jar:file:/D:/tomcat6.0.13/webapps/HelloWorld/WebRoot/WEB-INF/lib/cxf-2.1.3.jar!/META-INF/cxf/cxf-extension-http.fixml]] with [Root bean: class [org.apache.cxf.transport.http.ClientOnlyHTTPTransportFactory]; scope=singleton; abstract=false; lazyInit=true; autowireCandidate=true; autowireMode=0; dependencyCheck=0; factoryBeanName=null; factoryMethodName=null; initMethodName=null; destroyMethodName=null; defined in URL [jar:file:/D:/tomcat6.0.13/webapps/HelloWorld/WebRoot/WEB-INF/lib/cxf-2.1.3.jar!/META-INF/cxf/cxf-extension-http.fixml]]
2009-1-9 10:51:43 org.springframework.context.support.AbstractApplicationContext obtainFreshBeanFactory
信息: Bean factory for application context [org.apache.cxf.bus.spring.BusApplicationContext@b162d5]: org.springframework.beans.factory.support.DefaultListableBeanFactory@1ec6696
2009-1-9 10:51:44 org.springframework.context.support.AbstractApplicationContext$BeanPostProcessorChecker postProcessAfterInitialization
信息: Bean 'org.apache.cxf.bus.spring.Jsr250BeanPostProcessor' is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2009-1-9 10:51:44 org.springframework.context.support.AbstractApplicationContext$BeanPostProcessorChecker postProcessAfterInitialization
信息: Bean 'org.apache.cxf.bus.spring.BusExtensionPostProcessor' is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2009-1-9 10:51:44 org.springframework.beans.factory.support.DefaultListableBeanFactory preInstantiateSingletons
信息: Pre-instantiating singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@1ec6696: defining beans [cxf,org.apache.cxf.bus.spring.BusWiringBeanFactoryPostProcessor,org.apache.cxf.bus.spring.Jsr250BeanPostProcessor,org.apache.cxf.bus.spring.BusExtensionPostProcessor,org.apache.cxf.resource.ResourceManager,org.apache.cxf.configuration.Configurer,org.apache.cxf.binding.BindingFactoryManager,org.apache.cxf.transport.DestinationFactoryManager,org.apache.cxf.transport.ConduitInitiatorManager,org.apache.cxf.wsdl.WSDLManager,org.apache.cxf.phase.PhaseManager,org.apache.cxf.workqueue.WorkQueueManager,org.apache.cxf.buslifecycle.BusLifeCycleManager,org.apache.cxf.endpoint.ServerRegistry,org.apache.cxf.endpoint.ServerLifeCycleManager,org.apache.cxf.endpoint.ClientLifeCycleManager,org.apache.cxf.transports.http.QueryHandlerRegistry,org.apache.cxf.endpoint.EndpointResolverRegistry,org.apache.cxf.headers.HeaderManager,org.apache.cxf.catalog.OASISCatalogManager,org.apache.cxf.endpoint.ServiceContractResolverRegistry,org.apache.cxf.binding.corba.CorbaBindingFactory,org.apache.cxf.binding.corba.wsdl.WSDLExtensionRegister,org.apache.cxf.jaxws.context.WebServiceContextResourceResolver,org.apache.cxf.jaxws.context.WebServiceContextImpl,javax.xml.ws.WebServiceContext,org.apache.cxf.binding.soap.SoapBindingFactory,org.apache.cxf.binding.soap.SoapTransportFactory,org.apache.cxf.binding.soap.customEditorConfigurer,org.apache.cxf.binding.xml.XMLBindingFactory,org.apache.cxf.ws.addressing.policy.AddressingAssertionBuilder,org.apache.cxf.ws.addressing.policy.AddressingPolicyInterceptorProvider,org.apache.cxf.ws.addressing.policy.UsingAddressingAssertionBuilder,org.apache.cxf.javascript.JavascriptQueryHandlerRegistry,org.apache.cxf.transport.local.LocalTransportFactory,org.apache.cxf.transport.http.policy.HTTPClientAssertionBuilder,org.apache.cxf.transport.http.policy.HTTPServerAssertionBuilder,org.apache.cxf.transport.http.policy.NoOpPolicyInterceptorProvider,org.apache.cxf.transport.http.ClientOnlyHTTPTransportFactory,org.apache.cxf.management.InstrumentationManager,org.apache.cxf.transport.http_jetty.JettyHTTPTransportFactory,org.apache.cxf.transport.jms.JMSTransportFactory,org.apache.cxf.binding.object.ObjectBindingFactory,org.apache.cxf.binding.http.HttpBindingFactory,org.apache.cxf.jaxrs.JAXRSBindingFactory,org.apache.cxf.ws.policy.AssertionBuilderRegistry,org.apache.cxf.ws.policy.PolicyConstants,org.apache.cxf.ws.policy.PolicyInterceptorProviderRegistry,org.apache.cxf.ws.policy.attachment.external.DomainExpressionBuilderRegistry,org.apache.cxf.ws.policy.attachment.external.EndpointReferenceDomainExpressionBuilder,org.apache.cxf.ws.policy.PolicyBuilder,org.apache.cxf.ws.policy.PolicyEngine,org.apache.cxf.ws.policy.attachment.wsdl11.Wsdl11AttachmentPolicyProvider,org.apache.cxf.ws.policy.attachment.ServiceModelPolicyProvider,org.apache.cxf.ws.policy.mtom.MTOMAssertionBuilder,org.apache.cxf.ws.policy.mtom.MTOMPolicyInterceptorProvider,org.apache.cxf.ws.rm.RMManager,org.apache.cxf.ws.rm.policy.RMPolicyInterceptorProvider,org.apache.cxf.ws.rm.RMAssertionBuilder]; root of factory hierarchy
2009-1-9 10:51:45 org.springframework.beans.factory.support.DefaultSingletonBeanRegistry destroySingletons
信息: Destroying singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@1ec6696: defining beans [cxf,org.apache.cxf.bus.spring.BusWiringBeanFactoryPostProcessor,org.apache.cxf.bus.spring.Jsr250BeanPostProcessor,org.apache.cxf.bus.spring.BusExtensionPostProcessor,org.apache.cxf.resource.ResourceManager,org.apache.cxf.configuration.Configurer,org.apache.cxf.binding.BindingFactoryManager,org.apache.cxf.transport.DestinationFactoryManager,org.apache.cxf.transport.ConduitInitiatorManager,org.apache.cxf.wsdl.WSDLManager,org.apache.cxf.phase.PhaseManager,org.apache.cxf.workqueue.WorkQueueManager,org.apache.cxf.buslifecycle.BusLifeCycleManager,org.apache.cxf.endpoint.ServerRegistry,org.apache.cxf.endpoint.ServerLifeCycleManager,org.apache.cxf.endpoint.ClientLifeCycleManager,org.apache.cxf.transports.http.QueryHandlerRegistry,org.apache.cxf.endpoint.EndpointResolverRegistry,org.apache.cxf.headers.HeaderManager,org.apache.cxf.catalog.OASISCatalogManager,org.apache.cxf.endpoint.ServiceContractResolverRegistry,org.apache.cxf.binding.corba.CorbaBindingFactory,org.apache.cxf.binding.corba.wsdl.WSDLExtensionRegister,org.apache.cxf.jaxws.context.WebServiceContextResourceResolver,org.apache.cxf.jaxws.context.WebServiceContextImpl,javax.xml.ws.WebServiceContext,org.apache.cxf.binding.soap.SoapBindingFactory,org.apache.cxf.binding.soap.SoapTransportFactory,org.apache.cxf.binding.soap.customEditorConfigurer,org.apache.cxf.binding.xml.XMLBindingFactory,org.apache.cxf.ws.addressing.policy.AddressingAssertionBuilder,org.apache.cxf.ws.addressing.policy.AddressingPolicyInterceptorProvider,org.apache.cxf.ws.addressing.policy.UsingAddressingAssertionBuilder,org.apache.cxf.javascript.JavascriptQueryHandlerRegistry,org.apache.cxf.transport.local.LocalTransportFactory,org.apache.cxf.transport.http.policy.HTTPClientAssertionBuilder,org.apache.cxf.transport.http.policy.HTTPServerAssertionBuilder,org.apache.cxf.transport.http.policy.NoOpPolicyInterceptorProvider,org.apache.cxf.transport.http.ClientOnlyHTTPTransportFactory,org.apache.cxf.management.InstrumentationManager,org.apache.cxf.transport.http_jetty.JettyHTTPTransportFactory,org.apache.cxf.transport.jms.JMSTransportFactory,org.apache.cxf.binding.object.ObjectBindingFactory,org.apache.cxf.binding.http.HttpBindingFactory,org.apache.cxf.jaxrs.JAXRSBindingFactory,org.apache.cxf.ws.policy.AssertionBuilderRegistry,org.apache.cxf.ws.policy.PolicyConstants,org.apache.cxf.ws.policy.PolicyInterceptorProviderRegistry,org.apache.cxf.ws.policy.attachment.external.DomainExpressionBuilderRegistry,org.apache.cxf.ws.policy.attachment.external.EndpointReferenceDomainExpressionBuilder,org.apache.cxf.ws.policy.PolicyBuilder,org.apache.cxf.ws.policy.PolicyEngine,org.apache.cxf.ws.policy.attachment.wsdl11.Wsdl11AttachmentPolicyProvider,org.apache.cxf.ws.policy.attachment.ServiceModelPolicyProvider,org.apache.cxf.ws.policy.mtom.MTOMAssertionBuilder,org.apache.cxf.ws.policy.mtom.MTOMPolicyInterceptorProvider,org.apache.cxf.ws.rm.RMManager,org.apache.cxf.ws.rm.policy.RMPolicyInterceptorProvider,org.apache.cxf.ws.rm.RMAssertionBuilder]; root of factory hierarchy
2009-1-9 10:51:45 org.apache.cxf.bus.spring.SpringBusFactory createBus
警告: Failed to create application context.
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.apache.cxf.wsdl.WSDLManager' defined in URL [jar:file:/D:/tomcat6.0.13/webapps/HelloWorld/WebRoot/WEB-INF/lib/cxf-2.1.3.jar!/META-INF/cxf/cxf.fixml]: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [org.apache.cxf.wsdl11.WSDLManagerImpl]: Constructor threw exception; nested exception is java.lang.LinkageError: JAXB 2.0 API is being loaded from the bootstrap classloader, but this RI (from jar:file:/D:/tomcat6.0.13/webapps/HelloWorld/WebRoot/WEB-INF/lib/jaxb-impl-2.1.7.jar!/com/sun/xml/bind/v2/model/impl/ModelBuilder.class) needs 2.1 API. Use the endorsed directory mechanism to place jaxb-api.jar in the bootstrap classloader. (See http://java.sun.com/j2se/1.5.0/docs/guide/standards/)
Caused by: org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [org.apache.cxf.wsdl11.WSDLManagerImpl]: Constructor threw exception; nested exception is java.lang.LinkageError: JAXB 2.0 API is being loaded from the bootstrap classloader, but this RI (from jar:file:/D:/tomcat6.0.13/webapps/HelloWorld/WebRoot/WEB-INF/lib/jaxb-impl-2.1.7.jar!/com/sun/xml/bind/v2/model/impl/ModelBuilder.class) needs 2.1 API. Use the endorsed directory mechanism to place jaxb-api.jar in the bootstrap classloader. (See http://java.sun.com/j2se/1.5.0/docs/guide/standards/)
Caused by: java.lang.LinkageError: JAXB 2.0 API is being loaded from the bootstrap classloader, but this RI (from jar:file:/D:/tomcat6.0.13/webapps/HelloWorld/WebRoot/WEB-INF/lib/jaxb-impl-2.1.7.jar!/com/sun/xml/bind/v2/model/impl/ModelBuilder.class) needs 2.1 API. Use the endorsed directory mechanism to place jaxb-api.jar in the bootstrap classloader. (See http://java.sun.com/j2se/1.5.0/docs/guide/standards/)
at com.sun.xml.bind.v2.model.impl.ModelBuilder.<clinit>(ModelBuilder.java:173)
at com.sun.xml.bind.v2.runtime.JAXBContextImpl.getTypeInfoSet(JAXBContextImpl.java:422)
at com.sun.xml.bind.v2.runtime.JAXBContextImpl.<init>(JAXBContextImpl.java:286)
at com.sun.xml.bind.v2.ContextFactory.createContext(ContextFactory.java:139)
at com.sun.xml.bind.v2.ContextFactory.createContext(ContextFactory.java:117)
at com.sun.xml.bind.v2.ContextFactory.createContext(ContextFactory.java:188)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at javax.xml.bind.ContextFinder.newInstance(Unknown Source)
at javax.xml.bind.ContextFinder.find(Unknown Source)
at javax.xml.bind.JAXBContext.newInstance(Unknown Source)
at javax.xml.bind.JAXBContext.newInstance(Unknown Source)
at org.apache.cxf.wsdl.JAXBExtensionHelper.createJAXBContext(JAXBExtensionHelper.java:196)
at org.apache.cxf.wsdl.JAXBExtensionHelper.getJAXBContext(JAXBExtensionHelper.java:183)
at org.apache.cxf.wsdl.JAXBExtensionHelper.addExtensions(JAXBExtensionHelper.java:168)
at org.apache.cxf.wsdl.JAXBExtensionHelper.addExtensions(JAXBExtensionHelper.java:88)
at org.apache.cxf.wsdl11.WSDLManagerImpl.registerInitialExtensions(WSDLManagerImpl.java:241)
at org.apache.cxf.wsdl11.WSDLManagerImpl.registerInitialExtensions(WSDLManagerImpl.java:221)
at org.apache.cxf.wsdl11.WSDLManagerImpl.<init>(WSDLManagerImpl.java:110)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:85)
at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:61)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:757)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:722)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:386)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:249)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:155)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:246)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:160)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:291)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:352)
at org.apache.cxf.bus.spring.BusApplicationContext.<init>(BusApplicationContext.java:88)
at org.apache.cxf.bus.spring.SpringBusFactory.createApplicationContext(SpringBusFactory.java:103)
at org.apache.cxf.bus.spring.SpringBusFactory.createBus(SpringBusFactory.java:94)
at org.apache.cxf.bus.spring.SpringBusFactory.createBus(SpringBusFactory.java:87)
at org.apache.cxf.bus.spring.SpringBusFactory.createBus(SpringBusFactory.java:65)
at org.apache.cxf.bus.spring.SpringBusFactory.createBus(SpringBusFactory.java:54)
at org.apache.cxf.BusFactory.getDefaultBus(BusFactory.java:70)
at org.apache.cxf.BusFactory.getThreadDefaultBus(BusFactory.java:107)
at org.apache.cxf.BusFactory.getThreadDefaultBus(BusFactory.java:98)
at org.apache.cxf.endpoint.AbstractEndpointFactory.getBus(AbstractEndpointFactory.java:73)
at org.apache.cxf.frontend.AbstractWSDLBasedEndpointFactory.initializeServiceFactory(AbstractWSDLBasedEndpointFactory.java:228)
at org.apache.cxf.frontend.ServerFactoryBean.initializeServiceFactory(ServerFactoryBean.java:157)
at org.apache.cxf.frontend.AbstractWSDLBasedEndpointFactory.createEndpoint(AbstractWSDLBasedEndpointFactory.java:99)
at org.apache.cxf.frontend.ServerFactoryBean.create(ServerFactoryBean.java:117)
at org.apache.cxf.jaxws.JaxWsServerFactoryBean.create(JaxWsServerFactoryBean.java:168)
at test.MainServer.main(MainServer.java:10)
Exception in thread "main" java.lang.RuntimeException: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.apache.cxf.wsdl.WSDLManager' defined in URL [jar:file:/D:/tomcat6.0.13/webapps/HelloWorld/WebRoot/WEB-INF/lib/cxf-2.1.3.jar!/META-INF/cxf/cxf.fixml]: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [org.apache.cxf.wsdl11.WSDLManagerImpl]: Constructor threw exception; nested exception is java.lang.LinkageError: JAXB 2.0 API is being loaded from the bootstrap classloader, but this RI (from jar:file:/D:/tomcat6.0.13/webapps/HelloWorld/WebRoot/WEB-INF/lib/jaxb-impl-2.1.7.jar!/com/sun/xml/bind/v2/model/impl/ModelBuilder.class) needs 2.1 API. Use the endorsed directory mechanism to place jaxb-api.jar in the bootstrap classloader. (See http://java.sun.com/j2se/1.5.0/docs/guide/standards/)
at org.apache.cxf.bus.spring.SpringBusFactory.createBus(SpringBusFactory.java:97)
at org.apache.cxf.bus.spring.SpringBusFactory.createBus(SpringBusFactory.java:87)
at org.apache.cxf.bus.spring.SpringBusFactory.createBus(SpringBusFactory.java:65)
at org.apache.cxf.bus.spring.SpringBusFactory.createBus(SpringBusFactory.java:54)
at org.apache.cxf.BusFactory.getDefaultBus(BusFactory.java:70)
at org.apache.cxf.BusFactory.getThreadDefaultBus(BusFactory.java:107)
at org.apache.cxf.BusFactory.getThreadDefaultBus(BusFactory.java:98)
at org.apache.cxf.endpoint.AbstractEndpointFactory.getBus(AbstractEndpointFactory.java:73)
at org.apache.cxf.frontend.AbstractWSDLBasedEndpointFactory.initializeServiceFactory(AbstractWSDLBasedEndpointFactory.java:228)
at org.apache.cxf.frontend.ServerFactoryBean.initializeServiceFactory(ServerFactoryBean.java:157)
at org.apache.cxf.frontend.AbstractWSDLBasedEndpointFactory.createEndpoint(AbstractWSDLBasedEndpointFactory.java:99)
at org.apache.cxf.frontend.ServerFactoryBean.create(ServerFactoryBean.java:117)
at org.apache.cxf.jaxws.JaxWsServerFactoryBean.create(JaxWsServerFactoryBean.java:168)
at test.MainServer.main(MainServer.java:10)
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.apache.cxf.wsdl.WSDLManager' defined in URL [jar:file:/D:/tomcat6.0.13/webapps/HelloWorld/WebRoot/WEB-INF/lib/cxf-2.1.3.jar!/META-INF/cxf/cxf.fixml]: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [org.apache.cxf.wsdl11.WSDLManagerImpl]: Constructor threw exception; nested exception is java.lang.LinkageError: JAXB 2.0 API is being loaded from the bootstrap classloader, but this RI (from jar:file:/D:/tomcat6.0.13/webapps/HelloWorld/WebRoot/WEB-INF/lib/jaxb-impl-2.1.7.jar!/com/sun/xml/bind/v2/model/impl/ModelBuilder.class) needs 2.1 API. Use the endorsed directory mechanism to place jaxb-api.jar in the bootstrap classloader. (See http://java.sun.com/j2se/1.5.0/docs/guide/standards/)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:451)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:249)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:155)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:246)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:160)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:291)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:352)
at org.apache.cxf.bus.spring.BusApplicationContext.<init>(BusApplicationContext.java:88)
at org.apache.cxf.bus.spring.SpringBusFactory.createApplicationContext(SpringBusFactory.java:103)
at org.apache.cxf.bus.spring.SpringBusFactory.createBus(SpringBusFactory.java:94)
... 13 more
Caused by: org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [org.apache.cxf.wsdl11.WSDLManagerImpl]: Constructor threw exception; nested exception is java.lang.LinkageError: JAXB 2.0 API is being loaded from the bootstrap classloader, but this RI (from jar:file:/D:/tomcat6.0.13/webapps/HelloWorld/WebRoot/WEB-INF/lib/jaxb-impl-2.1.7.jar!/com/sun/xml/bind/v2/model/impl/ModelBuilder.class) needs 2.1 API. Use the endorsed directory mechanism to place jaxb-api.jar in the bootstrap classloader. (See http://java.sun.com/j2se/1.5.0/docs/guide/standards/)
at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:100)
at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:61)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:757)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:722)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:386)
... 22 more
Caused by: java.lang.LinkageError: JAXB 2.0 API is being loaded from the bootstrap classloader, but this RI (from jar:file:/D:/tomcat6.0.13/webapps/HelloWorld/WebRoot/WEB-INF/lib/jaxb-impl-2.1.7.jar!/com/sun/xml/bind/v2/model/impl/ModelBuilder.class) needs 2.1 API. Use the endorsed directory mechanism to place jaxb-api.jar in the bootstrap classloader. (See http://java.sun.com/j2se/1.5.0/docs/guide/standards/)
at com.sun.xml.bind.v2.model.impl.ModelBuilder.<clinit>(ModelBuilder.java:173)
at com.sun.xml.bind.v2.runtime.JAXBContextImpl.getTypeInfoSet(JAXBContextImpl.java:422)
at com.sun.xml.bind.v2.runtime.JAXBContextImpl.<init>(JAXBContextImpl.java:286)
at com.sun.xml.bind.v2.ContextFactory.createContext(ContextFactory.java:139)
at com.sun.xml.bind.v2.ContextFactory.createContext(ContextFactory.java:117)
at com.sun.xml.bind.v2.ContextFactory.createContext(ContextFactory.java:188)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at javax.xml.bind.ContextFinder.newInstance(Unknown Source)
at javax.xml.bind.ContextFinder.find(Unknown Source)
at javax.xml.bind.JAXBContext.newInstance(Unknown Source)
at javax.xml.bind.JAXBContext.newInstance(Unknown Source)
at org.apache.cxf.wsdl.JAXBExtensionHelper.createJAXBContext(JAXBExtensionHelper.java:196)
at org.apache.cxf.wsdl.JAXBExtensionHelper.getJAXBContext(JAXBExtensionHelper.java:183)
at org.apache.cxf.wsdl.JAXBExtensionHelper.addExtensions(JAXBExtensionHelper.java:168)
at org.apache.cxf.wsdl.JAXBExtensionHelper.addExtensions(JAXBExtensionHelper.java:88)
at org.apache.cxf.wsdl11.WSDLManagerImpl.registerInitialExtensions(WSDLManagerImpl.java:241)
at org.apache.cxf.wsdl11.WSDLManagerImpl.registerInitialExtensions(WSDLManagerImpl.java:221)
at org.apache.cxf.wsdl11.WSDLManagerImpl.<init>(WSDLManagerImpl.java:110)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:85)
... 26 more
37 楼 xiyeqing99 2009-01-08  
楼主真是好人.....

谢谢啦  正想了解SOA
36 楼 makemyownlife 2009-01-08  
学习学习,欣赏楼主奉献精神!!
35 楼 tsc9541 2009-01-08  
谢谢楼主啊,给出了这么好东西
34 楼 zousch 2009-01-08  
谢谢拿出来贡献!
以前接触过一点axis,现在正好有个项目要用CXF,学习中!非常感谢
33 楼 hanjiangit 2009-01-08  
楼主  感谢咯  以后会陆续添加 激动
32 楼 lanmengxiaozi 2009-01-08  
顶哦,谢谢楼主
31 楼 qiancaoduwu 2009-01-08  
好东西哦
30 楼 鸡蛋炒番茄 2009-01-07  
谢谢楼主了,这段一时间正好整下webservice,呵呵!!
29 楼 qiuhb 2009-01-07  
谢谢楼主,期待第6集
28 楼 sunshy511 2009-01-06  
好东西!顶!
27 楼 ljh06130612 2009-01-06  
谢谢,你的知识积累成果
26 楼 yangtao309 2009-01-06  
谢谢 楼主正在学习中

相关推荐

    CXF入门 webService异步调用模式

    CXF入门教程(5)--webService异步调用模式文章配套代码,文中涉及的异步调用客户端的代码放在com.neareast.test.cxf.asyClient包下。原文地址:http://blog.csdn.net/neareast/article/details/7726503

    CXF入门教程(4) -- webService异步调用模式

    CXF入门教程(4) -- webService异步调用模式文章配套代码,文中涉及的异步调用客户端的代码放在com.neareast.test.cxf.asyClient包下。原文地址:http://blog.csdn.net/neareast/article/details/7726503

    CXF打印SOAP报文,记录WebService日志

    ### CXF打印SOAP报文与记录WebService日志 在企业级应用开发中,尤其是涉及到服务端接口(如WebService)的设计与实现时,日志记录变得尤为重要。它不仅可以帮助开发者更好地理解系统运行状况、定位问题所在,还能...

    使用CXF和camel-cxf调用webservice

    总的来说,Apache CXF和camel-cxf提供了强大的工具集,帮助开发者高效地集成和管理Web服务。通过理解这两个框架的工作原理和使用方法,你可以构建出更加灵活、可维护的分布式系统。在开发过程中,务必注意对源码的...

    webService(基于cxf)的完整例子

    在这个基于CXF的Web服务完整例子中,我们将深入探讨CXF的核心概念、配置、以及如何创建和调用Web服务。 1. **CXF框架介绍**:CXF,全称为"Code first eXtended Framework",最初由XFire项目发展而来,后与Apache ...

    springboot整合CXF发布webservice和客户端调用

    SpringBoot整合CXF是将流行的Java Web服务框架CXF与SpringBoot轻量级框架结合,以便更方便地创建和消费Web服务。这个项目提供了一个很好的示例,通过详细注释帮助开发者理解如何在SpringBoot应用中发布和调用Web服务...

    WebService_CXF范例.

    【WebService CXF详解与入门】 WebService是一种允许不同系统之间进行通信和交互的标准协议,它基于HTTP协议,使得应用程序可以无视具体实现细节地调用互联网上的服务。这种技术使得分布式应用程序的发展成为可能,...

    C#动态调用CXF WEBSERVICE框架的共通类

    C#动态调用CXF WEBSERVICE框架共通类。

    WebService CXF 详细教程

    **WebService CXF 详解** **一、WebService简介** WebService是一种基于标准的,可以在不同操作系统、编程语言之间交换数据的Web应用程序。它通过WSDL(Web服务描述语言)定义了服务接口,利用SOAP(简单对象访问...

    CXF框架webservice教程.pdf

    本教程将详细介绍如何使用CXF框架来创建和消费Web服务。 首先,你需要从Apache官方网站下载CXF的开发包,例如在本例中是`apache-cxf-2.4.3.zip`。这个ZIP文件包含了所有必要的JAR文件,你需要将它们添加到你的Java...

    CXF webservice+mybatis

    CXF提供了丰富的API和工具,包括动态客户端生成、WSDL第一和代码第一的Web服务实现、以及强大的扩展机制,使开发者能够根据需求定制自己的服务。 1. **CXF的架构**:CXF的核心组件包括Bus(总线)、Service(服务)...

    SpringBoot框架及CXF发布WebService

    在给定的压缩包文件中,"WebService_Server"可能包含了SpringBoot与CXF集成的服务器端代码示例,而"Webservice_Client"则可能包含CXF客户端调用服务的示例代码。这两个部分可以作为学习和实践SpringBoot发布和消费...

    cxf做的webservice对外提供接口调用

    【标题】:“cxf做的webservice对外提供接口调用” 【描述】中提到的“webservice对外发布接口全部源码拿起来就能用”,这表明这是一个关于使用Apache CXF框架创建和发布的Web服务项目。Apache CXF是一个开源的Java...

    cxf WebService jar包(1)

    cxf WebService jar包

    Java cxf开发webservice,分别有客户端和服务端

    2.用cxf开发webservice 3.这个服务端和客户端的小demo 在服务端 对外开放接口服务,然后在客户端 调用服务端的方法, 实现客户端(一个javaweb项目)对服务端(javaweb项目)方法的调用, 实际上就是发送和接收消息...

    Java调用CXF WebService接口的两种方式实例

    Java调用CXF WebService接口的两种方式实例 Java调用CXF WebService接口是Java开发者在开发过程中经常遇到的问题。今天,我们将讨论Java调用CXF WebService接口的两种方式实例,即静态调用和动态调用。 静态调用 ...

    CXF webservice Demo

    【CXF Webservice Demo】是基于Apache CXF框架的一个示例项目,用于演示如何使用CXF来创建和消费Web服务。Apache CXF是一个开源的Java框架,它允许开发者构建和集成Web服务,支持多种Web服务标准,如SOAP、RESTful ...

    cxf webservice demo

    1. **CXF_HELLO**: 这个项目可能是一个基础的“Hello World”服务,演示了如何使用CXF创建一个简单的Web服务,该服务可能接收一个字符串参数并返回相应的问候信息。 2. **CXF_HELLO_Object**: 此项目可能是对对象...

    CXF WebService 视频和源码

    【CXF WebService 视频和源码】这个资源包主要涵盖了如何利用Apache CXF框架来创建和消费WebService的相关教程,结合了视频教学和实际的源代码,为学习者提供了全面的学习材料。Apache CXF是一个开源的Java服务框架...

Global site tag (gtag.js) - Google Analytics