Help needed with “Unsupported execution environment” deploying Equinox Declarative Services onto JBoss AS 7 CR1

The recent candidate release of JBoss AS 7.0.0.CR1 (codenamed “White Rabbit”) caught my attention for its support for the OSGi 4.2 Core (with the JBoss OSGi component). I’m currently swamped with book reading – OSGi and Equinox, and OSGi in Action – and got wild about trying it out.

I meant to have written an article about deploying a plugin with OSGi Declarative Services onto JBoss AS 7 and while preparing the environment I ran across an issue Unsupported execution environment [OSGi/Minimum-1.2, CDC-1.1/Foundation-1.1, J2SE-1.4] we have [J2SE-1.5, , JavaSE-1.6]:

jacek:~/apps/equinox/plugins
$ cp org.eclipse.equinox.ds_1.3.0.v20110502.jar /Users/jacek/apps/jboss/standalone/deployments/

// On the JBoss AS 7 CR1's console:

12:50:30,450 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-2) Starting deployment of "org.eclipse.equinox.ds_1.3.0.v20110502.jar"
12:50:30,793 INFO  [org.jboss.osgi.framework.internal.BundleManager] (MSC service thread 1-1) JBossOSGi Framework Core - 1.0.0.CR6
12:50:30,892 INFO  [org.jboss.osgi.framework.internal.BundleManager] (MSC service thread 1-2) Install bundle: system.bundle:0.0.0
12:50:31,682 INFO  [org.jboss.osgi.framework.internal.BundleManager] (MSC service thread 1-2) Install bundle: org.jboss.logging:3.0.0
12:50:31,684 INFO  [org.jboss.osgi.framework.internal.BundleManager] (MSC service thread 1-3) Install bundle: javaee.api:0.0.0
12:50:31,756 INFO  [org.jboss.osgi.framework.internal.BundleManager] (MSC service thread 1-2) Install bundle: jboss-as-osgi-configadmin:7.0.0.CR1
12:50:31,803 INFO  [org.jboss.osgi.framework.internal.BundleManager] (MSC service thread 1-4) Install bundle: org.apache.aries.util:0.3.0
12:50:32,268 INFO  [org.jboss.osgi.framework.internal.BundleManager] (MSC service thread 1-1) Install bundle: jbosgi-webapp:1.0.2
12:50:32,387 INFO  [org.jboss.osgi.framework.internal.BundleManager] (MSC service thread 1-1) Install bundle: jbosgi-blueprint:1.0.2
12:50:32,432 INFO  [org.jboss.osgi.framework.internal.BundleManager] (MSC service thread 1-2) Install bundle: org.apache.felix.eventadmin:1.2.6
12:50:32,480 INFO  [org.jboss.osgi.framework.internal.BundleManager] (MSC service thread 1-1) Install bundle: jbosgi-webconsole:1.0.6
12:50:32,737 INFO  [org.jboss.osgi.framework.internal.BundleManager] (MSC service thread 1-3) Install bundle: jboss-osgi-http:1.0.3
12:50:32,900 INFO  [org.jboss.osgi.framework.internal.BundleManager] (MSC service thread 1-1) Install bundle: org.apache.felix.configadmin:1.2.8
12:50:32,935 INFO  [org.jboss.osgi.framework.internal.BundleManager] (MSC service thread 1-3) Install bundle: org.apache.felix.metatype:1.0.4
12:50:32,972 INFO  [org.jboss.osgi.framework.internal.BundleManager] (MSC service thread 1-1) Install bundle: jboss-osgi-jmx:1.0.10
12:50:33,062 INFO  [org.jboss.osgi.framework.internal.BundleManager] (MSC service thread 1-2) Install bundle: jboss-osgi-xerces:2.9.1.SP7
12:50:33,128 INFO  [org.jboss.osgi.framework.internal.BundleManager] (MSC service thread 1-1) Install bundle: jboss-osgi-logging:1.0.0
12:50:33,236 INFO  [org.jboss.osgi.framework.internal.BundleManager] (MSC service thread 1-1) Install bundle: org.apache.felix.log:1.0.0
12:50:33,307 INFO  [org.jboss.osgi.framework.internal.BundleManager] (MSC service thread 1-2) Install bundle: org.apache.aries.jmx:0.3.0
12:50:33,549 INFO  [org.jboss.osgi.framework.internal.BundleManager] (MSC service thread 1-4) Install bundle: osgi.cmpn:4.2.0.200908310645
12:50:33,773 INFO  [org.jboss.osgi.framework.internal.BundleManager] (MSC service thread 1-3) Install bundle: org.apache.felix.webconsole:3.1.6.SP1
12:50:33,833 INFO  [org.jboss.osgi.framework.internal.StartLevelPlugin] (MSC service thread 1-2) Starting bundles for start level: 1
12:50:34,188 INFO  [org.jboss.osgi.framework.internal.HostBundleState] (MSC service thread 1-2) Bundle started: org.apache.felix.configadmin:1.2.8
12:50:34,228 INFO  [org.jboss.osgi.framework.internal.HostBundleState] (MSC service thread 1-2) Bundle started: org.apache.felix.log:1.0.0
12:50:34,254 INFO  [org.jboss.osgi.framework.internal.HostBundleState] (MSC service thread 1-2) Bundle started: jboss-osgi-logging:1.0.0
12:50:34,269 INFO  [org.jboss.osgi.framework.internal.HostBundleState] (MSC service thread 1-2) Bundle started: jboss-as-osgi-configadmin:7.0.0.CR1
12:50:34,272 INFO  [org.jboss.osgi.framework.internal.FrameworkActive] (MSC service thread 1-2) OSGi Framework started
12:50:34,290 INFO  [org.jboss.osgi.framework.internal.BundleManager] (MSC service thread 1-1) Install bundle: org.eclipse.equinox.ds:1.3.0.v20110502
12:50:34,293 ERROR [org.jboss.as.osgi] (MSC service thread 1-1) Cannot start bundle: org.eclipse.equinox.ds:1.3.0.v20110502: org.osgi.framework.BundleException: Unsupported execution environment [OSGi/Minimum-1.2, CDC-1.1/Foundation-1.1, J2SE-1.4] we have [J2SE-1.5, , JavaSE-1.6]
	at org.jboss.osgi.framework.internal.HostBundleState.assertStartConditions(HostBundleState.java:240)
	at org.jboss.osgi.framework.internal.HostBundleState.startInternal(HostBundleState.java:176)
	at org.jboss.osgi.framework.internal.AbstractBundleState.start(AbstractBundleState.java:494)
	at org.jboss.as.osgi.deployment.BundleStartTracker$1.processService(BundleStartTracker.java:146)
	at org.jboss.as.osgi.deployment.BundleStartTracker$1.transition(BundleStartTracker.java:121)
	at org.jboss.msc.service.ServiceControllerImpl.invokeListener(ServiceControllerImpl.java:1442)
	at org.jboss.msc.service.ServiceControllerImpl.access$2500(ServiceControllerImpl.java:49)
	at org.jboss.msc.service.ServiceControllerImpl$ListenerTask.run(ServiceControllerImpl.java:1940)
	at org.jboss.msc.service.ServiceControllerImpl$ClearTCCLTask.run(ServiceControllerImpl.java:2291)
	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) [:1.6.0_26]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [:1.6.0_26]
	at java.lang.Thread.run(Thread.java:680) [:1.6.0_26]

12:50:34,367 INFO  [org.jboss.as.server.controller] (DeploymentScanner-threads - 2) Deployed "org.eclipse.equinox.ds_1.3.0.v20110502.jar"

There’s indeed Bundle-RequiredExecutionEnvironment in MANIFEST.MF of the org.eclipse.equinox.ds bundle:

Bundle-RequiredExecutionEnvironment: OSGi/Minimum-1.2, CDC-1.1/Foundation-1.1, J2SE-1.4

, and according to the spec – the OSGi Service Platform, Core Specification Release 4, Version 4.2 (page 30-332):

“3.2.1.15 Bundle-RequiredExecutionEnvironment: CDC-1.0/Foundation-1.0
The Bundle-RequiredExecutionEnvironment contains a comma-separated list of execution environments that must be present on the Service Platform. See Execution Environment on page 35.”

I’m thus looking for answers to the following two questions (of which the latter is the most important to me):

  1. Why doesn’t JBoss AS 7 CR1 add J2SE-1.4 to Bundle-RequiredExecutionEnvironment?
  2. How to change the supported execution environments in JBoss AS 7?

Could anyone help me with them and the issue in particular?

Be Sociable, Share!
This entry was posted in Frameworks, Java EE.

3 Responses to Help needed with “Unsupported execution environment” deploying Equinox Declarative Services onto JBoss AS 7 CR1

  1. Neil Bartlett says:

    Unfortunately I know nothing about JBoss AS 7, however if it is an OSGi R4.2 compliant framework implementation then it should support the property “org.osgi.framework.executionenvironment”, as the OSGi specification requires.

    You could use that property to set the list of EEs supported by the JVM, which it seems JBoss is setting incorrectly (any JVM that supports Java1.6 implicitly also supports 1.5, 1.4, 1.3, 1.2, 1.1 and 1.0, plus also OSGi Minimum 1.0, 1.1, 1.2 etc).

    • Jacek Laskowski says:

      I changed the org.osgi.framework.executionenvironment property in configuration/standalone.xml and it works better now. Thanks for the hint.

Leave a Reply

%d bloggers like this: