How to deploy Eclipse Plugins on JBoss with JBoss OSGI?
bruderol May 11, 2010 9:47 AMHello
I am trying to use JBoss OSGI to use some Eclipse Plugins (with extension points) inside the Jboss Server (and later in our EJB SessionBeans).
I am having problems in deploying the plugins (a simple Eclipse Plugin with only one plugin dependency to org.eclipse.core.runtime, version 3.5).
Could you tell me please, if it is feasable at all to use Eclipse Plugins with extension points etc. inside J2EE applications on JBoss and if using JBoss OSGI is the right solution to do that??
Anybody here that has some experience in doing that and could help me?
Details see below ...
===========
Some more details about what I tried and about the concrete problems I am currently facing ...
Step by step setup of my plugin deployment ...
1. Installed JBoss AS jboss-5.1.0.GA and JBoss OSGI jboss-osgi-1.0.0.Beta7 (with equinox and JBoss AS integration).
2. As a simple proof of concept I created a very simple eclipse plugin (my.test.plugin) that does nothing else than logging something when the plugin lifecycle methods (start and stop) are called and only depends on the plugin org.eclipse.core.runtime
3. I built this plugin (using Export ... from Eclipse IDE) and put the plugin jar into the deploy folder of JBoss (jboss-5.1.0.GA\server\default\deploy\osgi).
4. Changed the deployer configuration for JBoss OSGI (in jboss-5.1.0.GA\server\default\deployers\osgi.deployer\META-INF\jboss-osgi-jboss-beans.xml) to start the following plugins:
...
<property name="autoStart">
<list elementClass="java.net.URL">
<value>${jboss.server.home.url}/deploy/osgi/org.apache.felix.log.jar</value>
<value>${jboss.server.home.url}/deploy/osgi/jboss-osgi-common.jar</value>
<value>${jboss.server.home.url}/deploy/osgi/my.test.plugin_1.0.0.201005111137.jar</value>
</list>
</property>
...
5. When starting the server I get some error because of the missing dependencies (as expected):
java.lang.IllegalStateException: Cannot start bundle: file:/C:/development/jboss/jboss-5.1.0.GA/server/default/deploy/osgi/my.test.plugin_1.0.0.201005101905.jar
Caused by: org.osgi.framework.BundleException: The bundle could not be resolved. Reason: Missing Constraint: Require-Bundle: org.eclipse.core.runtime; bundle-version="0.0.0"
6. I started to add the missing dependencies step by step by adding the following plugins (from my eclipse 3.5 installation):
- org.eclipse.core.runtime_3.5.0.v20090525.jar
- org.eclipse.core.runtime.compatibility.registry_3.2.200.v20090429-1800.jar
- org.eclipse.core.runtime.compatibility.auth_3.2.100.v20090413.jar
- org.eclipse.core.jobs_3.4.100.v20090429-1800.jar
- org.eclipse.core.contenttype_3.4.1.R35x_v20090826-0451.jar
- org.eclipse.equinox.common_3.5.1.R35x_v20090807-1100.jar
- org.eclipse.equinox.registry_3.4.100.v20090520-1800.jar
- org.eclipse.equinox.preferences_3.2.300.v20090520-1800.jar
- org.eclipse.equinox.app_1.2.0.v20090520-1800.jar
I did not add the following dependencies, because I think that those are already included in JBoss OSGI or because they caused some problems ("Framework extensions are not supported."):
- org.eclipse.osgi.services_3.2.0.v20090520-1800.jar (this is already there for sure)
- org.eclipse.osgi_3.5.1.R35x_v20090827.jar (seems to work without so far)
- javax.servlet_2.5.0.v200806031605.jar (seems to work without so far)
- javax.transaction_1.1.1.v201002111330.jar (caused "Framework extensions are not supported.")
- org.eclipse.persistence.jpa.equinox.weaving_1.1.3.v20091002-r5404.jar (caused "Framework extensions are not supported.")
Of course I changed the jboss-osgi-jboss-beans.xml accordingly (also by adding missing plugins step by step):
<property name="autoInstall">
<list elementClass="java.net.URL">
<value>${jboss.server.home.url}/deploy/osgi/org.eclipse.osgi.services.jar</value>
<value>${jboss.server.home.url}/deploy/osgi/org.eclipse.osgi.util.jar</value>
<value>${jboss.server.home.url}/deploy/osgi/org.eclipse.equinox.common_3.5.1.R35x_v20090807-1100.jar</value>
<value>${jboss.server.home.url}/deploy/osgi/org.eclipse.core.jobs_3.4.100.v20090429-1800.jar</value>
<value>${jboss.server.home.url}/deploy/osgi/org.eclipse.equinox.preferences_3.2.300.v20090520-1800.jar</value>
<value>${jboss.server.home.url}/deploy/osgi/org.eclipse.core.contenttype_3.4.1.R35x_v20090826-0451.jar</value>
<value>${jboss.server.home.url}/deploy/osgi/org.eclipse.equinox.app_1.2.0.v20090520-1800.jar</value>
<value>${jboss.server.home.url}/deploy/osgi/org.eclipse.core.runtime.compatibility.auth_3.2.100.v20090413.jar</value>
<value>${jboss.server.home.url}/deploy/osgi/org.eclipse.core.runtime.compatibility.registry_3.2.200.v20090429-1800.jar</value>
<value>${jboss.server.home.url}/deploy/osgi/org.eclipse.equinox.registry_3.4.100.v20090520-1800.jar</value>
<value>${jboss.server.home.url}/deploy/osgi/org.eclipse.core.runtime_3.5.0.v20090525.jar</value>
</list>
</property>
<property name="autoStart">
<list elementClass="java.net.URL">
<value>${jboss.server.home.url}/deploy/osgi/org.apache.felix.log.jar</value>
<value>${jboss.server.home.url}/deploy/osgi/jboss-osgi-common.jar</value>
<value>${jboss.server.home.url}/deploy/osgi/org.eclipse.core.runtime_3.5.0.v20090525.jar</value>
<value>${jboss.server.home.url}/deploy/osgi/my.test.plugin_1.0.0.201005111137.jar</value>
</list>
</property>
Some of the plugins have to be listed explicitly in the autoInstall-Section, otherwise I get some "missing bundle"-exceptions, others seem to work without explicitly listing them, that's a little bit strange. To be sure I explicitly listed all.
7. In the end I managed to get my plugin started (with configuration as listed above). But I still get the following exceptions after my plugin has been started up:
13:48:57,495 ERROR [ProfileDeployAction] Failed to add deployment: org.eclipse.equinox.registry_3.4.100.v20090520-1800.jar
org.jboss.deployers.spi.DeploymentException: Error determining structure: org.eclipse.equinox.registry_3.4.100.v20090520-1800.jar
at org.jboss.deployers.spi.DeploymentException.rethrowAsDeploymentException(DeploymentException.java:49)
...
Caused by: java.lang.IllegalArgumentException: Null child
at org.jboss.deployers.vfs.spi.structure.helpers.AbstractStructureDeployer.getRelativePath(AbstractStructureDeployer.java:101)
...
Anybody having an idea what is wrong with my setup or how I could do a clean setup on JBoss OSGI for plugins using org.eclipse.core.runtime ?
Thank you for any help, feedback or input.