users@glassfish.java.net

Unit test initialization error

From: <forums_at_java.net>
Date: Mon, 20 Feb 2012 14:02:26 -0600 (CST)

I am a student studying enterprise component architecture. I'm working on a
simple EJB project, but I am running into issues with my unit tests. I'm
using Netbeans 7.1 with Glassfish 3.1.1. I have a EJB Module project with a
@Stateless @LocalBean that implements a @Remote interface from another
project. In the unit test I am using an embedded EJB container, and attempt
to do a lookup via the context.

The problem is I am getting the following warning: 

WARNING: multiple versions of ant detected in path for junit
        
jar:file:/C:/Program%20Files/NetBeans%207.1/java/ant/lib/ant.jar!/org/apache/tools/ant/Project.class
     and
jar:file:/C:/glassfish3/glassfish/modules/ant.jar!/org/apache/tools/ant/Project.class

And the following error: 

Testcase: initializationError(trefliq.persistence.CredentialEJBTest):   
Caused an ERROR
Absent Code attribute in method that is not native or abstract in class file
javax/ejb/embeddable/EJBContainer
java.lang.ClassFormatError: Absent Code attribute in method that is not
native or abstract in class file javax/ejb/embeddable/EJBContainer
    at java.lang.ClassLoader.defineClass1(Native Method)
    at java.lang.ClassLoader.defineClass(ClassLoader.java:791)
    at
java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
    at java.net.URLClassLoader.defineClass(URLClassLoader.java:449)
    at java.net.URLClassLoader.access$100(URLClassLoader.java:71)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:423)
    at java.lang.ClassLoader.defineClass(ClassLoader.java:791)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:356)
    at java.lang.Class.getDeclaredFields0(Native Method)

I am just wondering if anyone is familiar with this issue, and can perhaps
give me some suggestions on how to resolve it? 

Thank you for your time.


--
[Message sent by forum member 'mrbhill']
View Post: http://forums.java.net/node/883666