dev@glassfish.java.net

Re: Deployment fails for .ear file containing ACC client

From: Tim Quinn <tim.quinn_at_oracle.com>
Date: Wed, 9 Nov 2011 07:45:27 -0600

I am not sure whether this is a GlassFish problem or not. Marina or
Cheng might be able to answer that.

Another approach which works successfully - and is generally regarded
as a better design - is to place the remote interface for B into a
library JAR rather than into the same JAR as the EJB itself. Then the
client depends only on that library JAR. This is considered better
than allowing the client to see the EJB implementation itself.

By the way, this is the application design NetBeans 7 directly supports.

- Tim

On Nov 9, 2011, at 1:02 AM, Ito, Masumi wrote:

> 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
>
>