java.lang.NoSuchMethodError thrown for an installed maven osgi bundle
oren Jun 30, 2009 9:10 AMDear All,
I wrapped one of my non-OSGi maven projects as an OSGi bundle and installed it to FUSE ESB using
osgi/install -s wrap:mvn:edu.utah.further.core/core-api$Bundle-SymbolicName=further-core-api&Bundle-Version=1.0
Then I developed a BC that depends on core-api, and is fronted by a CXF web service (both are OSGi bundles).
osgi/install -s wrap:mvn:edu.utah.further.fqe/fqe-bc
osgi/install -s wrap:mvn:edu.utah.further.fqe/fqe-bc-ws
osgi/list displays:
FQE Binding Component (1.0.0.SNAPSHOT)
FQE Web Service (1.0.0.SNAPSHOT)
Note that the non-maven project is not started. Is that normal?
Anyway, when I call a method of the WS that invokes a fqe-bc method that invokes a core-api method called CollectionUtil.newMap(), I get that:
org.apache.cxf.interceptor.Fault: edu.utah.further.core.api.util.CollectionUtil.
newMap()Ljava/util/Map;
at org.apache.cxf.service.invoker.AbstractInvoker.createFault(AbstractIn
voker.java:148)
at org.apache.cxf.service.invoker.AbstractInvoker.invoke(AbstractInvoker
.java:114)
at org.apache.cxf.jaxrs.JAXRSInvoker.invoke(JAXRSInvoker.java:122)
at org.apache.cxf.jaxrs.JAXRSInvoker.invoke(JAXRSInvoker.java:70)
at org.apache.cxf.interceptor.ServiceInvokerInterceptor$1.run(ServiceInv
okerInterceptor.java:57)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:44
1)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
at java.util.concurrent.FutureTask.run(FutureTask.java:138)
at org.apache.cxf.workqueue.SynchronousExecutor.execute(SynchronousExecu
tor.java:37)
at org.apache.cxf.interceptor.ServiceInvokerInterceptor.handleMessage(Se
rviceInvokerInterceptor.java:95)
at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseIntercept
orChain.java:236)
at org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainIniti
ationObserver.java:89)
at org.apache.cxf.transport.http_jetty.JettyHTTPDestination.serviceReque
st(JettyHTTPDestination.java:302)
at org.apache.cxf.transport.http_jetty.JettyHTTPDestination.doService(Je
ttyHTTPDestination.java:265)
at org.apache.cxf.transport.http_jetty.JettyHTTPHandler.handle(JettyHTTP
Handler.java:70)
at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:7
66)
at org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHand
lerCollection.java:230)
at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:1
52)
at org.mortbay.jetty.Server.handle(Server.java:324)
at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:53
4)
at org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpCo
nnection.java:864)
at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:533)
at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:207)
at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:403)
at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.ja
va:409)
at org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.j
ava:522)
Caused by: java.lang.NoSuchMethodError: edu.utah.further.core.api.util.Collectio
nUtil.newMap()Ljava/util/Map;
at edu.utah.further.fqe.fqe_bc.FqeClientImpl.requestDataSourceStatus(Fqe
ClientImpl.java:125)
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.osgi.service.importer.support.internal.aop.Servic
eInvoker.doInvoke(ServiceInvoker.java:64)
at org.springframework.osgi.service.importer.support.internal.aop.Servic
eInvoker.invoke(ServiceInvoker.java:78)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(
ReflectiveMethodInvocation.java:171)
at org.springframework.aop.support.DelegatingIntroductionInterceptor.doP
roceed(DelegatingIntroductionInterceptor.java:131)
at org.springframework.aop.support.DelegatingIntroductionInterceptor.inv
oke(DelegatingIntroductionInterceptor.java:119)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(
ReflectiveMethodInvocation.java:171)
at org.springframework.osgi.service.util.internal.aop.ServiceTCCLInterce
ptor.invokeUnprivileged(ServiceTCCLInterceptor.java:57)
at org.springframework.osgi.service.util.internal.aop.ServiceTCCLInterce
ptor.invoke(ServiceTCCLInterceptor.java:40)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(
ReflectiveMethodInvocation.java:171)
at org.springframework.osgi.service.importer.support.LocalBundleContextA
dvice.invoke(LocalBundleContextAdvice.java:59)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(
ReflectiveMethodInvocation.java:171)
at org.springframework.aop.support.DelegatingIntroductionInterceptor.doP
roceed(DelegatingIntroductionInterceptor.java:131)
at org.springframework.aop.support.DelegatingIntroductionInterceptor.inv
oke(DelegatingIntroductionInterceptor.java:119)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(
ReflectiveMethodInvocation.java:171)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynami
cAopProxy.java:204)
at $Proxy78.requestDataSourceStatus(Unknown Source)
at edu.utah.further.fqe.fqe_bc_ws.FqeServiceFrontEndRestImpl.requestData
SourceStatus(FqeServiceFrontEndRestImpl.java:146)
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.apache.cxf.service.invoker.AbstractInvoker.performInvocation(Abst
ractInvoker.java:166)
at org.apache.cxf.service.invoker.AbstractInvoker.invoke(AbstractInvoker
.java:82)
... 24 more
Why is my method not found? I think I declared it correctly in the felix plugin. Here are the headers of these projects (produced with osgi/header):
Bundle 179
-
Archiver-Version = Plexus Archiver
Tool = Bnd-unknown version
Export-Package = edu.utah.further.core.api.util;uses:="edu.utah.further.core.api
.constant,edu.utah.further.core.api.misc,org.apache.commons.lang",edu.utah.furth
er.core.api.misc,edu.utah.further.core.api.constant,edu.utah.further.core.api.ws
;uses:="org.apache.commons.logging,edu.utah.further.core.api.util,org.apache.com
mons.lang.builder,javax.xml.bind.annotation,edu.utah.further.core.api.misc",edu.
utah.further.core.api.annotation
Generated-By-Ops4j-Pax-From = wrap:mvn:edu.utah.further.core/core-api$Bundle-Sym
bolicName=further-core-api&Bundle-Version=1.0
Bundle-Version = 1.0
Build-Jdk = 1.6.0_10
Created-By = 1.6.0_10 (Sun Microsystems Inc.)
Bundle-ManifestVersion = 2
Manifest-Version = 1.0
Bnd-LastModified = 1246325100321
Originally-Created-By = Apache Maven
Built-By = Oren Livne
Import-Package = edu.utah.further.core.api.annotation;resolution:=optional,edu.u
tah.further.core.api.constant;resolution:=optional,edu.utah.further.core.api.mis
c;resolution:=optional,edu.utah.further.core.api.util;resolution:=optional,edu.u
tah.further.core.api.ws;resolution:=optional,javax.xml.bind.annotation;resolutio
n:=optional,org.apache.commons.lang;resolution:=optional,org.apache.commons.lang
.builder;resolution:=optional,org.apache.commons.logging;resolution:=optional
Bundle-SymbolicName = further-core-api
FQE Binding Component (199)
-
Tool = Bnd-0.0.238
Bundle-Description = Federated Query Engine - Binding Component
Export-Package = edu.utah.further.fqe.fqe_bc;uses:="org.apache.camel.builder,org
.apache.camel.model,javax.annotation,edu.utah.further.core.api.util,org.apache.c
amel,org.slf4j,org.apache.commons.lang,org.springframework.beans.factory"
Bundle-Version = 1.0.0.SNAPSHOT
Build-Jdk = 1.6.0_10
Created-By = Apache Maven Bundle Plugin
Bundle-ManifestVersion = 2
Manifest-Version = 1.0
Bnd-LastModified = 1246333968914
Bundle-Name = FQE Binding Component
Built-By = Oren Livne
Import-Package = edu.utah.further.core.api.util,edu.utah.further.fqe.fqe_bc,java
x.annotation;version="1.0",javax.jms;version="1.1",org.apache.activemq,org.apach
e.camel;version="1.6.0.fuse",org.apache.camel.builder;version="1.6.0.fuse",org.a
pache.camel.component.jms;version="1.6.0.fuse",org.apache.camel.model;version="1
.6.0.fuse",org.apache.camel.osgi,org.apache.commons.lang;version="2.4",org.slf4j
,org.springframework.beans.factory;version="2.5",org.springframework.context;ver
sion="2.5"
Bundle-SymbolicName = edu.utah.further.fqe.fqe-bc
FQE Web Service (202)
-
Tool = Bnd-0.0.238
Bundle-Description = Federated query engine
Export-Package = edu.utah.further.fqe.fqe_bc_ws;uses:="org.apache.cxf.aegis.type
.java5,javax.annotation,javax.ws.rs,edu.utah.further.fqe.fqe_bc,org.slf4j,org.sp
ringframework.beans.factory,edu.utah.further.fqe.fqe_se_simple"
Bundle-Version = 1.0.0.SNAPSHOT
Build-Jdk = 1.6.0_10
Created-By = Apache Maven Bundle Plugin
Bundle-ManifestVersion = 2
Manifest-Version = 1.0
Bnd-LastModified = 1246334000133
Bundle-Name = FQE Web Service
Built-By = Oren Livne
Import-Package = META-INF.cxf,META-INF.cxf.osgi,edu.utah.further.fqe.fqe_bc,edu.
utah.further.fqe.fqe_bc_ws,edu.utah.further.fqe.fqe_se_simple,javax.annotation;v
ersion="1.0",javax.ws.rs;version="1.0",javax.wsdl,org.apache.cxf.aegis.type.java
5;version="2.2.0.fuse",org.apache.cxf.binding;version="2.2.0.fuse",org.apache.cx
f.bus;version="2.2.0.fuse",org.apache.cxf.bus.resource;version="2.2.0.fuse",org.
apache.cxf.bus.spring;version="2.2.0.fuse",org.apache.cxf.configuration.spring;v
ersion="2.2.0.fuse",org.apache.cxf.jaxrs.utils;version="2.2.0.fuse",org.apache.c
xf.resource;version="2.2.0.fuse",org.apache.servicemix.cxf.transport.http_osgi,o
rg.codehaus.jra,org.slf4j,org.springframework.beans.factory;version="2.5",org.sp
ringframework.beans.factory.config;version="2.5"
Bundle-SymbolicName = edu.utah.further.fqe.fqe-bc-ws
Require-Bundle = org.apache.cxf.cxf-bundle
Thank you in advance.
Oren
P.S. Attached is fqe-bc's pom file.
-
pom.xml 7.2 KB