can you please help me write a healthy working ejb client program for EJB 3.0?
Here is the exception:
javax.ejb.EJBException: Invalid invocation of local interface (null container)
at
org.jboss.ejb3.stateless.StatelessLocalProxy.invoke(StatelessLocalProxy.java:75)
at $Proxy0.calculate(Unknown Source)
at client.CalculatorClient.main(CalculatorClient.java:52)
Here is my program..
/**
*
*/
package client;
import java.util.Hashtable;
import calc.Calculator;
//import calc.CalculatorRemote;
import javax.naming.Context;
import javax.naming.InitialContext;
/**
* @author RArvinda
*
*/
public class CalculatorClient {
public static void main(String[] args) throws Exception
{
Hashtable env = new Hashtable();
env.put(Context.INITIAL_CONTEXT_FACTORY,
"org.jnp.interfaces.NamingContextFactory");
env.put(Context.PROVIDER_URL, "localhost:1099");
env.put("java.naming.factory.url.pkgs", "org.jboss.naming:org.jnp.interfaces");
try
{
Context ctx = new InitialContext(env);
trail.slsb.Calculator calculator = (trail.slsb.Calculator)
ctx.lookup("EJB3Trail/StatelessCalculator/local");
System.out.println("1 + 1 = " +
calculator.calculate(10,10,10.0,10.0));
}catch(Exception e){
e.printStackTrace();
}
}
}
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3942105#3942105
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3942105
-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
JBoss-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jboss-user