Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Virgo » NoClassDefFoundError for javax.annotation.Priority
NoClassDefFoundError for javax.annotation.Priority [message #1023271] Sat, 23 March 2013 20:26 Go to next message
Eduardo Fernández is currently offline Eduardo FernándezFriend
Messages: 7
Registered: October 2011
Junior Member
Hi, I'm trying to use Virgo with Jersey 2 but when I try to access to the rest service, the Jersey servlet throws this exception:

java.lang.NoClassDefFoundError: javax/annotation/Priority
	at org.glassfish.jersey.model.internal.RankedProvider.computeRank(
	at org.glassfish.jersey.model.internal.RankedProvider.<init>(
	at org.glassfish.jersey.internal.inject.Providers.getAllRankedProviders(
	at org.glassfish.jersey.server.ApplicationHandler.getProcessingProviders(
	at org.glassfish.jersey.server.ApplicationHandler.initialize(
	at org.glassfish.jersey.server.ApplicationHandler.access$500(
	at org.glassfish.jersey.server.ApplicationHandler$
	at org.glassfish.jersey.internal.Errors$
	at org.glassfish.jersey.internal.Errors$

I have read in this post that the cause of this kind of problems may be the configuration in java6-server.profile and files. I have tried putting the next lines in these files without luck:

javax.annotation;version="0",\ in under packageImports

javax.annotation,\ in java6-server.profile under org.osgi.framework.bootdelegation:q

Also I have tried to import this package in my bundle but it didn't work.

What's wrong with my bundles?

Thanks in advance.
Re: NoClassDefFoundError for javax.annotation.Priority [message #1023533 is a reply to message #1023271] Sun, 24 March 2013 13:34 Go to previous messageGo to next message
Violeta Georgieva is currently offline Violeta GeorgievaFriend
Messages: 276
Registered: October 2010
Senior Member

You have to provide this class by yourself.

It is neither part of the standard Java SE 6 API nor Java EE 6 API.

This is part of the Commons Annotations 1.2 MR which is part of Java EE 7 API which is expected at the end of the April this year.


[Updated on: Sun, 24 March 2013 13:38]

Report message to a moderator

Re: NoClassDefFoundError for javax.annotation.Priority [message #1023584 is a reply to message #1023533] Sun, 24 March 2013 16:42 Go to previous message
Eduardo Fernández is currently offline Eduardo FernándezFriend
Messages: 7
Registered: October 2011
Junior Member
Hi Violetta,

Thanks for your answer. This commons annotations bundle is already loaded, I downloaded the file jax-rs-ri-2.0-m13-3.tar.gz from Jersey site and I created the next plan with the bundles in the tarball:

<plan name="jersey" version="2.0.0" scoped="false" atomic="true"


	<artifact type="bundle" name="org.glassfish.hk2.external.asm-all-repackaged" version="[2.1.76, 3)" />
	<artifact type="bundle" name="org.glassfish.hk2.external.cglib" version="[2.1.76, 3)" />
	<artifact type="bundle" name="" version="[14.0.0, 15.0.0)" />
	<artifact type="bundle" name="org.glassfish.hk2.api" version="[2.1.76, 3)" />
	<artifact type="bundle" name="org.glassfish.hk2.utils" version="[2.1.76, 3)" />
	<artifact type="bundle" name="org.glassfish.hk2.external.javax.inject" version="[2.1.76, 3)" />
	<artifact type="bundle" name="" version="[2.0.0, 3)" />
	<artifact type="bundle" name="org.glassfish.jersey.core.jersey-client" version="[2.0.0, 3)" />
	<artifact type="bundle" name="org.glassfish.jersey.core.jersey-common" version="[2.0.0, 3)" />
	<artifact type="bundle" name="org.glassfish.jersey.containers.jersey-container-servlet" version="[2.0.0, 3)" />
	<artifact type="bundle" name="org.glassfish.jersey.containers.jersey-container-servlet-core" version="[2.0.0, 3)" />
	<artifact type="bundle" name="org.glassfish.jersey.core.jersey-server" version="[2.0.0, 3)" />
	<artifact type="bundle" name="org.glassfish.hk2.osgi-resource-locator" version="[1.0.1, 2)" />
	<artifact type="bundle" name="javax.validation.api" version="[1.1.0, 2)" />
	<artifact type="bundle" name="javax.annotation-api" version="[1.1.99, 2)" />
	<artifact type="bundle" name="javax.servlet-api" version="[3.0.0, 4)" />

I've tried downgrade the version of Jersey by using the 1.17 but I received the next exception when I ask for the RESTful resource:

com.sun.jersey.core.spi.scanning.ScannerException: The URI scheme bundleentry of the URI bundleentry://149.fwk650188911/WEB-INF/classes/jersey/test/RestService.class is not supported. Package scanning deployment is not supported for such URIs.
Try using a different deployment mechanism such as explicitly declaring root resource and provider classes using an extension of

I just wanted to export my blueprint services by using JAX-RS (the implementation no matter) in Virgo Jetty Server, but this process is becoming painful.

I really appreciate any example with JAX-RS (Jersey or CXF) in Virgo Jetty Server.

Thanks in advance,
Eduardo Fernández.
Previous Topic:LDAP over SSL keystore
Next Topic:Spring data
Goto Forum:

Current Time: Thu Apr 26 00:22:53 GMT 2018

Powered by FUDForum. Page generated in 0.02068 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software