dev@glassfish.java.net

Deployment fails for .ear file containing ACC client

From: Ito, Masumi <masumii_at_fast.au.fujitsu.com>
Date: Wed, 9 Nov 2011 18:02:39 +1100

Hi,

I would like to confirm whether this is a GF bug. I would appreciate it
if you could help me.

- Problem
An error message is displayed when deploying an .ear file that includes
Application Client Container(ACC) client.

Error message is:
remote failure: Error occurred during deployment: Exception while
deploying the app [MyApplication] : Target ejb MyLocalClass for remote
ejb 3.0 reference com.mycompany.ejb.MyRemoteClass/local does not expose
a remote businessinterface of type com.mycompany.ejb.local.MyLocal.
Please see server.log for more details.

- Steps to reproduce the problem
1. Create a .jar file that includes a local interface and a business
class. Refer to this as "EJB A".
2. Create a .jar file that includes a remote interface and a business
class. Refer to this as "EJB B".
   "EJB B" injects "EJB A" using @EJB annotation.
3. Create a .jar file that includes an ACC client class. Refer to this
as "ACC A".
   "ACC A" injects "EJB B" using @EJB annotation, or looks up "EJB B".
   In its manifest file, "EJB B" .jar file is specified with the
relative path from top of .ear file.
4. Create a .ear file which contains the .jar files which have been
created in Step 1, 2 and 3.
5. Deploy the .ear file which was created in Step 4 on Glassfish v3.1.1.
6. Deployment fails and the error message is displayed.

The ACC client directly refers to the only remote EJB. However, GF seems
to validate the local EJB as well as remote EJB.

- Workaround
To avoid validation error for annotations, use JNDI lookup for the local
EJB instead of the annotations.

Thanks,
Masumi