Hello, everyone.
I have several beans which are deployed without any errors.
I have client that initializes initialContext:
But the last statement throws exception:
I defined every bean in ejb-jar.xml[/color blue]:
from weblogic-ejb-jar.xml[/color blue]:
And weblogic server doesn't show this ejb in jndi tree also.
Any help or advice is appreciated.
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
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>
...
Code:
...
<weblogic-enterprise-bean>
<ejb-name>ProjectBean</ejb-name>
[b]<jndi-name>ejb/Project</jndi-name>[/b]
</weblogic-enterprise-bean>
...
Any help or advice is appreciated.