users@glassfish.java.net

Re: lookup ejb from OSGI ServiceListener

From: Sahoo <sanjeeb.sahoo_at_oracle.com>
Date: Sun, 05 Jun 2011 06:28:53 +0530

On Thursday 02 June 2011 08:42 PM, Sahoo wrote:
> On Thursday 02 June 2011 07:56 PM, forums_at_java.net wrote:
>> [quote=Sahoo]have you tried using adminService directly in
>> postConstruct()
>> method? Does it result in same exception?[/quote]
>>
>> Invocation of adminService directly from postConstruct works. The
>> failure
>> happens in ServiceListener, when I through a dummy event.
> I don't know why you mentioned about this dummy event, because from
> the stack trace I see it's a real event. You must be using Export-EJB
> manifest which is causing your EJBs to be registered as services and
> that's in turn raising the event. Let me write a test case to see if I
> can understand the error. Stay tuned.
Are you not removing the ServiceListener in preDestroy method of the
EJB? I could reproduce by not removing the listener.

Sahoo