You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@karaf.apache.org by Chris Geer <ch...@cxtsoftware.com> on 2012/07/04 00:30:27 UTC

Karaf Blueprint generates null service lookups

 I recently ran into a weird issue where the first time a service is
referenced the
org.apache.aries.blueprint.container.ReferenceRecipe.getService() call
returns null. After that first call it works fine but it's causing no end
of problems on system startup (10 services or so all failing on their first
call). My setup is that I have a CXF JAX-RS web service that has references
to my various OSGI services. When a call comes in, the JAX-RS service calls
the correct OSGI service and then returns the appropriate data. All the
services are starting properly and bring wired up properly.
(default-activation=lazy)

I've tried this with Karaf 2.2.7 and 2.2.8 and get the same problem. I
didn't see this problem using 2.2.7 previously so I'm guessing it's related
to upgrading to the newer 1.6.0_33 JDK and this bug
ARIES-861<https://issues.apache.org/jira/browse/ARIES-861>
.

Is there anyway to resolve this other than changing VMs? I've tried adding
explicit no-arg constructors, specifying an init method....

Thanks,
Chris

Stack Trace (with Debug)

14:41:14,036 | DEBUG | lixDispatchQueue | account
 | 217 - account - 1.0.0.SNAPSHOT | FrameworkEvent ERROR
org.osgi.framework.ServiceException: Service factory exception: (class:
com/cxtsoftware/p141/services/account/impl/$AccountServiceImpl1183864159,
method: <init> signature: (Ljava/lang/reflect/InvocationHandler;)V) Call to
wrong initialization method
at
org.apache.felix.framework.ServiceRegistrationImpl.getFactoryUnchecked(ServiceRegistrationImpl.java:314)
at
org.apache.felix.framework.ServiceRegistrationImpl.getService(ServiceRegistrationImpl.java:221)
at
org.apache.felix.framework.ServiceRegistry.getService(ServiceRegistry.java:297)
at org.apache.felix.framework.Felix.getService(Felix.java:3021)
at
org.apache.felix.framework.BundleContextImpl.getService(BundleContextImpl.java:329)
at
org.apache.aries.blueprint.container.BlueprintContainerImpl.getService(BlueprintContainerImpl.java:422)
at
org.apache.aries.blueprint.container.ReferenceRecipe.getService(ReferenceRecipe.java:185)
at
org.apache.aries.blueprint.container.ReferenceRecipe.access$000(ReferenceRecipe.java:49)
at
org.apache.aries.blueprint.container.ReferenceRecipe$ServiceDispatcher.call(ReferenceRecipe.java:206)
at org.apache.aries.proxy.impl.ProxyHandler$1.invoke(ProxyHandler.java:50)
at org.apache.aries.proxy.impl.DefaultWrapper.invoke(DefaultWrapper.java:31)
at org.apache.aries.proxy.impl.ProxyHandler.invoke(ProxyHandler.java:78)
at $Proxy87.findAccounts(Unknown Source)
at
com.cxtsoftware.p141.services.operations.AccountsResource.findAccounts(AccountsResource.java:50)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)[:1.6.0_33]
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)[:1.6.0_33]
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)[:1.6.0_33]
at java.lang.reflect.Method.invoke(Method.java:597)[:1.6.0_33]
at
org.apache.cxf.service.invoker.AbstractInvoker.performInvocation(AbstractInvoker.java:180)
at
org.apache.cxf.service.invoker.AbstractInvoker.invoke(AbstractInvoker.java:96)
at
org.apache.cxf.jaxrs.JAXRSInvoker.invoke(JAXRSInvoker.java:167)[153:org.apache.cxf.cxf-rt-frontend-jaxrs:2.6.1]
at
com.cxtsoftware.p141.commons.web.SubjectInvoker.internalInvoke(SubjectInvoker.java:40)[208:web:1.0.0.SNAPSHOT]
at
com.cxtsoftware.p141.commons.web.SubjectInvoker.access$000(SubjectInvoker.java:23)[208:web:1.0.0.SNAPSHOT]
at
com.cxtsoftware.p141.commons.web.SubjectInvoker$1.run(SubjectInvoker.java:34)
at java.security.AccessController.doPrivileged(Native Method)[:1.6.0_33]
at javax.security.auth.Subject.doAs(Subject.java:337)[:1.6.0_33]
at
com.cxtsoftware.p141.commons.web.SubjectInvoker.invoke(SubjectInvoker.java:30)[208:web:1.0.0.SNAPSHOT]
at
org.apache.cxf.jaxrs.JAXRSInvoker.invoke(JAXRSInvoker.java:94)[153:org.apache.cxf.cxf-rt-frontend-jaxrs:2.6.1]
at
org.apache.cxf.interceptor.ServiceInvokerInterceptor$1.run(ServiceInvokerInterceptor.java:58)[140:org.apache.cxf.cxf-api:2.6.1]
at
org.apache.cxf.interceptor.ServiceInvokerInterceptor.handleMessage(ServiceInvokerInterceptor.java:94)[140:org.apache.cxf.cxf-api:2.6.1]
at
org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:262)[140:org.apache.cxf.cxf-api:2.6.1]
at
org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:122)[140:org.apache.cxf.cxf-api:2.6.1]
at
org.apache.cxf.transport.http.AbstractHTTPDestination.invoke(AbstractHTTPDestination.java:211)[147:org.apache.cxf.cxf-rt-transports-http:2.6.1]
at
org.apache.cxf.transport.servlet.ServletController.invokeDestination(ServletController.java:213)[147:org.apache.cxf.cxf-rt-transports-http:2.6.1]
at
org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:154)[147:org.apache.cxf.cxf-rt-transports-http:2.6.1]
at
org.apache.cxf.transport.servlet.CXFNonSpringServlet.invoke(CXFNonSpringServlet.java:129)[147:org.apache.cxf.cxf-rt-transports-http:2.6.1]
at
org.apache.cxf.transport.servlet.AbstractHTTPServlet.handleRequest(AbstractHTTPServlet.java:187)[147:org.apache.cxf.cxf-rt-transports-http:2.6.1]
at
org.apache.cxf.transport.servlet.AbstractHTTPServlet.doGet(AbstractHTTPServlet.java:115)[147:org.apache.cxf.cxf-rt-transports-http:2.6.1]
at
javax.servlet.http.HttpServlet.service(HttpServlet.java:693)[92:org.apache.geronimo.specs.geronimo-servlet_2.5_spec:1.1.2]
at
org.apache.cxf.transport.servlet.AbstractHTTPServlet.service(AbstractHTTPServlet.java:166)[147:org.apache.cxf.cxf-rt-transports-http:2.6.1]
at
org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:547)[102:org.eclipse.jetty.servlet:7.5.4.v20111024]
at
org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:480)[102:org.eclipse.jetty.servlet:7.5.4.v20111024]
at
org.ops4j.pax.web.service.jetty.internal.HttpServiceServletHandler.doHandle(HttpServiceServletHandler.java:70)[112:org.ops4j.pax.web.pax-web-jetty:1.0.11]
at
org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:119)[100:org.eclipse.jetty.server:7.5.4.v20111024]
at
org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:520)[101:org.eclipse.jetty.security:7.5.4.v20111024]
at
org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:227)[100:org.eclipse.jetty.server:7.5.4.v20111024]
at
org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:941)[100:org.eclipse.jetty.server:7.5.4.v20111024]
at
org.ops4j.pax.web.service.jetty.internal.HttpServiceContext.doHandle(HttpServiceContext.java:117)[112:org.ops4j.pax.web.pax-web-jetty:1.0.11]
at
org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:409)[102:org.eclipse.jetty.servlet:7.5.4.v20111024]
at
org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:186)[100:org.eclipse.jetty.server:7.5.4.v20111024]
at
org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:875)[100:org.eclipse.jetty.server:7.5.4.v20111024]
at
org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:117)[100:org.eclipse.jetty.server:7.5.4.v20111024]
at
org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:149)[100:org.eclipse.jetty.server:7.5.4.v20111024]
at
org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:110)[100:org.eclipse.jetty.server:7.5.4.v20111024]
at
org.eclipse.jetty.server.Server.handle(Server.java:345)[100:org.eclipse.jetty.server:7.5.4.v20111024]
at
org.eclipse.jetty.server.HttpConnection.handleRequest(HttpConnection.java:441)[100:org.eclipse.jetty.server:7.5.4.v20111024]
at
org.eclipse.jetty.server.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:919)[100:org.eclipse.jetty.server:7.5.4.v20111024]
at
org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:582)[96:org.eclipse.jetty.http:7.5.4.v20111024]
at
org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:218)[96:org.eclipse.jetty.http:7.5.4.v20111024]
at
org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:51)[100:org.eclipse.jetty.server:7.5.4.v20111024]
at
org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:586)[95:org.eclipse.jetty.io:7
.5.4.v20111024]
at
org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:44)[95:org.eclipse.jetty.io:7
.5.4.v20111024]
at
org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:598)[94:org.eclipse.jetty.util:7.5.4.v20111024]
at
org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:533)[94:org.eclipse.jetty.util:7.5.4.v20111024]
at java.lang.Thread.run(Thread.java:680)[:1.6.0_33]
Caused by: java.lang.VerifyError: (class:
com/cxtsoftware/p141/services/account/impl/$AccountServiceImpl1183864159,
method: <init> signature: (Ljava/lang/reflect/InvocationHandler;)V) Call to
wrong initialization method
at java.lang.Class.getDeclaredConstructors0(Native Method)[:1.6.0_33]
at
java.lang.Class.privateGetDeclaredConstructors(Class.java:2389)[:1.6.0_33]
at java.lang.Class.getConstructor0(Class.java:2699)[:1.6.0_33]
at java.lang.Class.getConstructor(Class.java:1657)[:1.6.0_33]
at
org.apache.aries.proxy.impl.gen.ProxySubclassGenerator.newProxySubclassInstance(ProxySubclassGenerator.java:159)
at
org.apache.aries.proxy.impl.AsmProxyManager.createNewProxy(AsmProxyManager.java:81)
at
org.apache.aries.proxy.impl.AbstractProxyManager.createProxy(AbstractProxyManager.java:50)
at
org.apache.aries.blueprint.container.BeanRecipe.addInterceptors(BeanRecipe.java:690)
at
org.apache.aries.blueprint.container.BeanRecipe.internalCreate(BeanRecipe.java:730)
at
org.apache.aries.blueprint.di.AbstractRecipe.create(AbstractRecipe.java:64)
at org.apache.aries.blueprint.di.RefRecipe.internalCreate(RefRecipe.java:60)
at
org.apache.aries.blueprint.di.AbstractRecipe.create(AbstractRecipe.java:64)
at
org.apache.aries.blueprint.container.BlueprintRepository.createInstances(BlueprintRepository.java:219)
at
org.apache.aries.blueprint.container.BlueprintRepository.createInstance(BlueprintRepository.java:198)
at
org.apache.aries.blueprint.container.BlueprintRepository.create(BlueprintRepository.java:137)
at
org.apache.aries.blueprint.container.ServiceRecipe.createRecipe(ServiceRecipe.java:370)
at
org.apache.aries.blueprint.container.ServiceRecipe.createService(ServiceRecipe.java:278)
at
org.apache.aries.blueprint.container.ServiceRecipe.internalGetService(ServiceRecipe.java:248)
at
org.apache.aries.blueprint.container.ServiceRecipe.getService(ServiceRecipe.java:327)
at
org.apache.aries.blueprint.container.ServiceRecipe$TriggerServiceFactory.getService(ServiceRecipe.java:430)
at
org.apache.felix.framework.ServiceRegistrationImpl.getFactoryUnchecked(ServiceRegistrationImpl.java:310)
... 64 more
14:41:14,040 | ERROR | rations/accounts | JAXRSExceptionMapper
| 208 - web - 1.0.0.SNAPSHOT | Error caught in ExceptionMapper
java.lang.IllegalStateException: getService() returned null for
[com.cxtsoftware.p141.services.account.AccountService]
at
org.apache.aries.blueprint.container.ReferenceRecipe.getService(ReferenceRecipe.java:188)
at
org.apache.aries.blueprint.container.ReferenceRecipe.access$000(ReferenceRecipe.java:49)
at
org.apache.aries.blueprint.container.ReferenceRecipe$ServiceDispatcher.call(ReferenceRecipe.java:206)
at org.apache.aries.proxy.impl.ProxyHandler$1.invoke(ProxyHandler.java:50)
at org.apache.aries.proxy.impl.DefaultWrapper.invoke(DefaultWrapper.java:31)
at org.apache.aries.proxy.impl.ProxyHandler.invoke(ProxyHandler.java:78)
at $Proxy87.findAccounts(Unknown Source)
at
com.cxtsoftware.p141.services.operations.AccountsResource.findAccounts(AccountsResource.java:50)[229:operations-service:1.0.0.SNAPSHOT]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)[:1.6.0_33]
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)[:1.6.0_33]
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)[:1.6.0_33]
at java.lang.reflect.Method.invoke(Method.java:597)[:1.6.0_33]
at
org.apache.cxf.service.invoker.AbstractInvoker.performInvocation(AbstractInvoker.java:180)[140:org.apache.cxf.cxf-api:2.6.1]
at
org.apache.cxf.service.invoker.AbstractInvoker.invoke(AbstractInvoker.java:96)[140:org.apache.cxf.cxf-api:2.6.1]
at
org.apache.cxf.jaxrs.JAXRSInvoker.invoke(JAXRSInvoker.java:167)[153:org.apache.cxf.cxf-rt-frontend-jaxrs:2.6.1]
at
com.cxtsoftware.p141.commons.web.SubjectInvoker.internalInvoke(SubjectInvoker.java:40)[208:web:1.0.0.SNAPSHOT]
at
com.cxtsoftware.p141.commons.web.SubjectInvoker.access$000(SubjectInvoker.java:23)[208:web:1.0.0.SNAPSHOT]
at
com.cxtsoftware.p141.commons.web.SubjectInvoker$1.run(SubjectInvoker.java:34)[208:web:1.0.0.SNAPSHOT]
at java.security.AccessController.doPrivileged(Native Method)[:1.6.0_33]
at javax.security.auth.Subject.doAs(Subject.java:337)[:1.6.0_33]
at
com.cxtsoftware.p141.commons.web.SubjectInvoker.invoke(SubjectInvoker.java:30)[208:web:1.0.0.SNAPSHOT]
at
org.apache.cxf.jaxrs.JAXRSInvoker.invoke(JAXRSInvoker.java:94)[153:org.apache.cxf.cxf-rt-frontend-jaxrs:2.6.1]
at
org.apache.cxf.interceptor.ServiceInvokerInterceptor$1.run(ServiceInvokerInterceptor.java:58)[140:org.apache.cxf.cxf-api:2.6.1]
at
org.apache.cxf.interceptor.ServiceInvokerInterceptor.handleMessage(ServiceInvokerInterceptor.java:94)[140:org.apache.cxf.cxf-api:2.6.1]
at
org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:262)[140:org.apache.cxf.cxf-api:2.6.1]
at
org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:122)[140:org.apache.cxf.cxf-api:2.6.1]
at
org.apache.cxf.transport.http.AbstractHTTPDestination.invoke(AbstractHTTPDestination.java:211)[147:org.apache.cxf.cxf-rt-transports-http:2.6.1]
at
org.apache.cxf.transport.servlet.ServletController.invokeDestination(ServletController.java:213)[147:org.apache.cxf.cxf-rt-transports-http:2.6.1]
at
org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:154)[147:org.apache.cxf.cxf-rt-transports-http:2.6.1]
at
org.apache.cxf.transport.servlet.CXFNonSpringServlet.invoke(CXFNonSpringServlet.java:129)[147:org.apache.cxf.cxf-rt-transports-http:2.6.1]
at
org.apache.cxf.transport.servlet.AbstractHTTPServlet.handleRequest(AbstractHTTPServlet.java:187)[147:org.apache.cxf.cxf-rt-transports-http:2.6.1]
at
org.apache.cxf.transport.servlet.AbstractHTTPServlet.doGet(AbstractHTTPServlet.java:115)[147:org.apache.cxf.cxf-rt-transports-http:2.6.1]
at
javax.servlet.http.HttpServlet.service(HttpServlet.java:693)[92:org.apache.geronimo.specs.geronimo-servlet_2.5_spec:1.1.2]
at
org.apache.cxf.transport.servlet.AbstractHTTPServlet.service(AbstractHTTPServlet.java:166)[147:org.apache.cxf.cxf-rt-transports-http:2.6.1]
at
org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:547)[102:org.eclipse.jetty.servlet:7.5.4.v20111024]
at
org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:480)[102:org.eclipse.jetty.servlet:7.5.4.v20111024]
at
org.ops4j.pax.web.service.jetty.internal.HttpServiceServletHandler.doHandle(HttpServiceServletHandler.java:70)[112:org.ops4j.pax.web.pax-web-jetty:1.0.11]
at
org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:119)[100:org.eclipse.jetty.server:7.5.4.v20111024]
at
org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:520)[101:org.eclipse.jetty.security:7.5.4.v20111024]
at
org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:227)[100:org.eclipse.jetty.server:7.5.4.v20111024]
at
org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:941)[100:org.eclipse.jetty.server:7.5.4.v20111024]
at
org.ops4j.pax.web.service.jetty.internal.HttpServiceContext.doHandle(HttpServiceContext.java:117)[112:org.ops4j.pax.web.pax-web-jetty:1.0.11]
at
org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:409)[102:org.eclipse.jetty.servlet:7.5.4.v20111024]
at
org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:186)[100:org.eclipse.jetty.server:7.5.4.v20111024]
at
org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:875)[100:org.eclipse.jetty.server:7.5.4.v20111024]
at
org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:117)[100:org.eclipse.jetty.server:7.5.4.v20111024]
at
org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:149)[100:org.eclipse.jetty.server:7.5.4.v20111024]
at
org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:110)[100:org.eclipse.jetty.server:7.5.4.v20111024]
at
org.eclipse.jetty.server.Server.handle(Server.java:345)[100:org.eclipse.jetty.server:7.5.4.v20111024]
at
org.eclipse.jetty.server.HttpConnection.handleRequest(HttpConnection.java:441)[100:org.eclipse.jetty.server:7.5.4.v20111024]
at
org.eclipse.jetty.server.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:919)[100:org.eclipse.jetty.server:7.5.4.v20111024]
at
org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:582)[96:org.eclipse.jetty.http:7.5.4.v20111024]
at
org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:218)[96:org.eclipse.jetty.http:7.5.4.v20111024]
at
org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:51)[100:org.eclipse.jetty.server:7.5.4.v20111024]
at
org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:586)[95:org.eclipse.jetty.io:7
.5.4.v20111024]
at
org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:44)[95:org.eclipse.jetty.io:7
.5.4.v20111024]
at
org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:598)[94:org.eclipse.jetty.util:7.5.4.v20111024]
at
org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:533)[94:org.eclipse.jetty.util:7.5.4.v20111024]

Re: Karaf Blueprint generates null service lookups

Posted by uromahn <ur...@paypal.com>.
Looks like my original post was not relayed to the mailing list, hence this
follow-up to my own post.

Here is a repeat so you guys can see it:
This issue and the resolved defect
https://issues.apache.org/jira/browse/KARAF-1614 is currently a blocker for
our development. Any idea when Karaf 2.2.9 is scheduled for release? 

I have checked out 2.2.9-SNAPSHOT and could  successfully try it out, but I
can't release anything into production here that is still "SNAPSHOT". 

Thank you, 
-Ulrich

--
View this message in context: http://karaf.922171.n3.nabble.com/Karaf-Blueprint-generates-null-service-lookups-tp4025152p4025251.html
Sent from the Karaf - User mailing list archive at Nabble.com.

Re: Karaf Blueprint generates null service lookups

Posted by Chris Geer <ch...@cxtsoftware.com>.
Thank you sir.

Chris

On Tue, Jul 3, 2012 at 11:26 PM, Freeman Fang <fr...@gmail.com>wrote:

> Hi,
>
> The fix for ARIES-861 also backported to aries.proxy 0.3.1, hence I think
> Karaf 2.2.x can pick up aries.proxy 0.3.1 which include this fix also.
> Create KARAF-1614[1] to track it, and next Karaf 2.2.9 should include the
> fix.
> [1]https://issues.apache.org/jira/browse/KARAF-1614
>
> Freeman
>
> On 2012-7-4, at 下午1:55, Chris Geer wrote:
>
> Thanks Freeman, I assume there is a long term solution in the plans. Do
> you know if it will backport to the current versions (Karaf 2.2.x, Camel
> 2.10.x,...) or will it only make it into Karaf 3.0? I'm assuming this will
> limit the ability to ever upgrade the JVM.
>
> Chris
>
> On Tue, Jul 3, 2012 at 8:52 PM, Freeman Fang <fr...@gmail.com>wrote:
>
>> Hi,
>>
>> Yeah, I believe it's same issue as ARIES-861.
>> Can't come up with other workaround unless you change the VM version :-(
>>
>> Freeman
>> On 2012-7-4, at 上午6:30, Chris Geer wrote:
>>
>> I recently ran into a weird issue where the first time a service is
>> referenced the
>> org.apache.aries.blueprint.container.ReferenceRecipe.getService() call
>> returns null. After that first call it works fine but it's causing no end
>> of problems on system startup (10 services or so all failing on their first
>> call). My setup is that I have a CXF JAX-RS web service that has references
>> to my various OSGI services. When a call comes in, the JAX-RS service calls
>> the correct OSGI service and then returns the appropriate data. All the
>> services are starting properly and bring wired up properly.
>> (default-activation=lazy)
>>
>> I've tried this with Karaf 2.2.7 and 2.2.8 and get the same problem. I
>> didn't see this problem using 2.2.7 previously so I'm guessing it's related
>> to upgrading to the newer 1.6.0_33 JDK and this bug ARIES-861<https://issues.apache.org/jira/browse/ARIES-861>
>> .
>>
>> Is there anyway to resolve this other than changing VMs? I've tried
>> adding explicit no-arg constructors, specifying an init method....
>>
>> Thanks,
>> Chris
>>
>> Stack Trace (with Debug)
>>
>> 14:41:14,036 | DEBUG | lixDispatchQueue | account
>>  | 217 - account - 1.0.0.SNAPSHOT | FrameworkEvent ERROR
>> org.osgi.framework.ServiceException: Service factory exception: (class:
>> com/cxtsoftware/p141/services/account/impl/$AccountServiceImpl1183864159,
>> method: <init> signature: (Ljava/lang/reflect/InvocationHandler;)V) Call to
>> wrong initialization method
>>  at
>> org.apache.felix.framework.ServiceRegistrationImpl.getFactoryUnchecked(ServiceRegistrationImpl.java:314)
>> at
>> org.apache.felix.framework.ServiceRegistrationImpl.getService(ServiceRegistrationImpl.java:221)
>>  at
>> org.apache.felix.framework.ServiceRegistry.getService(ServiceRegistry.java:297)
>> at org.apache.felix.framework.Felix.getService(Felix.java:3021)
>>  at
>> org.apache.felix.framework.BundleContextImpl.getService(BundleContextImpl.java:329)
>> at
>> org.apache.aries.blueprint.container.BlueprintContainerImpl.getService(BlueprintContainerImpl.java:422)
>>  at
>> org.apache.aries.blueprint.container.ReferenceRecipe.getService(ReferenceRecipe.java:185)
>> at
>> org.apache.aries.blueprint.container.ReferenceRecipe.access$000(ReferenceRecipe.java:49)
>>  at
>> org.apache.aries.blueprint.container.ReferenceRecipe$ServiceDispatcher.call(ReferenceRecipe.java:206)
>> at org.apache.aries.proxy.impl.ProxyHandler$1.invoke(ProxyHandler.java:50)
>>  at
>> org.apache.aries.proxy.impl.DefaultWrapper.invoke(DefaultWrapper.java:31)
>> at org.apache.aries.proxy.impl.ProxyHandler.invoke(ProxyHandler.java:78)
>>  at $Proxy87.findAccounts(Unknown Source)
>> at
>> com.cxtsoftware.p141.services.operations.AccountsResource.findAccounts(AccountsResource.java:50)
>>  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native
>> Method)[:1.6.0_33]
>> at
>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)[:1.6.0_33]
>>  at
>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)[:1.6.0_33]
>> at java.lang.reflect.Method.invoke(Method.java:597)[:1.6.0_33]
>>  at
>> org.apache.cxf.service.invoker.AbstractInvoker.performInvocation(AbstractInvoker.java:180)
>> at
>> org.apache.cxf.service.invoker.AbstractInvoker.invoke(AbstractInvoker.java:96)
>>  at
>> org.apache.cxf.jaxrs.JAXRSInvoker.invoke(JAXRSInvoker.java:167)[153:org.apache.cxf.cxf-rt-frontend-jaxrs:2.6.1]
>> at com.cxtsoftware.p141.commons.web.SubjectInvoker.internalInvoke
>> (SubjectInvoker.java:40)[208:web:1.0.0.SNAPSHOT]
>>  at com.cxtsoftware.p141.commons.web.SubjectInvoker.access
>> $000(SubjectInvoker.java:23)[208:web:1.0.0.SNAPSHOT]
>>  at
>> com.cxtsoftware.p141.commons.web.SubjectInvoker$1.run(SubjectInvoker.java:34)
>>  at java.security.AccessController.doPrivileged(Native Method)[:1.6.0_33]
>>  at javax.security.auth.Subject.doAs(Subject.java:337)[:1.6.0_33]
>>  at com.cxtsoftware.p141.commons.web.SubjectInvoker.invoke
>> (SubjectInvoker.java:30)[208:web:1.0.0.SNAPSHOT]
>>  at
>> org.apache.cxf.jaxrs.JAXRSInvoker.invoke(JAXRSInvoker.java:94)[153:org.apache.cxf.cxf-rt-frontend-jaxrs:2.6.1]
>>  at
>> org.apache.cxf.interceptor.ServiceInvokerInterceptor$1.run(ServiceInvokerInterceptor.java:58)[140:org.apache.cxf.cxf-api:2.6.1]
>>  at
>> org.apache.cxf.interceptor.ServiceInvokerInterceptor.handleMessage(ServiceInvokerInterceptor.java:94)[140:org.apache.cxf.cxf-api:2.6.1]
>>  at
>> org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:262)[140:org.apache.cxf.cxf-api:2.6.1]
>>  at
>> org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:122)[140:org.apache.cxf.cxf-api:2.6.1]
>>  at
>> org.apache.cxf.transport.http.AbstractHTTPDestination.invoke(AbstractHTTPDestination.java:211)[147:org.apache.cxf.cxf-rt-transports-http:2.6.1]
>>  at
>> org.apache.cxf.transport.servlet.ServletController.invokeDestination(ServletController.java:213)[147:org.apache.cxf.cxf-rt-transports-http:2.6.1]
>> at
>> org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:154)[147:org.apache.cxf.cxf-rt-transports-http:2.6.1]
>>  at
>> org.apache.cxf.transport.servlet.CXFNonSpringServlet.invoke(CXFNonSpringServlet.java:129)[147:org.apache.cxf.cxf-rt-transports-http:2.6.1]
>> at
>> org.apache.cxf.transport.servlet.AbstractHTTPServlet.handleRequest(AbstractHTTPServlet.java:187)[147:org.apache.cxf.cxf-rt-transports-http:2.6.1]
>>  at
>> org.apache.cxf.transport.servlet.AbstractHTTPServlet.doGet(AbstractHTTPServlet.java:115)[147:org.apache.cxf.cxf-rt-transports-http:2.6.1]
>> at
>> javax.servlet.http.HttpServlet.service(HttpServlet.java:693)[92:org.apache.geronimo.specs.geronimo-servlet_2.5_spec:1.1.2]
>>  at
>> org.apache.cxf.transport.servlet.AbstractHTTPServlet.service(AbstractHTTPServlet.java:166)[147:org.apache.cxf.cxf-rt-transports-http:2.6.1]
>> at
>> org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:547)[102:org.eclipse.jetty.servlet:7.5.4.v20111024]
>>  at
>> org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:480)[102:org.eclipse.jetty.servlet:7.5.4.v20111024]
>> at org.ops4j.pax.
>> web.service.jetty.internal.HttpServiceServletHandler.doHandle
>> (HttpServiceServletHandler.java:70)[112:org.ops4j.pax.web.pax-web-jetty:1.0.11]
>>  at
>> org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:119)[100:org.eclipse.jetty.server:7.5.4.v20111024]
>> at
>> org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:520)[101:org.eclipse.jetty.security:7.5.4.v20111024]
>>  at
>> org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:227)[100:org.eclipse.jetty.server:7.5.4.v20111024]
>> at
>> org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:941)[100:org.eclipse.jetty.server:7.5.4.v20111024]
>>  at org.ops4j.pax.web.service.jetty.internal.HttpServiceContext.doHandle
>> (HttpServiceContext.java:117)[112:org.ops4j.pax.web.pax-web-jetty:1.0.11]
>>  at
>> org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:409)[102:org.eclipse.jetty.servlet:7.5.4.v20111024]
>> at
>> org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:186)[100:org.eclipse.jetty.server:7.5.4.v20111024]
>>  at
>> org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:875)[100:org.eclipse.jetty.server:7.5.4.v20111024]
>> at
>> org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:117)[100:org.eclipse.jetty.server:7.5.4.v20111024]
>>  at
>> org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:149)[100:org.eclipse.jetty.server:7.5.4.v20111024]
>> at
>> org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:110)[100:org.eclipse.jetty.server:7.5.4.v20111024]
>>  at
>> org.eclipse.jetty.server.Server.handle(Server.java:345)[100:org.eclipse.jetty.server:7.5.4.v20111024]
>> at
>> org.eclipse.jetty.server.HttpConnection.handleRequest(HttpConnection.java:441)[100:org.eclipse.jetty.server:7.5.4.v20111024]
>>  at
>> org.eclipse.jetty.server.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:919)[100:org.eclipse.jetty.server:7.5.4.v20111024]
>> at
>> org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:582)[96:org.eclipse.jetty.http:7.5.4.v20111024]
>>  at
>> org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:218)[96:org.eclipse.jetty.http:7.5.4.v20111024]
>> at
>> org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:51)[100:org.eclipse.jetty.server:7.5.4.v20111024]
>>  at
>> org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:586)[95:org.eclipse.jetty.io:7
>> .5.4.v20111024]
>> at
>> org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:44)[95:org.eclipse.jetty.io:7
>> .5.4.v20111024]
>>  at
>> org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:598)[94:org.eclipse.jetty.util:7.5.4.v20111024]
>> at
>> org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:533)[94:org.eclipse.jetty.util:7.5.4.v20111024]
>>  at java.lang.Thread.run(Thread.java:680)[:1.6.0_33]
>> Caused by: java.lang.VerifyError: (class:
>> com/cxtsoftware/p141/services/account/impl/$AccountServiceImpl1183864159,
>> method: <init> signature: (Ljava/lang/reflect/InvocationHandler;)V) Call to
>> wrong initialization method
>>  at java.lang.Class.getDeclaredConstructors0(Native Method)[:1.6.0_33]
>> at
>> java.lang.Class.privateGetDeclaredConstructors(Class.java:2389)[:1.6.0_33]
>>  at java.lang.Class.getConstructor0(Class.java:2699)[:1.6.0_33]
>> at java.lang.Class.getConstructor(Class.java:1657)[:1.6.0_33]
>>  at
>> org.apache.aries.proxy.impl.gen.ProxySubclassGenerator.newProxySubclassInstance(ProxySubclassGenerator.java:159)
>> at
>> org.apache.aries.proxy.impl.AsmProxyManager.createNewProxy(AsmProxyManager.java:81)
>>  at
>> org.apache.aries.proxy.impl.AbstractProxyManager.createProxy(AbstractProxyManager.java:50)
>> at
>> org.apache.aries.blueprint.container.BeanRecipe.addInterceptors(BeanRecipe.java:690)
>>  at
>> org.apache.aries.blueprint.container.BeanRecipe.internalCreate(BeanRecipe.java:730)
>> at
>> org.apache.aries.blueprint.di.AbstractRecipe.create(AbstractRecipe.java:64)
>>  at
>> org.apache.aries.blueprint.di.RefRecipe.internalCreate(RefRecipe.java:60)
>> at
>> org.apache.aries.blueprint.di.AbstractRecipe.create(AbstractRecipe.java:64)
>>  at
>> org.apache.aries.blueprint.container.BlueprintRepository.createInstances(BlueprintRepository.java:219)
>> at
>> org.apache.aries.blueprint.container.BlueprintRepository.createInstance(BlueprintRepository.java:198)
>>  at
>> org.apache.aries.blueprint.container.BlueprintRepository.create(BlueprintRepository.java:137)
>> at
>> org.apache.aries.blueprint.container.ServiceRecipe.createRecipe(ServiceRecipe.java:370)
>>  at
>> org.apache.aries.blueprint.container.ServiceRecipe.createService(ServiceRecipe.java:278)
>> at
>> org.apache.aries.blueprint.container.ServiceRecipe.internalGetService(ServiceRecipe.java:248)
>>  at
>> org.apache.aries.blueprint.container.ServiceRecipe.getService(ServiceRecipe.java:327)
>> at
>> org.apache.aries.blueprint.container.ServiceRecipe$TriggerServiceFactory.getService(ServiceRecipe.java:430)
>>  at
>> org.apache.felix.framework.ServiceRegistrationImpl.getFactoryUnchecked(ServiceRegistrationImpl.java:310)
>> ... 64 more
>> 14:41:14,040 | ERROR | rations/accounts | JAXRSExceptionMapper
>>   | 208 - web - 1.0.0.SNAPSHOT | Error caught in ExceptionMapper
>> java.lang.IllegalStateException: getService() returned null for
>> [com.cxtsoftware.p141.services.account.AccountService]
>>  at
>> org.apache.aries.blueprint.container.ReferenceRecipe.getService(ReferenceRecipe.java:188)
>> at
>> org.apache.aries.blueprint.container.ReferenceRecipe.access$000(ReferenceRecipe.java:49)
>>  at
>> org.apache.aries.blueprint.container.ReferenceRecipe$ServiceDispatcher.call(ReferenceRecipe.java:206)
>> at org.apache.aries.proxy.impl.ProxyHandler$1.invoke(ProxyHandler.java:50)
>>  at
>> org.apache.aries.proxy.impl.DefaultWrapper.invoke(DefaultWrapper.java:31)
>> at org.apache.aries.proxy.impl.ProxyHandler.invoke(ProxyHandler.java:78)
>>  at $Proxy87.findAccounts(Unknown Source)
>> at
>> com.cxtsoftware.p141.services.operations.AccountsResource.findAccounts(AccountsResource.java:50)[229:operations-service:1.0.0.SNAPSHOT]
>>  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native
>> Method)[:1.6.0_33]
>> at
>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)[:1.6.0_33]
>>  at
>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)[:1.6.0_33]
>> at java.lang.reflect.Method.invoke(Method.java:597)[:1.6.0_33]
>>  at
>> org.apache.cxf.service.invoker.AbstractInvoker.performInvocation(AbstractInvoker.java:180)[140:org.apache.cxf.cxf-api:2.6.1]
>> at
>> org.apache.cxf.service.invoker.AbstractInvoker.invoke(AbstractInvoker.java:96)[140:org.apache.cxf.cxf-api:2.6.1]
>>  at
>> org.apache.cxf.jaxrs.JAXRSInvoker.invoke(JAXRSInvoker.java:167)[153:org.apache.cxf.cxf-rt-frontend-jaxrs:2.6.1]
>> at com.cxtsoftware.p141.commons.web.SubjectInvoker.internalInvoke
>> (SubjectInvoker.java:40)[208:web:1.0.0.SNAPSHOT]
>>  at com.cxtsoftware.p141.commons.web.SubjectInvoker.access
>> $000(SubjectInvoker.java:23)[208:web:1.0.0.SNAPSHOT]
>>  at
>> com.cxtsoftware.p141.commons.web.SubjectInvoker$1.run(SubjectInvoker.java:34)[208:web:1.0.0.SNAPSHOT]
>>  at java.security.AccessController.doPrivileged(Native Method)[:1.6.0_33]
>>  at javax.security.auth.Subject.doAs(Subject.java:337)[:1.6.0_33]
>>  at com.cxtsoftware.p141.commons.web.SubjectInvoker.invoke
>> (SubjectInvoker.java:30)[208:web:1.0.0.SNAPSHOT]
>>  at
>> org.apache.cxf.jaxrs.JAXRSInvoker.invoke(JAXRSInvoker.java:94)[153:org.apache.cxf.cxf-rt-frontend-jaxrs:2.6.1]
>>  at
>> org.apache.cxf.interceptor.ServiceInvokerInterceptor$1.run(ServiceInvokerInterceptor.java:58)[140:org.apache.cxf.cxf-api:2.6.1]
>>  at
>> org.apache.cxf.interceptor.ServiceInvokerInterceptor.handleMessage(ServiceInvokerInterceptor.java:94)[140:org.apache.cxf.cxf-api:2.6.1]
>>  at
>> org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:262)[140:org.apache.cxf.cxf-api:2.6.1]
>>  at
>> org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:122)[140:org.apache.cxf.cxf-api:2.6.1]
>>  at
>> org.apache.cxf.transport.http.AbstractHTTPDestination.invoke(AbstractHTTPDestination.java:211)[147:org.apache.cxf.cxf-rt-transports-http:2.6.1]
>>  at
>> org.apache.cxf.transport.servlet.ServletController.invokeDestination(ServletController.java:213)[147:org.apache.cxf.cxf-rt-transports-http:2.6.1]
>> at
>> org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:154)[147:org.apache.cxf.cxf-rt-transports-http:2.6.1]
>>  at
>> org.apache.cxf.transport.servlet.CXFNonSpringServlet.invoke(CXFNonSpringServlet.java:129)[147:org.apache.cxf.cxf-rt-transports-http:2.6.1]
>> at
>> org.apache.cxf.transport.servlet.AbstractHTTPServlet.handleRequest(AbstractHTTPServlet.java:187)[147:org.apache.cxf.cxf-rt-transports-http:2.6.1]
>>  at
>> org.apache.cxf.transport.servlet.AbstractHTTPServlet.doGet(AbstractHTTPServlet.java:115)[147:org.apache.cxf.cxf-rt-transports-http:2.6.1]
>> at
>> javax.servlet.http.HttpServlet.service(HttpServlet.java:693)[92:org.apache.geronimo.specs.geronimo-servlet_2.5_spec:1.1.2]
>>  at
>> org.apache.cxf.transport.servlet.AbstractHTTPServlet.service(AbstractHTTPServlet.java:166)[147:org.apache.cxf.cxf-rt-transports-http:2.6.1]
>> at
>> org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:547)[102:org.eclipse.jetty.servlet:7.5.4.v20111024]
>>  at
>> org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:480)[102:org.eclipse.jetty.servlet:7.5.4.v20111024]
>> at org.ops4j.pax.
>> web.service.jetty.internal.HttpServiceServletHandler.doHandle
>> (HttpServiceServletHandler.java:70)[112:org.ops4j.pax.web.pax-web-jetty:1.0.11]
>>  at
>> org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:119)[100:org.eclipse.jetty.server:7.5.4.v20111024]
>> at
>> org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:520)[101:org.eclipse.jetty.security:7.5.4.v20111024]
>>  at
>> org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:227)[100:org.eclipse.jetty.server:7.5.4.v20111024]
>> at
>> org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:941)[100:org.eclipse.jetty.server:7.5.4.v20111024]
>>  at org.ops4j.pax.web.service.jetty.internal.HttpServiceContext.doHandle
>> (HttpServiceContext.java:117)[112:org.ops4j.pax.web.pax-web-jetty:1.0.11]
>>  at
>> org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:409)[102:org.eclipse.jetty.servlet:7.5.4.v20111024]
>> at
>> org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:186)[100:org.eclipse.jetty.server:7.5.4.v20111024]
>>  at
>> org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:875)[100:org.eclipse.jetty.server:7.5.4.v20111024]
>> at
>> org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:117)[100:org.eclipse.jetty.server:7.5.4.v20111024]
>>  at
>> org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:149)[100:org.eclipse.jetty.server:7.5.4.v20111024]
>> at
>> org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:110)[100:org.eclipse.jetty.server:7.5.4.v20111024]
>>  at
>> org.eclipse.jetty.server.Server.handle(Server.java:345)[100:org.eclipse.jetty.server:7.5.4.v20111024]
>> at
>> org.eclipse.jetty.server.HttpConnection.handleRequest(HttpConnection.java:441)[100:org.eclipse.jetty.server:7.5.4.v20111024]
>>  at
>> org.eclipse.jetty.server.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:919)[100:org.eclipse.jetty.server:7.5.4.v20111024]
>> at
>> org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:582)[96:org.eclipse.jetty.http:7.5.4.v20111024]
>>  at
>> org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:218)[96:org.eclipse.jetty.http:7.5.4.v20111024]
>> at
>> org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:51)[100:org.eclipse.jetty.server:7.5.4.v20111024]
>>  at
>> org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:586)[95:org.eclipse.jetty.io:7
>> .5.4.v20111024]
>> at
>> org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:44)[95:org.eclipse.jetty.io:7
>> .5.4.v20111024]
>>  at
>> org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:598)[94:org.eclipse.jetty.util:7.5.4.v20111024]
>> at
>> org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:533)[94:org.eclipse.jetty.util:7.5.4.v20111024]
>>
>>
>>      ---------------------------------------------
>> Freeman Fang
>>
>> FuseSource
>> Email:f <de...@fusesource.com>fang@fusesource.com
>> Web: fusesource.com
>> Twitter: freemanfang
>> Blog: http://freemanfang.blogspot.com
>> http://blog.sina.com.cn/u/1473905042
>> weibo: http://weibo.com/u/1473905042
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>
> ---------------------------------------------
> Freeman Fang
>
> FuseSource
> Email:f <de...@fusesource.com>fang@fusesource.com
> Web: fusesource.com
> Twitter: freemanfang
> Blog: http://freemanfang.blogspot.com
> http://blog.sina.com.cn/u/1473905042
> weibo: http://weibo.com/u/1473905042
>
>
>
>
>
>
>
>
>
>
>

Re: Karaf Blueprint generates null service lookups

Posted by Freeman Fang <fr...@gmail.com>.
Hi,

The fix for ARIES-861 also backported to aries.proxy 0.3.1, hence I  
think Karaf 2.2.x can pick up aries.proxy 0.3.1 which include this fix  
also.
Create KARAF-1614[1] to track it, and next Karaf 2.2.9 should include  
the fix.
[1]https://issues.apache.org/jira/browse/KARAF-1614

Freeman
On 2012-7-4, at 下午1:55, Chris Geer wrote:

> Thanks Freeman, I assume there is a long term solution in the plans.  
> Do you know if it will backport to the current versions (Karaf  
> 2.2.x, Camel 2.10.x,...) or will it only make it into Karaf 3.0? I'm  
> assuming this will limit the ability to ever upgrade the JVM.
>
> Chris
>
> On Tue, Jul 3, 2012 at 8:52 PM, Freeman Fang  
> <fr...@gmail.com> wrote:
> Hi,
>
> Yeah, I believe it's same issue as ARIES-861.
> Can't come up with other workaround unless you change the VM  
> version :-(
>
> Freeman
> On 2012-7-4, at 上午6:30, Chris Geer wrote:
>
>> I recently ran into a weird issue where the first time a service is  
>> referenced the  
>> org.apache.aries.blueprint.container.ReferenceRecipe.getService()  
>> call returns null. After that first call it works fine but it's  
>> causing no end of problems on system startup (10 services or so all  
>> failing on their first call). My setup is that I have a CXF JAX-RS  
>> web service that has references to my various OSGI services. When a  
>> call comes in, the JAX-RS service calls the correct OSGI service  
>> and then returns the appropriate data. All the services are  
>> starting properly and bring wired up properly. (default- 
>> activation=lazy)
>>
>> I've tried this with Karaf 2.2.7 and 2.2.8 and get the same  
>> problem. I didn't see this problem using 2.2.7 previously so I'm  
>> guessing it's related to upgrading to the newer 1.6.0_33 JDK and  
>> this bug ARIES-861.
>>
>> Is there anyway to resolve this other than changing VMs? I've tried  
>> adding explicit no-arg constructors, specifying an init method....
>>
>> Thanks,
>> Chris
>>
>> Stack Trace (with Debug)
>>
>> 14:41:14,036 | DEBUG | lixDispatchQueue |  
>> account                          | 217 - account - 1.0.0.SNAPSHOT |  
>> FrameworkEvent ERROR
>> org.osgi.framework.ServiceException: Service factory exception:  
>> (class: com/cxtsoftware/p141/services/account/impl/ 
>> $AccountServiceImpl1183864159, method: <init> signature: (Ljava/ 
>> lang/reflect/InvocationHandler;)V) Call to wrong initialization  
>> method
>> 	at  
>> org 
>> .apache 
>> .felix 
>> .framework 
>> .ServiceRegistrationImpl 
>> .getFactoryUnchecked(ServiceRegistrationImpl.java:314)
>> 	at  
>> org 
>> .apache 
>> .felix 
>> .framework 
>> .ServiceRegistrationImpl.getService(ServiceRegistrationImpl.java:221)
>> 	at  
>> org 
>> .apache 
>> .felix.framework.ServiceRegistry.getService(ServiceRegistry.java:297)
>> 	at org.apache.felix.framework.Felix.getService(Felix.java:3021)
>> 	at  
>> org 
>> .apache 
>> .felix 
>> .framework.BundleContextImpl.getService(BundleContextImpl.java:329)
>> 	at  
>> org 
>> .apache 
>> .aries 
>> .blueprint 
>> .container 
>> .BlueprintContainerImpl.getService(BlueprintContainerImpl.java:422)
>> 	at  
>> org 
>> .apache 
>> .aries 
>> .blueprint 
>> .container.ReferenceRecipe.getService(ReferenceRecipe.java:185)
>> 	at org.apache.aries.blueprint.container.ReferenceRecipe.access 
>> $000(ReferenceRecipe.java:49)
>> 	at org.apache.aries.blueprint.container.ReferenceRecipe 
>> $ServiceDispatcher.call(ReferenceRecipe.java:206)
>> 	at org.apache.aries.proxy.impl.ProxyHandler 
>> $1.invoke(ProxyHandler.java:50)
>> 	at  
>> org 
>> .apache.aries.proxy.impl.DefaultWrapper.invoke(DefaultWrapper.java: 
>> 31)
>> 	at  
>> org.apache.aries.proxy.impl.ProxyHandler.invoke(ProxyHandler.java:78)
>> 	at $Proxy87.findAccounts(Unknown Source)
>> 	at  
>> com 
>> .cxtsoftware 
>> .p141 
>> .services 
>> .operations.AccountsResource.findAccounts(AccountsResource.java:50)
>> 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)[: 
>> 1.6.0_33]
>> 	at  
>> sun 
>> .reflect 
>> .NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)[: 
>> 1.6.0_33]
>> 	at  
>> sun 
>> .reflect 
>> .DelegatingMethodAccessorImpl 
>> .invoke(DelegatingMethodAccessorImpl.java:25)[:1.6.0_33]
>> 	at java.lang.reflect.Method.invoke(Method.java:597)[:1.6.0_33]
>> 	at  
>> org 
>> .apache 
>> .cxf 
>> .service 
>> .invoker.AbstractInvoker.performInvocation(AbstractInvoker.java:180)
>> 	at  
>> org 
>> .apache 
>> .cxf.service.invoker.AbstractInvoker.invoke(AbstractInvoker.java:96)
>> 	at org.apache.cxf.jaxrs.JAXRSInvoker.invoke(JAXRSInvoker.java:167) 
>> [153:org.apache.cxf.cxf-rt-frontend-jaxrs:2.6.1]
>> 	at  
>> com 
>> .cxtsoftware 
>> .p141.commons.web.SubjectInvoker.internalInvoke(SubjectInvoker.java: 
>> 40)[208:web:1.0.0.SNAPSHOT]
>> 	at com.cxtsoftware.p141.commons.web.SubjectInvoker.access 
>> $000(SubjectInvoker.java:23)[208:web:1.0.0.SNAPSHOT]
>> 	at com.cxtsoftware.p141.commons.web.SubjectInvoker 
>> $1.run(SubjectInvoker.java:34)
>> 	at java.security.AccessController.doPrivileged(Native Method)[: 
>> 1.6.0_33]
>> 	at javax.security.auth.Subject.doAs(Subject.java:337)[:1.6.0_33]
>> 	at  
>> com 
>> .cxtsoftware 
>> .p141.commons.web.SubjectInvoker.invoke(SubjectInvoker.java:30) 
>> [208:web:1.0.0.SNAPSHOT]
>> 	at org.apache.cxf.jaxrs.JAXRSInvoker.invoke(JAXRSInvoker.java:94) 
>> [153:org.apache.cxf.cxf-rt-frontend-jaxrs:2.6.1]
>> 	at org.apache.cxf.interceptor.ServiceInvokerInterceptor 
>> $1.run(ServiceInvokerInterceptor.java:58)[140:org.apache.cxf.cxf- 
>> api:2.6.1]
>> 	at  
>> org 
>> .apache 
>> .cxf 
>> .interceptor 
>> .ServiceInvokerInterceptor 
>> .handleMessage(ServiceInvokerInterceptor.java:94) 
>> [140:org.apache.cxf.cxf-api:2.6.1]
>> 	at  
>> org 
>> .apache 
>> .cxf 
>> .phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java: 
>> 262)[140:org.apache.cxf.cxf-api:2.6.1]
>> 	at  
>> org 
>> .apache 
>> .cxf 
>> .transport 
>> .ChainInitiationObserver.onMessage(ChainInitiationObserver.java:122) 
>> [140:org.apache.cxf.cxf-api:2.6.1]
>> 	at  
>> org 
>> .apache 
>> .cxf 
>> .transport 
>> .http.AbstractHTTPDestination.invoke(AbstractHTTPDestination.java: 
>> 211)[147:org.apache.cxf.cxf-rt-transports-http:2.6.1]
>> 	at  
>> org 
>> .apache 
>> .cxf 
>> .transport 
>> .servlet.ServletController.invokeDestination(ServletController.java: 
>> 213)[147:org.apache.cxf.cxf-rt-transports-http:2.6.1]
>> 	at  
>> org 
>> .apache 
>> .cxf 
>> .transport.servlet.ServletController.invoke(ServletController.java: 
>> 154)[147:org.apache.cxf.cxf-rt-transports-http:2.6.1]
>> 	at  
>> org 
>> .apache 
>> .cxf 
>> .transport 
>> .servlet.CXFNonSpringServlet.invoke(CXFNonSpringServlet.java:129) 
>> [147:org.apache.cxf.cxf-rt-transports-http:2.6.1]
>> 	at  
>> org 
>> .apache 
>> .cxf 
>> .transport 
>> .servlet.AbstractHTTPServlet.handleRequest(AbstractHTTPServlet.java: 
>> 187)[147:org.apache.cxf.cxf-rt-transports-http:2.6.1]
>> 	at  
>> org 
>> .apache 
>> .cxf 
>> .transport 
>> .servlet.AbstractHTTPServlet.doGet(AbstractHTTPServlet.java:115) 
>> [147:org.apache.cxf.cxf-rt-transports-http:2.6.1]
>> 	at javax.servlet.http.HttpServlet.service(HttpServlet.java:693) 
>> [92:org.apache.geronimo.specs.geronimo-servlet_2.5_spec:1.1.2]
>> 	at  
>> org 
>> .apache 
>> .cxf 
>> .transport 
>> .servlet.AbstractHTTPServlet.service(AbstractHTTPServlet.java:166) 
>> [147:org.apache.cxf.cxf-rt-transports-http:2.6.1]
>> 	at  
>> org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java: 
>> 547)[102:org.eclipse.jetty.servlet:7.5.4.v20111024]
>> 	at  
>> org 
>> .eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java: 
>> 480)[102:org.eclipse.jetty.servlet:7.5.4.v20111024]
>> 	at org.ops4j.pax.web.service.jetty.internal.HttpServiceServletHandler.doHandle 
>> (HttpServiceServletHandler.java:70)[112:org.ops4j.pax.web.pax-web- 
>> jetty:1.0.11]
>> 	at  
>> org 
>> .eclipse 
>> .jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:119) 
>> [100:org.eclipse.jetty.server:7.5.4.v20111024]
>> 	at  
>> org 
>> .eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java: 
>> 520)[101:org.eclipse.jetty.security:7.5.4.v20111024]
>> 	at  
>> org 
>> .eclipse 
>> .jetty.server.session.SessionHandler.doHandle(SessionHandler.java: 
>> 227)[100:org.eclipse.jetty.server:7.5.4.v20111024]
>> 	at  
>> org 
>> .eclipse 
>> .jetty.server.handler.ContextHandler.doHandle(ContextHandler.java: 
>> 941)[100:org.eclipse.jetty.server:7.5.4.v20111024]
>> 	at org.ops4j.pax.web.service.jetty.internal.HttpServiceContext.doHandle 
>> (HttpServiceContext.java:117)[112:org.ops4j.pax.web.pax-web-jetty: 
>> 1.0.11]
>> 	at  
>> org 
>> .eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java: 
>> 409)[102:org.eclipse.jetty.servlet:7.5.4.v20111024]
>> 	at  
>> org 
>> .eclipse 
>> .jetty.server.session.SessionHandler.doScope(SessionHandler.java: 
>> 186)[100:org.eclipse.jetty.server:7.5.4.v20111024]
>> 	at  
>> org 
>> .eclipse 
>> .jetty.server.handler.ContextHandler.doScope(ContextHandler.java: 
>> 875)[100:org.eclipse.jetty.server:7.5.4.v20111024]
>> 	at  
>> org 
>> .eclipse 
>> .jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:117) 
>> [100:org.eclipse.jetty.server:7.5.4.v20111024]
>> 	at  
>> org 
>> .eclipse 
>> .jetty 
>> .server.handler.HandlerCollection.handle(HandlerCollection.java:149) 
>> [100:org.eclipse.jetty.server:7.5.4.v20111024]
>> 	at  
>> org 
>> .eclipse 
>> .jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:110) 
>> [100:org.eclipse.jetty.server:7.5.4.v20111024]
>> 	at org.eclipse.jetty.server.Server.handle(Server.java:345) 
>> [100:org.eclipse.jetty.server:7.5.4.v20111024]
>> 	at  
>> org 
>> .eclipse 
>> .jetty.server.HttpConnection.handleRequest(HttpConnection.java:441) 
>> [100:org.eclipse.jetty.server:7.5.4.v20111024]
>> 	at org.eclipse.jetty.server.HttpConnection 
>> $RequestHandler.headerComplete(HttpConnection.java:919) 
>> [100:org.eclipse.jetty.server:7.5.4.v20111024]
>> 	at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:582) 
>> [96:org.eclipse.jetty.http:7.5.4.v20111024]
>> 	at  
>> org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java: 
>> 218)[96:org.eclipse.jetty.http:7.5.4.v20111024]
>> 	at  
>> org 
>> .eclipse 
>> .jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java: 
>> 51)[100:org.eclipse.jetty.server:7.5.4.v20111024]
>> 	at  
>> org 
>> .eclipse 
>> .jetty 
>> .io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:586) 
>> [95:org.eclipse.jetty.io:7.5.4.v20111024]
>> 	at org.eclipse.jetty.io.nio.SelectChannelEndPoint 
>> $1.run(SelectChannelEndPoint.java:44)[95:org.eclipse.jetty.io: 
>> 7.5.4.v20111024]
>> 	at  
>> org 
>> .eclipse 
>> .jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java: 
>> 598)[94:org.eclipse.jetty.util:7.5.4.v20111024]
>> 	at org.eclipse.jetty.util.thread.QueuedThreadPool 
>> $3.run(QueuedThreadPool.java:533)[94:org.eclipse.jetty.util: 
>> 7.5.4.v20111024]
>> 	at java.lang.Thread.run(Thread.java:680)[:1.6.0_33]
>> Caused by: java.lang.VerifyError: (class: com/cxtsoftware/p141/ 
>> services/account/impl/$AccountServiceImpl1183864159, method: <init>  
>> signature: (Ljava/lang/reflect/InvocationHandler;)V) Call to wrong  
>> initialization method
>> 	at java.lang.Class.getDeclaredConstructors0(Native Method)[: 
>> 1.6.0_33]
>> 	at java.lang.Class.privateGetDeclaredConstructors(Class.java:2389) 
>> [:1.6.0_33]
>> 	at java.lang.Class.getConstructor0(Class.java:2699)[:1.6.0_33]
>> 	at java.lang.Class.getConstructor(Class.java:1657)[:1.6.0_33]
>> 	at  
>> org 
>> .apache 
>> .aries 
>> .proxy 
>> .impl 
>> .gen 
>> .ProxySubclassGenerator 
>> .newProxySubclassInstance(ProxySubclassGenerator.java:159)
>> 	at  
>> org 
>> .apache 
>> .aries 
>> .proxy.impl.AsmProxyManager.createNewProxy(AsmProxyManager.java:81)
>> 	at  
>> org 
>> .apache 
>> .aries 
>> .proxy 
>> .impl.AbstractProxyManager.createProxy(AbstractProxyManager.java:50)
>> 	at  
>> org 
>> .apache 
>> .aries 
>> .blueprint.container.BeanRecipe.addInterceptors(BeanRecipe.java:690)
>> 	at  
>> org 
>> .apache 
>> .aries 
>> .blueprint.container.BeanRecipe.internalCreate(BeanRecipe.java:730)
>> 	at  
>> org 
>> .apache 
>> .aries.blueprint.di.AbstractRecipe.create(AbstractRecipe.java:64)
>> 	at  
>> org 
>> .apache.aries.blueprint.di.RefRecipe.internalCreate(RefRecipe.java: 
>> 60)
>> 	at  
>> org 
>> .apache 
>> .aries.blueprint.di.AbstractRecipe.create(AbstractRecipe.java:64)
>> 	at  
>> org 
>> .apache 
>> .aries 
>> .blueprint 
>> .container 
>> .BlueprintRepository.createInstances(BlueprintRepository.java:219)
>> 	at  
>> org 
>> .apache 
>> .aries 
>> .blueprint 
>> .container 
>> .BlueprintRepository.createInstance(BlueprintRepository.java:198)
>> 	at  
>> org 
>> .apache 
>> .aries 
>> .blueprint 
>> .container.BlueprintRepository.create(BlueprintRepository.java:137)
>> 	at  
>> org 
>> .apache 
>> .aries 
>> .blueprint.container.ServiceRecipe.createRecipe(ServiceRecipe.java: 
>> 370)
>> 	at  
>> org 
>> .apache 
>> .aries 
>> .blueprint.container.ServiceRecipe.createService(ServiceRecipe.java: 
>> 278)
>> 	at  
>> org 
>> .apache 
>> .aries 
>> .blueprint 
>> .container.ServiceRecipe.internalGetService(ServiceRecipe.java:248)
>> 	at  
>> org 
>> .apache 
>> .aries 
>> .blueprint.container.ServiceRecipe.getService(ServiceRecipe.java:327)
>> 	at org.apache.aries.blueprint.container.ServiceRecipe 
>> $TriggerServiceFactory.getService(ServiceRecipe.java:430)
>> 	at  
>> org 
>> .apache 
>> .felix 
>> .framework 
>> .ServiceRegistrationImpl 
>> .getFactoryUnchecked(ServiceRegistrationImpl.java:310)
>> 	... 64 more
>> 14:41:14,040 | ERROR | rations/accounts |  
>> JAXRSExceptionMapper             | 208 - web - 1.0.0.SNAPSHOT |  
>> Error caught in ExceptionMapper
>> java.lang.IllegalStateException: getService() returned null for  
>> [com.cxtsoftware.p141.services.account.AccountService]
>> 	at  
>> org 
>> .apache 
>> .aries 
>> .blueprint 
>> .container.ReferenceRecipe.getService(ReferenceRecipe.java:188)
>> 	at org.apache.aries.blueprint.container.ReferenceRecipe.access 
>> $000(ReferenceRecipe.java:49)
>> 	at org.apache.aries.blueprint.container.ReferenceRecipe 
>> $ServiceDispatcher.call(ReferenceRecipe.java:206)
>> 	at org.apache.aries.proxy.impl.ProxyHandler 
>> $1.invoke(ProxyHandler.java:50)
>> 	at  
>> org 
>> .apache.aries.proxy.impl.DefaultWrapper.invoke(DefaultWrapper.java: 
>> 31)
>> 	at  
>> org.apache.aries.proxy.impl.ProxyHandler.invoke(ProxyHandler.java:78)
>> 	at $Proxy87.findAccounts(Unknown Source)
>> 	at  
>> com 
>> .cxtsoftware 
>> .p141 
>> .services 
>> .operations.AccountsResource.findAccounts(AccountsResource.java:50) 
>> [229:operations-service:1.0.0.SNAPSHOT]
>> 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)[: 
>> 1.6.0_33]
>> 	at  
>> sun 
>> .reflect 
>> .NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)[: 
>> 1.6.0_33]
>> 	at  
>> sun 
>> .reflect 
>> .DelegatingMethodAccessorImpl 
>> .invoke(DelegatingMethodAccessorImpl.java:25)[:1.6.0_33]
>> 	at java.lang.reflect.Method.invoke(Method.java:597)[:1.6.0_33]
>> 	at  
>> org 
>> .apache 
>> .cxf 
>> .service 
>> .invoker.AbstractInvoker.performInvocation(AbstractInvoker.java:180) 
>> [140:org.apache.cxf.cxf-api:2.6.1]
>> 	at  
>> org 
>> .apache 
>> .cxf.service.invoker.AbstractInvoker.invoke(AbstractInvoker.java:96) 
>> [140:org.apache.cxf.cxf-api:2.6.1]
>> 	at org.apache.cxf.jaxrs.JAXRSInvoker.invoke(JAXRSInvoker.java:167) 
>> [153:org.apache.cxf.cxf-rt-frontend-jaxrs:2.6.1]
>> 	at  
>> com 
>> .cxtsoftware 
>> .p141.commons.web.SubjectInvoker.internalInvoke(SubjectInvoker.java: 
>> 40)[208:web:1.0.0.SNAPSHOT]
>> 	at com.cxtsoftware.p141.commons.web.SubjectInvoker.access 
>> $000(SubjectInvoker.java:23)[208:web:1.0.0.SNAPSHOT]
>> 	at com.cxtsoftware.p141.commons.web.SubjectInvoker 
>> $1.run(SubjectInvoker.java:34)[208:web:1.0.0.SNAPSHOT]
>> 	at java.security.AccessController.doPrivileged(Native Method)[: 
>> 1.6.0_33]
>> 	at javax.security.auth.Subject.doAs(Subject.java:337)[:1.6.0_33]
>> 	at  
>> com 
>> .cxtsoftware 
>> .p141.commons.web.SubjectInvoker.invoke(SubjectInvoker.java:30) 
>> [208:web:1.0.0.SNAPSHOT]
>> 	at org.apache.cxf.jaxrs.JAXRSInvoker.invoke(JAXRSInvoker.java:94) 
>> [153:org.apache.cxf.cxf-rt-frontend-jaxrs:2.6.1]
>> 	at org.apache.cxf.interceptor.ServiceInvokerInterceptor 
>> $1.run(ServiceInvokerInterceptor.java:58)[140:org.apache.cxf.cxf- 
>> api:2.6.1]
>> 	at  
>> org 
>> .apache 
>> .cxf 
>> .interceptor 
>> .ServiceInvokerInterceptor 
>> .handleMessage(ServiceInvokerInterceptor.java:94) 
>> [140:org.apache.cxf.cxf-api:2.6.1]
>> 	at  
>> org 
>> .apache 
>> .cxf 
>> .phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java: 
>> 262)[140:org.apache.cxf.cxf-api:2.6.1]
>> 	at  
>> org 
>> .apache 
>> .cxf 
>> .transport 
>> .ChainInitiationObserver.onMessage(ChainInitiationObserver.java:122) 
>> [140:org.apache.cxf.cxf-api:2.6.1]
>> 	at  
>> org 
>> .apache 
>> .cxf 
>> .transport 
>> .http.AbstractHTTPDestination.invoke(AbstractHTTPDestination.java: 
>> 211)[147:org.apache.cxf.cxf-rt-transports-http:2.6.1]
>> 	at  
>> org 
>> .apache 
>> .cxf 
>> .transport 
>> .servlet.ServletController.invokeDestination(ServletController.java: 
>> 213)[147:org.apache.cxf.cxf-rt-transports-http:2.6.1]
>> 	at  
>> org 
>> .apache 
>> .cxf 
>> .transport.servlet.ServletController.invoke(ServletController.java: 
>> 154)[147:org.apache.cxf.cxf-rt-transports-http:2.6.1]
>> 	at  
>> org 
>> .apache 
>> .cxf 
>> .transport 
>> .servlet.CXFNonSpringServlet.invoke(CXFNonSpringServlet.java:129) 
>> [147:org.apache.cxf.cxf-rt-transports-http:2.6.1]
>> 	at  
>> org 
>> .apache 
>> .cxf 
>> .transport 
>> .servlet.AbstractHTTPServlet.handleRequest(AbstractHTTPServlet.java: 
>> 187)[147:org.apache.cxf.cxf-rt-transports-http:2.6.1]
>> 	at  
>> org 
>> .apache 
>> .cxf 
>> .transport 
>> .servlet.AbstractHTTPServlet.doGet(AbstractHTTPServlet.java:115) 
>> [147:org.apache.cxf.cxf-rt-transports-http:2.6.1]
>> 	at javax.servlet.http.HttpServlet.service(HttpServlet.java:693) 
>> [92:org.apache.geronimo.specs.geronimo-servlet_2.5_spec:1.1.2]
>> 	at  
>> org 
>> .apache 
>> .cxf 
>> .transport 
>> .servlet.AbstractHTTPServlet.service(AbstractHTTPServlet.java:166) 
>> [147:org.apache.cxf.cxf-rt-transports-http:2.6.1]
>> 	at  
>> org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java: 
>> 547)[102:org.eclipse.jetty.servlet:7.5.4.v20111024]
>> 	at  
>> org 
>> .eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java: 
>> 480)[102:org.eclipse.jetty.servlet:7.5.4.v20111024]
>> 	at org.ops4j.pax.web.service.jetty.internal.HttpServiceServletHandler.doHandle 
>> (HttpServiceServletHandler.java:70)[112:org.ops4j.pax.web.pax-web- 
>> jetty:1.0.11]
>> 	at  
>> org 
>> .eclipse 
>> .jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:119) 
>> [100:org.eclipse.jetty.server:7.5.4.v20111024]
>> 	at  
>> org 
>> .eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java: 
>> 520)[101:org.eclipse.jetty.security:7.5.4.v20111024]
>> 	at  
>> org 
>> .eclipse 
>> .jetty.server.session.SessionHandler.doHandle(SessionHandler.java: 
>> 227)[100:org.eclipse.jetty.server:7.5.4.v20111024]
>> 	at  
>> org 
>> .eclipse 
>> .jetty.server.handler.ContextHandler.doHandle(ContextHandler.java: 
>> 941)[100:org.eclipse.jetty.server:7.5.4.v20111024]
>> 	at org.ops4j.pax.web.service.jetty.internal.HttpServiceContext.doHandle 
>> (HttpServiceContext.java:117)[112:org.ops4j.pax.web.pax-web-jetty: 
>> 1.0.11]
>> 	at  
>> org 
>> .eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java: 
>> 409)[102:org.eclipse.jetty.servlet:7.5.4.v20111024]
>> 	at  
>> org 
>> .eclipse 
>> .jetty.server.session.SessionHandler.doScope(SessionHandler.java: 
>> 186)[100:org.eclipse.jetty.server:7.5.4.v20111024]
>> 	at  
>> org 
>> .eclipse 
>> .jetty.server.handler.ContextHandler.doScope(ContextHandler.java: 
>> 875)[100:org.eclipse.jetty.server:7.5.4.v20111024]
>> 	at  
>> org 
>> .eclipse 
>> .jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:117) 
>> [100:org.eclipse.jetty.server:7.5.4.v20111024]
>> 	at  
>> org 
>> .eclipse 
>> .jetty 
>> .server.handler.HandlerCollection.handle(HandlerCollection.java:149) 
>> [100:org.eclipse.jetty.server:7.5.4.v20111024]
>> 	at  
>> org 
>> .eclipse 
>> .jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:110) 
>> [100:org.eclipse.jetty.server:7.5.4.v20111024]
>> 	at org.eclipse.jetty.server.Server.handle(Server.java:345) 
>> [100:org.eclipse.jetty.server:7.5.4.v20111024]
>> 	at  
>> org 
>> .eclipse 
>> .jetty.server.HttpConnection.handleRequest(HttpConnection.java:441) 
>> [100:org.eclipse.jetty.server:7.5.4.v20111024]
>> 	at org.eclipse.jetty.server.HttpConnection 
>> $RequestHandler.headerComplete(HttpConnection.java:919) 
>> [100:org.eclipse.jetty.server:7.5.4.v20111024]
>> 	at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:582) 
>> [96:org.eclipse.jetty.http:7.5.4.v20111024]
>> 	at  
>> org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java: 
>> 218)[96:org.eclipse.jetty.http:7.5.4.v20111024]
>> 	at  
>> org 
>> .eclipse 
>> .jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java: 
>> 51)[100:org.eclipse.jetty.server:7.5.4.v20111024]
>> 	at  
>> org 
>> .eclipse 
>> .jetty 
>> .io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:586) 
>> [95:org.eclipse.jetty.io:7.5.4.v20111024]
>> 	at org.eclipse.jetty.io.nio.SelectChannelEndPoint 
>> $1.run(SelectChannelEndPoint.java:44)[95:org.eclipse.jetty.io: 
>> 7.5.4.v20111024]
>> 	at  
>> org 
>> .eclipse 
>> .jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java: 
>> 598)[94:org.eclipse.jetty.util:7.5.4.v20111024]
>> 	at org.eclipse.jetty.util.thread.QueuedThreadPool 
>> $3.run(QueuedThreadPool.java:533)[94:org.eclipse.jetty.util: 
>> 7.5.4.v20111024]
>
> ---------------------------------------------
> Freeman Fang
>
> FuseSource
> Email:ffang@fusesource.com
> Web: fusesource.com
> Twitter: freemanfang
> Blog: http://freemanfang.blogspot.com
> http://blog.sina.com.cn/u/1473905042
> weibo: http://weibo.com/u/1473905042
>
>
>
>
>
>
>
>
>
>
>

---------------------------------------------
Freeman Fang

FuseSource
Email:ffang@fusesource.com
Web: fusesource.com
Twitter: freemanfang
Blog: http://freemanfang.blogspot.com
http://blog.sina.com.cn/u/1473905042
weibo: http://weibo.com/u/1473905042











Re: Karaf Blueprint generates null service lookups

Posted by Chris Geer <ch...@cxtsoftware.com>.
Thanks Freeman, I assume there is a long term solution in the plans. Do you
know if it will backport to the current versions (Karaf 2.2.x, Camel
2.10.x,...) or will it only make it into Karaf 3.0? I'm assuming this will
limit the ability to ever upgrade the JVM.

Chris

On Tue, Jul 3, 2012 at 8:52 PM, Freeman Fang <fr...@gmail.com> wrote:

> Hi,
>
> Yeah, I believe it's same issue as ARIES-861.
> Can't come up with other workaround unless you change the VM version :-(
>
> Freeman
> On 2012-7-4, at 上午6:30, Chris Geer wrote:
>
> I recently ran into a weird issue where the first time a service is
> referenced the
> org.apache.aries.blueprint.container.ReferenceRecipe.getService() call
> returns null. After that first call it works fine but it's causing no end
> of problems on system startup (10 services or so all failing on their first
> call). My setup is that I have a CXF JAX-RS web service that has references
> to my various OSGI services. When a call comes in, the JAX-RS service calls
> the correct OSGI service and then returns the appropriate data. All the
> services are starting properly and bring wired up properly.
> (default-activation=lazy)
>
> I've tried this with Karaf 2.2.7 and 2.2.8 and get the same problem. I
> didn't see this problem using 2.2.7 previously so I'm guessing it's related
> to upgrading to the newer 1.6.0_33 JDK and this bug ARIES-861<https://issues.apache.org/jira/browse/ARIES-861>
> .
>
> Is there anyway to resolve this other than changing VMs? I've tried adding
> explicit no-arg constructors, specifying an init method....
>
> Thanks,
> Chris
>
> Stack Trace (with Debug)
>
> 14:41:14,036 | DEBUG | lixDispatchQueue | account
>  | 217 - account - 1.0.0.SNAPSHOT | FrameworkEvent ERROR
> org.osgi.framework.ServiceException: Service factory exception: (class:
> com/cxtsoftware/p141/services/account/impl/$AccountServiceImpl1183864159,
> method: <init> signature: (Ljava/lang/reflect/InvocationHandler;)V) Call to
> wrong initialization method
>  at
> org.apache.felix.framework.ServiceRegistrationImpl.getFactoryUnchecked(ServiceRegistrationImpl.java:314)
> at
> org.apache.felix.framework.ServiceRegistrationImpl.getService(ServiceRegistrationImpl.java:221)
>  at
> org.apache.felix.framework.ServiceRegistry.getService(ServiceRegistry.java:297)
> at org.apache.felix.framework.Felix.getService(Felix.java:3021)
>  at
> org.apache.felix.framework.BundleContextImpl.getService(BundleContextImpl.java:329)
> at
> org.apache.aries.blueprint.container.BlueprintContainerImpl.getService(BlueprintContainerImpl.java:422)
>  at
> org.apache.aries.blueprint.container.ReferenceRecipe.getService(ReferenceRecipe.java:185)
> at
> org.apache.aries.blueprint.container.ReferenceRecipe.access$000(ReferenceRecipe.java:49)
>  at
> org.apache.aries.blueprint.container.ReferenceRecipe$ServiceDispatcher.call(ReferenceRecipe.java:206)
> at org.apache.aries.proxy.impl.ProxyHandler$1.invoke(ProxyHandler.java:50)
>  at
> org.apache.aries.proxy.impl.DefaultWrapper.invoke(DefaultWrapper.java:31)
> at org.apache.aries.proxy.impl.ProxyHandler.invoke(ProxyHandler.java:78)
>  at $Proxy87.findAccounts(Unknown Source)
> at
> com.cxtsoftware.p141.services.operations.AccountsResource.findAccounts(AccountsResource.java:50)
>  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)[:1.6.0_33]
> at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)[:1.6.0_33]
>  at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)[:1.6.0_33]
> at java.lang.reflect.Method.invoke(Method.java:597)[:1.6.0_33]
>  at
> org.apache.cxf.service.invoker.AbstractInvoker.performInvocation(AbstractInvoker.java:180)
> at
> org.apache.cxf.service.invoker.AbstractInvoker.invoke(AbstractInvoker.java:96)
>  at
> org.apache.cxf.jaxrs.JAXRSInvoker.invoke(JAXRSInvoker.java:167)[153:org.apache.cxf.cxf-rt-frontend-jaxrs:2.6.1]
> at com.cxtsoftware.p141.commons.web.SubjectInvoker.internalInvoke
> (SubjectInvoker.java:40)[208:web:1.0.0.SNAPSHOT]
>  at com.cxtsoftware.p141.commons.web.SubjectInvoker.access
> $000(SubjectInvoker.java:23)[208:web:1.0.0.SNAPSHOT]
> at
> com.cxtsoftware.p141.commons.web.SubjectInvoker$1.run(SubjectInvoker.java:34)
>  at java.security.AccessController.doPrivileged(Native Method)[:1.6.0_33]
> at javax.security.auth.Subject.doAs(Subject.java:337)[:1.6.0_33]
>  at com.cxtsoftware.p141.commons.web.SubjectInvoker.invoke
> (SubjectInvoker.java:30)[208:web:1.0.0.SNAPSHOT]
> at
> org.apache.cxf.jaxrs.JAXRSInvoker.invoke(JAXRSInvoker.java:94)[153:org.apache.cxf.cxf-rt-frontend-jaxrs:2.6.1]
>  at
> org.apache.cxf.interceptor.ServiceInvokerInterceptor$1.run(ServiceInvokerInterceptor.java:58)[140:org.apache.cxf.cxf-api:2.6.1]
> at
> org.apache.cxf.interceptor.ServiceInvokerInterceptor.handleMessage(ServiceInvokerInterceptor.java:94)[140:org.apache.cxf.cxf-api:2.6.1]
>  at
> org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:262)[140:org.apache.cxf.cxf-api:2.6.1]
> at
> org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:122)[140:org.apache.cxf.cxf-api:2.6.1]
>  at
> org.apache.cxf.transport.http.AbstractHTTPDestination.invoke(AbstractHTTPDestination.java:211)[147:org.apache.cxf.cxf-rt-transports-http:2.6.1]
>  at
> org.apache.cxf.transport.servlet.ServletController.invokeDestination(ServletController.java:213)[147:org.apache.cxf.cxf-rt-transports-http:2.6.1]
> at
> org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:154)[147:org.apache.cxf.cxf-rt-transports-http:2.6.1]
>  at
> org.apache.cxf.transport.servlet.CXFNonSpringServlet.invoke(CXFNonSpringServlet.java:129)[147:org.apache.cxf.cxf-rt-transports-http:2.6.1]
> at
> org.apache.cxf.transport.servlet.AbstractHTTPServlet.handleRequest(AbstractHTTPServlet.java:187)[147:org.apache.cxf.cxf-rt-transports-http:2.6.1]
>  at
> org.apache.cxf.transport.servlet.AbstractHTTPServlet.doGet(AbstractHTTPServlet.java:115)[147:org.apache.cxf.cxf-rt-transports-http:2.6.1]
> at
> javax.servlet.http.HttpServlet.service(HttpServlet.java:693)[92:org.apache.geronimo.specs.geronimo-servlet_2.5_spec:1.1.2]
>  at
> org.apache.cxf.transport.servlet.AbstractHTTPServlet.service(AbstractHTTPServlet.java:166)[147:org.apache.cxf.cxf-rt-transports-http:2.6.1]
> at
> org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:547)[102:org.eclipse.jetty.servlet:7.5.4.v20111024]
>  at
> org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:480)[102:org.eclipse.jetty.servlet:7.5.4.v20111024]
> at org.ops4j.pax.
> web.service.jetty.internal.HttpServiceServletHandler.doHandle
> (HttpServiceServletHandler.java:70)[112:org.ops4j.pax.web.pax-web-jetty:1.0.11]
>  at
> org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:119)[100:org.eclipse.jetty.server:7.5.4.v20111024]
> at
> org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:520)[101:org.eclipse.jetty.security:7.5.4.v20111024]
>  at
> org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:227)[100:org.eclipse.jetty.server:7.5.4.v20111024]
> at
> org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:941)[100:org.eclipse.jetty.server:7.5.4.v20111024]
>  at org.ops4j.pax.web.service.jetty.internal.HttpServiceContext.doHandle
> (HttpServiceContext.java:117)[112:org.ops4j.pax.web.pax-web-jetty:1.0.11]
>  at
> org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:409)[102:org.eclipse.jetty.servlet:7.5.4.v20111024]
> at
> org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:186)[100:org.eclipse.jetty.server:7.5.4.v20111024]
>  at
> org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:875)[100:org.eclipse.jetty.server:7.5.4.v20111024]
> at
> org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:117)[100:org.eclipse.jetty.server:7.5.4.v20111024]
>  at
> org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:149)[100:org.eclipse.jetty.server:7.5.4.v20111024]
> at
> org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:110)[100:org.eclipse.jetty.server:7.5.4.v20111024]
>  at
> org.eclipse.jetty.server.Server.handle(Server.java:345)[100:org.eclipse.jetty.server:7.5.4.v20111024]
> at
> org.eclipse.jetty.server.HttpConnection.handleRequest(HttpConnection.java:441)[100:org.eclipse.jetty.server:7.5.4.v20111024]
>  at
> org.eclipse.jetty.server.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:919)[100:org.eclipse.jetty.server:7.5.4.v20111024]
> at
> org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:582)[96:org.eclipse.jetty.http:7.5.4.v20111024]
>  at
> org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:218)[96:org.eclipse.jetty.http:7.5.4.v20111024]
> at
> org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:51)[100:org.eclipse.jetty.server:7.5.4.v20111024]
>  at
> org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:586)[95:org.eclipse.jetty.io:7
> .5.4.v20111024]
> at
> org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:44)[95:org.eclipse.jetty.io:7
> .5.4.v20111024]
>  at
> org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:598)[94:org.eclipse.jetty.util:7.5.4.v20111024]
> at
> org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:533)[94:org.eclipse.jetty.util:7.5.4.v20111024]
>  at java.lang.Thread.run(Thread.java:680)[:1.6.0_33]
> Caused by: java.lang.VerifyError: (class:
> com/cxtsoftware/p141/services/account/impl/$AccountServiceImpl1183864159,
> method: <init> signature: (Ljava/lang/reflect/InvocationHandler;)V) Call to
> wrong initialization method
>  at java.lang.Class.getDeclaredConstructors0(Native Method)[:1.6.0_33]
> at
> java.lang.Class.privateGetDeclaredConstructors(Class.java:2389)[:1.6.0_33]
>  at java.lang.Class.getConstructor0(Class.java:2699)[:1.6.0_33]
> at java.lang.Class.getConstructor(Class.java:1657)[:1.6.0_33]
>  at
> org.apache.aries.proxy.impl.gen.ProxySubclassGenerator.newProxySubclassInstance(ProxySubclassGenerator.java:159)
> at
> org.apache.aries.proxy.impl.AsmProxyManager.createNewProxy(AsmProxyManager.java:81)
>  at
> org.apache.aries.proxy.impl.AbstractProxyManager.createProxy(AbstractProxyManager.java:50)
> at
> org.apache.aries.blueprint.container.BeanRecipe.addInterceptors(BeanRecipe.java:690)
>  at
> org.apache.aries.blueprint.container.BeanRecipe.internalCreate(BeanRecipe.java:730)
> at
> org.apache.aries.blueprint.di.AbstractRecipe.create(AbstractRecipe.java:64)
>  at
> org.apache.aries.blueprint.di.RefRecipe.internalCreate(RefRecipe.java:60)
> at
> org.apache.aries.blueprint.di.AbstractRecipe.create(AbstractRecipe.java:64)
>  at
> org.apache.aries.blueprint.container.BlueprintRepository.createInstances(BlueprintRepository.java:219)
> at
> org.apache.aries.blueprint.container.BlueprintRepository.createInstance(BlueprintRepository.java:198)
>  at
> org.apache.aries.blueprint.container.BlueprintRepository.create(BlueprintRepository.java:137)
> at
> org.apache.aries.blueprint.container.ServiceRecipe.createRecipe(ServiceRecipe.java:370)
>  at
> org.apache.aries.blueprint.container.ServiceRecipe.createService(ServiceRecipe.java:278)
> at
> org.apache.aries.blueprint.container.ServiceRecipe.internalGetService(ServiceRecipe.java:248)
>  at
> org.apache.aries.blueprint.container.ServiceRecipe.getService(ServiceRecipe.java:327)
> at
> org.apache.aries.blueprint.container.ServiceRecipe$TriggerServiceFactory.getService(ServiceRecipe.java:430)
>  at
> org.apache.felix.framework.ServiceRegistrationImpl.getFactoryUnchecked(ServiceRegistrationImpl.java:310)
> ... 64 more
> 14:41:14,040 | ERROR | rations/accounts | JAXRSExceptionMapper
> | 208 - web - 1.0.0.SNAPSHOT | Error caught in ExceptionMapper
> java.lang.IllegalStateException: getService() returned null for
> [com.cxtsoftware.p141.services.account.AccountService]
>  at
> org.apache.aries.blueprint.container.ReferenceRecipe.getService(ReferenceRecipe.java:188)
> at
> org.apache.aries.blueprint.container.ReferenceRecipe.access$000(ReferenceRecipe.java:49)
>  at
> org.apache.aries.blueprint.container.ReferenceRecipe$ServiceDispatcher.call(ReferenceRecipe.java:206)
> at org.apache.aries.proxy.impl.ProxyHandler$1.invoke(ProxyHandler.java:50)
>  at
> org.apache.aries.proxy.impl.DefaultWrapper.invoke(DefaultWrapper.java:31)
> at org.apache.aries.proxy.impl.ProxyHandler.invoke(ProxyHandler.java:78)
>  at $Proxy87.findAccounts(Unknown Source)
> at
> com.cxtsoftware.p141.services.operations.AccountsResource.findAccounts(AccountsResource.java:50)[229:operations-service:1.0.0.SNAPSHOT]
>  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)[:1.6.0_33]
> at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)[:1.6.0_33]
>  at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)[:1.6.0_33]
> at java.lang.reflect.Method.invoke(Method.java:597)[:1.6.0_33]
>  at
> org.apache.cxf.service.invoker.AbstractInvoker.performInvocation(AbstractInvoker.java:180)[140:org.apache.cxf.cxf-api:2.6.1]
> at
> org.apache.cxf.service.invoker.AbstractInvoker.invoke(AbstractInvoker.java:96)[140:org.apache.cxf.cxf-api:2.6.1]
>  at
> org.apache.cxf.jaxrs.JAXRSInvoker.invoke(JAXRSInvoker.java:167)[153:org.apache.cxf.cxf-rt-frontend-jaxrs:2.6.1]
> at com.cxtsoftware.p141.commons.web.SubjectInvoker.internalInvoke
> (SubjectInvoker.java:40)[208:web:1.0.0.SNAPSHOT]
>  at com.cxtsoftware.p141.commons.web.SubjectInvoker.access
> $000(SubjectInvoker.java:23)[208:web:1.0.0.SNAPSHOT]
> at
> com.cxtsoftware.p141.commons.web.SubjectInvoker$1.run(SubjectInvoker.java:34)[208:web:1.0.0.SNAPSHOT]
>  at java.security.AccessController.doPrivileged(Native Method)[:1.6.0_33]
> at javax.security.auth.Subject.doAs(Subject.java:337)[:1.6.0_33]
>  at com.cxtsoftware.p141.commons.web.SubjectInvoker.invoke
> (SubjectInvoker.java:30)[208:web:1.0.0.SNAPSHOT]
> at
> org.apache.cxf.jaxrs.JAXRSInvoker.invoke(JAXRSInvoker.java:94)[153:org.apache.cxf.cxf-rt-frontend-jaxrs:2.6.1]
>  at
> org.apache.cxf.interceptor.ServiceInvokerInterceptor$1.run(ServiceInvokerInterceptor.java:58)[140:org.apache.cxf.cxf-api:2.6.1]
> at
> org.apache.cxf.interceptor.ServiceInvokerInterceptor.handleMessage(ServiceInvokerInterceptor.java:94)[140:org.apache.cxf.cxf-api:2.6.1]
>  at
> org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:262)[140:org.apache.cxf.cxf-api:2.6.1]
> at
> org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:122)[140:org.apache.cxf.cxf-api:2.6.1]
>  at
> org.apache.cxf.transport.http.AbstractHTTPDestination.invoke(AbstractHTTPDestination.java:211)[147:org.apache.cxf.cxf-rt-transports-http:2.6.1]
>  at
> org.apache.cxf.transport.servlet.ServletController.invokeDestination(ServletController.java:213)[147:org.apache.cxf.cxf-rt-transports-http:2.6.1]
> at
> org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:154)[147:org.apache.cxf.cxf-rt-transports-http:2.6.1]
>  at
> org.apache.cxf.transport.servlet.CXFNonSpringServlet.invoke(CXFNonSpringServlet.java:129)[147:org.apache.cxf.cxf-rt-transports-http:2.6.1]
> at
> org.apache.cxf.transport.servlet.AbstractHTTPServlet.handleRequest(AbstractHTTPServlet.java:187)[147:org.apache.cxf.cxf-rt-transports-http:2.6.1]
>  at
> org.apache.cxf.transport.servlet.AbstractHTTPServlet.doGet(AbstractHTTPServlet.java:115)[147:org.apache.cxf.cxf-rt-transports-http:2.6.1]
> at
> javax.servlet.http.HttpServlet.service(HttpServlet.java:693)[92:org.apache.geronimo.specs.geronimo-servlet_2.5_spec:1.1.2]
>  at
> org.apache.cxf.transport.servlet.AbstractHTTPServlet.service(AbstractHTTPServlet.java:166)[147:org.apache.cxf.cxf-rt-transports-http:2.6.1]
> at
> org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:547)[102:org.eclipse.jetty.servlet:7.5.4.v20111024]
>  at
> org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:480)[102:org.eclipse.jetty.servlet:7.5.4.v20111024]
> at org.ops4j.pax.
> web.service.jetty.internal.HttpServiceServletHandler.doHandle
> (HttpServiceServletHandler.java:70)[112:org.ops4j.pax.web.pax-web-jetty:1.0.11]
>  at
> org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:119)[100:org.eclipse.jetty.server:7.5.4.v20111024]
> at
> org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:520)[101:org.eclipse.jetty.security:7.5.4.v20111024]
>  at
> org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:227)[100:org.eclipse.jetty.server:7.5.4.v20111024]
> at
> org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:941)[100:org.eclipse.jetty.server:7.5.4.v20111024]
>  at org.ops4j.pax.web.service.jetty.internal.HttpServiceContext.doHandle
> (HttpServiceContext.java:117)[112:org.ops4j.pax.web.pax-web-jetty:1.0.11]
>  at
> org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:409)[102:org.eclipse.jetty.servlet:7.5.4.v20111024]
> at
> org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:186)[100:org.eclipse.jetty.server:7.5.4.v20111024]
>  at
> org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:875)[100:org.eclipse.jetty.server:7.5.4.v20111024]
> at
> org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:117)[100:org.eclipse.jetty.server:7.5.4.v20111024]
>  at
> org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:149)[100:org.eclipse.jetty.server:7.5.4.v20111024]
> at
> org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:110)[100:org.eclipse.jetty.server:7.5.4.v20111024]
>  at
> org.eclipse.jetty.server.Server.handle(Server.java:345)[100:org.eclipse.jetty.server:7.5.4.v20111024]
> at
> org.eclipse.jetty.server.HttpConnection.handleRequest(HttpConnection.java:441)[100:org.eclipse.jetty.server:7.5.4.v20111024]
>  at
> org.eclipse.jetty.server.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:919)[100:org.eclipse.jetty.server:7.5.4.v20111024]
> at
> org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:582)[96:org.eclipse.jetty.http:7.5.4.v20111024]
>  at
> org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:218)[96:org.eclipse.jetty.http:7.5.4.v20111024]
> at
> org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:51)[100:org.eclipse.jetty.server:7.5.4.v20111024]
>  at
> org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:586)[95:org.eclipse.jetty.io:7
> .5.4.v20111024]
> at
> org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:44)[95:org.eclipse.jetty.io:7
> .5.4.v20111024]
>  at
> org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:598)[94:org.eclipse.jetty.util:7.5.4.v20111024]
> at
> org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:533)[94:org.eclipse.jetty.util:7.5.4.v20111024]
>
>
> ---------------------------------------------
> Freeman Fang
>
> FuseSource
> Email:f <de...@fusesource.com>fang@fusesource.com
> Web: fusesource.com
> Twitter: freemanfang
> Blog: http://freemanfang.blogspot.com
> http://blog.sina.com.cn/u/1473905042
> weibo: http://weibo.com/u/1473905042
>
>
>
>
>
>
>
>
>
>
>

Re: Karaf Blueprint generates null service lookups

Posted by Freeman Fang <fr...@gmail.com>.
Hi,

Yeah, I believe it's same issue as ARIES-861.
Can't come up with other workaround unless you change the VM version :-(

Freeman
On 2012-7-4, at 上午6:30, Chris Geer wrote:

> I recently ran into a weird issue where the first time a service is  
> referenced the  
> org.apache.aries.blueprint.container.ReferenceRecipe.getService()  
> call returns null. After that first call it works fine but it's  
> causing no end of problems on system startup (10 services or so all  
> failing on their first call). My setup is that I have a CXF JAX-RS  
> web service that has references to my various OSGI services. When a  
> call comes in, the JAX-RS service calls the correct OSGI service and  
> then returns the appropriate data. All the services are starting  
> properly and bring wired up properly. (default-activation=lazy)
>
> I've tried this with Karaf 2.2.7 and 2.2.8 and get the same problem.  
> I didn't see this problem using 2.2.7 previously so I'm guessing  
> it's related to upgrading to the newer 1.6.0_33 JDK and this bug  
> ARIES-861.
>
> Is there anyway to resolve this other than changing VMs? I've tried  
> adding explicit no-arg constructors, specifying an init method....
>
> Thanks,
> Chris
>
> Stack Trace (with Debug)
>
> 14:41:14,036 | DEBUG | lixDispatchQueue |  
> account                          | 217 - account - 1.0.0.SNAPSHOT |  
> FrameworkEvent ERROR
> org.osgi.framework.ServiceException: Service factory exception:  
> (class: com/cxtsoftware/p141/services/account/impl/ 
> $AccountServiceImpl1183864159, method: <init> signature: (Ljava/lang/ 
> reflect/InvocationHandler;)V) Call to wrong initialization method
> 	at  
> org 
> .apache 
> .felix 
> .framework 
> .ServiceRegistrationImpl 
> .getFactoryUnchecked(ServiceRegistrationImpl.java:314)
> 	at  
> org 
> .apache 
> .felix 
> .framework 
> .ServiceRegistrationImpl.getService(ServiceRegistrationImpl.java:221)
> 	at  
> org 
> .apache 
> .felix.framework.ServiceRegistry.getService(ServiceRegistry.java:297)
> 	at org.apache.felix.framework.Felix.getService(Felix.java:3021)
> 	at  
> org 
> .apache 
> .felix.framework.BundleContextImpl.getService(BundleContextImpl.java: 
> 329)
> 	at  
> org 
> .apache 
> .aries 
> .blueprint 
> .container 
> .BlueprintContainerImpl.getService(BlueprintContainerImpl.java:422)
> 	at  
> org 
> .apache 
> .aries 
> .blueprint.container.ReferenceRecipe.getService(ReferenceRecipe.java: 
> 185)
> 	at org.apache.aries.blueprint.container.ReferenceRecipe.access 
> $000(ReferenceRecipe.java:49)
> 	at org.apache.aries.blueprint.container.ReferenceRecipe 
> $ServiceDispatcher.call(ReferenceRecipe.java:206)
> 	at org.apache.aries.proxy.impl.ProxyHandler 
> $1.invoke(ProxyHandler.java:50)
> 	at  
> org 
> .apache.aries.proxy.impl.DefaultWrapper.invoke(DefaultWrapper.java:31)
> 	at  
> org.apache.aries.proxy.impl.ProxyHandler.invoke(ProxyHandler.java:78)
> 	at $Proxy87.findAccounts(Unknown Source)
> 	at  
> com 
> .cxtsoftware 
> .p141 
> .services 
> .operations.AccountsResource.findAccounts(AccountsResource.java:50)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)[: 
> 1.6.0_33]
> 	at  
> sun 
> .reflect 
> .NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)[: 
> 1.6.0_33]
> 	at  
> sun 
> .reflect 
> .DelegatingMethodAccessorImpl 
> .invoke(DelegatingMethodAccessorImpl.java:25)[:1.6.0_33]
> 	at java.lang.reflect.Method.invoke(Method.java:597)[:1.6.0_33]
> 	at  
> org 
> .apache 
> .cxf 
> .service 
> .invoker.AbstractInvoker.performInvocation(AbstractInvoker.java:180)
> 	at  
> org 
> .apache 
> .cxf.service.invoker.AbstractInvoker.invoke(AbstractInvoker.java:96)
> 	at org.apache.cxf.jaxrs.JAXRSInvoker.invoke(JAXRSInvoker.java:167) 
> [153:org.apache.cxf.cxf-rt-frontend-jaxrs:2.6.1]
> 	at  
> com 
> .cxtsoftware 
> .p141.commons.web.SubjectInvoker.internalInvoke(SubjectInvoker.java: 
> 40)[208:web:1.0.0.SNAPSHOT]
> 	at com.cxtsoftware.p141.commons.web.SubjectInvoker.access 
> $000(SubjectInvoker.java:23)[208:web:1.0.0.SNAPSHOT]
> 	at com.cxtsoftware.p141.commons.web.SubjectInvoker 
> $1.run(SubjectInvoker.java:34)
> 	at java.security.AccessController.doPrivileged(Native Method)[: 
> 1.6.0_33]
> 	at javax.security.auth.Subject.doAs(Subject.java:337)[:1.6.0_33]
> 	at  
> com 
> .cxtsoftware 
> .p141.commons.web.SubjectInvoker.invoke(SubjectInvoker.java:30) 
> [208:web:1.0.0.SNAPSHOT]
> 	at org.apache.cxf.jaxrs.JAXRSInvoker.invoke(JAXRSInvoker.java:94) 
> [153:org.apache.cxf.cxf-rt-frontend-jaxrs:2.6.1]
> 	at org.apache.cxf.interceptor.ServiceInvokerInterceptor 
> $1.run(ServiceInvokerInterceptor.java:58)[140:org.apache.cxf.cxf-api: 
> 2.6.1]
> 	at  
> org 
> .apache 
> .cxf 
> .interceptor 
> .ServiceInvokerInterceptor 
> .handleMessage(ServiceInvokerInterceptor.java:94) 
> [140:org.apache.cxf.cxf-api:2.6.1]
> 	at  
> org 
> .apache 
> .cxf 
> .phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java: 
> 262)[140:org.apache.cxf.cxf-api:2.6.1]
> 	at  
> org 
> .apache 
> .cxf 
> .transport 
> .ChainInitiationObserver.onMessage(ChainInitiationObserver.java:122) 
> [140:org.apache.cxf.cxf-api:2.6.1]
> 	at  
> org 
> .apache 
> .cxf 
> .transport 
> .http.AbstractHTTPDestination.invoke(AbstractHTTPDestination.java: 
> 211)[147:org.apache.cxf.cxf-rt-transports-http:2.6.1]
> 	at  
> org 
> .apache 
> .cxf 
> .transport 
> .servlet.ServletController.invokeDestination(ServletController.java: 
> 213)[147:org.apache.cxf.cxf-rt-transports-http:2.6.1]
> 	at  
> org 
> .apache 
> .cxf 
> .transport.servlet.ServletController.invoke(ServletController.java: 
> 154)[147:org.apache.cxf.cxf-rt-transports-http:2.6.1]
> 	at  
> org 
> .apache 
> .cxf 
> .transport 
> .servlet.CXFNonSpringServlet.invoke(CXFNonSpringServlet.java:129) 
> [147:org.apache.cxf.cxf-rt-transports-http:2.6.1]
> 	at  
> org 
> .apache 
> .cxf 
> .transport 
> .servlet.AbstractHTTPServlet.handleRequest(AbstractHTTPServlet.java: 
> 187)[147:org.apache.cxf.cxf-rt-transports-http:2.6.1]
> 	at  
> org 
> .apache 
> .cxf 
> .transport 
> .servlet.AbstractHTTPServlet.doGet(AbstractHTTPServlet.java:115) 
> [147:org.apache.cxf.cxf-rt-transports-http:2.6.1]
> 	at javax.servlet.http.HttpServlet.service(HttpServlet.java:693) 
> [92:org.apache.geronimo.specs.geronimo-servlet_2.5_spec:1.1.2]
> 	at  
> org 
> .apache 
> .cxf 
> .transport 
> .servlet.AbstractHTTPServlet.service(AbstractHTTPServlet.java:166) 
> [147:org.apache.cxf.cxf-rt-transports-http:2.6.1]
> 	at  
> org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java: 
> 547)[102:org.eclipse.jetty.servlet:7.5.4.v20111024]
> 	at  
> org 
> .eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java: 
> 480)[102:org.eclipse.jetty.servlet:7.5.4.v20111024]
> 	at org.ops4j.pax.web.service.jetty.internal.HttpServiceServletHandler.doHandle 
> (HttpServiceServletHandler.java:70)[112:org.ops4j.pax.web.pax-web- 
> jetty:1.0.11]
> 	at  
> org 
> .eclipse 
> .jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:119) 
> [100:org.eclipse.jetty.server:7.5.4.v20111024]
> 	at  
> org 
> .eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java: 
> 520)[101:org.eclipse.jetty.security:7.5.4.v20111024]
> 	at  
> org 
> .eclipse 
> .jetty.server.session.SessionHandler.doHandle(SessionHandler.java: 
> 227)[100:org.eclipse.jetty.server:7.5.4.v20111024]
> 	at  
> org 
> .eclipse 
> .jetty.server.handler.ContextHandler.doHandle(ContextHandler.java: 
> 941)[100:org.eclipse.jetty.server:7.5.4.v20111024]
> 	at org.ops4j.pax.web.service.jetty.internal.HttpServiceContext.doHandle 
> (HttpServiceContext.java:117)[112:org.ops4j.pax.web.pax-web-jetty: 
> 1.0.11]
> 	at  
> org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java: 
> 409)[102:org.eclipse.jetty.servlet:7.5.4.v20111024]
> 	at  
> org 
> .eclipse 
> .jetty.server.session.SessionHandler.doScope(SessionHandler.java:186) 
> [100:org.eclipse.jetty.server:7.5.4.v20111024]
> 	at  
> org 
> .eclipse 
> .jetty.server.handler.ContextHandler.doScope(ContextHandler.java:875) 
> [100:org.eclipse.jetty.server:7.5.4.v20111024]
> 	at  
> org 
> .eclipse 
> .jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:117) 
> [100:org.eclipse.jetty.server:7.5.4.v20111024]
> 	at  
> org 
> .eclipse 
> .jetty 
> .server.handler.HandlerCollection.handle(HandlerCollection.java:149) 
> [100:org.eclipse.jetty.server:7.5.4.v20111024]
> 	at  
> org 
> .eclipse 
> .jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:110) 
> [100:org.eclipse.jetty.server:7.5.4.v20111024]
> 	at org.eclipse.jetty.server.Server.handle(Server.java:345) 
> [100:org.eclipse.jetty.server:7.5.4.v20111024]
> 	at  
> org 
> .eclipse 
> .jetty.server.HttpConnection.handleRequest(HttpConnection.java:441) 
> [100:org.eclipse.jetty.server:7.5.4.v20111024]
> 	at org.eclipse.jetty.server.HttpConnection 
> $RequestHandler.headerComplete(HttpConnection.java:919) 
> [100:org.eclipse.jetty.server:7.5.4.v20111024]
> 	at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:582) 
> [96:org.eclipse.jetty.http:7.5.4.v20111024]
> 	at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java: 
> 218)[96:org.eclipse.jetty.http:7.5.4.v20111024]
> 	at  
> org 
> .eclipse 
> .jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:51) 
> [100:org.eclipse.jetty.server:7.5.4.v20111024]
> 	at  
> org 
> .eclipse 
> .jetty 
> .io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:586) 
> [95:org.eclipse.jetty.io:7.5.4.v20111024]
> 	at org.eclipse.jetty.io.nio.SelectChannelEndPoint 
> $1.run(SelectChannelEndPoint.java:44)[95:org.eclipse.jetty.io: 
> 7.5.4.v20111024]
> 	at  
> org 
> .eclipse 
> .jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:598) 
> [94:org.eclipse.jetty.util:7.5.4.v20111024]
> 	at org.eclipse.jetty.util.thread.QueuedThreadPool 
> $3.run(QueuedThreadPool.java:533)[94:org.eclipse.jetty.util: 
> 7.5.4.v20111024]
> 	at java.lang.Thread.run(Thread.java:680)[:1.6.0_33]
> Caused by: java.lang.VerifyError: (class: com/cxtsoftware/p141/ 
> services/account/impl/$AccountServiceImpl1183864159, method: <init>  
> signature: (Ljava/lang/reflect/InvocationHandler;)V) Call to wrong  
> initialization method
> 	at java.lang.Class.getDeclaredConstructors0(Native Method)[:1.6.0_33]
> 	at java.lang.Class.privateGetDeclaredConstructors(Class.java:2389)[: 
> 1.6.0_33]
> 	at java.lang.Class.getConstructor0(Class.java:2699)[:1.6.0_33]
> 	at java.lang.Class.getConstructor(Class.java:1657)[:1.6.0_33]
> 	at  
> org 
> .apache 
> .aries 
> .proxy 
> .impl 
> .gen 
> .ProxySubclassGenerator 
> .newProxySubclassInstance(ProxySubclassGenerator.java:159)
> 	at  
> org 
> .apache 
> .aries 
> .proxy.impl.AsmProxyManager.createNewProxy(AsmProxyManager.java:81)
> 	at  
> org 
> .apache 
> .aries 
> .proxy 
> .impl.AbstractProxyManager.createProxy(AbstractProxyManager.java:50)
> 	at  
> org 
> .apache 
> .aries 
> .blueprint.container.BeanRecipe.addInterceptors(BeanRecipe.java:690)
> 	at  
> org 
> .apache 
> .aries.blueprint.container.BeanRecipe.internalCreate(BeanRecipe.java: 
> 730)
> 	at  
> org 
> .apache.aries.blueprint.di.AbstractRecipe.create(AbstractRecipe.java: 
> 64)
> 	at  
> org 
> .apache.aries.blueprint.di.RefRecipe.internalCreate(RefRecipe.java:60)
> 	at  
> org 
> .apache.aries.blueprint.di.AbstractRecipe.create(AbstractRecipe.java: 
> 64)
> 	at  
> org 
> .apache 
> .aries 
> .blueprint 
> .container 
> .BlueprintRepository.createInstances(BlueprintRepository.java:219)
> 	at  
> org 
> .apache 
> .aries 
> .blueprint 
> .container 
> .BlueprintRepository.createInstance(BlueprintRepository.java:198)
> 	at  
> org 
> .apache 
> .aries 
> .blueprint 
> .container.BlueprintRepository.create(BlueprintRepository.java:137)
> 	at  
> org 
> .apache 
> .aries 
> .blueprint.container.ServiceRecipe.createRecipe(ServiceRecipe.java: 
> 370)
> 	at  
> org 
> .apache 
> .aries 
> .blueprint.container.ServiceRecipe.createService(ServiceRecipe.java: 
> 278)
> 	at  
> org 
> .apache 
> .aries 
> .blueprint 
> .container.ServiceRecipe.internalGetService(ServiceRecipe.java:248)
> 	at  
> org 
> .apache 
> .aries 
> .blueprint.container.ServiceRecipe.getService(ServiceRecipe.java:327)
> 	at org.apache.aries.blueprint.container.ServiceRecipe 
> $TriggerServiceFactory.getService(ServiceRecipe.java:430)
> 	at  
> org 
> .apache 
> .felix 
> .framework 
> .ServiceRegistrationImpl 
> .getFactoryUnchecked(ServiceRegistrationImpl.java:310)
> 	... 64 more
> 14:41:14,040 | ERROR | rations/accounts |  
> JAXRSExceptionMapper             | 208 - web - 1.0.0.SNAPSHOT |  
> Error caught in ExceptionMapper
> java.lang.IllegalStateException: getService() returned null for  
> [com.cxtsoftware.p141.services.account.AccountService]
> 	at  
> org 
> .apache 
> .aries 
> .blueprint.container.ReferenceRecipe.getService(ReferenceRecipe.java: 
> 188)
> 	at org.apache.aries.blueprint.container.ReferenceRecipe.access 
> $000(ReferenceRecipe.java:49)
> 	at org.apache.aries.blueprint.container.ReferenceRecipe 
> $ServiceDispatcher.call(ReferenceRecipe.java:206)
> 	at org.apache.aries.proxy.impl.ProxyHandler 
> $1.invoke(ProxyHandler.java:50)
> 	at  
> org 
> .apache.aries.proxy.impl.DefaultWrapper.invoke(DefaultWrapper.java:31)
> 	at  
> org.apache.aries.proxy.impl.ProxyHandler.invoke(ProxyHandler.java:78)
> 	at $Proxy87.findAccounts(Unknown Source)
> 	at  
> com 
> .cxtsoftware 
> .p141 
> .services 
> .operations.AccountsResource.findAccounts(AccountsResource.java:50) 
> [229:operations-service:1.0.0.SNAPSHOT]
> 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)[: 
> 1.6.0_33]
> 	at  
> sun 
> .reflect 
> .NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)[: 
> 1.6.0_33]
> 	at  
> sun 
> .reflect 
> .DelegatingMethodAccessorImpl 
> .invoke(DelegatingMethodAccessorImpl.java:25)[:1.6.0_33]
> 	at java.lang.reflect.Method.invoke(Method.java:597)[:1.6.0_33]
> 	at  
> org 
> .apache 
> .cxf 
> .service 
> .invoker.AbstractInvoker.performInvocation(AbstractInvoker.java:180) 
> [140:org.apache.cxf.cxf-api:2.6.1]
> 	at  
> org 
> .apache 
> .cxf.service.invoker.AbstractInvoker.invoke(AbstractInvoker.java:96) 
> [140:org.apache.cxf.cxf-api:2.6.1]
> 	at org.apache.cxf.jaxrs.JAXRSInvoker.invoke(JAXRSInvoker.java:167) 
> [153:org.apache.cxf.cxf-rt-frontend-jaxrs:2.6.1]
> 	at  
> com 
> .cxtsoftware 
> .p141.commons.web.SubjectInvoker.internalInvoke(SubjectInvoker.java: 
> 40)[208:web:1.0.0.SNAPSHOT]
> 	at com.cxtsoftware.p141.commons.web.SubjectInvoker.access 
> $000(SubjectInvoker.java:23)[208:web:1.0.0.SNAPSHOT]
> 	at com.cxtsoftware.p141.commons.web.SubjectInvoker 
> $1.run(SubjectInvoker.java:34)[208:web:1.0.0.SNAPSHOT]
> 	at java.security.AccessController.doPrivileged(Native Method)[: 
> 1.6.0_33]
> 	at javax.security.auth.Subject.doAs(Subject.java:337)[:1.6.0_33]
> 	at  
> com 
> .cxtsoftware 
> .p141.commons.web.SubjectInvoker.invoke(SubjectInvoker.java:30) 
> [208:web:1.0.0.SNAPSHOT]
> 	at org.apache.cxf.jaxrs.JAXRSInvoker.invoke(JAXRSInvoker.java:94) 
> [153:org.apache.cxf.cxf-rt-frontend-jaxrs:2.6.1]
> 	at org.apache.cxf.interceptor.ServiceInvokerInterceptor 
> $1.run(ServiceInvokerInterceptor.java:58)[140:org.apache.cxf.cxf-api: 
> 2.6.1]
> 	at  
> org 
> .apache 
> .cxf 
> .interceptor 
> .ServiceInvokerInterceptor 
> .handleMessage(ServiceInvokerInterceptor.java:94) 
> [140:org.apache.cxf.cxf-api:2.6.1]
> 	at  
> org 
> .apache 
> .cxf 
> .phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java: 
> 262)[140:org.apache.cxf.cxf-api:2.6.1]
> 	at  
> org 
> .apache 
> .cxf 
> .transport 
> .ChainInitiationObserver.onMessage(ChainInitiationObserver.java:122) 
> [140:org.apache.cxf.cxf-api:2.6.1]
> 	at  
> org 
> .apache 
> .cxf 
> .transport 
> .http.AbstractHTTPDestination.invoke(AbstractHTTPDestination.java: 
> 211)[147:org.apache.cxf.cxf-rt-transports-http:2.6.1]
> 	at  
> org 
> .apache 
> .cxf 
> .transport 
> .servlet.ServletController.invokeDestination(ServletController.java: 
> 213)[147:org.apache.cxf.cxf-rt-transports-http:2.6.1]
> 	at  
> org 
> .apache 
> .cxf 
> .transport.servlet.ServletController.invoke(ServletController.java: 
> 154)[147:org.apache.cxf.cxf-rt-transports-http:2.6.1]
> 	at  
> org 
> .apache 
> .cxf 
> .transport 
> .servlet.CXFNonSpringServlet.invoke(CXFNonSpringServlet.java:129) 
> [147:org.apache.cxf.cxf-rt-transports-http:2.6.1]
> 	at  
> org 
> .apache 
> .cxf 
> .transport 
> .servlet.AbstractHTTPServlet.handleRequest(AbstractHTTPServlet.java: 
> 187)[147:org.apache.cxf.cxf-rt-transports-http:2.6.1]
> 	at  
> org 
> .apache 
> .cxf 
> .transport 
> .servlet.AbstractHTTPServlet.doGet(AbstractHTTPServlet.java:115) 
> [147:org.apache.cxf.cxf-rt-transports-http:2.6.1]
> 	at javax.servlet.http.HttpServlet.service(HttpServlet.java:693) 
> [92:org.apache.geronimo.specs.geronimo-servlet_2.5_spec:1.1.2]
> 	at  
> org 
> .apache 
> .cxf 
> .transport 
> .servlet.AbstractHTTPServlet.service(AbstractHTTPServlet.java:166) 
> [147:org.apache.cxf.cxf-rt-transports-http:2.6.1]
> 	at  
> org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java: 
> 547)[102:org.eclipse.jetty.servlet:7.5.4.v20111024]
> 	at  
> org 
> .eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java: 
> 480)[102:org.eclipse.jetty.servlet:7.5.4.v20111024]
> 	at org.ops4j.pax.web.service.jetty.internal.HttpServiceServletHandler.doHandle 
> (HttpServiceServletHandler.java:70)[112:org.ops4j.pax.web.pax-web- 
> jetty:1.0.11]
> 	at  
> org 
> .eclipse 
> .jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:119) 
> [100:org.eclipse.jetty.server:7.5.4.v20111024]
> 	at  
> org 
> .eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java: 
> 520)[101:org.eclipse.jetty.security:7.5.4.v20111024]
> 	at  
> org 
> .eclipse 
> .jetty.server.session.SessionHandler.doHandle(SessionHandler.java: 
> 227)[100:org.eclipse.jetty.server:7.5.4.v20111024]
> 	at  
> org 
> .eclipse 
> .jetty.server.handler.ContextHandler.doHandle(ContextHandler.java: 
> 941)[100:org.eclipse.jetty.server:7.5.4.v20111024]
> 	at org.ops4j.pax.web.service.jetty.internal.HttpServiceContext.doHandle 
> (HttpServiceContext.java:117)[112:org.ops4j.pax.web.pax-web-jetty: 
> 1.0.11]
> 	at  
> org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java: 
> 409)[102:org.eclipse.jetty.servlet:7.5.4.v20111024]
> 	at  
> org 
> .eclipse 
> .jetty.server.session.SessionHandler.doScope(SessionHandler.java:186) 
> [100:org.eclipse.jetty.server:7.5.4.v20111024]
> 	at  
> org 
> .eclipse 
> .jetty.server.handler.ContextHandler.doScope(ContextHandler.java:875) 
> [100:org.eclipse.jetty.server:7.5.4.v20111024]
> 	at  
> org 
> .eclipse 
> .jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:117) 
> [100:org.eclipse.jetty.server:7.5.4.v20111024]
> 	at  
> org 
> .eclipse 
> .jetty 
> .server.handler.HandlerCollection.handle(HandlerCollection.java:149) 
> [100:org.eclipse.jetty.server:7.5.4.v20111024]
> 	at  
> org 
> .eclipse 
> .jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:110) 
> [100:org.eclipse.jetty.server:7.5.4.v20111024]
> 	at org.eclipse.jetty.server.Server.handle(Server.java:345) 
> [100:org.eclipse.jetty.server:7.5.4.v20111024]
> 	at  
> org 
> .eclipse 
> .jetty.server.HttpConnection.handleRequest(HttpConnection.java:441) 
> [100:org.eclipse.jetty.server:7.5.4.v20111024]
> 	at org.eclipse.jetty.server.HttpConnection 
> $RequestHandler.headerComplete(HttpConnection.java:919) 
> [100:org.eclipse.jetty.server:7.5.4.v20111024]
> 	at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:582) 
> [96:org.eclipse.jetty.http:7.5.4.v20111024]
> 	at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java: 
> 218)[96:org.eclipse.jetty.http:7.5.4.v20111024]
> 	at  
> org 
> .eclipse 
> .jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:51) 
> [100:org.eclipse.jetty.server:7.5.4.v20111024]
> 	at  
> org 
> .eclipse 
> .jetty 
> .io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:586) 
> [95:org.eclipse.jetty.io:7.5.4.v20111024]
> 	at org.eclipse.jetty.io.nio.SelectChannelEndPoint 
> $1.run(SelectChannelEndPoint.java:44)[95:org.eclipse.jetty.io: 
> 7.5.4.v20111024]
> 	at  
> org 
> .eclipse 
> .jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:598) 
> [94:org.eclipse.jetty.util:7.5.4.v20111024]
> 	at org.eclipse.jetty.util.thread.QueuedThreadPool 
> $3.run(QueuedThreadPool.java:533)[94:org.eclipse.jetty.util: 
> 7.5.4.v20111024]

---------------------------------------------
Freeman Fang

FuseSource
Email:ffang@fusesource.com
Web: fusesource.com
Twitter: freemanfang
Blog: http://freemanfang.blogspot.com
http://blog.sina.com.cn/u/1473905042
weibo: http://weibo.com/u/1473905042