Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

weblogic 9.1: cannot lookup entity ejb in jndi

Status
Not open for further replies.

538879

Programmer
May 25, 2008
2
0
0
RU
Hello, everyone.
I have several beans which are deployed without any errors.
I have client that initializes initialContext:
Code:
Properties props = new Properties();
            props.put(Context.INITIAL_CONTEXT_FACTORY,
                    weblogic.jndi.WLInitialContextFactory.class.getName());
            props.put(Context.PROVIDER_URL, "iiop://localhost:7001");
            Context context = new InitialContext(props);
            Object obj = context.lookup("ejb/Project");


But the last statement throws exception:
Code:
javax.naming.NameNotFoundException: Exception in lookup.: `ejb/Project' could not be found
I defined every bean in ejb-jar.xml[/color blue]:
Code:
...
<entity>
      <display-name>Project Bean</display-name>
      <ejb-name>ProjectBean</ejb-name>
      <home>ejb.ProjectHome</home>
      <remote>ejb.Project</remote>
      <local-home>ejb.ProjectLocalHome</local-home>
      <local>ejb.ProjectLocal</local>
      <ejb-class>ejb.ProjectBean</ejb-class>
      <persistence-type>Bean</persistence-type>
      <prim-key-class>java.lang.Integer</prim-key-class>
      <reentrant>false</reentrant>
      <resource-ref>
        <res-ref-name>jdbc/OracleDB</res-ref-name>
        <res-type>javax.sql.DataSource</res-type>
        <res-auth>Container</res-auth>
      </resource-ref>
    </entity>
...
from weblogic-ejb-jar.xml[/color blue]:
Code:
...
<weblogic-enterprise-bean>
        <ejb-name>ProjectBean</ejb-name>
        [b]<jndi-name>ejb/Project</jndi-name>[/b]
    </weblogic-enterprise-bean>
...
And weblogic server doesn't show this ejb in jndi tree also.
Any help or advice is appreciated.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top