Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[skalli-dev] Guide: how to export Skalli as an Eclipse product

Hi all,

I want to deploy Skalli in our infrastructure based on the Jetty runtime. I will define an Eclipse product and features to export it directly from my workspace. I will describe here in comprehensive all steps I had to do to make it running.

Note: When cloning Skalli from Git repo, it can be started within IDE without any problems.

There is yet a feature contained in Skalli: org.eclipse.skalli.feature. This feature does include a feature, which is NOT available in repo.
Therefore, I've replaced this by a new feature org.eclipse.skalli.orbit.feature and included the 3rdParty libraries as described in [1].

This does include 11 plugins:

If I try to export org.eclipse.skalli.feature again, it does not work, with exception:
Processing inclusion from feature org.eclipse.skalli.eclipse.feature: Unable to find plug-in: org.eclipse.core.jobs_3.5.0.v20100515. Please check the error log for more details.

I've changed the org.eclipse.skalli.eclipse.feature, to use the latest versions of, o.e.e.preferences, o.e.e.registry,,

Note: If we include the windows specific platform security plugin, we should also consider to include the win32_64 and macosx version of these fragments. I will dont care for the moment, as I will deploy to Linux, but I've added a bug for this [5].

If I try to export org.eclipse.skalli.feature again, I got cycle references:
A cycle was detected when generating the classpath org.eclipse.skalli.common_0.1.0.201105251413, org.eclipse.skalli.testutil_0.1.0.201105251413, org.eclipse.skalli.api.java_0.1.0.201105251413, org.eclipse.skalli.common_0.1.0.201105251413.

AFAI understand it is related to the fragment "o.e.s.common.test", which is a fragment of "o.e.s.common". This bundle depends on o.e.s.testutil, which leads to a cycle.

Q1: I do NOT know how I can specify to IGNORE the test fragment when exporting a feature/product from IDE. Any idea?

My workaround was to close this project in workspace, which does work. I had to close those projects too to avoid cycle references:

Q2: The o.e.s.testing.feature does only include test o.e.s.testutil bundle. I assume other bundles are missing? For what purpose does this feature will be needed for? 

Q3: Similar question about the feature for Skalli source bundles.

I've created now a product configuration with project org.eclipse.skalli.product/skalli.product.
I've added these features to this product:

I've also added missing bundles to org.eclipe.skalli.eclipse.feature:

I've also added missing bundles to org.eclipe.skalli.orbit.features:

I've set start level for bundles:

I could not set o.e.e.ds and o.e.e.common via product editor, fixed it in text mode. Not sure whether its a bug, have to investigate.

If I validate the product, all dependencies are fine now.

I want to add also the Jetty configuration files to the deployment. I've added a folder to org.eclipse.skalli.feature/rootfiles, which contains all required Jetty config files. For a simple demo mode, I've also added the workdir with a preset of data to this rootfiles area.
I've added a simple start script bin/ to start it with all required options:

java -Declipse.ignoreApp=true -Dosgi.noShutdown=true -Dequinox.ds.print=true -Djetty.home=./jetty -Dlogback.configurationFile=./jetty/etc/logback.xml -jar plugins/org.eclipse.osgi_*.jar -clear -console -consoleLog -configuration ./configuration

I will export the skalli.product with following configuration:
- Root directory: skalli
- do NOT Synchronize before exporting
- do NOT generate metadata
- allow for binary cycles

When starting the deployed skalli product now using bin/, I will get the next error messages:

Loading bundle will result in:
java.lang.NoClassDefFoundError: javax/xml/parsers/ParserConfigurationException

I am wondering why it is working in IDE. There are slight differences running OSGi from IDE and native.
See also [2], where the same problem has been reported.
Note: you can simulate this in IDE by setting the property -Dosgi.compatibility.bootdelegation=false in skalli launch config.

The reason for NoClassDefFoundError is that the bundle does NOT import javax.xml.parsers package.
I see two options:
a) import javax.xml.parsers in bundle
b) make javax packages visible to all bundles [3]
I would prefer option a) as this would allow to use different versions of XML parser.

I will add an import for packages 
for bundles

Server starts now fine, but JSPs will not be supported, due to fragment org.eclipse.jetty.osgi.boot.jsp is missing in feature org.eclipse.jetty.core. I've added this bundle to org.eclipse.skalli.eclipse.feature.

Note: I am not sure whether this is the right place. Probalby it has to be included in product export directly, as otherwise we get a reference from eclipse.feature to a specific runtime, here Jetty.

Now server starts, but when opening a browser JSP can NOT be compiled due to:
osgi> 2011-05-27 18:50:22.582:WARN::/search/login.jsp
java.lang.NoClassDefFoundError: javax/xml/parsers/ParserConfigurationException
at java.lang.Class.getDeclaredConstructors0(Native Method)
at java.lang.Class.privateGetDeclaredConstructors(
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(
at org.eclipse.skalli.view.internal.filter.ConfigFilter.doFilter(
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(
Caused by: 
java.lang.ClassNotFoundException: javax.xml.parsers.ParserConfigurationException
at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(

I've imported now the bundle org.apache.taglibs.standard.glassfish to my workspace, and added import packages for:
You have to update your launch config to use the bundle from workspace now and not from target.

I've also added the o.e.s.view.theme bundle to include the right icons. For an product export the folder src/main/java has been missing, which I added to the project.

Now everything is working fine, either from IDE with -Dosgi.compatibility.bootdelegation=false set, or running as product export with commandline script.

I've added a bug to support product export [4], and will add my changes as a patch set. It would be helpful, to get a review of someone of Skalli team to check whether this is the right implementation.

Bye, Jochen


Back to the top