Hello all,
I have a weird issue. It is not a major issue and I can get around it,
but I thought I should raise it just in case someone else has a
similar problem.
My development environment is eclipse. My bundles are PDE projects so
it is easy for me to run and debug during development. I have a run
configuration which starts the equinox OSGi framework and loads and
starts my bundles. As part of my development I have used java security
extensions and the java sax parser. Equinox in eclipse is quite happy
with me not defining javax.security.* and org.xml.sax.* as imports in
my manifests (as I assume these are standard parts of java). I am
using java security and the SAX parser from a wab.
As I got some significant functionality running in equinox, I have
decided to move back to karaf 2.2.3 (felix) for an integration test,
test cellar/hazelcast with multiple machines etc. and try to figure
out how I would deploy. I currently have all these features installed
(as well as my own features):
State Version Name
Repository Description
[installed ] [1.9.3 ] hazelcast
repo-0 In memory data grid
[installed ] [2.2.2 ] cellar
repo-0 Karaf clustering
[installed ] [2.2.2 ] cellar-webconsole
repo-0 Karaf Cellar Webconsole Plugin
[installed ] [3.0 ] guice
repo-0 Google Guice
[installed ] [3.0.6.RELEASE ] spring
karaf-2.2.3
[installed ] [1.2.1 ] spring-dm
karaf-2.2.3
[installed ] [2.2.3 ] obr
karaf-2.2.3
[installed ] [2.2.3 ] config
karaf-2.2.3
[installed ] [7.4.5.v20110725] jetty
karaf-2.2.3
[installed ] [2.2.3 ] http
karaf-2.2.3
[installed ] [2.2.3 ] war
karaf-2.2.3
[installed ] [2.2.3 ] webconsole-base
karaf-2.2.3
[installed ] [2.2.3 ] webconsole
karaf-2.2.3
[installed ] [2.2.3 ] ssh
karaf-2.2.3
[installed ] [2.2.3 ] management
karaf-2.2.3
[installed ] [1.2.0-SNAPSHOT ] shiro-core
shiro-1.2.0-SNAPSHOT
[installed ] [1.2.0-SNAPSHOT ] shiro-web
shiro-1.2.0-SNAPSHOT
[installed ] [5.5.0 ] activemq
activemq-5.5.0
[installed ] [5.5.0 ] activemq-blueprint
activemq-5.5.0
[installed ] [5.5.0 ] activemq-web-console
activemq-5.5.0
When I try and run my wars in Karaf, karaf throws ClassNotFound
exceptions on the following:
org.xml.sax.helpers.DefaultHandler
javax.security.auth.x500.X500Principal
I added the org.xml.sax.helpers and javax.security.auth.x500 into the
relevant Manifests and Karaf is now happy (I don't need to add
org.xml.sax.* or javax.security.* even though I use other sax and java
security classes).
Thinking this is a Felix issue, I created two vanilla instances of
Karaf 2.2.3, one using equinox and one using Felix.
I created a test bundle which did the following (without adding
org.xml.sax.helpers or javax.security.auth.x500 to the manifest):
package com.mytestcompany.importtest;
import javax.security.auth.x500.X500Principal;
import org.osgi.framework.BundleActivator;
import org.osgi.framework.BundleContext;
import org.xml.sax.helpers.DefaultHandler;
public class Activator implements BundleActivator {
@Override
public void start(BundleContext arg0) throws Exception {
X500Principal principal = new X500Principal("CN=Fred");
DefaultHandler defaultHandler = new DefaultHandler();
System.out.println("Initialized successfully");
}
.
.
}
Both the equinox and felix versions of Karaf printed "Initialized
successfully" without a problem...so it doesn't appear there is an
obvious problem with felix.
Any ideas what may be messed up? I was wondering whether it could be a
pax web issue, but I have Pax Web setup in eclipse as well (though I
am using pax web 1.1.1./pax url 1.3.4 in equinox vs. pax web 1.0.6/pax
url 1.2.8 as part of Karaf 2.2.3).
I guess this isn't that important as I can get around it, but if
anyone had any ideas what could cause the issue it would be much
appreciated.
thanks in advance,
Gareth