Unable to inject @Resource BundleContext in RESTEasy JAX-RS service in JBoss EAP 6
Issue
- I have a jax-rs rest service with:
@Resource
protected BundleContext context;
On startup I get the stack trace below. I have a deployed OSGI bundle that I'm trying to access... I have it Blueprint enabled. I haven't figured out how to do this yet from non osgi web application, but it seems obtaining the org.osgi.framework.BundleContext is the first step. Is there a reason I cannot inject this resource?
I have osgi enabled in my standalone:
<subsystem xmlns="urn:jboss:domain:osgi:1.2" activation="lazy">
<properties>
<property name="org.osgi.framework.startlevel.beginning">
1
</property>
</properties>
<capabilities>
<capability name="javax.servlet.api:v25"/>
<capability name="javax.transaction.api"/>
<capability name="org.apache.felix.log" startlevel="1"/>
<capability name="org.jboss.osgi.logging" startlevel="1"/>
<capability name="org.apache.felix.configadmin" startlevel="1"/>
<capability name="org.jboss.as.osgi.configadmin" startlevel="1"/>
<capability name="org.apache.aries:org.apache.aries.util:0.4" startlevel="2"/>
<capability name="org.apache.aries.proxy:org.apache.aries.proxy:0.4" startlevel="2"/>
<capability name="org.apache.aries.blueprint:org.apache.aries.blueprint:0.4" startlevel="2"/>
</capabilities>
</subsystem>
Environment
- JBoss Enterprise Application Platform (EAP)
- 6.0
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.
Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.
