Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Integration uses the container factory service in order to get running container #49

Closed
arcane86 opened this issue Jun 24, 2011 · 2 comments
Assignees
Milestone

Comments

@arcane86
Copy link
Collaborator

CDI-OSGi store the references to running CDI container into the container factory service.
Once the CDI implementation bundle is stopped the running container are inaccessible so CDI-OSGi cannot stop the management getting:
ERROR: Error stopping bundle. (java.lang.NullPointerException: Specified service reference cannot be null.)
java.lang.NullPointerException: Specified service reference cannot be null.
at org.apache.felix.framework.BundleContextImpl.getService(BundleContextImpl.java:319)
at org.osgi.cdi.impl.integration.IntegrationActivator.factory(IntegrationActivator.java:217)
at org.osgi.cdi.impl.integration.IntegrationActivator.stopCDIOSGi(IntegrationActivator.java:91)
at org.osgi.cdi.impl.integration.IntegrationActivator.stop(IntegrationActivator.java:70)
at org.osgi.cdi.impl.Activator.stop(Activator.java:51)
at org.apache.felix.framework.util.SecureAction.stopActivator(SecureAction.java:655)
at org.apache.felix.framework.Felix.stopBundle(Felix.java:2197)
at org.apache.felix.framework.BundleImpl.stop(BundleImpl.java:958)
at org.apache.felix.framework.BundleImpl.stop(BundleImpl.java:945)
at org.apache.felix.shell.impl.StopCommandImpl.execute(StopCommandImpl.java:70)
at org.apache.felix.shell.impl.Activator$ShellServiceImpl.executeCommand(Activator.java:276)
at org.apache.felix.shell.tui.Activator$ShellTuiRunnable.run(Activator.java:167)
at java.lang.Thread.run(Thread.java:662)

The container references should be store elsewhere (as they were before one maladroit refactoring :/ )

@mathieuancelin
Copy link
Owner

Is it possible to catch the stopping event ? Is it possible to identifie the stopped bundle and get the container another way (with the bundle id for instance) ?

@arcane86
Copy link
Collaborator Author

It's maybe possible.
But i think this is design fail do to my refactoring. The references to running CDI container should be kept within the extension implement bundle rather than within the container factory service (i.e the CDI implementation bundle).

@ghost ghost assigned arcane86 Jul 4, 2011
mathieuancelin added a commit that referenced this issue Jul 5, 2011
#49 Integration uses the container factory service in order to get running container
@arcane86 arcane86 closed this as completed Jul 5, 2011
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants