users@glassfish.java.net

Re: Working with EJB timers in a Grizzly Comet callback

From: Jeanfrancois Arcand <Jeanfrancois.Arcand_at_Sun.COM>
Date: Fri, 17 Apr 2009 15:40:01 -0400

Salut,

jewel_kader wrote:
> Hi,
>
> Currently I am using following workaround,
>
> Inside CometHandler.onInterrupt() I am invoking EJB through a remote
> interface (retried during initialization) but I guess this is not the right
> solution, because the grizzly and ejb stuffs are in same jvm so, there
> should be a way to access the local interface.

The issue is normally Glassfish InvokationManager bind some information
on a thread local (It's almost 7 year since I touched ejb impl so I
might say something stupid :-)) and that information is required in
order to use local interface. When Grizzly Comet execute the
onInterrupt() it doesn't have access for that data. It is probably
possible to support it...file an RFE here:

https://grizzly.dev.java.net/issues/

and I will try to look at it.

Thanks

-- Jeanfrancois



>
> Thanks,
>
> Jewel
>
>
> jewel_kader wrote:
>> Hello,
>>
>> Probably, I am facing same problem. I have a POJO which access local
>> interface of the EJB through jndi lookup. It works fine when called from
>> inside a Servlet but fails when called from CometHandler.onInterrupt
>> method. Any solution?
>>
>> Thanks,
>>
>> Jewel
>>
>>
>> Jeanfrancois Arcand-2 wrote:
>>> Salut,
>>>
>>> Marina Vatkina wrote:
>>>> Are you trying to use EJB timers without EJBs?
>>> I think the issue Leonid is facing happens because the calling thread
>>> doesn't contains the threads local information GlassFish is normally
>>> adding to a synchronous call. Since this is an asynchronous call, the
>>> thread locals are not set and since the Timer uses those, hence the
>>> exception. For Servlet 3.0 (which add Comet) that scenario will be
>>> handled, but for Grizzly Comet it is a limitation right now, hence I'm
>>> not sure I can propose a solution.
>>>
>>> A+
>>>
>>> -- Jeanfrancois
>>>
>>>
>>>
>>>> thanks,
>>>> -marina
>>>>
>>>> Leonid Mokrushin wrote:
>>>>> I'm trying to implement some cleanup code in the onInterrupt() callback
>>>>> of my CometHandler. The code is supposed to go through the EJB timers
>>>>> and cancel some of them. However I'm getting the following exception
>>>>> when trying to invoke timer.getInfo() method:
>>>>>
>>>>> java.lang.IllegalStateException: Invocation cannot be null
>>>>> at
>>>>> com.sun.ejb.containers.TimerWrapper.checkCallPermission(TimerWrapper.jav
>>>>> a:197)
>>>>> at
>>>>> com.sun.ejb.containers.TimerWrapper.getInfo(TimerWrapper.java:132)
>>>>> ... (my callback here)
>>>>>
>>>>> Any idea what can be a workaround?
>>>>>
>>>>> /Leonid
>>>>>
>>>>> ---------------------------------------------------------------------
>>>>> To unsubscribe, e-mail: users-unsubscribe_at_glassfish.dev.java.net
>>>>> For additional commands, e-mail: users-help_at_glassfish.dev.java.net
>>>>>
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: users-unsubscribe_at_glassfish.dev.java.net
>>>> For additional commands, e-mail: users-help_at_glassfish.dev.java.net
>>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe_at_glassfish.dev.java.net
>>> For additional commands, e-mail: users-help_at_glassfish.dev.java.net
>>>
>>>
>>>
>>
>