Hello,
I´m learning EJB3 form Mastering EJB3 book. I wrote the session bean, deploy it 
on JBoss, which says me that JNDI name is "CounterBean".

When coding the client there are these lines:

//gaining initial context - is OK
//and now the critical line:

Counter counter = (Counter) ctx.lookup("CounterBean");

this lines causes ClassCastException: org.jnp.interfaces.NamingContext

I don´t understand when it is necessary to use the call with 
PortableRemoteObject.narrow() and when the lookup returns the instance.

In bean class, there is annotation @Remote(Counter.class) so I suppose it is 
remote object. I also tried this name: "CounterBean/remote" but I got this 
exception:
java.lang.NoclassDefFoundError: org/jboss/util/thread/ThreadPool

Can anyone help me with running this simple but also tough example? :)

I would also like to know which jar files I need to add to project (Netbeans) 
e.g. jbossall-client.jar ... 

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

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

_______________________________________________
jboss-user mailing list
[email protected]
https://lists.jboss.org/mailman/listinfo/jboss-user

Reply via email to