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(RankedProvider.java:86)
	at org.glassfish.jersey.model.internal.RankedProvider.<init>(RankedProvider.java:79)
	at org.glassfish.jersey.internal.inject.Providers.getAllRankedProviders(Providers.java:223)
	at org.glassfish.jersey.server.ApplicationHandler.getProcessingProviders(ApplicationHandler.java:460)
	at org.glassfish.jersey.server.ApplicationHandler.initialize(ApplicationHandler.java:363)
	at org.glassfish.jersey.server.ApplicationHandler.access$500(ApplicationHandler.java:147)
	at org.glassfish.jersey.server.ApplicationHandler$3.run(ApplicationHandler.java:270)
	at org.glassfish.jersey.internal.Errors$2.call(Errors.java:249)
	at org.glassfish.jersey.internal.Errors$2.call(Errors.java:246)
....


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

javax.annotation;version="0",\ in org.eclipse.virgo.kernel.userregion.properties 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: 244
Registered: October 2010
Senior Member
Hi,

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.

http://java.net/projects/javaee-spec/pages/CommonAnnotations1_2MR

Regards
Violeta

[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"
        xmlns="http://www.eclipse.org/virgo/schema/plan"
		xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
		xsi:schemaLocation="
		        http://www.eclipse.org/virgo/schema/plan
		        http://www.eclipse.org/virgo/schema/plan/eclipse-virgo-plan.xsd">

	<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="com.google.guava" 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="javax.ws.rs.javax.ws.rs-api" 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)" />
</plan>


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 javax.ws.rs.core.Application


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: Sun Dec 21 13:36:50 GMT 2014

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

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