> Hi, > > I am developing an application which uses felix embedded to provide an OSGI > environment. I have set up a small run.bat which builds a classpath-string > using a few bootstrap libraries, that the application needs for firing up > Felix. I have all the bootstrap-libraries as plain JAR files in a bootstrap > folder, all other libraries as bundles in the lib folder. The bootstrap > libraries are: > > bnd-0.0.254.jar > icc-1.0-SNAPSHOT.jar > javax.servlet-1.0.0.jar > jcl104-over-slf4j-1.5.0.jar > log4j-1.2.12.jar > org.apache.felix.bundlerepository-1.0.2.jar > org.apache.felix.framework-1.0.3.jar > org.apache.felix.main-1.0.3.jar > org.apache.felix.shell-1.0.0.jar > org.apache.felix.shell.tui-1.0.0.jar > org.osgi.compendium-1.0.0.jar > org.osgi.core-1.0.0.jar > org.osgi.foundation-1.0.0.jar > slf4j-api-1.5.0.jar > slf4j-log4j12-1.5.0.jar > > So it's mostly OSGI, felix, some logging, bnd and ICC (our own library). So > far so good. Felix starts up, loads all the bundles and everyone is happy. > However, i never got this stuff to work inside my IDE (IntelliJ), i got all > kinds of mysterious errors when trying to run that exact same application. > Now i had a look on what was actually different, and i quickly found out > that IntelliJ just added all my bundled libraries to the classpath before > starting the application up. So to make sure that it was actually the > classpath (and not some mysterious stuff inside IntellIJ) I modified the > run.bat in a way that added all the bundles as well to the classpath before > starting the application, et voila - the sh*t hit the fan. I got the same > weird classloading errors i got in IntelliJ, most of them regarding the XML > parser like this: > > org.springframework.beans.factory.BeanDefinitionStoreException: Unexpected > excep > tion parsing XML document from URL > [bundle://44.0:0/application-context-osgi.xml > ]; nested exception is javax.xml.parsers.FactoryConfigurationError: Provider > org > .apache.xerces.jaxp.DocumentBuilderFactoryImpl not found > > Funny enough, the class is actually available from the xerces bundle i have > installed. I found this to be a startling experience, because usually you > get in trouble when you have forgotten some libs in your classpath and not > if you just add a few extra one's. My assumptions so far were: > > > 1. I need to put into the classpath, what the environment and my little > starter app needs to start up. > 2. The system bundle will export some packages from the classpath to other > bundles. I can specify the packages to be exported in the: > org.osgi.framework.system.packages variable. All other packages from the > classpath are unavailable. > 3. When i deploy a bundle, the packages from there are exported as specified > in the bundle's manifest. > > Given these three assumptions, i fail to understand why adding the bundles > to the classpath is frying the application because in fact it should't make > a difference on what i add to the classpath as all the stuff there is not > exported into the OSGI environment unless i specify it, so it just should > not make any difference.
Are you using the current trunk? If you use 1.0.3 could you retry on trunk or 1.0.4 when it is released - we fixed an issue that might be related ... Other then that, could you maybe try to create a simple example that fails so that we can look into it or make some more information available for example the complete stacktraces of the exceptions you see? regards, Karl > I spent a few days on this already and I am pretty sure I am doing something > that I am not supposed to do, because when i search the net for this kind of > stuff, I find nothing. I'd be thankful for any insights making this > behaviour more clear to me. Ow and if you have a few tips on how to work > with OSGI inside an IDE that would be helpful as well. > > Thanks a lot. > > Best regards, > Jan > -- > View this message in context: > http://www.nabble.com/Why-does-adding-libraries-to-the-classpath-change-how-things-work-inside-felix--tp16834823p16834823.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] > > -- Karl Pauls [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

