[ 
https://issues.apache.org/jira/browse/CAMEL-9570?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15296747#comment-15296747
 ] 

Quinn Stevenson commented on CAMEL-9570:
----------------------------------------

One more thing - I noticed one change in the stack trace for the case when the 
service-reference is injected into the route builder.

When the route is initially running, the service is called via 
sun.reflect.NativeMethodAccessorImpl.  However, after the OSGi service is 
stopped (when I'd expect the call to pickup a new service, blocking until one 
becomes available), the stack changes and the service is called via a 
sun.reflect.GeneratedMethodAccessor.

Initial stack trace
        at 
com.pronoia.osgi.service.impl.ServiceOneImplementation.execute(ServiceOneImplementation.java:20)
        at Proxye4dcb4b6_278e_4b9e_b700_e969c2379f0d.execute(Unknown Source)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native 
Method)[:1.8.0_91]
        at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)[:1.8.0_91]
        at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)[:1.8.0_91]
        at java.lang.reflect.Method.invoke(Method.java:498)[:1.8.0_91]
        at 
org.apache.camel.component.bean.MethodInfo.invoke(MethodInfo.java:408)[55:org.apache.camel.camel-core:2.18.0.SNAPSHOT]

Stack trace after service is stopped
        at 
com.pronoia.osgi.service.impl.ServiceOneImplementation.execute(ServiceOneImplementation.java:20)
        at Proxye4dcb4b6_278e_4b9e_b700_e969c2379f0d.execute(Unknown Source)
        at sun.reflect.GeneratedMethodAccessor91.invoke(Unknown Source)
        at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)[:1.8.0_91]
        at java.lang.reflect.Method.invoke(Method.java:498)[:1.8.0_91]
        at 
org.apache.camel.component.bean.MethodInfo.invoke(MethodInfo.java:408)[55:org.apache.camel.camel-core:2.18.0.SNAPSHOT]


> Blueprint Proxies are not used when injected into Java RouteBuilders
> --------------------------------------------------------------------
>
>                 Key: CAMEL-9570
>                 URL: https://issues.apache.org/jira/browse/CAMEL-9570
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-blueprint, camel-core
>    Affects Versions: 2.16.2
>            Reporter: Quinn Stevenson
>            Assignee: Christian Schneider
>
> Basic Conditions:
> - Java interface used for OSGi Services
> - Implementation of the Java interface registered as a OSGi service.  Note 
> that the package containing implementation is NOT exported
> - A Java RouteBuilder that uses the Java interface via bean(...) DSL calls, 
> with a setter for the bean implementing the interface
> - Wire everything together with Blueprint - create a <reference ...> for the 
> service, a <bean ...> for the RouteBuilder and inject the service reference, 
> and use the RouteBuilder in a CamelContext.
> After all this is deployed, stop the bundle implementing the service.  A 
> ServiceUnavailableException should be thrown after a timeout, but the object 
> that was injected into the RouteBuilder process the request - so the 
> Blueprint Proxy is not used.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to