PDA

View Full Version : Java Klasse in Makro iAccess einbinden



ChMüller
27-01-20, 12:01
Hallo zusammen,
ich versuche eine Java Klasse in einem Makro unter iAccess einzubinden. Er bringt allerdings immer den Fehler: "Macro.play(): Klasse MacroClass im Klassenpfad nicht gefunden"

Wie kann ich eine eigene Klasse einbinden?

Danke und Gruß
Christoph

Fuerchau
27-01-20, 14:01
Hier habe ich eine Doku gefunden:
https://www.ibm.com/support/knowledgecenter/SSS9FA_11.0.0/com.ibm.hod.doc/doc/macro/macro.html

ChMüller
27-01-20, 16:09
Vielen Dank schon mal. Das hatten wir auch schon alles durchgeackert, steigen aber leider nicht dahinter *wo* wir die Java Klasse ablegen müssen, damit er sie auch findet.

547

Fuerchau
27-01-20, 16:26
Ich mache mir nicht immer die Mühe alles selber auszuprobieren, aber hier stehts doch;-):

Deploying Java libraries or classes During macro playback, when the macro runtime processes a call to a Java method, the macro runtime searches all the available Java library files and class files for the class to which the method belongs, until it finds the class.
Deploying a Java library or class consists of placing the library file or class file containing the class in a location where the macro runtime can find it during macro playback.

You do not have to deploy the following types of Java classes:



Classes in the Java API (the Java archive files are already present on the client workstation and their locations are listed in the classpath that is specified when the Host On-Demand client is launched).
Classes in the Host On-Demand Macro Utility Libraries (HML libraries) are stored with the Host On-Demand client code (see The Macro Utility Libraries (HML libraries) (https://www.ibm.com/support/knowledgecenter/SSS9FA_11.0.0/com.ibm.hod.doc/doc/macro/macro.html?view=kc#mv1_hml_libraries)).

All other Java classes containing methods invoked by a macro script must be deployed by you to a location where the macro runtime can find them. Depending on the environment, you can deploy the Java classes as class files or as libraries containing Java classes.

For more information on deploying Java libraries and classes, see "Deploying customer-supplied Java archives and classes" in Planning, Installing, and Configuring Host On-Demand.
https://scc.its.state.nc.us/hod/en/doc/install/install.html

ChMüller
27-01-20, 16:36
Ja genau - da steht "an einen Ort, wo es gefunden werden kann". Wir finden den Ort aber nicht :(
Der weiterführende Link unten bringt uns leider auch nicht weiter. Sorry.

Fuerchau
28-01-20, 09:45
Ich würde einfach mal deine .jar in denselben Ordner packen wie die acsbundle.jar.

ChMüller
28-01-20, 10:01
Haben wir auch schon gemacht - immer die identische Fehlermeldung!?

Fuerchau
28-01-20, 12:53
Ok, wir bewegen uns hier in Java!
ACS befindet sich in der acsbundle.jar und wird mittels JVM gestartet.
Letztlich erfolgt also ein Aufruf per "Java -Djava.class.path=blabla -jar
acsbundle.jar"

In folgendem Link sind die Möglichkeiten beschrieben:
https://developer.ibm.com/articles/i-acs-commandline/

Der jeweilige Aufruf von "acslaunch_win-64" ist entsprechend mit obigem "java"-Aufruf zu ersetzen.
Somit kannst du den Classpath beim Aufruf ergänzen "-D
java.class.path=Path1;Path2".

Leider ist es da dann mit einem Doppelclick auf eine ".hod" nicht mehr getan.

Aber ich kann auch falsch liegen;-).