users@glassfish.java.net

Re: GF V3 - Cannot resolve reference Remote ejb-ref

From: <glassfish_at_javadesktop.org>
Date: Mon, 25 Jan 2010 07:15:05 PST

ideally the bean class packaged in lib jars should not have ejb annotations, just POJO, then the user can declare ejbs with ejb-jar.xml in his ejb-jar

One of the problems of packaging ejb component in lib jar is there is no way to know its portable global jnid name.

Can you try using a different ejb-name in your ejb-jar.xml so that it will declare a totally different ejb in current ear?

<session>
                        <ejb-name>SomeOtherName</ejb-name>
                        <ejb-class>org.imixs.demo.DemoServiceOneBean</ejb-class>
                        <session-type>Stateless</session-type>
                </session>

Then reference this ejb by this name (SomeOtherName):
@EJB(beanName="SomeOtherName", ...)

So the client always reference the ejb declared in your ejb-jar with ejb-jar.xml, and use the ejb class in lib jar only as an implementation class.
[Message sent by forum member 'cf126330' (cheng.fang_at_sun.com)]

http://forums.java.net/jive/thread.jspa?messageID=382785