camel-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Brad Johnson (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (CAMEL-9570) Blueprint Proxies are not used when injected into Java RouteBuilders
Date Thu, 26 May 2016 18:01:12 GMT

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

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

Quinn,

Are you using any of the injection annotations?  I ran into that same
problem when I was using annotations for injection instead of plain ol'
getter/setter.  I think I posted something about it sometime back.  I was
pretty puzzled by it at the time because my service was coming from another
bundle but when I would print out the bean being injected it clearly showed
that it was of the concrete type and not the proxied interface.  That
alarmed me a bit since I wasn't sure what was happening and obviously some
classloader shenanigans were happening that I was unaware of.  When I get
rid of the annotations and used the getter/setter explicitly the problem
went away.  That still left me a bit nervous so I try to check for that
regularly now.

Brad

On Thu, May 26, 2016 at 12:44 PM, Quinn Stevenson (JIRA) <jira@apache.org>



> 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)

Mime
View raw message