2 Replies Latest reply on May 24, 2006 11:07 AM by Laurent PAGE

    Exception occurred when I want to get Ejb Home object, why?

    wei yonglai Newbie

      Exception description:


      java.lang.ClassCastException
      com.sun.corba.se.internal.javax.rmi.PortableRemoteObject.narrow(PortableRemoteObject.java:293)
      javax.rmi.PortableRemoteObject.narrow(PortableRemoteObject.java:134)
      cn.edu.jlu.ejb.Delegate.getUserHome(Delegate.java:35)

      sub-client
      :
      Object objref = new InitialContext().lookup("ejb/User");
      userHome = (UserHome)PortableRemoteObject.narrow(objref, UserHome.class);
      
      sub-ejb-jar.xml

      <ejb-name>User</ejb-name>
      <home>cn.edu.jlu.ejb.UserHome</home>
      <remote>cn.edu.jlu.ejb.User</remote>
      <ejb-class>cn.edu.jlu.ejb.UserBean</ejb-class>
      <persistence-type>Bean</persistence-type>

      sub-jboss.xml
      <entity>
       <ejb-name>User</ejb-name>
       <jndi-name>ejb/User</jndi-name>
      </entity>
      
      sub-jboss-web.xml
      <ejb-ref>
       <ejb-ref-name>ejb/User</ejb-ref-name>
       <jndi-name>ejb/User</jndi-name>
      </ejb-ref>
      
      sub-web.xml
      <ejb-ref>
       <ejb-ref-name>ejb/User</ejb-ref-name>
       <ejb-ref-type>Entity</ejb-ref-type>