Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Lookup problem for local beans on oc4j

 
Ranadhir Nag
Ranch Hand
Posts: 138
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A lookup of a local Bean as follows:

<%
Context context = new InitialContext();
jdevpackage.hrAppEJBLocalHome hrapphome = (jdevpackage.hrAppEJBLocalHome)context.lookup("java:comp/env/ejb/hrAppEJB");

// Create local object
jdevpackage.hrAppEJBLocal hrapp = (jdevpackage.hrAppEJBLocal)hrapphome.create();

%>

where the web.xml contains the reference of the bean as follows:

<ejb-ref>
<ejb-ref-name>hrApp</ejb-ref-name>
<ejb-ref-type>Session</ejb-ref-type>
<home>jdevpackage.hrAppEJBHome</home>
<remote>jdevpackage.hrAppEJB</remote>
</ejb-ref>
<ejb-local-ref>
<ejb-ref-name>ejb/hrAppEJB</ejb-ref-name>
<ejb-ref-type>Session</ejb-ref-type>
<local-home>jdevpackage.hrAppEJBLocalHome</local-home>
<local>jdevpackage.hrAppEJBLocal</local>
</ejb-local-ref>

gives the following Java exception:
javax.naming.NamingException: Error instantiating web-app JNDI-context: No location specified and no suitable instance of the type 'jdevpackage.hrAppEJB' found for the ejb-ref hrApp


I am using oc4j and jdeveloper for deployment.
 
Andreas Schaefer
Ranch Hand
Posts: 63
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
To me that looks more like that the 'remote' EJB-Ref is invalid. Do you have a Remote Interface for this EJB? If not then please remove the EJB-Ref and only keep the local one.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic