Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
We have some REST services generated by Talend Studio ESB. If we deploy at the same machine where we develop them, work ok. However, we're developing our services in our DEVELOPMENT environment, and uploading and deploying them at INTEGRATION/TESTING environment. When we launch Karaf (trun.bat) in this environment appears some Java errors and our services are in state FAILED. What is the problem?
We export our services as OSGI for Bundle (.jar), we carry the file to INTEGRATION environment (container/deploy), but Karaf can't build and start them.
The error is:
Exception in thread "SpringOsgiExtenderThread-6" org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'service': 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.osgi.context.support.AbstractDelegatedExecutionApplicationContext.access$1600(AbstractDelegatedExecutionApplicationContext.java:69)
at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext$4.run(AbstractDelegatedExecutionApplicationContext.java:355)
at org.springframework.osgi.util.internal.PrivilegedUtils.executeWithCustomTCCL(PrivilegedUtils.java:85)
at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.completeRefresh(AbstractDelegatedExecutionApplicationContext.java:320)
at org.springframework.osgi.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor$CompleteRefreshTask.run(DependencyWaiterApplicationContextExecutor.java:132)
at java.lang.Thread.run(Thread.java:662)
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)
... 14 more
Caused by: org.apache.cxf.interceptor.Fault: Could not start Jetty server on port 8.115: Cannot assign requested address: bind
at org.apache.cxf.transport.http_jetty.JettyHTTPServerEngine.addServant(JettyHTTPServerEngine.java:386)
at org.apache.cxf.transport.http_jetty.JettyHTTPDestination.activate(JettyHTTPDestination.java:179)
at org.apache.cxf.transport.AbstractObservable.setMessageObserver(AbstractObservable.java:48)
at org.apache.cxf.binding.AbstractBaseBindingFactory.addListener(AbstractBaseBindingFactory.java:95)
at org.apache.cxf.endpoint.ServerImpl.start(ServerImpl.java:131)
at org.apache.cxf.jaxrs.JAXRSServerFactoryBean.create(JAXRSServerFactoryBean.java:192)
... 21 more
Caused by: java.net.BindException: Cannot assign requested address: bind
at sun.nio.ch.Net.bind(Native Method)
at sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:124)
at sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:59)
at org.eclipse.jetty.server.nio.SelectChannelConnector.open(SelectChannelConnector.java:187)
at org.eclipse.jetty.server.AbstractConnector.doStart(AbstractConnector.java:316)
at org.eclipse.jetty.server.nio.SelectChannelConnector.doStart(SelectChannelConnector.java:265)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)
at org.eclipse.jetty.server.Server.doStart(Server.java:286)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)
at org.apache.cxf.transport.http_jetty.JettyHTTPServerEngine.addServant(JettyHTTPServerEngine.java:375)
... 26 more
And after execute osgi:list:
karaf@trun> list
START LEVEL 100 , List Threshold: 50
ID State Blueprint Spring Level Name
Apache MINA Core (2.0.5)
Apache CXF Compatibility Bundle Jar (2.7.3)
camel-core (2.10.2)
camel-karaf-commands (2.10.5.SNAPSHOT)
camel-spring (2.10.2)
camel-blueprint (2.10.2)
camel-cxf-transport (2.10.2)
camel-cxf (2.10.2)
Commons Pool (1.6.0)
camel-jms (2.10.2)
Apache ServiceMix :: Bundles :: jdom (1.1.0.4)
OPS4J Pax Web - Jsp Support (1.1.4)
Commons JXPath (1.3)
Service Activity Monitoring :: Common (5.2.2)
Service Activity Monitoring :: Agent (5.2.2)
Talend :: ESB :: Job :: API (5.2.2)
Talend :: ESB :: LOCATOR :: AUTH (5.2.2)
Hosts: 186
ZooKeeper Bundle (3.3.6)
Fragments: 185
Service Locator Client for CXF (5.2.2)
Apache ServiceMix :: Bundles :: dom4j (1.6.1.5)
Apache ServiceMix :: Bundles :: jaxen (1.1.1.2)
Talend :: ESB :: Job :: Controller (5.2.2)
Commons Net (3.1.0)
Apache ServiceMix :: Bundles :: jsch (0.1.48.1)
camel-ftp (2.10.2)
Camel Talend Job Component (5.2.2)
Jolokia Agent (1.0.4)
Apache Karaf :: Shell :: Service Wrapper (2.2.9)
WSTestHandMadeWebService (0.1) (1.4)
Cheers
Thanks
Caused by: org.apache.cxf.interceptor.Fault: Could not start Jetty server on port 8.115: Cannot assign requested address: bind
<SERVER id="service" address="http://101.281.101.195:8115/">
<SERVICEBEANS>
<REF bean="serviceBean"></REF>
</SERVICEBEANS>
<PROVIDERS>
<REF bean="wrongCallHandler"></REF>
<REF bean="jsonProvider"></REF>
<REF bean="dom4jProvider"></REF>
</PROVIDERS>
</SERVER>