2009/11/30 sim085 <sim...@hotmail.com>: > > Wayne, > > Thank you very much for your help. I solved the problem using the first link > you suggested. Because that thread might not be very clear I decided to > offer an explanation here. > > Basically the problem was because in my pom.xml file I had the following > parts; > > <repository> > <id>java.net1</id> > <name>Java.Net Maven1 Repository, hosts the javaee-api > dependency</name> > <url>http://download.java.net/maven/1</url> > <layout>legacy</layout> > </repository> > ... > <dependency> > <groupId>javaee</groupId> > <artifactId>javaee-api</artifactId> > <version>5</version> > <scope>provided</scope> > </dependency> >
The above artifact is a pile of cack. You're better off using <dependency> <groupId>org.apache.openejb</groupId> <artifactId>javaee-api</artifactId> <version>5.0-1</version> </dependency> or another equivalent I think geronimo has one too > I am not actually making use of this library from my persistence module and > therefore I have no problem to remove it (was there by mistake when > splitting my project apart). I guess I might face a similar problem when I > will unit test my ejb's, however I hope the provided link will help be there > as well :) > > Thanks again. > > > > > Wayne Fay wrote: >> >>> java.lang.ClassFormatError: Absent Code attribute in method that is not >>> native or abstract in class file javax/persistence/Persistence >> >> This suggests the jar you are using as a dependency which contains >> javax.persistence.Persistence has an issue of some kind. I'd assume >> you're depending on the API jar (containing only stubs for the >> methods) and yet your tests need an implementation Jar to work >> properly. >> >> I just now Googled and found this thread: >> http://forums.java.net/jive/message.jspa?messageID=226931 >> which links to this blog: >> http://weblogs.java.net/blog/ludo/archive/2007/01/java_ee_5_apis.html >> which confirms exactly what I stated above. >> >> Wayne >> > > > > -- > View this message in context: > http://old.nabble.com/Problem-running-unit-tests-from-maven-%28JPA-related%29-tp26540500p26570571.html > Sent from the Maven - Users mailing list archive at Nabble.com. > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: users-unsubscr...@maven.apache.org > For additional commands, e-mail: users-h...@maven.apache.org > > --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org