-
1. Re: Adding 3rd party JARs to Rhino classpath
jayshaughnessy Jun 15, 2012 4:44 PM (in response to eeiswerth)I don't think that is something we currently allow.
I discussed this briefly with Mazz and one possibility we came up with is to create Server Plugin, deploy it into the server, and then have your script interact with that plugin. The server plugin can, I think, contain its own jars.
See here for more on server plugin development:
https://docs.jboss.org/author/display/RHQ/Server+Plugin+Development
There is also a possibly relevant BZ here:
-
2. Re: Adding 3rd party JARs to Rhino classpath
eeiswerth Jun 15, 2012 4:53 PM (in response to jayshaughnessy)Thanks for the feedback. The alternative approach I decided to go with was have a Rhino script call a shell script, which invokes my Java code and performs my work. For example,
java.lang.Runtime.getRuntime().exec('/somescript.sh');
And in the shell script I can simply invoke Java (java -jar etc....). This seems to be doing the trick.
-
3. Re: Adding 3rd party JARs to Rhino classpath
jayshaughnessy Jun 15, 2012 5:00 PM (in response to eeiswerth)Great, Thanks for posting your solution.
-
4. Re: Adding 3rd party JARs to Rhino classpath
lkrejci Jun 18, 2012 4:20 AM (in response to eeiswerth)If you have access to the RHQ server installation it should be possible to just add that jar to the server classpath - i.e. copy it either into the server's lib or in the lib of the rhq.ear.
-
5. Re: Adding 3rd party JARs to Rhino classpath
eeiswerth Jun 18, 2012 9:37 AM (in response to lkrejci)I do believe I tried this and used importPackage(...) to try and include my library in the Rhino script, but without success. If this does indeed work, it is definitley a cleaner solution. However, since what I currently have is working I'm going to leave it as is for now. Thanks for the suggestion.