in OpenQuant

Home 2015 Forums Programming C# in OpenQuant

This topic contains 1 reply, has 2 voices, and was last updated by avatar Johannes Lehmann 3 years, 3 months ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
  • #2497
    Haksun Li


    Can you please explain why I am getting this error. Btw I am using it as a library into a third party application OpenQuant and have extracted everything into its bin folder and added the relevant references to OpenQuant. The license file is in the same folder.
    System.TypeInitializationException: The type initializer for ‘com.numericalmethod.suanshu.algebra.linear.matrix.doubles.matrixtype.dense.DenseMatrix’ threw an exception. —> System.TypeInitializationException: The type initializer for ‘com.numericalmethod.suanshu.algebra.linear.matrix.doubles.matrixtype.mathoperation.SimpleMatrixMathOperation’ threw an exception. —> com.numericalmethod.suanshu.misc.license.LicenseError: license file not found – put the license file in the classpath, working directory, or next to suanshu.jar
    at com.numericalmethod.suanshu.misc.license.License.char()
    at com.numericalmethod.suanshu.misc.license.License.isValidated(Date )
    at com.numericalmethod.suanshu.misc.license.Package.long()
    at com.numericalmethod.suanshu.misc.license.Package.validate(String packageName)
    at com.numericalmethod.suanshu.algebra.linear.matrix.doubles.matrixtype.mathoperation.SimpleMatrixMathOperation..cctor()
    — End of inner exception stack trace —
    at com.numericalmethod.suanshu.algebra.linear.matrix.doubles.matrixtype.mathoperation.SimpleMatrixMathOperation..ctor()
    at com.numericalmethod.suanshu.algebra.linear.matrix.doubles.matrixtype.mathoperation.AutoParallelMatrixMathOperation..ctor(Int32 matrixSizeThreshold)
    at com.numericalmethod.suanshu.algebra.linear.matrix.doubles.matrixtype.mathoperation.AutoParallelMatrixMathOperation..ctor()
    at com.numericalmethod.suanshu.algebra.linear.matrix.doubles.matrixtype.dense.DenseMatrix..cctor()
    — End of inner exception stack trace —
    at com.numericalmethod.suanshu.algebra.linear.matrix.doubles.matrixtype.dense.DenseMatrix..ctor(Int32 nRows, Int32 nCols)
    at MyStrategy.OnBarSlice(Int64 size) in c:\Users\SUPER\Documents\OpenQuant\Projects\Suanshu\code.cs:line 41
    at OpenQuant.Trading.StrategyRunner.SetNewBarSlice(Int64 barSize)

    – Akhil Patel


    Hi Akhil,

    thanks for your question.

    When you run an application with SuanShu.NET from Visual Studio, the license file has to be in the same folder as the compiled executable. In most cases this is bin\Debug or bin\Release.

    Now since in your case you are using OpenQuant instead of Visual Studio and OpenQuant doesn’t run your code in a separate executable, the license file needs to be in the same folder as the OpenQuant executable (i.e. the folder that is called ‘OpenQuant’).

    However there is one final difficulty: Since the OpenQuant folder by default requires administrator privileges to move the license file there (Windows will prompt you), OpenQuant will fail to open the file.

    There are two possible solutions: Run OpenQuant as administrator, or change the permissions on the license file (Properties->Security->Edit) such that normal ‘Users’ can read the file. The second option would definitely be the preferred one!

    Please let me know if that solves your problem.


Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.