10 Replies Latest reply on Sep 14, 2001 3:23 PM by Paul Austin

    problem looking up an entity bean from a session bean

    lemasson Newbie

      My trouble is similar to the jsk'problem (Aug 31).
      I deploy a session bean and an entity bean in the same jar file. When the session bean try to look up the entity bean, an error is raised:

      javax.naming.CommunicationException. Root exception is java.net.MalformedURLException: no protocol: Files/jboss-2.2.1/tmp/deploy/Default/myJar.jar/ejb1001.jar

      The code looking for the entity myEntity from the session bean mySessionBean is:

      InitialContext ctx = new InitialContext ();
      Object obj = ctx.lookup(myEntityName) ; // here it doesn't work
      myEntityHome = (myEntityHome)PortableRemoteObject.narrow(obj,myEntityHome.class);
      


      The XML file ejb-jar.xml seems to be good and contains the ejb-ref part:
      <session>
      ...
      <ejb-name>mySession</ejb-name>
      ...
      <ejb-ref>
      <ejb-ref-name>entity/MyEntity</ejb-ref-name>
      <ejb-ref-type>Entity</ejb-ref-type>
      <home>com.myPackage.MyEntityHome</home>
      <remote>com.myPackage.MyEntity</remote>
      <ejb-link>MyEntity</ejb-link>
      </ejb-ref>
      ...
      </session>
      


      There is no jboss.xml.

      If someone have a solution ...

      Thanks,
      watt.