Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Exception when calling Entity from session bean

3 views
Skip to first unread message

Sadi melbouci

unread,
Jan 7, 2004, 1:44:55 PM1/7/04
to
I am trying to call an entity bean from a session bean and an expetion is being thrown. The session and entity bean are on separate jar files.
I will appreciate any help.

The session ejb-jar has the following:
<ejb-ref>
<ejb-ref-name>ejb/CoBean</ejb-ref-name>
<ejb-ref-type>Entity</ejb-ref-type>
....
<ejb-link>CoBean</ejb-link>
</ejb-ref>

The exception thrown is that it can not resolve the entity bean:
weblogic.deployment.EnvironmentException: [J2EE:160101]Error: The ejb-link 'CoBe
an' declared in the ejb-ref or ejb-local-ref 'ejb/CoBean' in the application mod
ule 'GenericSessionEJB.jar' could not be resolved. The target EJB for the ejb-re
f could not be found. Please ensure the link is correct.
at weblogic.ejb20.deployer.EnvironmentBuilder.addEJBLinkRef(EnvironmentB
uilder.java:738)
at weblogic.ejb20.deployer.EnvironmentBuilder.addEJBReferences(Environme
ntBuilder.java:537)
at weblogic.ejb20.deployer.EJBDeployer.bindEJBReferences(EJBDeployer.jav
a:1609)at weblogic.ejb20.deployer.EJBDeployer.activate(EJBDeployer.java:1375)
The entity ejb-jar contain:

<entity>
<ejb-name>CoBean</ejb-name>
....
</entity>

Deepak Vohra

unread,
Jan 8, 2004, 8:06:34 PM1/8/04
to

The ejb-link element value should be relative to the ejb jar file.
For example if the session ejb jar and entity ejb jar files are in a ear file.
To refer to the entity bean from the session bean

<ejb-link>./enity_ejb_jar_file/CoBean</ejb-link>

Deepak Vohra

unread,
Jan 9, 2004, 10:35:28 AM1/9/04
to

Make the ejb-link element
<ejb-link>../entity_ejb_jar_file/CoBean</ejb-link>

thanks,
Deepak

0 new messages