1

I am an Xpage developer new to Bluemix, trying to find a way to put 3rd party jar files on server. Tried the following ways:

1) Adding jar files inside the nsf under WebContent/WEB-INF/lib folder and configuring the build path.

2) Adding jar files inside the nsf using jars design element and configuring the build path.

3) As bluemix allows deploying plugins using shared-plugins folder, i created a plugin out of the jar files following the documentation pointed by the link http://www.dalsgaard-data.eu/blog/wrap-an-existing-jar-file-into-a-plug-in/ and deployed the plugin both on designer and server.

None of the above mentioned case worked. its throwing the error java.lang.NoClassDefFoundError

Even on my test server which is not on bluemix, all the above cases fails. But the app works fine when the jars are put under jvm/lib/ext folder on server. Not able to do this on bluemix as we do not have access to the file system.

Is there a way to put jar files under jvm/lib/ext folder on bluemix or how to make it work otherwise?

Thanks

2 Answers2

4

I use several external jars in my test bluemix apps I need some code showing how you are trying to accessing the classes in the jars. And I can update my answer with more information

No you can't place jars in the jvm/lib/ext folder in Bluemix what I know of

Sorry didn't see that you had tried this This is the answer how to do it in Bluemix from Tony McGuckin If you include a "shared-plugins" directory at the root of an app deployment directory and include OSGi plugins within this directory, then this directory and it's contents will be merged into the XPages Runtime OSGi location and loaded into the runtime memory space during staging.

eg: <my-app-deployment-dir>/shared-plugins/hello.world.jar

https://developer.ibm.com/answers/questions/202235/install-osgi-plugins-in-xpages-for-bluemix.html

Fredrik Norling
  • 3,461
  • 17
  • 21
  • 1
    It's pretty straight forward to use plugins on Bluemix. I blogged about it and also made a video: http://oliverbusse.notesx.net/hp.nsf/blogpost.xsp?documentId=FD2 – Oliver Busse Nov 16 '15 at 18:56
  • Could it be down to java policy permissions? You can work with that using environment variables in bluemix. See here: https://www.ng.bluemix.net/docs/starters/xpages/index.html#xpruntime_xprt_envivariables, specifically the env var called `APP_JAVA_POLICY_ALL_PERMISSION` – Brian Gleeson - IBM Nov 17 '15 at 11:58
0

The issue was with manifest file of one of the jar file which required a plugin (The plugin was manipulated and pushed with a different name). hence it was throwing the error java.lang.NoClassDefFoundError.

It is resolved by changing the plugin name and version. Thank you all for the responses