maven-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sim085 <>
Subject Problem running unit tests from maven (JPA related)
Date Fri, 27 Nov 2009 10:28:05 GMT


I am trying to set some unit tests that will create a derby database in
memory and persist objects in this database using openJPA. However when I
run the test scripts from maven I get the following exception:

java.lang.ClassFormatError: Absent Code attribute in method that is not
native or abstract in class file javax/persistence/Persistence

The fact is that if I move the same unit test code and run it as a normal
java application (with proper class-path set in META-INF file) then I have
no problems and the application runs as a charm (i.e. - objects are
persisted accordingly).

For a JPA application to run properly you need an xml file called
persistence.xml. I placed this file in both src\main\resources\META-INF\
directory and also in the src\test\resources\META-INF\ directory, however to
no avail! 

The fact is that the unit test only fails on the Persistence dependency
(defined in pom as dependency with scope 'test') while the Derby dependency
(used to create database) works like a charm from unit tests as well.

Does anyone have any idea what this might be?

Simon J. 
View this message in context:
Sent from the Maven - Users mailing list archive at

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message