Ok, I was interpreting the error msg wrong. Configure is called before
@EndpointInject is injected, so updateService is null when configure is
called.

Is this a feature or bug? It would be nice to be able to use @EndpointInject
in RouteBuilders, instead of the more verbose explicit lookup.

/Magnus

On Wed, Mar 5, 2008 at 2:12 PM, Magnus Heino <[EMAIL PROTECTED]> wrote:

>
> Whats wrong with this?
>
> @Component
> public class ServiceRoutes extends SpringRouteBuilder {
>
>     @EndpointInject
>     protected Endpoint<?> updateService;
>
>     public void configure() throws Exception() {
>         Endpoint<?> myUpdateService = (Endpoint<?>) this.getContext
> ().getRegistry().lookup("updateService");
>     }
> }
>
>
> myUpdateService is successfully looked up, but the @EndpointInject fails
> with:
>
> java.lang.IllegalArgumentException: Either 'uri' or 'ref' must be
> specified on: [EMAIL PROTECTED]
>     at org.apache.camel.impl.RouteContext.resolveEndpoint(
> RouteContext.java:117)
>     at org.apache.camel.model.ToType.resolveEndpoint(ToType.java:80)
>     at org.apache.camel.model.ToType.createProcessor(ToType.java:74)
>     at org.apache.camel.model.ProcessorType.makeProcessor(
> ProcessorType.java:1205)
>     at org.apache.camel.model.ProcessorType.addRoutes(ProcessorType.java
> :91)
>     at org.apache.camel.model.RouteType.addRoutes(RouteType.java:177)
>     at org.apache.camel.model.RouteType.addRoutes(RouteType.java:71)
>     at org.apache.camel.impl.DefaultCamelContext.startRouteDefinitions(
> DefaultCamelContext.java:466)
>     at org.apache.camel.impl.DefaultCamelContext.doStart(
> DefaultCamelContext.java:458)
>     at org.apache.camel.spring.SpringCamelContext.doStart(
> SpringCamelContext.java:143)
>     at org.apache.camel.impl.ServiceSupport.start(ServiceSupport.java:51)
>     at org.apache.camel.spring.SpringCamelContext.onApplicationEvent(
> SpringCamelContext.java:96)
>
>
> --
>
>  /Magnus Heino




-- 

 /Magnus Heino

Reply via email to