One Star

[resolved] Problem when deploying on karaf container

Hi,
i can't deploy a tRest service (with tRestRequest and tRestResponse) on Karaf. The service works fine when i deploying on Studio, but when i export the job (.jar for bundle osgi), Karaf can't deploy, here the stack trace (v5.3.0 RC1 and RC2, i need v5.3.0 because i have a problem with trest component in older version):

karaf@trun> Exception in thread "SpringOsgiExtenderThread-2" org.springframework
.beans.factory.BeanCreationException: Error creating bean with name 'service': C
annot resolve reference to bean 'wrongCallHandler' while setting bean property '
providers' with key ; nested exception is org.springframework.beans.factory.B
eanCreationException: Error creating bean with name 'wrongCallHandler' defined i
n URL : Resolution of
declared constructors on bean Class from ClassLoader ] failed;
nested exception is java.lang.LinkageError: loader constraint violation: when r
esolving overridden method "vifproject.pan_mainv3_0_3.PAN_mainv3$ExceptionMapper
4TalendJobRestService.toResponse(Ljavax/ws/rs/WebApplicationExceptionSmiley WinkLjavax/ws
/rs/core/Response;" the class loader (instance of org/eclipse/osgi/internal/base
adaptor/DefaultClassLoader) of the current class, vifproject/pan_mainv3_0_3/PAN_
mainv3$ExceptionMapper4TalendJobRestService, and its superclass loader (instance
of org/eclipse/osgi/internal/baseadaptor/DefaultClassLoader), have different Cl
ass objects for the type javax/ws/rs/WebApplicationException used in the signatu
re
at org.springframework.beans.factory.support.BeanDefinitionValueResolver
.resolveReference(BeanDefinitionValueResolver.java:329)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver
.resolveValueIfNecessary(BeanDefinitionValueResolver.java:107)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver
.resolveManagedList(BeanDefinitionValueResolver.java:354)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver
.resolveValueIfNecessary(BeanDefinitionValueResolver.java:154)
at org.springframework.beans.factory.support.AbstractAutowireCapableBean
Factory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1360)
at org.springframework.beans.factory.support.AbstractAutowireCapableBean
Factory.populateBean(AbstractAutowireCapableBeanFactory.java:1118)
at org.springframework.beans.factory.support.AbstractAutowireCapableBean
Factory.doCreateBean(AbstractAutowireCapableBeanFactory.java:517)
at org.springframework.beans.factory.support.AbstractAutowireCapableBean
Factory.createBean(AbstractAutowireCapableBeanFactory.java:456)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getOb
ject(AbstractBeanFactory.java:294)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistr
y.getSingleton(DefaultSingletonBeanRegistry.java:225)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBe
an(AbstractBeanFactory.java:291)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean
(AbstractBeanFactory.java:193)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.
preInstantiateSingletons(DefaultListableBeanFactory.java:607)
at org.springframework.context.support.AbstractApplicationContext.finish
BeanFactoryInitialization(AbstractApplicationContext.java:925)
at org.springframework.osgi.context.support.AbstractDelegatedExecutionAp
plicationContext.access$1600(AbstractDelegatedExecutionApplicationContext.java:6
9)
at org.springframework.osgi.context.support.AbstractDelegatedExecutionAp
plicationContext$4.run(AbstractDelegatedExecutionApplicationContext.java:355)
at org.springframework.osgi.util.internal.PrivilegedUtils.executeWithCus
tomTCCL(PrivilegedUtils.java:85)
at org.springframework.osgi.context.support.AbstractDelegatedExecutionAp
plicationContext.completeRefresh(AbstractDelegatedExecutionApplicationContext.ja
va:320)
at org.springframework.osgi.extender.internal.dependencies.startup.Depen
dencyWaiterApplicationContextExecutor$CompleteRefreshTask.run(DependencyWaiterAp
plicationContextExecutor.java:132)
at java.lang.Thread.run(Thread.java:662)
Caused by: org.springframework.beans.factory.BeanCreationException: Error creati
ng bean with name 'wrongCallHandler' defined in URL : Resolution of declared constructors on bean Clas
s fr
om ClassLoader ] failed; nested exception is java.lang.Lin
kageError: loader constraint violation: when resolving overridden method "vifpro
ject.pan_mainv3_0_3.PAN_mainv3$ExceptionMapper4TalendJobRestService.toResponse(L
javax/ws/rs/WebApplicationExceptionSmiley WinkLjavax/ws/rs/core/Response;" the class load
er (instance of org/eclipse/osgi/internal/baseadaptor/DefaultClassLoader) of the
current class, vifproject/pan_mainv3_0_3/PAN_mainv3$ExceptionMapper4TalendJobRe
stService, and its superclass loader (instance of org/eclipse/osgi/internal/base
adaptor/DefaultClassLoader), have different Class objects for the type javax/ws/
rs/WebApplicationException used in the signature
at org.springframework.beans.factory.support.ConstructorResolver.autowir
eConstructor(ConstructorResolver.java:160)
at org.springframework.beans.factory.support.AbstractAutowireCapableBean
Factory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:1035)
at org.springframework.beans.factory.support.AbstractAutowireCapableBean
Factory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:939)
at org.springframework.beans.factory.support.AbstractAutowireCapableBean
Factory.doCreateBean(AbstractAutowireCapableBeanFactory.java:485)
at org.springframework.beans.factory.support.AbstractAutowireCapableBean
Factory.createBean(AbstractAutowireCapableBeanFactory.java:456)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getOb
ject(AbstractBeanFactory.java:294)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistr
y.getSingleton(DefaultSingletonBeanRegistry.java:225)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBe
an(AbstractBeanFactory.java:291)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean
(AbstractBeanFactory.java:193)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver
.resolveReference(BeanDefinitionValueResolver.java:323)
... 19 more
Caused by: java.lang.LinkageError: loader constraint violation: when resolving o
verridden method "vifproject.pan_mainv3_0_3.PAN_mainv3$ExceptionMapper4TalendJob
RestService.toResponse(Ljavax/ws/rs/WebApplicationExceptionSmiley WinkLjavax/ws/rs/core/R
esponse;" the class loader (instance of org/eclipse/osgi/internal/baseadaptor/De
faultClassLoader) of the current class, vifproject/pan_mainv3_0_3/PAN_mainv3$Exc
eptionMapper4TalendJobRestService, and its superclass loader (instance of org/ec
lipse/osgi/internal/baseadaptor/DefaultClassLoader), have different Class object
s for the type javax/ws/rs/WebApplicationException used in the signature
at java.lang.Class.getDeclaredConstructors0(Native Method)
at java.lang.Class.privateGetDeclaredConstructors(Class.java:2389)
at java.lang.Class.getDeclaredConstructors(Class.java:1836)
at org.springframework.beans.factory.support.ConstructorResolver.autowir
eConstructor(ConstructorResolver.java:157)
... 28 more
Exception in thread "SpringOsgiExtenderThread-8" org.springframework.beans.facto
ry.BeanCreationException: Error creating bean with name 'eventFeature': FactoryB
ean threw exception on object creation; nested exception is org.springframework.
aop.framework.AopConfigException: Cannot proxy target class because CGLIB2 is no
t available. Add CGLIB to the class path or specify proxy interfaces.
at org.springframework.beans.factory.support.FactoryBeanRegistrySupport.
doGetObjectFromFactoryBean(FactoryBeanRegistrySupport.java:149)
at org.springframework.beans.factory.support.FactoryBeanRegistrySupport.
getObjectFromFactoryBean(FactoryBeanRegistrySupport.java:102)
at org.springframework.beans.factory.support.AbstractBeanFactory.getObje
ctForBeanInstance(AbstractBeanFactory.java:1442)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBe
an(AbstractBeanFactory.java:248)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean
(AbstractBeanFactory.java:193)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.
preInstantiateSingletons(DefaultListableBeanFactory.java:603)
at org.springframework.context.support.AbstractApplicationContext.finish
BeanFactoryInitialization(AbstractApplicationContext.java:925)
at org.springframework.osgi.context.support.AbstractDelegatedExecutionAp
plicationContext.access$1600(AbstractDelegatedExecutionApplicationContext.java:6
9)
at org.springframework.osgi.context.support.AbstractDelegatedExecutionAp
plicationContext$4.run(AbstractDelegatedExecutionApplicationContext.java:355)
at org.springframework.osgi.util.internal.PrivilegedUtils.executeWithCus
tomTCCL(PrivilegedUtils.java:85)
at org.springframework.osgi.context.support.AbstractDelegatedExecutionAp
plicationContext.completeRefresh(AbstractDelegatedExecutionApplicationContext.ja
va:320)
at org.springframework.osgi.extender.internal.dependencies.startup.Depen
dencyWaiterApplicationContextExecutor$CompleteRefreshTask.run(DependencyWaiterAp
plicationContextExecutor.java:132)
at java.lang.Thread.run(Thread.java:662)
Caused by: org.springframework.aop.framework.AopConfigException: Cannot proxy ta
rget class because CGLIB2 is not available. Add CGLIB to the class path or speci
fy proxy interfaces.
at org.springframework.aop.framework.DefaultAopProxyFactory.createAopPro
xy(DefaultAopProxyFactory.java:67)
at org.springframework.aop.framework.ProxyCreatorSupport.createAopProxy(
ProxyCreatorSupport.java:104)
at org.springframework.aop.framework.ProxyFactory.getProxy(ProxyFactory.
java:112)
at org.springframework.osgi.service.util.internal.aop.ProxyUtils$1.run(P
roxyUtils.java:65)
at java.security.AccessController.doPrivileged(Native Method)
at org.springframework.osgi.service.util.internal.aop.ProxyUtils.createP
roxy(ProxyUtils.java:62)
at org.springframework.osgi.service.util.internal.aop.ProxyUtils.createP
roxy(ProxyUtils.java:39)
at org.springframework.osgi.service.importer.support.AbstractServiceProx
yCreator.createServiceProxy(AbstractServiceProxyCreator.java:107)
at org.springframework.osgi.service.importer.support.OsgiServiceProxyFac
toryBean.createProxy(OsgiServiceProxyFactoryBean.java:206)
at org.springframework.osgi.service.importer.support.AbstractServiceImpo
rterProxyFactoryBean.getObject(AbstractServiceImporterProxyFactoryBean.java:86)
at org.springframework.osgi.service.importer.support.OsgiServiceProxyFac
toryBean.getObject(OsgiServiceProxyFactoryBean.java:161)
at org.springframework.beans.factory.support.FactoryBeanRegistrySupport.
doGetObjectFromFactoryBean(FactoryBeanRegistrySupport.java:142)
... 12 more
1 ACCEPTED SOLUTION

Accepted Solutions
One Star

Re: [resolved] Problem when deploying on karaf container

I found the solution (by chance)!
I work with tRestRequest and tRestResponse components and there is a limitation when you try to deploy on Karaf: you can't recover some son SubJobs you have in your main Job for Rest exposure! So if you have complex job you want split in subjobs, you only can do this with a SOAP job and deploy with a .kar in Karaf.
It is a bug?
Xavier
3 REPLIES
One Star

Re: [resolved] Problem when deploying on karaf container

I found the solution (by chance)!
I work with tRestRequest and tRestResponse components and there is a limitation when you try to deploy on Karaf: you can't recover some son SubJobs you have in your main Job for Rest exposure! So if you have complex job you want split in subjobs, you only can do this with a SOAP job and deploy with a .kar in Karaf.
It is a bug?
Xavier
One Star

Re: [resolved] Problem when deploying on karaf container

hi
i have the some issue can you explain how did you resolve it ;
One Star

Re: [resolved] Problem when deploying on karaf container

Hi,
if you use trest components and subjobs to exposure your web service, ... i doesn't know solution! My only solution is to change Rest exposure with SOAP exposure with tesb components to produce a .kar and deploy on Karaf. Only .kar is able to consider subjobs.
Did i answered to you?