Login  Register

Re: null pointer exception on instanciating a matlab .jar class from plugin

Posted by Nathaniel Ryckman on Jul 05, 2011; 4:29pm
URL: http://imagej.273.s1.nabble.com/null-pointer-exception-on-instanciating-a-matlab-jar-class-from-plugin-tp3683949p3683950.html

Could you give us the stack trace?

Also, just to check, you meant to type:

thismclass = new Aclass();

Right? If you only have "thismclass = new Aclass;", then that could be your problem.

Heerpa wrote
Hi,

I am currently trying to write IJ plugins that access Matlab-generated .jar files.
With the help of http://imagejdocu.tudor.lu/doku.php?id=howto:plugins:how_to_set_up_netbeans_to_work_with_imagej_and_matlab_together
and the mathworks documentation, especially
http://www.mathworks.com/help/toolbox/javabuilder/ug/bsl9gar.html
and some entries in this forum, I can now
- access MATLAB functionality via deployed .jar from a java application
- create an IJ plugin that uses MATLAB types like MWArray, use MWException etc.
- declare a variable of my class (Aclass thismclass = null;)

but one i instanciate my class (thismclass = new Aclass;) ant open the plugin in IJ, I get a nullpointer Exception (even though I try-catch the instanciation).

Has anybody had the same problem or knows what to do to fix it?

best H