Hi,

I want to test ws-security in CXF. Following the document
http://cwiki.apache.org/CXF20DOC/ws-security.html, I have checked out the
sample from SVN, and compiled success. But A runtime exception was thrown
from running Server.java:

 

 

 

2008-7-24 21:56:04
org.apache.cxf.service.factory.ReflectionServiceFactoryBean
buildServiceFromWSDL

信息: Creating Service
{http://apache.org/hello_world_soap_http}GreeterService from WSDL:
org/apache/cxf/systest/ws/security/hello_world.wsdl

- Destroying singletons in
[EMAIL PROTECTED]:
defining beans
[cxf,org.apache.cxf.bus.spring.Jsr250BeanPostProcessor,org.apache.cxf.bus.sp
ring.BusExtensionPostProcessor,org.apache.cxf.resource.ResourceManager,org.a
pache.cxf.configuration.Configurer,org.apache.cxf.binding.BindingFactoryMana
ger,org.apache.cxf.transport.DestinationFactoryManager,org.apache.cxf.transp
ort.ConduitInitiatorManager,org.apache.cxf.wsdl.WSDLManager,org.apache.cxf.p
hase.PhaseManager,org.apache.cxf.workqueue.WorkQueueManager,org.apache.cxf.b
uslifecycle.BusLifeCycleManager,org.apache.cxf.endpoint.ServerRegistry,org.a
pache.cxf.endpoint.ServerLifeCycleManager,org.apache.cxf.endpoint.ClientLife
CycleManager,org.apache.cxf.transports.http.QueryHandlerRegistry,org.apache.
cxf.endpoint.EndpointResolverRegistry,org.apache.cxf.headers.HeaderManager,o
rg.apache.cxf.catalog.OASISCatalogManager,org.apache.cxf.endpoint.ServiceCon
tractResolverRegistry,org.apache.cxf.binding.soap.SoapBindingFactory,org.apa
che.cxf.binding.soap.SoapTransportFactory,org.apache.cxf.binding.soap.custom
EditorConfigurer,org.apache.cxf.jaxws.context.WebServiceContextResourceResol
ver,org.apache.cxf.jaxws.context.WebServiceContextImpl,org.apache.cxf.bindin
g.xml.XMLBindingFactory,org.apache.cxf.ws.addressing.policy.AddressingAssert
ionBuilder,org.apache.cxf.ws.addressing.policy.AddressingPolicyInterceptorPr
ovider,org.apache.cxf.ws.addressing.policy.UsingAddressingAssertionBuilder,o
rg.apache.cxf.transport.local.LocalTransportFactory,org.apache.cxf.transport
.http.policy.HTTPClientAssertionBuilder,org.apache.cxf.transport.http.policy
.HTTPServerAssertionBuilder,org.apache.cxf.transport.http.ClientOnlyHTTPTran
sportFactory,org.apache.cxf.transport.http_jetty.JettyHTTPTransportFactory,o
rg.apache.cxf.transport.jms.JMSTransportFactory,org.apache.cxf.management.jm
x.InstrumentationManagerImpl,UsernameTokenEndpoint,UsernameToken_Request,Tim
estampSignEncryptEndpoint,TimestampSignEncrypt_Request,TimestampSignEncrypt_
Response]; root of factory hierarchy

2008-7-24 21:56:05 org.apache.cxf.bus.spring.SpringBusFactory createBus

警告: Failed to create application context.

org.springframework.beans.factory.BeanCreationException: Error creating bean
with name 'UsernameTokenEndpoint': Invocation of init method failed; nested
exception is java.lang.IncompatibleClassChangeError: Class
com.ibm.wsdl.DefinitionImpl does not implement the requested interface
javax.wsdl.extensions.AttributeExtensible

Caused by: java.lang.IncompatibleClassChangeError: Class
com.ibm.wsdl.DefinitionImpl does not implement the requested interface
javax.wsdl.extensions.AttributeExtensible

    at
org.apache.cxf.wsdl11.WSDLServiceBuilder.copyExtensionAttributes(WSDLService
Builder.java:120)

    at
org.apache.cxf.wsdl11.WSDLServiceBuilder.buildServices(WSDLServiceBuilder.ja
va:236)

    at
org.apache.cxf.wsdl11.WSDLServiceBuilder.buildServices(WSDLServiceBuilder.ja
va:153)

    at
org.apache.cxf.wsdl11.WSDLServiceFactory.create(WSDLServiceFactory.java:117)

    at
org.apache.cxf.service.factory.ReflectionServiceFactoryBean.buildServiceFrom
WSDL(ReflectionServiceFactoryBean.java:300)

    at
org.apache.cxf.service.factory.ReflectionServiceFactoryBean.initializeServic
eModel(ReflectionServiceFactoryBean.java:392)

    at
org.apache.cxf.service.factory.ReflectionServiceFactoryBean.create(Reflectio
nServiceFactoryBean.java:180)

    at
org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean.create(JaxWsServiceFact
oryBean.java:163)

    at
org.apache.cxf.frontend.AbstractWSDLBasedEndpointFactory.createEndpoint(Abst
ractWSDLBasedEndpointFactory.java:79)

    at
org.apache.cxf.frontend.ServerFactoryBean.create(ServerFactoryBean.java:114)

    at
org.apache.cxf.jaxws.JaxWsServerFactoryBean.create(JaxWsServerFactoryBean.ja
va:160)

    at org.apache.cxf.jaxws.EndpointImpl.getServer(EndpointImpl.java:322)

    at org.apache.cxf.jaxws.EndpointImpl.doPublish(EndpointImpl.java:244)

    at org.apache.cxf.jaxws.EndpointImpl.publish(EndpointImpl.java:194)

    at org.apache.cxf.jaxws.EndpointImpl.publish(EndpointImpl.java:380)

    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:1242)

    at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory
.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1208)

    at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory
.initializeBean(AbstractAutowireCapableBeanFactory.java:1172)

    at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory
.createBean(AbstractAutowireCapableBeanFactory.java:427)

    at
org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(Ab
stractBeanFactory.java:249)

    at
org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSi
ngleton(DefaultSingletonBeanRegistry.java:155)

    at
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(Abstra
ctBeanFactory.java:246)

    at
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(Abstra
ctBeanFactory.java:160)

    at org.springframework.beans.factory.support.DefaultListableBeanFactory.
preInstantiateSingletons(DefaultListableBeanFactory.java:291)

    at
org.springframework.context.support.AbstractApplicationContext.refresh(Abstr
actApplicationContext.java:352)

    at
org.apache.cxf.bus.spring.BusApplicationContext.<init>(BusApplicationContext
.java:86)

    at
org.apache.cxf.bus.spring.SpringBusFactory.createBus(SpringBusFactory.java:9
3)

    at
org.apache.cxf.bus.spring.SpringBusFactory.createBus(SpringBusFactory.java:8
9)

    at
org.apache.cxf.bus.spring.SpringBusFactory.createBus(SpringBusFactory.java:6
5)

    at org.apache.cxf.systest.ws.security.Server.run(Server.java:34)

    at
org.apache.cxf.testutil.common.AbstractTestServerBase.start(AbstractTestServ
erBase.java:67)

    at org.apache.cxf.systest.ws.security.Server.main(Server.java:42)

java.lang.RuntimeException:
org.springframework.beans.factory.BeanCreationException: Error creating bean
with name 'UsernameTokenEndpoint': Invocation of init method failed; nested
exception is java.lang.IncompatibleClassChangeError: Class
com.ibm.wsdl.DefinitionImpl does not implement the requested interface
javax.wsdl.extensions.AttributeExtensible

    at
org.apache.cxf.bus.spring.SpringBusFactory.createBus(SpringBusFactory.java:9
6)

    at
org.apache.cxf.bus.spring.SpringBusFactory.createBus(SpringBusFactory.java:8
9)

    at
org.apache.cxf.bus.spring.SpringBusFactory.createBus(SpringBusFactory.java:6
5)

    at org.apache.cxf.systest.ws.security.Server.run(Server.java:34)

    at
org.apache.cxf.testutil.common.AbstractTestServerBase.start(AbstractTestServ
erBase.java:67)

    at org.apache.cxf.systest.ws.security.Server.main(Server.java:42)

Caused by: org.springframework.beans.factory.BeanCreationException: Error
creating bean with name 'UsernameTokenEndpoint': Invocation of init method
failed; nested exception is java.lang.IncompatibleClassChangeError: Class
com.ibm.wsdl.DefinitionImpl does not implement the requested interface
javax.wsdl.extensions.AttributeExtensible

    at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory
.initializeBean(AbstractAutowireCapableBeanFactory.java:1175)

    at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory
.createBean(AbstractAutowireCapableBeanFactory.java:427)

    at
org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(Ab
stractBeanFactory.java:249)

    at
org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSi
ngleton(DefaultSingletonBeanRegistry.java:155)

    at
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(Abstra
ctBeanFactory.java:246)

    at
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(Abstra
ctBeanFactory.java:160)

    at org.springframework.beans.factory.support.DefaultListableBeanFactory.
preInstantiateSingletons(DefaultListableBeanFactory.java:291)

    at
org.springframework.context.support.AbstractApplicationContext.refresh(Abstr
actApplicationContext.java:352)

    at
org.apache.cxf.bus.spring.BusApplicationContext.<init>(BusApplicationContext
.java:86)

    at
org.apache.cxf.bus.spring.SpringBusFactory.createBus(SpringBusFactory.java:9
3)

    ... 5 more

Caused by: java.lang.IncompatibleClassChangeError: Class
com.ibm.wsdl.DefinitionImpl does not implement the requested interface
javax.wsdl.extensions.AttributeExtensible

    at
org.apache.cxf.wsdl11.WSDLServiceBuilder.copyExtensionAttributes(WSDLService
Builder.java:120)

    at
org.apache.cxf.wsdl11.WSDLServiceBuilder.buildServices(WSDLServiceBuilder.ja
va:236)

    at
org.apache.cxf.wsdl11.WSDLServiceBuilder.buildServices(WSDLServiceBuilder.ja
va:153)

    at
org.apache.cxf.wsdl11.WSDLServiceFactory.create(WSDLServiceFactory.java:117)

    at
org.apache.cxf.service.factory.ReflectionServiceFactoryBean.buildServiceFrom
WSDL(ReflectionServiceFactoryBean.java:300)

    at
org.apache.cxf.service.factory.ReflectionServiceFactoryBean.initializeServic
eModel(ReflectionServiceFactoryBean.java:392)

    at
org.apache.cxf.service.factory.ReflectionServiceFactoryBean.create(Reflectio
nServiceFactoryBean.java:180)

    at
org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean.create(JaxWsServiceFact
oryBean.java:163)

    at
org.apache.cxf.frontend.AbstractWSDLBasedEndpointFactory.createEndpoint(Abst
ractWSDLBasedEndpointFactory.java:79)

    at
org.apache.cxf.frontend.ServerFactoryBean.create(ServerFactoryBean.java:114)

    at
org.apache.cxf.jaxws.JaxWsServerFactoryBean.create(JaxWsServerFactoryBean.ja
va:160)

    at org.apache.cxf.jaxws.EndpointImpl.getServer(EndpointImpl.java:322)

    at org.apache.cxf.jaxws.EndpointImpl.doPublish(EndpointImpl.java:244)

    at org.apache.cxf.jaxws.EndpointImpl.publish(EndpointImpl.java:194)

    at org.apache.cxf.jaxws.EndpointImpl.publish(EndpointImpl.java:380)

    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:1242)

    at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory
.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1208)

    at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory
.initializeBean(AbstractAutowireCapableBeanFactory.java:1172)

    ... 14 more

 

the version of WDSL4J in CXF 2.1.1 is 1.6.1. Who can tell me how to resolve
this problem,thanks!

Reply via email to