users@glassfish.java.net

Re: How to call OSGI service from managed bean?

From: Sivakumar Thyagarajan <sivakumar.thyagarajan_at_oracle.com>
Date: Mon, 23 Jan 2012 23:05:09 +0530

Hi

On Monday 23 January 2012 07:17 PM, forums_at_java.net wrote:
> Hi,
>
> I fixed the problem. I added "transient" in order to disable
> serialization into the OSGI part.
>
> @Inject @OSGiService(dynamic=true) transient SessionHandle hello;
>
> Problem is solved.

Sorry for the delay. In your original error trace, there was this
following error:
> Caused by: org.jboss.weld.exceptions.UnserializableDependencyException: WELD-001413 The bean Managed Bean [class com.DX_57.SR_57.userCheck] with qualifiers [@Any @Default @Named] declares passivating scope but has non-serializable dependency org.glassfish.osgicdi.impl.OSGiServiceExtension$OSGiServiceBean_at_4d0dcfad
> at org.jboss.weld.bootstrap.Validator.validateInjectionPointPassivationCapable(Validator.java:328)
> at org.jboss.weld.bootstrap.Validator.validateInjectionPoint(Validator.java:290)
> at org.jboss.weld.bootstrap.Validator.validateBean(Validator.java:106)

Since you are using a dynamic reference to the service, marking it as a
transient field in the SessionScoped Bean makes the Bean passivatable
and must help resolve your issue.

Thanks
--Siva.

>
>
> --
>
> [Message sent by forum member 'rcbandit']
>
> View Post: http://forums.java.net/node/882760
>
>