Hello Aris Experts,
I try to migrate a script from Aris 7.2 to Aris 9.6. This script uses a jar file (imported in the script category, and imported in the script).
To explain you the problem, I made a simple test with the following code :
java class in the imported jar :
package bpmap.test; import org.jdom.Element; public class SimpleTest { Element elt; public Element test(){ elt = new Element("test"); return elt; } }
My code in the script :
var simpleTest = new Packages.bpmap.test.SimpleTest(); var result = simpleTest.test();
When I run the script on Aris BA 7.2, it works correctly and creates an instance of my java class. The Method test() return the jdom.Element object. --> OK
I do exactly the same in Aris BA 9.6.
When I run the script on Aris BA 9.6, I have the message : java.lang.NoClassDefFoundError : org/jdom/Element.
The both examples use the same jar file.
I tried with other java classes and I get always the same message.
How can I do with ABA 9.6 to use a jar file ?
Thank you in advance for your help.
Best Regards.
Hi,
the import of jars from a script is unchanged in ARIS 9. The error message identifies the error: your class (SimpleTest) has been loaded quite well while org.jdom.element has not been loaded.
JDom is used inside ARIS so the reference to jdom should be possible (for example in a script try Context.getXMLParser). But maybe your jar is linked to another version of JDom than the one that is used/provided by ARIS (JDom 1.1)?
BR, Torsten
Hi Torsten,
Thank you for your response.
So I identified exactly what package is used by report :
In the Aris 9.6 script editor, I obtain the following information (in the variable watcher) for a jdom Document :
jdomDoc.getClass().getPackage() --> package org.jdom, JDOM Classes, version 1.0
jdomDoc.getClass().getName() ---> org.jdom.Document
jdomDoc.getClass().getResource("") --> jar:file:/C:/SoftwareAG/ARIS9.6/server/bin/work/work_abs_s/base/webapps/abs/WEB-INF/lib/jdom-1.1.jar!/org/jdom/
Then in eclipse, I import exactly this pakage (eg. image attached) and only this one in my build path to create the following java class :
package bpmap.testjar; import org.jdom.Element; public class Test { public Test(){ }; public static Element getTest(){ return new Element("coucou"); }; };
When I import and try to use this class I have again the same problem : java.lang.NoClassDefFoundError: org/jdom/Element.
I don't understand why, I use exactly the same package that is used by report.
Have you try this kind of code on Aris 9.6 by your side? I never had a problem with 7.2.
My example used jdom librairie, but it is the same problem using another one.
In fact, I would like to use libraries located in the pakage : y-aris-server-bl-core-96.0.1.1.jar
<ARIS9.6>\server\bin\work\work_abs_s\base\webapps\abs\WEB-INF\lib
Do you have an input? Is there a bug? Or I do something wrong? but what?
Thank you for your help.
BR,