users@glassfish.java.net

Re: Working with EJB timers in a Grizzly Comet callback

From: jewel_kader <tojewel_at_gmail.com>
Date: Fri, 17 Apr 2009 08:39:13 -0700 (PDT)

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.

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
>>
>>
>>
>
>

-- 
View this message in context: http://www.nabble.com/Working-with-EJB-timers-in-a-Grizzly-Comet-callback-tp19915592p23100113.html
Sent from the java.net - glassfish users mailing list archive at Nabble.com.