Configuring CXF address
tysgodhi Jan 19, 2009 1:52 PMI've succeeded in bundling my own CFX service using OSGI and getting ESB to run it, but only at port 8080 in the /cxf URL. When I try to publish it to a different URL by using a fully-qualified address in the endpoint element of beans.xml, as shown in the example in Developing and Deploying JAX-WS Applications with FUSE ESB, I get the following stack trace. Where/how can the full URL for a service be configured, and is it possible to configure listeners at multiple ports?
Exception in thread "SpringOsgiExtenderThread-64" org.springframework.beans.fact
ory.BeanCreationException: Error creating bean with name 'helloWorld': Invocatio
n of init method failed; nested exception is javax.xml.ws.WebServiceException: j
ava.lang.IllegalStateException: Endpoint address should be a relative URI wrt to
the servlet address (use '/xxx' for example)
at org.springframework.beans.factory.support.AbstractAutowireCapableBean
Factory.initializeBean(AbstractAutowireCapableBeanFactory.java:1337)
at org.springframework.beans.factory.support.AbstractAutowireCapableBean
Factory.doCreateBean(AbstractAutowireCapableBeanFactory.java:473)
at org.springframework.beans.factory.support.AbstractAutowireCapableBean
Factory$1.run(AbstractAutowireCapableBeanFactory.java:409)
at java.security.AccessController.doPrivileged(Native Method)
at org.springframework.beans.factory.support.AbstractAutowireCapableBean
Factory.createBean(AbstractAutowireCapableBeanFactory.java:380)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getOb
ject(AbstractBeanFactory.java:264)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistr
y.getSingleton(DefaultSingletonBeanRegistry.java:221)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBe
an(AbstractBeanFactory.java:261)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean
(AbstractBeanFactory.java:185)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean
(AbstractBeanFactory.java:164)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.
preInstantiateSingletons(DefaultListableBeanFactory.java:429)
at org.springframework.context.support.AbstractApplicationContext.finish
BeanFactoryInitialization(AbstractApplicationContext.java:729)
at org.springframework.osgi.context.support.AbstractDelegatedExecutionAp
plicationContext.completeRefresh(AbstractDelegatedExecutionApplicationContext.ja
va:276)
at org.springframework.osgi.extender.internal.dependencies.startup.Depen
dencyWaiterApplicationContextExecutor$CompleteRefreshTask.run(DependencyWaiterAp
plicationContextExecutor.java:145)
at java.lang.Thread.run(Thread.java:619)
Caused by: javax.xml.ws.WebServiceException: java.lang.IllegalStateException: En
dpoint address should be a relative URI wrt to the servlet address (use '/xxx' f
or example)
at org.apache.cxf.jaxws.EndpointImpl.doPublish(EndpointImpl.java:267)
at org.apache.cxf.jaxws.EndpointImpl.publish(EndpointImpl.java:201)
at org.apache.cxf.jaxws.EndpointImpl.publish(EndpointImpl.java:394)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.springframework.beans.factory.support.AbstractAutowireCapableBean
Factory.invokeCustomInitMethod(AbstractAutowireCapableBeanFactory.java:1413)
at org.springframework.beans.factory.support.AbstractAutowireCapableBean
Factory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1374)
at org.springframework.beans.factory.support.AbstractAutowireCapableBean
Factory.initializeBean(AbstractAutowireCapableBeanFactory.java:1334)
... 14 more
Caused by: java.lang.IllegalStateException: Endpoint address should be a relativ
e URI wrt to the servlet address (use '/xxx' for example)
at org.apache.servicemix.cxf.transport.http_osgi.OsgiTransportFactory.ge
tDestination(OsgiTransportFactory.java:59)
at org.apache.cxf.endpoint.ServerImpl.initDestination(ServerImpl.java:90
)
at org.apache.cxf.endpoint.ServerImpl.(ServerImpl.java:69)
at org.apache.cxf.frontend.ServerFactoryBean.create(ServerFactoryBean.ja
va:118)
at org.apache.cxf.jaxws.JaxWsServerFactoryBean.create(JaxWsServerFactory
Bean.java:168)
at org.apache.cxf.jaxws.EndpointImpl.getServer(EndpointImpl.java:336)
at org.apache.cxf.jaxws.EndpointImpl.doPublish(EndpointImpl.java:251)
... 23 more