users@glassfish.java.net

EJB 3.1 how to call an extern EJB

From: <glassfish_at_javadesktop.org>
Date: Wed, 19 May 2010 14:18:38 PDT

Hello
I start with Glassfish and have a problem to call an EJB from an EJB
Explaination
I created an new EJB project in eclipse named EJBTest1 in wich I created an EJB class
@Stateless
@Remote(TestEJBRemote.class)
public class TestEJB implements TestEJBRemote {
 
    /**
     * Default constructor.
     */
    public TestEJB() {
        // TODO Auto-generated constructor stub
    }
    public String sayHello(String name) {
                String txt = "Hello It's me having=>" + name;
                return txt;

        }

}
and an interface

@Remote
public interface TestEJBRemote {
        public abstract String sayHello(String name);
}

this EJB run fine when I call it from a standalone Swing client

But I want to call it from another EJB so I created an second project named EJBTest2

@Stateless
public class TestEJB_EXTERN {

        @EJB
        TestEJBRemote testejb;

        @Schedule(second = "*/5", minute = "*", hour = "*")
        public void dowork() {
                Logger.getLogger("").info("TestEJB_EXTERN:");

        }

}

I packacge the first EJBTest1 in an EJB jar and put i in the second project

when I deploy the second EJB I receive the following error message

GRAVE: Class [ Lorg/linuxart/info/jepr/ejb/TestEJBRemote; ] not found. Error while loading [ class test_ejb_externe.TestEJB_EXTERN ]
ATTENTION: Error in annotation processing: java.lang.NoClassDefFoundError: Lorg/linuxart/info/jepr/ejb/TestEJBRemote;

I search on internet and found no example
Any Ideas to resolve it
thank for your help
[Message sent by forum member 'ritzjp']

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