5 Replies Latest reply on Jan 13, 2012 3:12 AM by Christos Vasilakis

    Access EJB

    Christos Vasilakis Newbie

      Hi there,


      I have defined a Singleton EJB as





      public class Routing {

      private HashMap<String, HashMap<String, NE>> routing;



      public void init() {



      routing  =  new HashMap<String, HashMap<String, NE>>();




      public void cleanup() {





      public void addRouteFromRegistrationCommandMsg(RegistrationCommandMessage message) {




      On my RouteBuilder I


             .unmarshal().json(JsonLibrary.Jackson, gr.forthnet.nms.svcrrd.service.messages.RegistrationCommandMessage.class)

                 .bean(Routing.class, "addRouteFromRegistrationCommandMsg(gr.forthnet.nms.svcrrd.service.messages.RegistrationCommandMessage)")                       

             .log("registration completed");


      The bean is successfully called together with json unmarshalling. The problem is that routing instance variable is NULL and I get a NullPointerException so probably it is not the EJB but a new bean instance. I thought because the bean is exposed as CDI I could have access to it.


      The other method is to use camel-ejb component. I tried it too (and installed the camel-ejb component on the jboss instance) but I couldn't get access to it. Something is wrong with the JNDI name and the way I call it.


      Any tips on how to proper access the EJB through the route?