users@jersey.java.net

Re: [Jersey] REST call hanging in com.sun.jersey.server.impl.managedbeans.ManagedBeanComponentProviderFactoryInitilizer.java line 56 code

From: Mahesh Venkat <mhvenkat_at_gmail.com>
Date: Thu, 24 Dec 2009 12:41:53 -0800

I bypassed this issue by adding JBoss jndi socket timeout properties in *
<jboss-server-dir>/server/default/conf/jndi.properties*


jnp.timeout=10

jnp.sotimeout=10

· *jnp.timeout*: The connection timeout in milliseconds. The default value
is 0 which means the connection will block until the VM TCP/IP layer times
out.

· *jnp.sotimeout*: The connected socket read timeout in milliseconds. The
default value is 0 which means reads will block. This is the value passed to
the Socket.setSoTimeout on the newly connected socket.
The core issue is that Jersey code is attempting to open socket to
localhost:1099 for a Glashfish JNDI context (*
com.sun.enterprise.container.common.spi.util.InjectionManager*) and it s not
available in a JBoss app server.

Regards
--Mahesh

On Fri, Dec 18, 2009 at 7:02 AM, Paul Sandoz <Paul.Sandoz_at_sun.com> wrote:

>
> On Dec 18, 2009, at 3:51 PM, Mahesh Venkat wrote:
>
> Hi Paul,
>
> I am using JBoss 4.2.3 GA with Tomcat 5..5.
> The hang occurs when I make the first call after recycling the JBoss
> server.
>
> Apparently this does not occur all the time nor in all the machines.
>
>
> I think this may be a JBoss bug when recycling (but it perhaps may be
> alleviated if Jersey closes the InitialContext instances when finished).
>
>
> It looks like this hang is influenced by the order in which some classes or
> jars are loaded perhaps?
>
>
> From the thread dump it looks more like an issue with the JBoss JNDI
> implementation.
>
> I suspect you can probably reproduce this by writing a simple servlet that
> instantiates InitialConext and looks up something that is known not to
> exist.
>
>
> I was sarching for InjectionManager context. Is this defined somewhere?
>
> * Object injectionMgr = new InitialContext().
>
> lookup("com.sun.enterprise.container.common.spi.util.InjectionManager");
>
> *
>
>
> The name above will only be bound to an object for GlassFish v3
> deployments. On JBoss the lookup should throw an NamingException.
>
> Paul.
>



-- 
Regards
--Mahesh