[jboss-user] [EJB 3.0] - Re: Unit test EJB3 Exception

2009-03-26 Thread Wolfgang Knauf
What do you mean with I use the same JVM... in your previous post? Same java.exe executable, or same process? If the latter: how do you start the Unit Tests so that they run inside the container? Wolfgang View the original post :

[jboss-user] [EJB 3.0] - Re: Unit test EJB3 Exception

2009-03-26 Thread Wolfgang Knauf
Hi, do you use JBoss 5? If yes: jbossall-client.jar just defines a bunch of classpath entries in its Manifest.mf, so you have to add much more JARs to your classpath (but I cannot tell you, which ones). And one more thing: as your unit test seems to be a standalone application client, you

[jboss-user] [EJB 3.0] - Re: Unit test EJB3 Exception

2009-03-26 Thread mvpc
I just meant that i am executing the unit tests on same machine that the EJB is deployed. Really I use JBoss 5 and i think there are lots of jars more to add to classpath. And I have to use local interface, i can't use remote interface in a application that's running locally. Thanks! I'll

[jboss-user] [EJB 3.0] - Re: Unit test EJB3 Exception

2009-03-26 Thread itsme
In case of an test client startet with an own main method this client runs in fact in a different process then the jboss and your ejbs. In that case you must use the remote interfaces as per the process is remote to the jboss (as already Wolfgang and ALR said). View the original post :

[jboss-user] [EJB 3.0] - Re: Unit test EJB3 Exception

2009-03-25 Thread Wolfgang Knauf
Hi, what does the JNDIView ( http://www.jboss.org/community/docs/DOC-9583 ) display for your bean and for the app client? According to the message, I would suspect that the JNDI path continues (something like MyBean/local/somethingmore), and your lookup is not done on the end node of the

[jboss-user] [EJB 3.0] - Re: Unit test EJB3 Exception

2009-03-25 Thread mvpc
I think the problem is not there, because I can get the Reference to MyBean with ctx.lookup(MyBean/local) The problem is when i try to narrow this with MyBeanLocalInterface i = PortableRemoteObject.narrow(ref, MyBean.class) Propably i'm missing some jar in the classpath. The server i'm

[jboss-user] [EJB 3.0] - Re: Unit test EJB3 Exception

2009-03-25 Thread Wolfgang Knauf
Oops, my bad... Local interfaces can be cast directly: MyLocal local = (MyLocal) ctx.lookup(MyBean/local); Probably a narrow would even result in error. By the way, with EJB3, the narrow is even for remote interfaces no longer required, direct casting is possible. And one more thing: a Unit

[jboss-user] [EJB 3.0] - Re: Unit test EJB3 Exception

2009-03-25 Thread mvpc
Hummm I changed the code to: MyLocal local = (MyLocal)ctx.lookup(MyBean/local); But I am now getting the exception: java.lang.ClassCastException: javax.naming.Reference cannot be cast to br.com.original.negocio.email.interfaces.IEmailLocal Thanks! View the original post :

[jboss-user] [EJB 3.0] - Re: Unit test EJB3 Exception

2009-03-25 Thread ALRubinger
mvpc wrote : java.lang.ClassCastException: javax.naming.Reference cannot be cast to br.com.original.negocio.email.interfaces.IEmailLocal This is a common symptom that you don't have the proxy object factories on your client CP. Typically this is fixed by ensuring you've got

Re: [jboss-user] [EJB 3.0] - Re: Unit test EJB3 Exception

2009-03-25 Thread Jari Fredriksson
Oops, my bad... Local interfaces can be cast directly: MyLocal local = (MyLocal) ctx.lookup(MyBean/local); Probably a narrow would even result in error. By the way, with EJB3, the narrow is even for remote interfaces no longer required, direct casting is possible. Maybe in most

[jboss-user] [EJB 3.0] - Re: Unit test EJB3 Exception

2009-03-25 Thread mvpc
I use the same JVM that the EJB is deployed and have added the jbossall-cliente.jar and it doesn't work at all, I get the same exception. My EJB application is running when i execute the unit test. Is This right ? View the original post :