Hi, 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? Regards, Simon J. -- View this message in context: http://old.nabble.com/Problem-running-unit-tests-from-maven-%28JPA-related%29-tp26540500p26540500.html Sent from the Maven - Users mailing list archive at Nabble.com. --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
