Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Equinox » ClassNotFoundException when start bundles with command line version 3.5.1
icon9.gif  ClassNotFoundException when start bundles with command line version 3.5.1 [message #488804] Wed, 30 September 2009 09:51 Go to next message
Ashish  is currently offline Ashish Friend
Messages: 13
Registered: September 2009
Junior Member
I am new to eclipse OSGi. Currently, I am using eclipse OSGi 3.5.1 version. I have 4 bundles. When I invoke all these bundles from eclipse all the bundles start without any issue. But the same bundles, when I try to invoke from command line (java -jar jar_location -console -configuration configuration), getting java.lang.ClassNotFoundException: javax.xml.xpath.XPathExpressionException. This class is present in rt.jar which is in java_home classpath.

Same bundles run without any problem with same command when I run them with 3.2.2 version OSGi jar. When I change osgi 3.5.1 with version 3.2.2, all bundles run fine.

I think, running bundles from command line, it is not able to pick classes which are in rt.jar's javax package.

So is it a bug in new version which was not exist in older version or some configuration issue? Please suggest me, should I use new version(3.5.1) or move back to old version(3.2.2)?

Any workaround to solve this problem in 3.5.1 version.

StackTrace:-

osgi> org.osgi.framework.BundleException: Exception in com.ca.caf.bundle.BundleLoaderActivator.start() of bundle BundleLoader.
[java] at org.eclipse.osgi.framework.internal.core.BundleContextImpl.s tartActivator(BundleContextImpl.java:806)
[java] at org.eclipse.osgi.framework.internal.core.BundleContextImpl.s tart(BundleContextImpl.java:755)
[java] at org.eclipse.osgi.framework.internal.core.BundleHost.startWor ker(BundleHost.java:352)
[java] at org.eclipse.osgi.framework.internal.core.AbstractBundle.star t(AbstractBundle.java:280)
[java] at org.eclipse.osgi.framework.internal.core.AbstractBundle.star t(AbstractBundle.java:272)
[java] at org.eclipse.osgi.framework.internal.core.FrameworkCommandPro vider._start(FrameworkCommandProvider.java:253)
[java] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[java] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcce ssorImpl.java:39)
[java] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe thodAccessorImpl.java:25)
[java] at java.lang.reflect.Method.invoke(Method.java:597)
[java] at org.eclipse.osgi.framework.internal.core.FrameworkCommandInt erpreter.execute(FrameworkCommandInterpreter.java:155)
[java] at org.eclipse.osgi.framework.internal.core.FrameworkConsole.do command(FrameworkConsole.java:303)
[java] at org.eclipse.osgi.framework.internal.core.FrameworkConsole.co nsole(FrameworkConsole.java:288)
[java] at org.eclipse.osgi.framework.internal.core.FrameworkConsole.ru n(FrameworkConsole.java:224)
[java] at java.lang.Thread.run(Thread.java:619)
[java] Caused by: java.lang.NoClassDefFoundError: javax/xml/xpath/XPathExpressionException
[java] at com.ca.caf.bundle.BundleLoader.init(BundleLoader.java:56)
[java] at com.ca.caf.bundle.BundleLoaderActivator.start(BundleLoaderAc tivator.java:37)
[java] at org.eclipse.osgi.framework.internal.core.BundleContextImpl$1 .run(BundleContextImpl.java:783)
[java] at java.security.AccessController.doPrivileged(Native Method)
[java] at org.eclipse.osgi.framework.internal.core.BundleContextImpl.s tartActivator(BundleContextImpl.java:774)
[java] ... 14 more

[Updated on: Wed, 30 September 2009 09:53]

Report message to a moderator

Re: ClassNotFoundException when start bundles with command line version 3.5.1 [message #489739 is a reply to message #488804] Mon, 05 October 2009 17:31 Go to previous messageGo to next message
Andrew Niefer is currently offline Andrew NieferFriend
Messages: 990
Registered: July 2009
Senior Member
Have you declared a dependency on javax.xml.xpath in your manifest with
Import-Package?

See this wiki page: http://wiki.eclipse.org/Equinox_Boot_Delegation

-Andrew

Ashish wrote:
> I am new to eclipse OSGi. Currently, I am using eclipse OSGi 3.5.1
> version. I have 4 bundles. When I invoke all these bundles from eclipse
> all the bundles start without any issue. But the same bundles, when I
> try to invoke from command line (java -jar jar_location -console
> -configuration configuration), getting java.lang.ClassNotFoundException:
> javax.xml.xpath.XPathExpressionException. This class is present in
> rt.jar which is in java_home classpath.
>
> Same bundles run without any problem with same command when I run them
> with 3.2.2 version OSGi jar. When I change osgi 3.5.1 with version
> 3.2.2, all bundles run fine.
>
> I think, running bundles from command line, it is not able to pick
> classes which are in rt.jar's javax package.
>
> So is it a bug in new version which was not exist in older version or
> some configuration issue? Please suggest me, should I use new
> version(3.5.1) or move back to old version(3.2.2)?
>
> Any workaround to solve this problem in 3.5.1 version.
Re: ClassNotFoundException when start bundles with command line version 3.5.1 [message #494342 is a reply to message #488804] Fri, 30 October 2009 11:02 Go to previous message
Ashish  is currently offline Ashish Friend
Messages: 13
Registered: September 2009
Junior Member
Hello Andrew,

Thank you very much for your response. It worked successfully.

My apologies for late response.

Ashish
Previous Topic:DS and Jetty
Next Topic:eclipselink persistance.xml with Tomcat in OSGI bundle
Goto Forum:
  


Current Time: Fri Apr 26 16:58:24 GMT 2024

Powered by FUDForum. Page generated in 0.03458 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top