5 Replies Latest reply on Dec 24, 2009 1:01 PM by Bob Casazza

    @Produce - producing null pointer

    Bob Casazza Newbie

      Hi,

       

      I'm not sure where I'm going wrong.

       

      I'm trying to use the @Produce annotation, following an example. Seems simple enough...

       

           public interface MyListener {

               String sayHello(String name);

           }

       

           @Produce(uri="test-jms:queue:test.queue")

           MyListener     producer;

            

           public void sendMsg() throws Exception {

                 

                producer.sayHello("Test Msg");

                 

           }

       

      In my main, I create the Camel Context, add the test-jms component.. start up the context... then I create the class containing sendMsg and call it... producer is null... I've not used annotations much before.. I still have to instantiate producer? The annotation doesn't do that for me, correct?

       

      Bob