views:

423

answers:

2

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.

A: 

well .. i was able to get rid of this error message .. but my method of doing so is more of a nasty hack .. i just removed the webservices-tools.jar file from the glassfish library folder and that fixed the issue.

SibzTer
+1  A: 

OpenEJB 3.1.2 fixed that issue and can now successfully ignore class files that are not actually loadable by a standard classloader -- i.e. 1.0.com.sun.codemodel.ClassWriter is not a valid class name. Seems Sun puts some classes into a "1.0" directory for it's own internal purposes.

3.1.2 was just cut yesterday, the download page hasn't yet been updated. But the official release is available here:

http://www.apache.org/dist/openejb/3.1.2/

Hope this helps!

David Blevins