users@glassfish.java.net

Re: Maven3 JUnit4 java.lang.ClassFormatError: ...

From: Romain Grecourt <romain.grecourt_at_oracle.com>
Date: Tue, 25 Jun 2013 15:14:07 +0200

Hi,

Your issue might be related to the fact that
javax.persistence.Persistence class is present in the following
dependencies:

  - javax:javax.javaee-api
  - glassfish-embedded-all

You just need to make sure eclipselink is first in the test classpath.
Which is what you did by removing javaee-api and use scope=provided for
glassfish-embedded-all.

Note that javaee-api:6.0 contains stripped classes, it is only intended
for compilation *only*.

Thanks,
Romain

On 6/25/13 2:39 PM, forums_at_java.net wrote:
> I fix the problem by removing this section javax javaee-api
> ${javaee-api.version} provided and updating this one
> org.glassfish.main.extras glassfish-embedded-all ${glassfish.version}
> provided
>
> --
>
> [Message sent by forum member 'ruddy32']
>
> View Post: http://forums.java.net/node/897474
>
>