users@jersey.java.net

[Jersey] Re: Bizarre stack trace with jersey-client

From: Pavel Bucek <pavel.bucek_at_oracle.com>
Date: Thu, 20 Jan 2011 18:45:49 +0100

really interesting.. I even was able to reproduce it by myself..

exclude javaee-web-api dependency and it should start to work (if you
need it, you shouldn't be testing on grizzly webserver anyway, it
doesn't support EE stuff).

However, I need to investigate what is happening here, it is probably
some classloading issue (I can see jsr 311 api included once from
javaee-web-api and once from jersey, not sure yet about javamail).. I'll
keep you updated.

Regards,
Pavel

On 01/20/2011 05:50 PM, Mewel wrote:
> Sorry that i reply to this old thread but i have exact the same problem.
>
> My pom.xml contains:
>
> <!-- jersey test framework 1.5 -->
> <dependency>
> <groupId>com.sun.jersey.jersey-test-framework</groupId>
> <artifactId>jersey-test-framework-grizzly</artifactId>
> <version>1.5</version>
> <scope>test</scope>
> </dependency>
>
> <!-- java ee 6.0 -->
> <dependency>
> <groupId>javax</groupId>
> <artifactId>javaee-web-api</artifactId>
> <version>6.0</version>
> <scope>provided</scope>
> </dependency>
>
> <!-- junit -->
> <dependency>
> <groupId>junit</groupId>
> <artifactId>junit</artifactId>
> <version>4.8.1</version>
> <scope>test</scope>
> </dependency>
>
> If i run my test case i get the same strange exception
> ("java.lang.ClassFormatError: Absent Code attribute in method that is not
> native or abstract in class file javax/mail/MessagingException"). My test
> looks like:
>
> public class MyTestCase extends JerseyTest {
>
> public MyTestCase() {
> super("my.webservice"); //<-- error occur here
> }
>
> ...
> }
>
> Thanks for any tip or advice.
> Matthias
>