hstaudacher / osgi-jax-rs-connector

An OSGi - JAX-RS 2.0 Connector, software repository available on the link below
http://hstaudacher.github.io/osgi-jax-rs-connector
Other
190 stars 98 forks source link

Use of @Suspended AsyncResponse fails to load bundle #136

Closed talentedbrute closed 8 years ago

talentedbrute commented 8 years ago

While using the latest version of osgi-jax-rs-connector deployed on both Apache Karaf 3.0.4 and Glassfish 4.1 the bundle fails to load. The error that is given when accessing any URL for the bundle is: Jersey is not ready yet!

I have narrowed the issue down to the use of @Suspend AyncResponse as shown by the sample method below.

Sample method

@POST
@Consumes(MediaType.APPLICATION_XML)
@Produces(MediaType.APPLICATION_XML)
@Path("process")
public void processJob(JobParameters params, @Suspend final AsyncResponse response) {

};

Removing the above method from the bundle results in a working bundle. Is there another preferred methodology instead of AysncReponse?

TIA

talentedbrute commented 8 years ago

Fixed this. It was due to the Bundle not being able to find the class AsyncResponse as it was missing from the Import-Package list.

I have spent that last few days trying to figure out what was wrong and I wasn't able to figure this out until I found Issue #117, the code provided help me in determining what the issue was. I agree that some logging during the initialization of bundles would be helpful.

Just my 2 cents.

Thanks for a great tool!

hstaudacher commented 8 years ago

So, no issue related to the connector. Closed