3 Replies Latest reply on Oct 2, 2012 3:05 AM by Kirill Mikhailov

    JNDI Lookup is not working in thread's run method AS 7.1

    sandip jorwekar Newbie

      My code is working properly when i don't use thread  ( It does JNDI lookup and return home stub and also and also create the remote object stub)

      But When i use Thread (run method) to do JNDI lookup, at that time JNDI lookup for home stub is successful but it fails when home.create() method is get called and it returns with below error

      java.lang.IllegalStateException: No EJB receiver available for handling [appName:,modulename:auroraclientcommon,distinctname:]

      my code snippet is as below and i get the error at Book xref1=bookHome.create();

      public void run() {
      // TODO Auto-generated method stub
      System.out.println("runnable");
      BookHome bookHome = null;
      try { bookHome = (BookHome) ctx.lookup("app/Book!test.BookHome"); }

      Book xref1=bookHome.create();
      System.out.println("run "+xref1);
      } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); }
      }