1 Reply Latest reply on Nov 23, 2004 5:38 PM by Michael Gandor

    Local EJB session error

    Michael Gandor Newbie

      I have local tessted SessionBean ( the same is tof LocalEntityBean).
      In jboss.xml I have settings for set localEJB to the global INDI Namespace




      on jmx-console pages I can check that JNDI name is coorect.

      +- UserTransaction (class: org.jboss.tm.usertx.client.ClientUserTransaction)
      +- Counter (proxy: $Proxy49 implements interface session1.CountLocalHome)
      +- invokers (class: org.jnp.interfaces.NamingContext)

      I have tested class in web to communicate with local EJB.

      Hashtable env = new Hashtable();
      env.put(Context.PROVIDER_URL, "localhost:1099");
      String message="get message";
      int i=1;
      Context ctx = new InitialContext(env);
      Object obj=ctx.lookup("Counter");
      CountLocalHome home=(CountLocalHome)obj;

      That code is correct in JBoss-3.2.5, but
      in JBoss-4.0.0 it is not correct

      I have Exception
      21:34:07,523 INFO [STDOUT] java.lang.ClassCastException
      21:34:07,523 INFO [STDOUT] at test.Session1.getSession1(Unknown Source)
      21:34:07,523 INFO [STDOUT] at org.apache.jsp.test_jsp._jspService(test_jsp.java:74)

      What is wrong?

      I can send tested ear package and sources.

        • 1. Re: Local EJB session error
          Michael Gandor Newbie

          Ok I did more tests, and I can reapeat that error on every new JBoss.
          In my tests I also added packet.jar file into lib server dir.
          In packet.jar are the same classes which are used in packet.ear file.
          It is simplicity to have no problems in time of test with access to classes.

          When I run JBoss-4.0.0 without packet.jar then my EJB behaviour is correct.

          Can any JBoss Guru tell me it is mistake to have packet.jar in lib directory?