Testing an entityBean under 3.2.3 using Junitejb
pstrotmann Jan 2, 2004 12:52 AMHi Folks
Welcome to 2004 with this more precise posting of the problem I posted yesterday.
It seems to be a problem getting acces to EJBTestRunner
as indicated in the following stacktrace:
--------------------------- cut ----------------------------------------------------
Buildfile: /home/strotmann/eclipse/workspace/gp/build.xml
gpTest:
[junit] .E
[junit] Time: 0,617
[junit] There was 1 error:
[junit] 1) testAdresse(org.strotmann.gp.GpTest)
[junit] javax.naming.NameNotFoundException: ejb not bound
[junit] at org.jnp.server.NamingServer.getBinding(NamingServer.java:495)
[junit] at org.jnp.server.NamingServer.getBinding(NamingServer.java:503)
[junit] at org.jnp.server.NamingServer.getObject(NamingServer.java:509)
[junit] at org.jnp.server.NamingServer.lookup(NamingServer.java:253)
[junit] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[junit] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
[junit] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
[junit] at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:261)
[junit] at sun.rmi.transport.Transport$1.run(Transport.java:148)
[junit] at java.security.AccessController.doPrivileged(Native Method)
[junit] at sun.rmi.transport.Transport.serviceCall(Transport.java:144)
[junit] at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:460)
[junit] at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:701)
[junit] at java.lang.Thread.run(Thread.java:534)
[junit] at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(StreamRemoteCall.java:247)
[junit] at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:223)
[junit] at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:133)
[junit] at org.jnp.server.NamingServer_Stub.lookup(Unknown Source)
[junit] at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:528)
[junit] at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:507)
[junit] at javax.naming.InitialContext.lookup(InitialContext.java:347)
[junit] at net.sourceforge.junitejb.EJBTestCase.getEJBTestRunner(EJBTestCase.java:162)
[junit] at net.sourceforge.junitejb.EJBTestCase.runBare(EJBTestCase.java:109)
[junit] at net.sourceforge.junitejb.EJBTestCase.run(EJBTestCase.java:95)
[junit] FAILURES!!!
[junit] Tests run: 1, Failures: 0, Errors: 1
BUILD FAILED: file:/home/strotmann/eclipse/workspace/gp/build.xml:23: Java returned: -1
Total time: 2 seconds
------------------------ cut ----------------------------------
The code snipped to run the test case (adapted from cmp2 example ) is
------------------------ cut ----------------------------------
-------------------------- cut ---------------------------------------
EJBTestRunnerEJB has been successfully deployed by
-------------------------- cut ----from jboss.xml-----------------------------------
<ejb-name>EJBTestRunnerEJB</ejb-name>
<jndi-name>ejb/EJBTestRunner</jndi-name>
-------------------------- cut ---------------------------------------
and
-------------------------- cut ----from ejb-jar.xml-----------------------------------
JUnit Session Bean Test Runner
<ejb-name>EJBTestRunnerEJB</ejb-name>
net.sourceforge.junitejb.EJBTestRunnerHome
net.sourceforge.junitejb.EJBTestRunner
<ejb-class>net.sourceforge.junitejb.EJBTestRunnerBean</ejb-class>
<session-type>Stateless</session-type>
<transaction-type>Bean</transaction-type>
------------------------------ cut ----------------------------------------------
Deployment results in the following two entries in jmx-console under jboss.j2ee
jndiName=EJBTestRunnerEJB, plugin=pool,service=ejb
jndiName=EJBTestRunnerEJB, service=ejb
peter