• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

Cannot use External Jars with Equinox

 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Update:
I've since fixed this...I wasn't putting my classpath jars in the actual jar I was building. That fixed my issue.


Hello,

Now that I have managed to get Equinox to work, I am running into a different problem.

I have a bunch of external jars(around 10) that I use for one of my bundles. For example, I use the commons-lang3-3.1.jar for various things. When I run my OSGi framework in Eclipse - it all works great. I just need to make sure I add them to my bundle's class path.

However, when I execute it outside of Eclipse, it throws java.lang.NoClassDefFoundError: errors. I'm not sure why this is happening.

I've done a bit of research and it seems that I have really two options:

1. Place the jar file in the root directory of my bundle (in this case, the bundle's jar file), and then make sure that the manifest file has a proper Export-Package on it.
I have tried this - and it still cannot find the jar.
2. Make a bundle of the jar file, and install that, ensuring all dependencies are resolved. THIS does NOT work for jar files. However, if I copy the actual source and use that instead of a jar file within the bundle, then it works. But I won't be able to do this for all of my jars since the source isn't present and I don't want to have to build every single external jar I use...

I'm pretty new to OSGi, and any help would be useful.

The below is from option 1:
Stacktrace:


Here is the manifest file:


The .jar file is in the root directory of this bundle. It is in included in the class path and the export...I also see it in the packages command:



I am confused as to why this doesn't work - it can be seen by the framework - my bundle just can't load it!!

Thanks.
 
I think she's lovely. It's this tiny ad that called her crazy:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic