users@glassfish.java.net

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

From: <glassfish_at_javadesktop.org>
Date: Mon, 25 Jan 2010 14:36:41 PST

Hi,
I did not found out how to solve my problem. So I will try to explain the situation behind my problem:

In my scenario I have two ejb modules in one ear:

my-ear
  |---- jee-demo-lib-0.0.2.jar (EJB Module1)
  |---- jee-demo-ejb-0.0.2.jar (EJB Module2)
  |---- META-INF/
                |---- application.xml
                |---- sun-application.xml
  |
  |----- jee-demo-war-0.0.2.war (WEB Module)
 

EJB Module 2 did for example inject an EJB from Module 1
When I left all ejb-jar.xml Discriptors everything works and deployment succeeded.
I am able to add an additional ejb-jar.xml Descriptor into Module2 where I redefine an EJB implemented in Module2 - everything works perfect!

But now I want to redefine a EJB form Module1 by defining the new settings in the ejb-jar.xml from Module2 (!)

ejb-jar.xml from Module2:
....
                <session>
                      <!-- an EJB implemented in Module1 -->
                        <ejb-name>DemoServiceSecondBean</ejb-name>
                        <ejb-class>org.imixs.demo.DemoServiceSecondBean</ejb-class>
                        <session-type>Stateless</session-type>
                </session>
...

Now I got the following Exception:

SCHWERWIEGEND: Cannot resolve reference Remote ejb-ref name=org.imixs.demo.app.AppServiceOneBean/demoServiceSecond,Remote 3.x interface =org.imixs.demo.DemoServiceSecond,ejb-link=null,lookup=null,mappedName=,jndi-name=,refType=Session because there are 2 ejbs in the application with interface org.imixs.demo.DemoServiceSecond
SCHWERWIEGEND: Exception while deploying the app
java.lang.RuntimeException: Cannot resolve reference Remote ejb-ref name=org.imixs.demo.app.AppServiceOneBean/demoServiceSecond,Remote 3.x interface =org.imixs.demo.DemoServiceSecond,ejb-link=null,lookup=null,mappedName=,jndi-name=,refType=Session because there are 2 ejbs in the application with interface org.imixs.demo.DemoServiceSecond
        at com.sun.enterprise.deployment.util.EjbBundleValidator.accept(EjbBundleValidator.java:569)
.....


You may ask why I want to overwrite settings from an ejb implemented in Module1 in an ejb-jar.xml Descriptor provided in Module2.
The reason is, that I want to provide a encapsulated ejb Module for third-parties to use it in there JEE Applications. And my EJB Implementations define some settings which should be overwritten by the application deployer.
But the application deployer did not have the sources from my EJB module1. He only whant to use it and change some settings by overwriting the ejb-jar.xml. So he typical put only the jar into his EAR module.

My EJB module is OpenSource hosted on dev.java.net. So the problem is not to provide the application deployer with sources. But I whant to make it as easy as possible for the deployer to use my EJBs and also to overwrite some settings from my ejb implementations.
So my suggestion is that he declares a new ejb module where he define additional settings for my ejbs.
The hole concept works perfect in glassfish 2.1 - in this case the ejb is placed in the /lib folder from the ear. But as I understand this is no longer possible in glassfish 3.

I hope I have explained this all now better to understand.
thanks for any help

ralph
[Message sent by forum member 'rsoika' (Ralph.Soika_at_imixs.com)]

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