Template Matching Plugin: javacpp issue

Hi @LThomas,

I am having an issue running the Template Matching Plugin:

I am getting this error when running it:

[ERROR] Module threw error
java.lang.NoSuchMethodError: putMemberOffset
	at java.lang.ClassLoader$NativeLibrary.load(Native Method)
	at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1941)
	at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1824)
	at java.lang.Runtime.load0(Runtime.java:809)
	at java.lang.System.load(System.java:1086)
	at org.bytedeco.javacpp.Loader.loadLibrary(Loader.java:1282)
	at org.bytedeco.javacpp.Loader.load(Loader.java:1043)
	at org.bytedeco.javacpp.Loader.load(Loader.java:935)
	at org.bytedeco.javacpp.opencv_core.<clinit>(opencv_core.java:10)

My suspicion is that Fiji now ships a newer version of javacpp, which over-writes the older version that one downloads for the plugin to run and thus there is the incompatibility. But it is just an idea…

Maybe someone can help?

Christian

1 Like

Hi Christian,
Can you try to activate the IJ-OpenCV update site ?
It is shipping its own version of javacpp and as far as I remember it is compatible with the implementation of qingzong.

Otherwise you can try our Multi-Template-Matching by activating its update site together with IJ-OpenCV. You would have the options for multiple objects and/or templates.

1 Like

I just did some more tests and in my Fijis there is (since recently) this file:

../jars/javacpp-1.4.4.jar

I do not know where it comes from…

If I remove this file, Fiji uses the old javacpp.jar that I manually downloaded and everything works :slight_smile:

@LThomas: Could you tell me which javacpp version you have in your Fiji?

Glad that it works !
Yes I use the same than IJ-OpenCV, so currently 1.4.2

Interesting…I wonder where the javacpp-1.4.4.jar comes from in my case…

This is a problem, because Fiji will only consider the latest version…

Do you have by chance any idea, which Fiji plugin could ship javacpp-1.4.4.jar?

No idea sorry…

But if you did not put it your self it probably comes from an update site.
You could check in the advanced mode of fiji updater the list of files that were installed by the update sites you activated

I just hope you dont have so many of them activated :sweat_smile:
Maybe there is a clever way to do that with the updater via the command line

2 Likes

Hi Tischer,

The error is very likely that an old javacpp.jar was loaded and it didn’t have the putMemberOffset method. Have you tried to install the plugin via FIJI’s updater ?
The update site is
http://sites.imagej.net/Template_Matching/

The javacpp is also used by the H5J_Loader_Plugin which is bundled in FIJI’s default installation. Early in this year, FIJI by default installed the version 0.1.1(javacpp-0.1.1.jar). So at that time, to make the template matching plugin work under FIJI, the work around was to manually replace the javacpp-0.1.1.jar with the javacpp.jar downloaded from my site (which is version 1.4.4). If javacpp-0.1.1.jar was loaded, you would have the putMemberOffset error.

The built-in javacpp from FIJI’s installation has been updated to version 1.4.4 recently. That is why you have this file : javacpp-1.4.4.jar in your jars folder.

Best,

Zong

2 Likes

Thanks for the answer!

In may case I had both “your” javaccp.jar and the javacpp-1.4.4.jar in the plugins and jars folder, respectively. The error disappeared when I removed javacpp-1.4.4.jar.

Did you test your plugin with Fiji’s javacpp-1.4.4.jar already?


The plugin works with the bundled javacpp-1.4.4.jar.
(It is the same as the javacpp.jar downloaded from my github repo)

2 Likes