This Question have no Text answers yet!

Searching for Viewable

By : flyer

I just wanted to add Viewable from Jersey to my NetBeansProject. It was a horror...

1'st approach:

My web app using the Glassfish 4.0 so I though just adding Jersey from NetBeans handy option "Add Library" I found the Jersey 1.13 hoping this will give me a Viewable in my classpath. Alright, the Viewable is there!

com.sun.jersey.api.view.Viewable from jersey-server.jar

But during server start no luck...

org.glassfish.deployment.common.DeploymentException: CDI deployment failure:Error loading class com.sun.jersey.guice.spi.container.servlet.GuiceContainer

2'st approach:

After realising that GF 4.0 is considered to work with Jersey 2.x I removed Jersey 1.13 provided by NetBeans. I downloaded Jersey 2.x (2.1.0). Unfortunattely Viewable is not part of Jersey 2.x ... :(

3'rd approach:

When I failed to use Viewable in my GF 4.0 i go for GF 3.0 thinking that this may solve my problems. I downloaded server happy the see the solution is close. After start I added "Add Library" Jersey 1.13... I start the server... no luck:

SEVERE: Missing dependency for field: private com.sun.jersey.oauth.server.spi.OAuthProvider com.sun.jersey.oauth.server.api.resources.AccessTokenRequest.provider
SEVERE: Missing dependency for field: private com.sun.jersey.oauth.server.spi.OAuthProvider com.sun.jersey.oauth.server.api.resources.RequestTokenRequest.provider

After some digging I found the GlassFish is starting with :

INFO: Initiating Jersey application, version 'Jersey: 1.11.1 03/31/2012 06:49 PM'

And I have 1.13 added .... It something new for me, the GlassFish has Jersey included and is not compatible with 1.13 version!

4'rd approach:

I removed previously added Jersey 1.13. But I see error from NetBeans:

package com.sun.jersey.api.view.Viewable doesn't exists.

What the hell... I go for my libraries tree and see only one Jersey lib is added by default:

Libraries -> GlassFish Server -> jersey-core.jar

It seems the jersey-server.jar is missing....

QUESTION: If Jersey is part of GlassFish, why I don't see a jersey-gf-server.jar library in my Library tree and only jersey-core.jar is there?

By : flyer

Video about Searching for Viewable