AndreasFagschlunger / O2Xfs

Java API for accessing CEN/XFS API, EMV Level 2 Kernel
47 stars 28 forks source link

at.o2xfs.operator questions #77

Closed barrney closed 5 years ago

barrney commented 5 years ago
  1. How do I start the GUI from at.o2xfs.operator?

  2. I was getting this error: Error: Unable to access jarfile ...\O2Xfs-develop\at.o2xfs.operator\lib\at.o2xfs.operator-${version}.jar

  3. Is it possible to run it on Windows XP environment?

Thanks!

AndreasFagschlunger commented 5 years ago

Hi @barrney

  1. The GUI should popup automatically, that's the whole point of O²XFS Operator, to provide a GUI and show basic tasks.
  2. There is an old release which should work: https://github.com/AndreasFagschlunger/O2Xfs/releases Obviously, {version} should be replaced by the actual version.
  3. It's possible but you need at least Java 8 to run O²Xfs. The JRE from Oracle should work, although it's not officially supported.
barrney commented 5 years ago

Hello, after I've transfer the jar files from the link you provided I got this when I run start.cmd

Exception in thread "XfsStartUpTask" java.lang.UnsatisfiedLinkError: no at.o2xfs.win32 in java.library.path at java.lang.ClassLoader.loadLibrary(Unknown Source) at java.lang.Runtime.loadLibrary0(Unknown Source) at java.lang.System.loadLibrary(Unknown Source) at at.o2xfs.xfs.XfsAPI.(Unknown Source) at at.o2xfs.xfs.XfsAPI.getInstance(Unknown Source) at at.o2xfs.xfs.service.XfsServiceManager.(Unknown Source) at at.o2xfs.xfs.service.XfsServiceManager.getInstance(Unknown Source) at at.o2xfs.operator.task.xfs.XfsStartUpTask.doExecute(Unknown Source) at at.o2xfs.operator.task.Task.execute(Unknown Source) at at.o2xfs.operator.task.TaskManager.executeTask(Unknown Source) at at.o2xfs.operator.task.TaskManager.access$100(Unknown Source) at at.o2xfs.operator.task.TaskManager$1.run(Unknown Source) at java.lang.Thread.run(Unknown Source)

AndreasFagschlunger commented 5 years ago

Which version of O²XFS are you testing? The old release ZIP or did you compile the source code on your own? In the release ZIP the DLLs are in the folder bin, so this folder must be in the java.library.path, see start.cmd for example:

java -Dlog4j.configuration=file:/%workingDirectory%\config\log4j.xml -Djava.library.path=%workingDirectory%\bin -jar %workingDirectory%\lib\at.o2xfs.operator.jar

In newer version of O²Xfs the libraries are loaded from your user directory:

%USERPROFILE%\.o2xfs\lib\x86
%USERPROFILE%\.o2xfs\lib\x86_64

There are JARs which contain the necessary DLLs and are dependencies as any other JAR, e.g.

https://repo.fagschlunger.co.at/webapp/#/artifacts/browse/tree/General/libs-snapshot-local/at/o2xfs/o2xfs-xfs-binaries https://repo.fagschlunger.co.at/webapp/#/artifacts/browse/tree/General/libs-snapshot-local/at/o2xfs/o2xfs-win32-binaries

If these dependencies are in your classpath, the Library class should find them and copy them automatically to your user directory and load them from there.

barrney commented 5 years ago

Hello I was able to get the GUI started up image

However, encounter an exception java.lang.ClassNotFoundException: at.o2xfs.operator.task.xfs.cdm.DispenseTask at java.net.URLClassLoader.findClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Unknown Source) at at.o2xfs.operator.menu.XMLMenuFactory.createTask(Unknown Source) at at.o2xfs.operator.menu.XMLMenuFactory.processTaskCommand(Unknown Source) at at.o2xfs.operator.menu.XMLMenuFactory.processMenuCommand(Unknown Source) at at.o2xfs.operator.menu.XMLMenuFactory.processMenuCommand(Unknown Source) at at.o2xfs.operator.menu.XMLMenuFactory.processMenuCommand(Unknown Source) at at.o2xfs.operator.menu.XMLMenuFactory.loadMenu(Unknown Source) at at.o2xfs.operator.menu.MenuTask.loadCommands(Unknown Source) at at.o2xfs.operator.menu.MenuTask.doExecute(Unknown Source) at at.o2xfs.operator.task.Task.execute(Unknown Source) at at.o2xfs.operator.task.TaskManager.executeTask(Unknown Source) at at.o2xfs.operator.task.TaskManager.access$100(Unknown Source) at at.o2xfs.operator.task.TaskManager$1.run(Unknown Source) at java.lang.Thread.run(Unknown Source) java.lang.IllegalArgumentException at at.o2xfs.common.Assert.notNull(Unknown Source) at at.o2xfs.operator.task.ExecuteTaskCommand.(Unknown Source) at at.o2xfs.operator.menu.XMLMenuFactory.processTaskCommand(Unknown Source) at at.o2xfs.operator.menu.XMLMenuFactory.processMenuCommand(Unknown Source) at at.o2xfs.operator.menu.XMLMenuFactory.processMenuCommand(Unknown Source) at at.o2xfs.operator.menu.XMLMenuFactory.processMenuCommand(Unknown Source) at at.o2xfs.operator.menu.XMLMenuFactory.loadMenu(Unknown Source) at at.o2xfs.operator.menu.MenuTask.loadCommands(Unknown Source) at at.o2xfs.operator.menu.MenuTask.doExecute(Unknown Source) at at.o2xfs.operator.task.Task.execute(Unknown Source) at at.o2xfs.operator.task.TaskManager.executeTask(Unknown Source) at at.o2xfs.operator.task.TaskManager.access$100(Unknown Source) at at.o2xfs.operator.task.TaskManager$1.run(Unknown Source) at java.lang.Thread.run(Unknown Source)

AndreasFagschlunger commented 5 years ago

Looks like you are using an old operator.jar? Try this build from yesterday: https://repo.fagschlunger.co.at/libs-snapshot-local/o2xfs/at.o2xfs.operator/1.0.0.BUILD-SNAPSHOT/at.o2xfs.operator-1.0.0.BUILD-20190612.214019-35.zip

barrney commented 5 years ago

Using your jar build you provided works!

However, what are the possible issues having; "The process cannot access the file because it is being used by another process"?

AndreasFagschlunger commented 5 years ago

This may be caused by the redirection of STDERR and STDOUT in start.cmd. You could try and remove the redirection:

java -Dlog4j.configuration=file:/%workingDirectory%\config\log4j.xml -jar %workingDirectory%\lib\at.o2xfs.operator-1.0.0.BUILD-SNAPSHOT.jar

And update log4j.xml to use files instead of console for logging.

AndreasFagschlunger commented 5 years ago

Another guess, you are using and old start.cmd and this line at the end causes the message:

MOVE /Y *.log* %workingDirectory%\%COMPUTERNAME%
barrney commented 5 years ago
  1. I tried to remove %workingDirectory%\%COMPUTERNAME%\out.log 2> %workingDirectory%\%COMPUTERNAME%\err.log

I got Error: Could not find or load main class and This is my current start.cmd image

AndreasFagschlunger commented 5 years ago

You path contains spaces choose a directory path without spaces or escape the paths:

@ECHO OFF
CLS
SET workingDirectory=%~dp0
SET workingDirectory=%workingDirectory:~0,-1%
IF NOT EXIST "%workingDirectory%\%COMPUTERNAME%" MD "%workingDirectory%\%COMPUTERNAME%"
java "-Dlog4j.configuration=file:/%workingDirectory%\config\log4j.xml" -jar "%workingDirectory%\lib\at.o2xfs.operator-1.0.0.BUILD-SNAPSHOT.jar" > "%workingDirectory%\%COMPUTERNAME%\out.log" 2> "%workingDirectory%\%COMPUTERNAME%\err.log"
barrney commented 5 years ago

@AndreasFagschlunger

It works.!

Are all folder interconnected with each other?

Currently I have all the folder moved and only using at.o2xfs.operator, is it still completely functional?

AndreasFagschlunger commented 5 years ago

O²XFS Operator needs some sort of configuration to work, beside the various JAR Archives. And therefore it expects a file operator.properties in a sub folder config within its current working directory.

barrney commented 5 years ago

Is it safe to run without folderat.o2xfs.xfs.service or at.o2xfs.common?

AndreasFagschlunger commented 5 years ago

The O²XFS Operator ZIP archive contains the necessary minimum to run. This is a lib folder containing the JARs and the config folder for configuration.

There is no folder at.o2xfs.xfs.service or at.o2xfs.common. These folders exist in this git repository and contain the source code which then compiles to the JAR files in the lib folder. And yes, they are dependent.

barrney commented 5 years ago

Hello,

Currently testing on a ATM. However during dispense task, there was an error at the end

image

AndreasFagschlunger commented 5 years ago

You should see the XFS error in the log files but I also changed the behavior, so next time you should see at least the error name and not only the class name.