Removing the version did not help.
However, i am not using java -jar bin/felix.jar.
I use a custom launcher, since i embedded felix in my application.
I tried 2 different ways to init/start felix.
The first one (which i now use by default) is:
<code>
Map<String, String> configMap = new HashMap<String, String>();
configMap.put(Constants.FRAMEWORK_STORAGE, "cache");
configMap.put(Constants.FRAMEWORK_SYSTEMPACKAGES,
"org.osgi.framework;
version=2.0.0,");
configMap.put(AutoProcessor.AUTO_DEPLOY_ACTION_PROPERY,
"install,start,update");
try {
Felix felix = new Felix(configMap);
felix.init();
AutoProcessor.process(configMap,
felix.getBundleContext());
felix.start();
felix.waitForStop(0);
System.exit(0);
} catch (Exception ex) {
System.err.println("Could not start apache felix: " +
ex);
ex.printStackTrace();
System.exit(-1);
}
</code>
The second approach is very similar, but it uses a framework object instead:
<code>
public static void main(String[] args) {
Map<String, String> configMap = new HashMap<String, String>();
configMap.put(Constants.FRAMEWORK_STORAGE, "cache");
configMap.put(Constants.FRAMEWORK_SYSTEMPACKAGES,
"org.osgi.framework;
version=2.0.0,");
configMap.put(AutoProcessor.AUTO_DEPLOY_ACTION_PROPERY,
"install,start,update");
try {
framework =
getFrameworkFactory().newFramework(configMap);
framework.init();
AutoProcessor.process(configMap,
framework.getBundleContext());
framework.start();
framework.waitForStop(0);
System.exit(0);
} catch (Exception ex) {
System.err.println("Could not create framework: " + ex);
ex.printStackTrace();
System.exit(-1);
}
}
private static FrameworkFactory getFrameworkFactory() throws Exception {
URL url =
Main.class.getClassLoader().getResource("META-INF/services/org.osgi.framework.launch.FrameworkFactory");
if (url != null) {
BufferedReader br = new BufferedReader(new
InputStreamReader(url.openStream()));
try {
for (String s = br.readLine(); s != null; s =
br.readLine()) {
s = s.trim();
// Try to load first non-empty,
non-commented line.
if ((s.length() > 0) && (s.charAt(0) !=
'#')) {
return (FrameworkFactory)
Class.forName(s).newInstance();
}
}
} finally {
br.close();
}
}
throw new Exception("Could not find framework factory.");
}
</code>
Both of these ways result in the described error. Is this the problem?
Niko
Richard S. Hall wrote:
>
> How are you launching the framework? With "java -jar bin/felix.jar"? If
> so, it should be exporting javax.swing from the system bundle by
> default. You could try to remove your "version>=1.6.0" just in case.
>
> -> richard
>
--
View this message in context:
http://www.nabble.com/Error-starting-bundle---ClassNotFoundException--%3E-for-javax.swing.UIManager-----tp25826275p25860484.html
Sent from the Apache Felix - Users mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]