Standalone java app to load a model

Generic selectors
Exact matches only
Search title only
Search in content
Search in all posts
Search in pages
Answers
Questions
333 views
0

Hello,
I’m new to Quantrix and was trying to load a very basic "hello world" model thru a simple java app. It’s throwing a runtime exception. Does anyone have any suggestions please?

Really appreciate any help. Thanks!

Quantrix Modeler 6.1.0 64-bit edition

Here is the entire java code-
——————————————————————
package qmdmj;
import com.quantrix.scripting.core.sapi.impl.QuantrixImpl;

public class mtest {
public static void main(String[] args) {
System.out.println("Trying to open the model…");
try {
QuantrixImpl qm = new QuantrixImpl();
qm.openModel("c:\\temp\\test.model");
}
catch (Exception e) {
e.printStackTrace();
}
}
}
—————————————————————————————

And here is the exception message with the trace-

java.lang.NullPointerException
at java.io.Reader.<init>(Reader.java:78)
at java.io.InputStreamReader.<init>(InputStreamReader.java:72)
at com.quantrix.core.internal.ModelDocument.initializeHeaders(ModelDocument.java:307)
at com.quantrix.core.internal.ModelDocument.<init>(ModelDocument.java:226)
at com.quantrix.core.internal.ModelDocumentApplication.lambda$0(ModelDocumentApplication.java:258)
at com.subx.general.core.iapi.transaction.TransactionManager.performOutsideTransaction(TransactionManager.java:313)
at com.quantrix.core.internal.ModelDocumentApplication.createDocumentModel(ModelDocumentApplication.java:256)
at com.quantrix.core.internal.ModelDocumentApplication.createDocumentModel(ModelDocumentApplication.java:1)
at com.subx.document.core.iapi.DocumentApplication$6.perform(DocumentApplication.java:460)
at com.subx.document.core.iapi.DocumentApplication$6.perform(DocumentApplication.java:1)
at com.subx.general.core.iapi.role.CurrentSession.performWithSession(CurrentSession.java:86)
at com.subx.general.core.iapi.role.CurrentSession._performInsecurely(CurrentSession.java:115)
at com.subx.general.core.iapi.role.CurrentSession.performInsecurely(CurrentSession.java:96)
at com.subx.document.core.iapi.DocumentApplication.readFromFile(DocumentApplication.java:455)
at com.subx.document.core.iapi.DocumentApplication$4.perform(DocumentApplication.java:336)
at com.subx.document.core.iapi.DocumentApplication$4.perform(DocumentApplication.java:1)
at com.subx.general.core.iapi.role.CurrentSession.performWithSession(CurrentSession.java:86)
at com.subx.general.core.iapi.role.CurrentSession._performInsecurely(CurrentSession.java:115)
at com.subx.general.core.iapi.role.CurrentSession.performInsecurely(CurrentSession.java:96)
at com.subx.general.core.iapi.transaction.TransactionManager.performInsecurelyOutsideTransaction(TransactionManager.java:349)
at com.subx.document.core.iapi.DocumentApplication.openDocument(DocumentApplication.java:332)
at com.subx.document.core.iapi.DocumentApplication.openDocument(DocumentApplication.java:279)
at com.quantrix.scripting.core.sapi.impl.QuantrixImpl.openModel(QuantrixImpl.java:39)
at com.quantrix.scripting.core.sapi.impl.QuantrixImpl.openModel(QuantrixImpl.java:33)
at qmdmj.mtest.main(mtest.java:9)

Answered question
0

Hello,
The simple answer is that loading of a model via scripting from a standalone Java application is not supported.
What are you trying to accomplish?

Answered question