[Geoserver-devel] [Geoserver-users] JPEG2000 plugin

Hi Tobias,
keeping the mailing list in the loop so that future users with similar questions may see your experiences on that topic.

On Fri, Oct 26, 2012 at 2:16 PM, Tobias Reinicke <ramotswa@anonymised.com> wrote:

Hi Daniele,

Thanks for the reply.

So I have put the three jar files into the geoserver/lib directory as stated.
I have put the dll’s into another folder, and have put that folder on my windows path.

That’s it in terms of what I need to do right?

If so, I am getting this error on start up. Have copied the entire geoserver start up log so you can see if anything else is missing.

Thanks for your help.

I can see 2 unrelated issues from your log.

  1. DLL path issue
Oct 26, 2012 12:11:26 PM it.geosolutions.util.KakaduUtilities loadKakadu
WARNING: Failed to load the Kakadu native libs. This is not a problem unless you
 need to use the Kakadu plugin: it won't be enabled. java.lang.UnsatisfiedLinkEr
ror: C:\Program Files (x86)\Java\jdk1.7.0_09\bin\kdu_jni.dll: Can't find depende
nt libraries

It seems like a kdu_jni.dll on your JDK/bin isn’t finding additional dependencies.
Question:
You said “I have put the dll’s into another folder, and have put that folder on my windows path
Is that “another folder” == the JDK bin one?
if affirmative, you should check if the other required kakadu DLLs are there too… (you may also consider using 1 to find other potentially missing DLLs).
if negative, I suggest to remove the kdu_jni.dll from your JDK bin. That one may take precedence with respect to the other DLLs you have put into the “another folder”. Removing it from the JDK bin should allow avoiding DLLs loading from unexpected locations (maybe an old kdu_jni.dll looking for old kdu_x##.dlls.

  1. Missing jar.
WARNING: Can't load a service for category "GridFormatFactorySpi". Cause is "Ser
viceConfigurationError: org.geotools.coverage.grid.io.GridFormatFactorySpi: Prov
ider org (...) NoClassDefFoundError: it/geosolutions/imageio/imageioimpl/imagere
admt/ImageReadDescriptorMT".
java.util.ServiceConfigurationError: org.geotools.coverage.grid.io.GridFormatFac
torySpi: Provider org.geotools.coverageio.jp2k.JP2KFormatFactory could not be in
stantiated: java.lang.NoClassDefFoundError: it/geosolutions/imageio/imageioimpl/
imagereadmt/ImageReadDescriptorMT

I will take a look to the jp2k related geotools pom to make sure that dependency is imported.
In the meantime, you may consider adding that one 2 to your geoserver WEB-INF/lib which should fix the NoClassDefFoundError exception.

Please, let us know if you have additional issues after fixing those 2.
If everything goes fine, we can discover whether the Kakadu 7 native libs are properly working against previous jni jars.

Cheers,
Daniele

Toby

On 26 October 2012 12:03, Daniele Romagnoli <daniele.romagnoli@anonymised.com> wrote:

Hi Tobias,

On Thu, Oct 25, 2012 at 3:10 PM, Tobias Reinicke <ramotswa@anonymised.com.> wrote:

Hello all,

I am trying to get this to work and was just wondering;

I have the three dll’s as specified on
http://geo-solutions.blogspot.co.uk/2010/03/geoserver-and-geotools-now-supporting.html

but that was 2 years ago, and we have Kakadu version 7.

The jar files I have are:
imageio-ext-kakadujni-5.2.6
imageio-ext-kakadu-1.1.4
gt-jp2k-8.2

Is there an updated jni library available that works with version 7?

We hadn’t a chance to work against Version 7 yet.
As seen from the blog you have reported, we were able to use the same kakadujni stuff against 5.2.6 and 6.3 versions.
However, we didn’t checked if something has been changed at JNI side on version 7.
You maybe could try to see if these old jars are still working with the new DLLs and share with us your results/feedbacks. (Not sure if it will works.)

Also, to get this running, do I “JUST” need the dll’s?

That should be fine. (provided that the old jars are working with the new DLLs without any change)

Regards,
Daniele

Or the rest of the Kakadu source code available too?

Thanks

Toby


Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_sfd2d_oct


Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

Our support, Your Success! Visit http://opensdi.geo-solutions.it for more information.

Ing. Daniele Romagnoli
Senior Software Engineer

GeoSolutions S.A.S.
Via Poggio alle Viti 1187
55054 Massarosa (LU)
Italy
phone: +39 0584 962313
fax: +39 0584 1660272

http://www.geo-solutions.it
http://twitter.com/geosolutions_it


Our support, Your Success! Visit http://opensdi.geo-solutions.it for more information.

Ing. Daniele Romagnoli
Senior Software Engineer

GeoSolutions S.A.S.
Via Poggio alle Viti 1187
55054 Massarosa (LU)
Italy
phone: +39 0584 962313
fax: +39 0584 1660272

http://www.geo-solutions.it
http://twitter.com/geosolutions_it


On Fri, Oct 26, 2012 at 3:05 PM, Tobias Reinicke <ramotswa@anonymised.com> wrote:

Hi Daniele,

So progress :

  1. DLL path issue
Oct 26, 2012 12:11:26 PM it.geosolutions.util.KakaduUtilities loadKakadu
WARNING: Failed to load the Kakadu native libs. This is not a problem unless you
 need to use the Kakadu plugin: it won't be enabled. java.lang.UnsatisfiedLinkEr
ror: C:\Program Files (x86)\Java\jdk1.7.0_09\bin\kdu_jni.dll: Can't find depende
nt libraries

It seems like a kdu_jni.dll on your JDK/bin isn’t finding additional dependencies.
Question:
You said “I have put the dll’s into another folder, and have put that folder on my windows path
Is that “another folder” == the JDK bin one?
if affirmative, you should check if the other required kakadu DLLs are there too… (you may also consider using [1] to find other potentially missing DLLs).
if negative, I suggest to remove the kdu_jni.dll from your JDK bin. That one may take precedence with respect to the other DLLs you have put into the “another folder”. Removing it from the JDK bin should allow avoiding DLLs loading from unexpected locations (maybe an old kdu_jni.dll looking for old kdu_x##.dlls.

I was being a silly (the dll’s weren’t actually in that folder). That folder is actually the JDK folder, and I put the dll files in there which has helped this issue. I don’t get that error anymore.

  1. Missing jar.
WARNING: Can't load a service for category "GridFormatFactorySpi". Cause is "Ser
viceConfigurationError: org.geotools.coverage.grid.io.GridFormatFactorySpi: Prov
ider org (...) NoClassDefFoundError: it/geosolutions/imageio/imageioimpl/imagere
admt/ImageReadDescriptorMT".
java.util.ServiceConfigurationError: org.geotools.coverage.grid.io.GridFormatFac
torySpi: Provider org.geotools.coverageio.jp2k.JP2KFormatFactory could not be in
stantiated: java.lang.NoClassDefFoundError: it/geosolutions/imageio/imageioimpl/
imagereadmt/ImageReadDescriptorMT

I will take a look to the jp2k related geotools pom to make sure that dependency is imported.
In the meantime, you may consider adding that one [2] to your geoserver WEB-INF/lib which should fix the NoClassDefFoundError exception.

  1. Again, progress - I added that .jar file and that error is no more.

When I try and add a new store I now have a new option called:
JP2K (Direct)
Which seems right.

I tried creating one - pointing it to a single .jpx file, but when I click “Save”, I get the attached error in the text file.

Mmm… When similar error happen

java.lang.NoClassDefFoundError: Could not initialize class kdu_jni.Kdu_codestream

it usually means that some static initialization (or preliminar initialization in any case) went wrong which prevents the class to be properly loaded.
Taking a look at the second log you have added to the additional email you have sent a few seconds ago, I guess something has been changed at JNI side from version 5-6 to 7.
Long story short, I think that the current kdu_jni.jar are invoking kdu_jni.DLL native methods which don’t exist anymore so that won’t work
If you have a kdu_jni.jar for Kakadu 7 (I think it can be produced through a Visual Studio ready to use solution or something similar in your source code) you can try a “desperate” attempt :slight_smile:
If we are lucky, the kdu_jni.jar methods used by the imageio-ext-kakadu.jar readers could still be available and unchanged (High luck factor) in the latest kdu_jni.jar.
Moreover we also hope that the procedures to instantiante internal kakadu structures in the proper order (jp2_family_source, jpx_source, codestream, …) aren’t changed too.
Again… we have never analyzed kakadu 7 yet so I really have no idea about the library changes.

Hope this helps.
Daniele

One other note - running the dependency walker on the kdu_jni.dll I get two errors;

GPSVC.DLL
IESHIMS.DLL
But then it’s trying to find those two in the same folder as the kdu_jni.dll, which is prob why it shows the error.

I think so… they are probably available on windows/system32 or somewhere else so you aren’t seeing runtime errors.

Thanks for your help - looks like we’re nearly there!

Toby

Daniele

Our support, Your Success! Visit http://opensdi.geo-solutions.it for more information.

Ing. Daniele Romagnoli
Senior Software Engineer

GeoSolutions S.A.S.
Via Poggio alle Viti 1187
55054 Massarosa (LU)
Italy
phone: +39 0584 962313
fax: +39 0584 1660272

http://www.geo-solutions.it
http://twitter.com/geosolutions_it


On Fri, Oct 26, 2012 at 4:06 PM, Tobias Reinicke <ramotswa@anonymised.com> wrote:

Hi Daniele,

Thanks for your help. I have asked to see if I can get the jar file, but I am not feeling lucky. I will see if I can get v5 from Kakadu and use those dll’s…

No Problem.
(v6.3 may provide better performances than v5)

Daniele

Regards,

Toby

On 26 October 2012 14:26, Daniele Romagnoli <daniele.romagnoli@anonymised.com> wrote:

On Fri, Oct 26, 2012 at 3:05 PM, Tobias Reinicke <ramotswa@anonymised.com> wrote:

Hi Daniele,

So progress :

  1. DLL path issue
Oct 26, 2012 12:11:26 PM it.geosolutions.util.KakaduUtilities loadKakadu
WARNING: Failed to load the Kakadu native libs. This is not a problem unless you
 need to use the Kakadu plugin: it won't be enabled. java.lang.UnsatisfiedLinkEr
ror: C:\Program Files (x86)\Java\jdk1.7.0_09\bin\kdu_jni.dll: Can't find depende
nt libraries

It seems like a kdu_jni.dll on your JDK/bin isn’t finding additional dependencies.
Question:
You said “I have put the dll’s into another folder, and have put that folder on my windows path
Is that “another folder” == the JDK bin one?
if affirmative, you should check if the other required kakadu DLLs are there too… (you may also consider using [1] to find other potentially missing DLLs).
if negative, I suggest to remove the kdu_jni.dll from your JDK bin. That one may take precedence with respect to the other DLLs you have put into the “another folder”. Removing it from the JDK bin should allow avoiding DLLs loading from unexpected locations (maybe an old kdu_jni.dll looking for old kdu_x##.dlls.

I was being a silly (the dll’s weren’t actually in that folder). That folder is actually the JDK folder, and I put the dll files in there which has helped this issue. I don’t get that error anymore.

  1. Missing jar.
WARNING: Can't load a service for category "GridFormatFactorySpi". Cause is "Ser
viceConfigurationError: org.geotools.coverage.grid.io.GridFormatFactorySpi: Prov
ider org (...) NoClassDefFoundError: it/geosolutions/imageio/imageioimpl/imagere
admt/ImageReadDescriptorMT".
java.util.ServiceConfigurationError: org.geotools.coverage.grid.io.GridFormatFac
torySpi: Provider org.geotools.coverageio.jp2k.JP2KFormatFactory could not be in
stantiated: java.lang.NoClassDefFoundError: it/geosolutions/imageio/imageioimpl/
imagereadmt/ImageReadDescriptorMT

I will take a look to the jp2k related geotools pom to make sure that dependency is imported.
In the meantime, you may consider adding that one [2] to your geoserver WEB-INF/lib which should fix the NoClassDefFoundError exception.

  1. Again, progress - I added that .jar file and that error is no more.

When I try and add a new store I now have a new option called:
JP2K (Direct)
Which seems right.

I tried creating one - pointing it to a single .jpx file, but when I click “Save”, I get the attached error in the text file.

Mmm… When similar error happen

java.lang.NoClassDefFoundError: Could not initialize class kdu_jni.Kdu_codestream

it usually means that some static initialization (or preliminar initialization in any case) went wrong which prevents the class to be properly loaded.
Taking a look at the second log you have added to the additional email you have sent a few seconds ago, I guess something has been changed at JNI side from version 5-6 to 7.
Long story short, I think that the current kdu_jni.jar are invoking kdu_jni.DLL native methods which don’t exist anymore so that won’t work
If you have a kdu_jni.jar for Kakadu 7 (I think it can be produced through a Visual Studio ready to use solution or something similar in your source code) you can try a “desperate” attempt :slight_smile:
If we are lucky, the kdu_jni.jar methods used by the imageio-ext-kakadu.jar readers could still be available and unchanged (High luck factor) in the latest kdu_jni.jar.
Moreover we also hope that the procedures to instantiante internal kakadu structures in the proper order (jp2_family_source, jpx_source, codestream, …) aren’t changed too.
Again… we have never analyzed kakadu 7 yet so I really have no idea about the library changes.

Hope this helps.
Daniele

One other note - running the dependency walker on the kdu_jni.dll I get two errors;

GPSVC.DLL
IESHIMS.DLL
But then it’s trying to find those two in the same folder as the kdu_jni.dll, which is prob why it shows the error.

I think so… they are probably available on windows/system32 or somewhere else so you aren’t seeing runtime errors.

Thanks for your help - looks like we’re nearly there!

Toby

Daniele

Our support, Your Success! Visit http://opensdi.geo-solutions.it for more information.

Ing. Daniele Romagnoli
Senior Software Engineer

GeoSolutions S.A.S.
Via Poggio alle Viti 1187
55054 Massarosa (LU)
Italy
phone: +39 0584 962313
fax: +39 0584 1660272

http://www.geo-solutions.it
http://twitter.com/geosolutions_it


Our support, Your Success! Visit http://opensdi.geo-solutions.it for more information.

Ing. Daniele Romagnoli
Senior Software Engineer

GeoSolutions S.A.S.
Via Poggio alle Viti 1187
55054 Massarosa (LU)
Italy
phone: +39 0584 962313
fax: +39 0584 1660272

http://www.geo-solutions.it
http://twitter.com/geosolutions_it