ejb testing issues with netbeans and openejb

Posted by SibzTer on Stack Overflow See other posts from Stack Overflow or by SibzTer
Published on 2009-10-08T20:30:16Z Indexed on 2010/04/14 3:13 UTC
Read the original article Hit count: 560

Filed under:
|
|

I have created a netbeans 6.7 EnterpriseApplication project with ejb and war modules with a test stateless session ejb with a simple sayHello() method.

I also added the openEjb library in order to unit test the ejb. Everything runs fine except that I keep getting the following error:


Testsuite: com.myapp.test.NewEmptyJUnitTest
Apache OpenEJB 3.1.1    build: 20090530-06:18
http://openejb.apache.org/
INFO - openejb.home = C:\Users\me\Documents\NetBeansProjects\TestEnterpriseApp\TestEnterpriseApp-ejb
INFO - openejb.base = C:\Users\me\Documents\NetBeansProjects\TestEnterpriseApp\TestEnterpriseApp-ejb
INFO - Configuring Service(id=Default Security Service, type=SecurityService, provider-id=Default Security Service)
INFO - Configuring Service(id=Default Transaction Manager, type=TransactionManager, provider-id=Default Transaction Manager)
INFO - Found ClientModule in classpath: C:\Program Files\NetBeans 6.7.1\java2\ant\lib\ant.jar
INFO - Found ClientModule in classpath: C:\Program Files\NetBeans 6.7.1\java2\ant\lib\ant-launcher.jar
INFO - Found EjbModule in classpath: C:\Users\me\Documents\NetBeansProjects\TestEnterpriseApp\TestEnterpriseApp-ejb\build\jar
INFO - Found ClientModule in classpath: C:\Users\me\Documents\NetBeansProjects\TestEnterpriseApp\lib\OpenEJB\xml-resolver-1.2.jar
INFO - Found ClientModule in classpath: C:\Users\me\Documents\Downloads\glassfish\lib\webservices-tools.jar
INFO - Beginning load: C:\Program Files\NetBeans 6.7.1\java2\ant\lib\ant.jar
INFO - Beginning load: C:\Program Files\NetBeans 6.7.1\java2\ant\lib\ant-launcher.jar
INFO - Beginning load: C:\Users\me\Documents\NetBeansProjects\TestEnterpriseApp\TestEnterpriseApp-ejb\build\jar
INFO - Beginning load: C:\Users\me\Documents\NetBeansProjects\TestEnterpriseApp\lib\OpenEJB\xml-resolver-1.2.jar
INFO - Beginning load: C:\Users\me\Documents\Downloads\glassfish\lib\webservices-tools.jar
INFO - Configuring enterprise application: classpath.ear
WARN - No application-client.xml found assuming annotations present: classpath.ear, module: ant.jar
WARN - No application-client.xml found assuming annotations present: classpath.ear, module: ant-launcher.jar
WARN - No application-client.xml found assuming annotations present: classpath.ear, module: xml-resolver-1.2.jar
WARN - No application-client.xml found assuming annotations present: classpath.ear, module: webservices-tools.jar
java.lang.Exception: Could not load 1/0/com/sun/codemodel/CodeWriter.class
        at org.apache.xbean.finder.ClassFinder.readClassDef(ClassFinder.java:730)
....

Turns out that I am getting the glassfish library webservices-tools.jar from somewhere somehow and I cant find out how to get rid of it so that I dont get the bunch of Exceptions whenever I try to run any junit tests.

Has anyone faced this issue before? Can you help me resolve it please?

Thanks.

© Stack Overflow or respective owner

Related posts about netbeans6.7

Related posts about junit4