Hi Guys, can anyone help me here on this simple proble… I created three jave files to understand stateless EJBs, the files are
package com.myeclipse.ejb3;
import javax.ejb.Remote;
@Remote
public interface HelloUser {
public void sayHello(String name);
}
==============================================================
package com.myeclipse.ejb3;
import javax.ejb.Stateless;
@Stateless(mappedName=”HelloUser”)
public class HelloUserBean implements HelloUser {
public void sayHello(String name) {
System.out.println(“Hello ” + name + ” welcome to EJB 3 In Action!”);
}
}
==============================================================
// and the client class
package com.myeclipse.ejb3;
import javax.ejb.EJB;
import javax.naming.*;
public class HelloUserClient {
private static HelloUser helloUser;
public static void main(String[] args) {
System.out.println(“Invoking EJB”);
try
{
Context ctx = new InitialContext();
helloUser = (HelloUser) ctx.lookup(“HelloUser#com.myeclipse.ejb3.HelloUser”);
helloUser.sayHello(“Curious George”);
System.out.println(“Invoked EJB successfully .. see server console for output”);
}
catch (Exception e)
{
e.printStackTrace();
}
}
}
==================================
when I created an EJB3 project in myeclipse, and run this client after deploying it to Weblogic 10, I am getting this o/p
javax.naming.NoInitialContextException: Need to specify class name in environment or system property, or as an applet parameter, or in an application resource file: java.naming.factory.initial
at javax.naming.spi.NamingManager.getInitialContext(Unknown Source)
at javax.naming.InitialContext.getDefaultInitCtx(Unknown Source)
Can you tell what’s going wrong here, I haven’t created any other file except these three …am I missing anything here…..