0 Replies Latest reply on Jun 28, 2002 8:54 AM by aejp

    Problem redeploying an entity bean used by a stateless sessi

    aejp

      Hi,

      I have a simple CMP entity bean which talks to an SQLServer database; I have added a stateless session bean between my client and the entity bean. This session bean provides a method to find multiple entries. The session bean uses a remote looks up on the entity bean at the moment. The stateless session bean returns a vector of data-only objects which are created from the entity bean data.

      The problem I have is on redeployment.

      I have two test harnesses, one to access the entity bean directly and another to use the stateless session bean.

      I have no problems using either test harness until I redeploy my entity bean; every time, the redeployment leads to an exception being thrown (see end of message for top part of stack trace).

      After redeploying my entity bean this problem only happens on the server, ie in the stateless session bean; I can run the direct-to-entity test without a problem.

      If I redeploy my stateless bean (ie after the exception and therefore after my entity bean!) things work again!

      I've tried this with my session and entity beans in a single JAR but it always fails [I suspect this is beacuse the order of the beans in the xml put the session bean first so I was effectively redeploying the entity bean each time]

      I have a half-theory that something in the stateless session bean is holding on to something which refers to the entity bean and when I redeploy it's trying to reuse this rather than reestablish - i.e there seems to be some sort of dependency from the stateless session bean.

      If I shut down the server after the exception is thrown, the restart brings everything up fine (which adds weight the the suggestion that something in the stateless session bean is holding a reference somewhere)

      Does anyone have any ideas?

      thanks

      Tony

      2002-06-28 12:44:14,201 ERROR [STDERR] java.lang.ClassCastException
      2002-06-28 12:44:14,201 ERROR [STDERR] at com.sun.corba.se.internal.javax.rmi.PortableRemoteObject.narrow(PortableRemoteObject.java:293)
      2002-06-28 12:44:14,201 ERROR [STDERR] at javax.rmi.PortableRemoteObject.narrow(PortableRemoteObject.java:134)
      2002-06-28 12:44:14,211 ERROR [STDERR] at com.axxia.phonelist.EmployeeFacadeBean.getEmployees(EmployeeFacadeBean.java:23)
      2002-06-28 12:44:14,211 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      2002-06-28 12:44:14,211 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      2002-06-28 12:44:14,211 ERROR [STDERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      2002-06-28 12:44:14,211 ERROR [STDERR] at java.lang.reflect.Method.invoke(Method.java:324)
      2002-06-28 12:44:14,211 ERROR [STDERR] at org.jboss.ejb.StatelessSessionContainer$ContainerInterceptor.invoke(StatelessSessionContainer.java:664)