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

Brad Johnson commented on CAMEL-9570:
-------------------------------------

I'd be curious what class you see when you inject the reference.  In certain 
configurations with the route builders and annotations I'd see it inject 
non-proxied elements.  When I'd do the blueprintReference.getClass().getName() 
I'd see the concrete type of implementing class.  If I injected it it in a 
different fashion I'd see the com.sun.Proxy which is what I'd expect.  So what 
appears to be happening is that some other mechanic is loading that class and 
injecting in a non-proxied fashion.  When the other bundle is stopped it 
doesn't care because it isn't coming through that classloading mechanism.  

You are seeing the issue when  you do this which is similar to what I was doing 
with the package scanning when I saw that behavior.  I've been sick  for a few 
days and completely modified my design to skirt the issue so I don't recall it 
all right now. 

<camelContext id="very-simple-context"
                xmlns="http://camel.apache.org/schema/blueprint";>
<routeBuilder ref="very-simple-route-builder" />    
        </camelContext>

I was doing this:

<camelContext id="very-simple-context"  
xmlns="http://camel.apache.org/schema/blueprint";>
              <package>com.foo.bar</package>
</camelContext>

At least I think that was the syntax but it's been awhile.  

> 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