users@glassfish.java.net

[gf-users] Re: EJB module uses remote interface in a different JAR

From: William <streetpoet_at_163.com>
Date: Thu, 26 Feb 2015 08:32:25 +0800

for my own opinion, you must copy compiled interface classes(not impl) into your own jar thus you can use remote ejb directly in your code by using @EJB annotation.
of course the remote ejb should be deployed on glassfish before.

William
2015/2/26

> On Feb 26, 2015, at 7:46 AM, thufir <hawat.thufir_at_gmail.com> wrote:
>
> The EJB module I built uses a remote interface. Because that remote interface is in a different JAR, that library JAR containing the interface must be placed in Glassfish first so that the EJB module (JAR) can find the library? Or, rather, so that Glassfish can find that library for the EJB.
>
> I'm getting an error:
>
> Error in annotation processing: {0}.
> java.lang.NoClassDefFoundError: net/bounceme/doge/greeter/ejb/GreeterRemote
>
>
> which I take to mean that Glassfish cannot find the class GreeterRemote because it's not on the classpath...for the EJB?
>
> How do I add the library to glassfish for the EJB?
>
>
> I googled and found:
>
> http://www.coderanch.com/t/507913/EJB-JEE/java/Glassfish-return-java-lang-NoClassDefFoundError
>
> which I think is the exact problem, but that solution didn't seem to work for me; he puts the library JAR in:
>
> <glassfish_home>/domains/domain1/lib
>
>
> I don't mind reading the glassfish manuals, but thought I'd ask here before digging through them.
>
>
>
> thanks,
>
> Thufir