[jboss-user] [EJB 3.0] - Re: Remote Client to EJB 3.0 fail .. :( javax.naming.Communi

J0Ke do-not-reply at jboss.com
Tue Jul 11 15:16:15 EDT 2006


hm .
org.jboss.annotation.ejb.RemoteBinding(jndiBinding="SimpleEJB") 

in which jar is located this ? i cant find it on client/*.jars

btw i Try SimpleEJB/remote it says remote not bound.
i try somethink different i write this code :


and the output is:
XAConnectionFactory: org.jboss.mq.SpyXAConnectionFactory
TopicConnectionFactory: org.jboss.naming.LinkRefPair
EventDispatcher: org.jboss.ws.eventing.mgmt.DispatcherDelegate
UserTransactionSessionFactory: $Proxy42
UIL2ConnectionFactory: javax.naming.LinkRef
UIL2XAConnectionFactory: javax.naming.LinkRef
QueueConnectionFactory: org.jboss.naming.LinkRefPair
topic: org.jnp.interfaces.NamingContext
queue: org.jnp.interfaces.NamingContext
SimpleEJBBean: org.jnp.interfaces.NamingContext
ConnectionFactory: org.jboss.mq.SpyConnectionFactory
UserTransaction: org.jboss.tm.usertx.client.ClientUserTransaction
jmx: org.jnp.interfaces.NamingContext
UILXAConnectionFactory: javax.naming.LinkRef
UILConnectionFactory: javax.naming.LinkRef

so the EJB is deloyed.
then i try this client:
        InitialContext ctx;
        try {

            ctx = new InitialContext();
            ctx.addToEnvironment("java.naming.factory.initial", 
                                 "org.jnp.interfaces.NamingContextFactory");
            ctx.addToEnvironment("java.naming.factory.url.pkgs", 
                                 "org.jboss.naming:org.jnp.interfaces");
            ctx.addToEnvironment(Context.PROVIDER_URL, "jnp://localhost:1099");
            SimpleEJB ejb= 
                (SimpleEJB)ctx.lookup("SimpleEJBBean"); // i try SimpleEJBBean becouse there is SimpleEJBBean in the list
            System.out.println(simpleSession.sayHello("EJB3"));

        } catch (NamingException e) {
            e.printStackTrace();
        }

but now my client says :
Exception in thread main
java.lang.ClassCastException: org.jnp.interfaces.NamingContext
	at client.SimpleEJBClient.main(SimpleEJBClient.java:39)
Process exited with exit code 1.

line 39 is 
            SimpleSession simpleSession = 
                (SimpleSession)ctx.lookup("SimpleSessionBean");

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3957116#3957116

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3957116



More information about the jboss-user mailing list