0 Replies Latest reply on Feb 17, 2006 9:49 AM by Bernhard Neuhauser

    ejb - lookup fails

    Bernhard Neuhauser Newbie

      I try to reach a session bean remotly.

      The code is rather simple:

      InitialContext ctx = new InitialContext();
      Object o = ctx.lookup("DummyBean");


      tells me that this object imlements the NamingContext interface.

      All howtos explain that a simple cast to the remote Interface should be enough. But whenever i try to cast to DummyBean it fails with a ClassCastException.

      When i use the same .ejb3 deployment with glassfish it works well without any hassles.

      Differences i noticed between jboss and glassfish:
      When i lookup to glassfish the syntax is ctx.lookup("thetest.DummyBean");

      But with jboss it seems like its ctx.lookup("DummyBean") works.

      When i try to cast the glassfish object to the RemoteInterface it works well. But when i try to cast the jboss object to the remote interface or to the bean itself it simple fails.

      The deployment line from the logfile:
      15:48:23,625 INFO [Ejb3AnnotationHandler] found EJB3: ejbName=DummyOneBean, class=thetest.DummyOneBean, type=STATELESS

      Im quite new to jboss, so help would be really great

      Bernhard Neuhauser