ejb-link

ah, didn't know this forum existed - forgive the cross post from EJB Beans forum:

Hello all,

I'm trying to use the 1.4.1 AVK and keep running into an issue.

I have an entity EJB jar and two session EJB jars, each with their own ejb-jar.xml.

In the entity jar's ejb-jar.xml I have:

=====

<ejb-name>Mydataobject</ejb-name>

=====

For each of the session jars, their ejb-jar.xml has a local reference:

=====

<ejb-local-ref id="EJBLocalRef_1">

<ejb-ref-name>com/mydomain/interfaces/MydataobjectLocalHome</ejb-ref-name>

<ejb-ref-type>Entity</ejb-ref-type>

<local-home>com.mydomain.interfaces.MydataobjectLocalHome</local-home>

<local>com.mydomain.interfaces.MydataobjectLocal</local>

<ejb-link>Mydataobject</ejb-link>

</ejb-local-ref>

=======

Now, everything I've read regarding the EJB2.1 spec (specifically section 20.3.2) says this is how you can do this as long as all the jars are within the same application. So how come the AVK keeps coming failing with:

========

Error: No enterprise bean matching [ Mydataobject ] found within [ com.mydomain.session.ejb.<SessionOne or SessionTwo> ] JAR file.

Assertion:

EJB Link element test. Please refer to EJB 2.1 Specification Section #20.3.2 for further information.

Test Name:

tests.ejb.elements.EjbLinkElement

========

thanks, very confused.

-D

[1556 byte] By [binarymonk_01a] at [2007-10-1 21:14:04]
# 1

Do you have one ear file which contains these three ejb jars (one entity and two session). All the three jars should be in the same ear file to be considered as part of same application. There should be proper entries in META-INF/application.xml for the three jars.

I did the following and it worked for me.

I have an ear file "sample.ear" which contains

stateless-ejb.jar

stateful-ejb.jar

entity-ejb.jar

In the entity jar's ejb-jar.xml I have:

=====

<ejb-name>DummyBean</ejb-name>

=====

In the stateful-ejb.jar's ejb-jar.xml I have-

=====

<ejb-local-ref id="EJBLocal">

<ejb-ref-name>com/abc/DummyRef</ejb-ref-name>

<ejb-ref-type>Entity</ejb-ref-type>

<local-home>com.abc.DummyLocalHome</local-home>

<local>com.abc.DummyLocal</local>

<ejb-link>DummyBean</ejb-link>

</ejb-local-ref>

=======

Test "tests.ejb.elements.EjbLinkElement" did not fail for this application in AVK 1.4.1.

VikasAwasthia at 2007-7-13 3:10:40 > top of Java-index,Enterprise & Remote Computing,AVK Portability...