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

Edstrom Johan commented on CAMEL-4552:
--------------------------------------

08:27  joed> Is this actually a bug? 
https://issues.apache.org/jira/browse/CAMEL-4552 From the example it looks like 
camel should perform annotationscanning across the bundle cp? Isn't it so that 
at least a packageScan or routeScan 
             should be needed? If so bp actually does perform the injecting
08:28  joed> That may be broken though, but at least it is "trying"

09:43  cibsen> joed could be not a bug, but we dont have it tested
09:43  cibsen> and blueprint had many missing features in the start
09:44  cibsen> and @EndpointInject @Produce etc is CAmel specific annotations
09:44  joed> I guess I'm wondering what the correct behaviour should be 
actually. :) I have a test project with spring/blueprint
09:44  cibsen> if possible to IoC the stuff like we do in camel-spring
09:44  joed> CamelInjector extends CamelPostProcessorHelper implements 
BeanProcessor
09:44  cibsen> so you can inject a ProducerTemplate / Endpoint etc usign those 
annotations
09:44  joed> It is there.
09:45  cibsen> ah kewl
09:45  cibsen> but it possible dont work due that exception
09:45  cibsen> the JIRA was created to look into the issue - eg to not forget 
about it

09:45  joed> I cannot reproduce the exception with regular endoints, I was too 
tired to install jbi/nmr

                
> Add support for @EndpointInject, @Producer, etc in camel-blueprint as we 
> support in camel-spring
> ------------------------------------------------------------------------------------------------
>
>                 Key: CAMEL-4552
>                 URL: https://issues.apache.org/jira/browse/CAMEL-4552
>             Project: Camel
>          Issue Type: Improvement
>          Components: camel-blueprint
>    Affects Versions: 2.8.0
>            Reporter: Charles Moulliard
>             Fix For: 2.9.0
>
>
> The following syntax with Camel 2.8 generates the error
> {code}
> public class NmrConsumerRoute extends RouteBuilder{
>  @EndpointInject(ref="nmrConsumer")
>  private Endpoint demo1ConsumerUri ;
>  @Override
>  public void configure() throws Exception {
>   from("nmr:demo1").log("${in.body}");
>  }
> }
> <blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0";
>       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
>       xmlns:camel="http://camel.apache.org/schema/blueprint";
>       xsi:schemaLocation="
>       http://www.osgi.org/xmlns/blueprint/v1.0.0
> http://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd
>       http://camel.apache.org/schema/blueprint
> http://camel.apache.org/schema/blueprint/camel-blueprint.xsd";>
>  <camelContext xmlns="http://camel.apache.org/schema/blueprint";>
>     <endpoint id="nmrConsumer" uri="nmr:demo1"/>
>  </camelContext>
> </blueprint>
> {code}
> Error
> {code}
> Caused by: org.apache.camel.FailedToCreateRouteException: Failed to
> create route route8: Route[[From[no uri or ref supplied!]] ->
> [Log[${in.body}]]] because of Either 'uri' or 'ref' must be specified
> on: org.apache.camel.impl.DefaultRouteContext@2dac2cb7
>        at 
> org.apache.camel.model.RouteDefinition.addRoutes(RouteDefinition.java:170)
>        at 
> org.apache.camel.impl.DefaultCamelContext.startRoute(DefaultCamelContext.java:698)
>        at 
> org.apache.camel.impl.DefaultCamelContext.startRouteDefinitions(DefaultCamelContext.java:1660)
>        at 
> org.apache.camel.impl.DefaultCamelContext.doStartCamel(DefaultCamelContext.java:1447)
>        at 
> org.apache.camel.impl.DefaultCamelContext.doStart(DefaultCamelContext.java:1339)
>        at org.apache.camel.impl.ServiceSupport.start(ServiceSupport.java:67)
>        at org.apache.camel.impl.ServiceSupport.start(ServiceSupport.java:54)
>        at 
> org.apache.camel.impl.DefaultCamelContext.start(DefaultCamelContext.java:1317)
>        at 
> org.apache.camel.blueprint.BlueprintCamelContext.maybeStart(BlueprintCamelContext.java:88)
>        at 
> org.apache.camel.blueprint.BlueprintCamelContext.init(BlueprintCamelContext.java:80)
>        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native 
> Method)[:1.6.0_26]
>        at 
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)[:1.6.0_26]
>        at 
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)[:1.6.0_26]
>        at java.lang.reflect.Method.invoke(Method.java:597)[:1.6.0_26]
>        at 
> org.apache.aries.blueprint.utils.ReflectionUtils.invoke(ReflectionUtils.java:226)[10:org.apache.aries.blueprint:0.3.1]
>        at 
> org.apache.aries.blueprint.container.BeanRecipe.invoke(BeanRecipe.java:824)[10:org.apache.aries.blueprint:0.3.1]
>        at 
> org.apache.aries.blueprint.container.BeanRecipe.runBeanProcInit(BeanRecipe.java:636)[10:org.apache.aries.blueprint:0.3.1]
>        ... 24 more
> {code}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to