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

Cannot register beans created by producer methods as OSGi services #34

Open
wants to merge 3 commits into
base: 0.x
Choose a base branch
from

Conversation

mwinkels
Copy link

When the @OsgiServiceProvider annotation is used on a producer method (which should be possible according to its JavaDoc) the following exception is thrown:

15:19:10.895 [Start Level Event Dispatcher] INFO  o.o.p.c.e.i.c.ComponentLifecycleManager - component Greeter, Name:null, WebBeans Type:PRODUCERMETHOD, API Types:[java.lang.Object,sample.osgiProviderProducerMethod.Greeter], Qualifiers:[javax.enterprise.inject.Any,org.ops4j.pax.cdi.api.OsgiServiceProvider] is available
15:19:10.912 [Start Level Event Dispatcher] ERROR o.o.pax.cdi.spi.AbstractCdiContainer - 
java.lang.NullPointerException: null
    at org.ops4j.pax.cdi.extension.impl.component.ComponentLifecycleManager.registerService(ComponentLifecycleManager.java:183) ~[pax-cdi-extension-0.13.0-SNAPSHOT.jar:na]
    at org.ops4j.pax.cdi.extension.impl.component.ComponentLifecycleManager.start(ComponentLifecycleManager.java:107) ~[pax-cdi-extension-0.13.0-SNAPSHOT.jar:na]
    at org.ops4j.pax.cdi.extension.impl.component.ComponentLifecycleManager$$OwbNormalScopeProxy0.start(org/ops4j/pax/cdi/extension/impl/component/ComponentLifecycleManager.java) ~[na:na]
    at org.ops4j.pax.cdi.extension.impl.BeanBundleImpl.onInitialized(BeanBundleImpl.java:60) ~[pax-cdi-extension-0.13.0-SNAPSHOT.jar:na]
    ...

The integration test in this pull requests show the problem. The last commit proposes a fix.

@ANierbeck
Copy link
Member

thanks for providing a fix including a test :-)
could you also open an issue for this at the ops4j jira and link it with this PR, this way it's documented in the next release notes.

thanks, Achim

@mwinkels
Copy link
Author

Unfortunately I cannot create an account to create an issue on ops4j jira.

@ANierbeck
Copy link
Member

ahh ... that's right. Let me create one for you. We unfortunately have been swamped by spam on our Jira.

@Tcharl
Copy link

Tcharl commented Feb 25, 2017

@mwinkels did you have your JIRA account? This is a really nice addition!

@jbonofre jbonofre self-requested a review January 20, 2020 04:47
@jbonofre
Copy link
Member

@mwinkels I know it's pretty old. I think it has been addressed, but can you please double check and eventually update the PR based on master ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants