Hi friend's
i am calling my ejb class using this code
public class Client
{
public static void main(String[] args) throws Exception
{
CalculatorRemote calculator =null;
Properties properties = new Properties();
properties.put("java.naming.factory.initial",
"org.jnp.interfaces.NamingContextFactory");
properties.put("java.naming.provider.url",
"jnp://localhost:1099");
properties.put("java.naming.factory.url.pkgs",
"org.jboss.naming:org.jnp.interfaces");
properties.put("jnp.socket.Factory",
"org.jnp.interfaces.TimedSocketFactory");
Context ctx = new InitialContext(properties);
CalculatorRemote obj =
(CalculatorRemote)ctx.lookup("CalculatorBean/remote");
System.out.println("1 + 1 = " + calculator.add(1, 1));
System.out.println("1 - 1 = " + calculator.subtract(1, 1));
}
}
but always get this exception
Exception in thread "main" java.lang.ClassCastException: javax.naming.Reference
cannot be cast to org.jboss.tutorial.stateless.bean.CalculatorRemote
at org.jboss.tutorial.stateless.client.Client.main(Client.java:26)
i am using jboss-5.1.0.GA and jdk1.6
please help me
View the original post :
http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4253258#...
Reply to the post :
http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&a...