Unable to start Quantrix from QAPI. What is the problem?
Using QAPI to start Quantrix I receive the following error output:
——————————————————–
C:Program FilesQuantrix Modeler
Exception in thread “”main”” java.lang.RuntimeException: Problems initializing Quantrix instance: null
at QAPI.QuantrixFactory.getQuantrix(Source:58)
at FirstSample.main(FirstSample.java:11)
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at QAPI.QuantrixFactory.getQuantrix(Source:54)
… 1 more
Caused by: java.lang.ExceptionInInitializerError
at JR.f(Source:133)
at JR.b(Source:113)
at JR.<init>(Source:106)
at JR.as_(Source:98)
at com.quantrix.qapi.impl.Bootstrapper.setup(Source:29)
… 6 more
Caused by: java.lang.NullPointerException
at ZS.a(Source:23)
at cv.<clinit>(Source:23)
… 11 more
—————————————————————
The source code that generated the above output is:
————————————————————–
public class FirstSample
{
public static void main(String[] args)
{
String pluginsPathStr = args[0];
System.out.println(pluginsPathStr);
/* get the app */
java.io.File pluginsPath = new java.io.Fil(pluginsPathStr);
QAPI.QuantrixFactory.setQuantrixLocation(pluginsPath);
QAPI.Quantrix quantrix = QAPI.QuantrixFactory.getQuantrix();
quantrix.showUserInterface();
}
}
———————————————————————–
I am currently using Quantrix 2.4 on Vista. I don’t believe there is a classpath error as I have included all the Quantrix jar files in the classpath. Can anyone tell me where the problem might lie? Is it possible that Quantrix may require administrator privileges to be run from QAPI? Any help would be greatly appreciated. Thanks!
Kris Prieb
Thanks for the help, Bryan! Very much appreciated. Switching from “”qapi.jar”” to “”QuantrixAPI.jar”” did the trick.
I was already using the application root directory rather than the plugins directory as the path string (though I did make the mistake of using the plugins directory earlier on). Also, I didn’t make any modifications to the directory structure to create a non-space path name. So ultimately the problem was with the .jar files. This makes me wonder what the purpose of the other .jar file is if not to be used as part of the API.
Here is the new output:
______________________________
C:Program FilesQuantrix Modeler
FOUND: C:Program FilesQuantrix Modelerstartup.jar
WAITING on java.lang.Object@190d11
matrix name = Matrix2
done
______________________________
And the new test code:
______________________________
import QAPI.MatrixView;
import QAPI.Model;
public class FirstSample
{
public static void main(String[] args)
{
String appDirStr = args[0];
System.out.println(appDirStr);
/* get the app */
java.io.File appDirPath = new java.io.File(appDirStr);
QAPI.QuantrixFactory.setQuantrixLocation(appDirPath);
QAPI.Quantrix quantrix = QAPI.QuantrixFactory.getQuantrix();
final Model m = quantrix.createModel();
MatrixView matrix = m.createMatrix();
String name = matrix.getName();
System.out.println(“”matrix name = “” + name); // says “”Matrix2″”
quantrix.showUserInterface();
System.out.println(“”done””);
}
}
—————————————–
Kris Prieb