[JNDI/Naming/Network] - access ejb frm a standalone java client:java.lang.ClassNotFo
by yhqian99
Hello All,
I am using MyEclipse5.5 + JBOSS to develop a stateless HelloEJB, after deployment, I can see the deployed bean from http://localhost:8080/jmx-console/.
Then I use a standalone java client to access the EJB, but get the error of "javax.naming.NoInitialContextException: Cannot instantiate class: org.jnp.interfaces.NamingContextFactory [Root exception is java.lang.ClassNotFoundException: org.jnp.interfaces.NamingContextFactory]"
Here is my code:
package com;
import javax.ejb.Stateless;
@Stateless
public class HelloEJB implements HelloEJBLocal, HelloEJBRemote
{
public HelloEJB()
{
}
public String sayHello(String name)
{
return "Welcome, " + name + ", I am a stateless Session Bean";
}
}
package com;
import javax.ejb.Local;
@Local
public interface HelloEJBLocal
{
public String sayHello(String name);
}
package com;
import javax.ejb.Remote;
@Remote
public interface HelloEJBRemote
{
public String sayHello(String name);
}
I have set the jbossall-client.jar to my java build path, is there anything I missed? Any help are highly apprieciated.
Yhqian
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4221728#4221728
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4221728
15 years, 7 months