This just means you also need to bundle saxpath. FWIW, there's an OSGi bundle for JDOM in the SpringSource repository: http://www.springsource.com/repository/app/bundle/version/detail?name=com.springsource.org.jdom&version=1.1.0&searchType=bundlesByName&searchQuery=jdom
Justin On Wed, Jan 13, 2010 at 2:42 PM, Renaud Pelissier < [email protected]> wrote: > Hi Richard, > > I am under the impression that JDOM is again responsible for my problem. > The problem comes when calling > org.jdom.xpath.XPath.newInstance(XPath.java:134). > > What do you think, should I just change my XML library and the drop this > JDOM that is making me crazy by not having a regular dependancies tree > (that > causes BND to generate a stupid MANIFEST)? > > Regards, > > Renaud > > > > org.osgi.framework.BundleException: Activator start error in bundle > fr.numvision.kernel [18]. > at org.apache.felix.framework.Felix.activateBundle(Felix.java:1751) > at org.apache.felix.framework.Felix.startBundle(Felix.java:1622) > at org.apache.felix.framework.BundleImpl.start(BundleImpl.java:915) > at > > org.apache.felix.shell.impl.StartCommandImpl.execute(StartCommandImpl.java:114) > at > > org.apache.felix.shell.impl.Activator$ShellServiceImpl.executeCommand(Activator.java:286) > at > > org.apache.felix.shell.tui.Activator$ShellTuiRunnable.run(Activator.java:184) > at java.lang.Thread.run(Unknown Source) > Caused by: java.lang.NoClassDefFoundError: org/saxpath/SAXPathException > at java.lang.ClassLoader.defineClass1(Native Method) > at java.lang.ClassLoader.defineClass(Unknown Source) > at > > org.apache.felix.framework.ModuleImpl$ModuleClassLoader.findClass(ModuleImpl.java:1787) > at > > org.apache.felix.framework.ModuleImpl.findClassOrResourceByDelegation(ModuleImpl.java:682) > at > org.apache.felix.framework.ModuleImpl.access$100(ModuleImpl.java:60) > at > > org.apache.felix.framework.ModuleImpl$ModuleClassLoader.loadClass(ModuleImpl.java:1650) > at java.lang.ClassLoader.loadClass(Unknown Source) > at java.lang.ClassLoader.loadClassInternal(Unknown Source) > at java.lang.Class.forName0(Native Method) > at java.lang.Class.forName(Unknown Source) > at org.jdom.xpath.XPath.newInstance(XPath.java:134) > at fr.numvision.common.xml.XmlDAO.getElements(XmlDAO.java:343) > at fr.numvision.common.xml.XmlDAO.getElement(XmlDAO.java:372) > at fr.numvision.common.xml.XmlDAO.getString(XmlDAO.java:133) > at fr.numvision.common.xml.XmlDAO.getInt(XmlDAO.java:94) > at > > fr.numvision.kernel.sat.ConfigDAO.getBoxListenerSleepDelay(ConfigDAO.java:62) > at > fr.numvision.kernel.sat.KernelActivator.start(KernelActivator.java:28) > at > > org.apache.felix.framework.util.SecureAction.startActivator(SecureAction.java:639) > at org.apache.felix.framework.Felix.activateBundle(Felix.java:1700) > ... 6 more > Caused by: java.lang.ClassNotFoundException: org.saxpath.SAXPathException > at > > org.apache.felix.framework.ModuleImpl.findClassOrResourceByDelegation(ModuleImpl.java:738) > at > org.apache.felix.framework.ModuleImpl.access$100(ModuleImpl.java:60) > at > > org.apache.felix.framework.ModuleImpl$ModuleClassLoader.loadClass(ModuleImpl.java:1650) > at java.lang.ClassLoader.loadClass(Unknown Source) > at java.lang.ClassLoader.loadClassInternal(Unknown Source) > ... 25 more > java.lang.NoClassDefFoundError: org/saxpath/SAXPathException > > > > 2010/1/13 Richard S. Hall <[email protected]> > > > On 1/13/10 12:40, Renaud Pelissier wrote: > > > >> Hello, > >> > >> This is a second post about ClassCastException when running my bundle. > >> I am running my Bundle and I get a "Activator start error" with a > >> ClassCastException: > >> > >> > >> > >>> java.lang.ClassCastException: fr.numvision.kernel.sat.KernelActivator > >>> cannot be cast to org.osgi.framework.BundleActivator > >>> > >>> > >>> > >> I don't understand this error because > >> fr.numvision.kernel.sat.KernelActivator IMPLEMENTS > >> org.osgi.framework.BundleActivator. > >> > >> > > > > There error is telling you that you have two copies of the > BundleActivator > > class loaded into your VM somehow. The framework is using one and your > > bundle is using another. > > > > Do you have any other bundles exporting org.osgi.framework? Where is your > > bundle getting this package from? If you issue the following command in > the > > Felix shell you can see the wiring: > > > > inspect package requirement <bundle-id> > > > > or shortened to: > > > > inspect p r <bundle-id> > > > > Where <bundle-id> is the ID of your bundle, then you should see from > where > > it is getting org.osgi.framework. If it is not the system bundle > > (org.apache.felix.framework), then you have an issue. > > > > You might also have mistakenly embedded this package into your bundle and > > you are not importing it at all, which would also be an issue. > > > > -> richard > > > > > > Any idea? > >> > >> Regards, > >> > >> Renaud > >> > >> > >> > >> > >> > >> package fr.numvision.kernel.sat; > >> > >> > >>> import org.osgi.framework.BundleActivator; > >>> import org.osgi.framework.BundleContext; > >>> > >>> import fr.numvision.common.NumVisionException; > >>> import fr.numvision.kernel.IterativeRunner; > >>> import fr.numvision.kernel.Logger; > >>> import fr.numvision.kernel.Logger.LoggingLevel; > >>> import fr.numvision.networkdiscovery.sat.BoxListener; > >>> > >>> public class KernelActivator implements BundleActivator{ > >>> > >>> private Thread boxListenerTread=null; > >>> > >>> @Override > >>> public void start(BundleContext context) throws Exception { > >>> Logger.createGlobalConsoleLogger(); > >>> Logger.log(this,"Logger was configured properly", > >>> LoggingLevel.INFO); > >>> > >>> System.out.println("STARTING"); > >>> NumVisionException exception=new NumVisionException(); > >>> System.out.println(exception); > >>> > >>> Logger.createLogger("kernel",new > >>> > >>> > String[]{"fr.numvision.kernel","fr.numvision.networkdiscovery"},ConfigDAO.dirLog); > >>> > >>> BoxListener boxListener=new BoxListener(); > >>> IterativeRunner iterativeRunner=new > IterativeRunner(boxListener, > >>> ConfigDAO.getBoxListenerSleepDelay()); > >>> boxListenerTread=new Thread(iterativeRunner); > >>> boxListenerTread.start(); > >>> } > >>> > >>> @Override > >>> public void stop(BundleContext arg0) throws Exception { > >>> boxListenerTread.interrupt(); > >>> } > >>> > >>> } > >>> > >>> > >>> > >> > >> > > > > --------------------------------------------------------------------- > > To unsubscribe, e-mail: [email protected] > > For additional commands, e-mail: [email protected] > > >

