Hi Dear friends..
Need your help...
I am new to
EJB,
I was trying to run an example from
the MyEclipse's tutorial..
Using GlassFish v 2, MyEclipse 6.0, EJB 3.
The code is as follows
*******************************************************
package com.myeclipseide.ejb3;
import javax.ejb.Stateless;
@Stateless
public class MyBean implements MyBeanRemote {
public
String doSomething() {
return "HELLO";
}
}
***************************************************************************
package com.myeclipseide.ejb3;
import javax.naming.InitialContext;
import javax.naming.NamingException;
public class MyBeanClient {
public static void main(String[] args) {
try {
InitialContext ctx = new InitialContext();
MyBeanRemote bean = (MyBeanRemote) ctx.lookup("com.myeclipseide.ejb3.MyBeanRemote");
bean.doSomething();
System.out.println("Hi!!");
} catch (NamingException e) {
e.printStackTrace();
}
}
}
******************************************************************************
package com.myeclipseide.ejb3;
import javax.ejb.Remote;
@Remote
public interface MyBeanRemote {
public String doSomething() ;
}
*********************************************************************
The output got printed is:-
Hi!!
And the expected line
"HELLO"
of method "doSomething" is not getting printed..
Can anyone help in solving this problem..
Thanks