You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@tuscany.apache.org by Kallen McInerney <ka...@marketamerica.com> on 2012/06/28 23:07:43 UTC

Tuscany on Glassfish

Had some difficulty getting Tuscany 2.0 Beta 3 running on Glassfish 3.1.2 using Wink for the REST bindings.  I was hitting an issue it seemed others were getting with Apache Wink throwing the exception below.


java.lang.NullPointerException
at org.apache.wink.common.internal.http.Accept.valueOf(Accept.java:139)
at org.apache.wink.server.internal.contexts.HttpHeadersImpl.getAcceptHeader(HttpHeadersImpl.java:151)
at org.apache.wink.server.internal.contexts.HttpHeadersImpl.getAcceptableMediaTypes(HttpHeadersImpl.java:105)
I'm new to Glassfish but just wanted to leave my workaround here since it seems no one had an answer for it.  You need to place Wink and its dependencies (i.e. slf4j) in your glassfish "libs" directory (i.e. \glassfish3\glassfish\lib).  If you don't the constructor of org.apache.wink.common.internal.runtime.RuntimeDelegateImpl never gets hit and along with it the header delegates never init.

Someone no doubt has a better solution but thought I'd pass it on.



Kallen McInerney
Principal Engineer

Email: kallenm@shop.com<ma...@shop.com>

Phone: (831) 531-4811

Skype: kallen.mcinerney


SHOP*COMTM
A Market America Company

Shop Smart, Save Big(tm)
<http://www.shop.com/>www.shop.com<http://www.shop.com/>
Join us on Facebook<http://www.facebook.com/Shop.com>.
Follow us on Twitter<http://twitter.com/shopcom>.
Read The Shopping Vine<http://theshoppingvine.com/>.



Re: Tuscany on Glassfish

Posted by Luciano Resende <lu...@gmail.com>.
On Fri, Jun 29, 2012 at 3:30 PM, Kallen McInerney
<ka...@marketamerica.com> wrote:
> Yes I did include Wink and Tuscany in the WAR to start with.  I was
> migrating from the embedded Jetty implementation to Glassfish so had
> something to compare against.  Started debugging into Wink and from what I
> could tell it was a classloader issue.  Again probably my inexperience with
> glassfish but hopefully it will get someone else over the hump.
>

In couple of app servers (e.g. websphere and I believe geronimo), we
have to configure to use the webapp classloader first. Based on your
workaround and [1] this might seem to be the same problem, And [2]
seems to explain how to turn app classload priority under
"Application-Specific Class Loading" section. Let us know if that
helps a bit... so we can document for others.

Thanks

[1] http://docs.oracle.com/cd/E18930_01/html/821-2418/beadf.html
[2] http://docs.oracle.com/cd/E19798-01/821-1752/beade/index.html


-- 
Luciano Resende
http://people.apache.org/~lresende
http://twitter.com/lresende1975
http://lresende.blogspot.com/

RE: Tuscany on Glassfish

Posted by Kallen McInerney <ka...@marketamerica.com>.
Yes I did include Wink and Tuscany in the WAR to start with.  I was migrating from the embedded Jetty implementation to Glassfish so had something to compare against.  Started debugging into Wink and from what I could tell it was a classloader issue.  Again probably my inexperience with glassfish but hopefully it will get someone else over the hump.


________________________________
From: Raymond Feng [mailto:enjoyjava@gmail.com]
Sent: Thursday, June 28, 2012 3:04 PM
To: user@tuscany.apache.org
Subject: Re: Tuscany on Glassfish

Did you use Tuscany as part of the WAR for your web application when you hit the NPE? I assume you need to make sure the wink jars are available withTuscany jars.

Thanks,
Raymond

On Jun 28, 2012, at 2:07 PM, Kallen McInerney wrote:


Had some difficulty getting Tuscany 2.0 Beta 3 running on Glassfish 3.1.2 using Wink for the REST bindings.  I was hitting an issue it seemed others were getting with Apache Wink throwing the exception below.


java.lang.NullPointerException
at org.apache.wink.common.internal.http.Accept.valueOf(Accept.java:139)
at org.apache.wink.server.internal.contexts.HttpHeadersImpl.getAcceptHeader(HttpHeadersImpl.java:151)
at org.apache.wink.server.internal.contexts.HttpHeadersImpl.getAcceptableMediaTypes(HttpHeadersImpl.java:105)
I'm new to Glassfish but just wanted to leave my workaround here since it seems no one had an answer for it.  You need to place Wink and its dependencies (i.e. slf4j) in your glassfish "libs" directory (i.e. \glassfish3\glassfish\lib).  If you don't the constructor of org.apache.wink.common.internal.runtime.RuntimeDelegateImpl never gets hit and along with it the header delegates never init.

Someone no doubt has a better solution but thought I'd pass it on.


Kallen McInerney
Principal Engineer
Email: kallenm@shop.com<ma...@shop.com>
Phone: (831) 531-4811
Skype: kallen.mcinerney

SHOP*COMTM
A Market America Company

Shop Smart, Save Big(tm)
<http://www.shop.com/>www.shop.com<http://www.shop.com/>
Join us on Facebook<http://www.facebook.com/Shop.com>.
Follow us on Twitter<http://twitter.com/shopcom>.
Read The Shopping Vine<http://theshoppingvine.com/>.




Re: Tuscany on Glassfish

Posted by Raymond Feng <en...@gmail.com>.
Did you use Tuscany as part of the WAR for your web application when you hit the NPE? I assume you need to make sure the wink jars are available withTuscany jars.

Thanks,
Raymond

On Jun 28, 2012, at 2:07 PM, Kallen McInerney wrote:

> Had some difficulty getting Tuscany 2.0 Beta 3 running on Glassfish 3.1.2 using Wink for the REST bindings.  I was hitting an issue it seemed others were getting with Apache Wink throwing the exception below.
>  
> java.lang.NullPointerException
> at org.apache.wink.common.internal.http.Accept.valueOf(Accept.java:139)
> at org.apache.wink.server.internal.contexts.HttpHeadersImpl.getAcceptHeader(HttpHeadersImpl.java:151)
> at org.apache.wink.server.internal.contexts.HttpHeadersImpl.getAcceptableMediaTypes(HttpHeadersImpl.java:105)
> 
> I’m new to Glassfish but just wanted to leave my workaround here since it seems no one had an answer for it.  You need to place Wink and its dependencies (i.e. slf4j) in your glassfish “libs” directory (i.e. \glassfish3\glassfish\lib).  If you don’t the constructor of org.apache.wink.common.internal.runtime.RuntimeDelegateImpl never gets hit and along with it the header delegates never init.
>  
> Someone no doubt has a better solution but thought I’d pass it on.
>  
>  
> Kallen McInerney
> Principal Engineer
> Email: kallenm@shop.com
> Phone: (831) 531-4811 
> Skype: kallen.mcinerney
>  
> SHOP•COMTM
> A Market America Company
>  
> Shop Smart, Save Big™
> www.shop.com
> Join us on Facebook.
> Follow us on Twitter.
> Read The Shopping Vine.
>  
>