2 Replies Latest reply on Feb 10, 2004 11:06 AM by sunkur

    ejb bug on JBoss - error in lookup- Need urgent help

    sunkur Newbie

      Hi All,

      I am getting error NameNotfoundexception-com not found on JBoss

      I am using JBoss3.2.1,apache ant to build and deploy classes.

      I created .war file under JBoss/server/default/deployand deployed jsp, and ejb jar file into war file
      My ejbJar file consists of ejbclasses.serverclasses,Metainf folder with ejb-jar.xml and JBoss.xml

      Properties p = new Properties();
      p.setProperty(Context.INITIAL_CONTEXT_FACTORY,
      "org.jnp.interfaces.NamingContextFactory");
      p.setProperty(Context.PROVIDER_URL, "jnp://localhost:1099"); p.setProperty("java.naming.factory.url.pkgs",
      "org.jboss.naming:org.jnp.interfaces");
      Context ctx = new InitialContext(p);
      Object obj = ctx.lookup("com/emp/EmpHome");
      EmpHome home = (EmpHome) javax.rmi.PortableRemoteObject.narrow( obj, EmpHome.class );

      I am getting error
      javax.naming.NameNotFoundException: com not bound
      at org.jnp.server.NamingServer.getBinding(NamingServer.java:495)
      at org.jnp.server.NamingServer.getBinding(NamingServer.java:503)
      at org.jnp.server.NamingServer.getObject(NamingServer.java:509)
      at org.jnp.server.NamingServer.lookup(NamingServer.java:253)
      at org.jnp.server.NamingServer.lookup(NamingServer.java:256)
      at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:492)
      at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:606)
      at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:471)
      at javax.naming.InitialContext.lookup(InitialContext.java:350)
      at org.apache.jsp.processcustomer_jsp.getEmpRemoteRef(processcustomer_jsp.java:53)

      Here is my ejb-jar.xml info
      --------------------------------------
      <ejb-jar>
      Employee EJB
      <display-name>EmpHome</display-name>
      <enterprise-beans>

      <ejb-name>EmpHome</ejb-name>
      com.emp.EmpHome
      com.emp.EmpRemote
      <ejb-class>com.emp.EmpBean</ejb-class>
      <session-type>Stateless</session-type>
      <transaction-type>Container</transaction-type>

      </enterprise-beans>
      <assembly-descriptor>
      <container-transaction>
      Transaction attributes for 'EmpEJB' methods

      <ejb-name>EmpHome</ejb-name>
      <method-name>*</method-name>

      <trans-attribute>Supports</trans-attribute>
      </container-transaction>
      <container-transaction>

      <ejb-name>EmpHome</ejb-name>
      <method-intf>Home</method-intf>
      <method-name>*</method-name>

      <trans-attribute>Supports</trans-attribute>
      </container-transaction>
      <container-transaction>

      <ejb-name>EmpHome</ejb-name>
      <method-intf>Remote</method-intf>
      <method-name>*</method-name>

      <trans-attribute>Supports</trans-attribute>
      </container-transaction>
      </assembly-descriptor>
      </ejb-jar>


      JBoss.xml
      ---------------

      <?xml version="1.0" encoding="UTF-8"?>
      <!DOCTYPE jboss PUBLIC
      "-//JBoss//DTD JBOSS 3.0//EN"
      "http://www.jboss.org/j2ee/dtd/jboss_3_0.dtd">

      <enterprise-beans>

      <ejb-name>EmpHome</ejb-name>
      <jndi-name>com/emp/EmpHome</jndi-name>

      </enterprise-beans>



      I think there is some error in lookup. Any thaughts?

      Please let me know what I am missing.
      I'll be very thankful.
      SunKur