Jump to content
Excelsior Forums
Sign in to follow this  
hedes

Error at runtime when using imageio

Recommended Posts

Hello,

we compile our java applications with jet 3.6 ( Windows XP ).

Until now, our applications works fine with only JAI. But now, we have added jai_imageio, and at runtime a null pointer exception occurs :


Exception in thread "main" java.lang.ExceptionInInitializerError
? ? ? ? at java.lang.Class.newInstance0(Unknown Source)
? ? ? ? at java.lang.Class.<unknown>(Unknown Source)
? ? ? ? at sun.misc.Service$LazyIterator.next(Unknown Source)
? ? ? ? at javax.imageio.spi.IIORegistry.registerApplicationClasspathSpis(Unknow
n Source)
? ? ? ? at javax.imageio.spi.IIORegistry.<unknown>(Unknown Source)
? ? ? ? at javax.imageio.spi.IIORegistry.getDefaultInstance(Unknown Source)
? ? ? ? at javax.imageio.ImageIO.<clinit>(Unknown Source)
Caused by: java.lang.NullPointerException
? ? ? ? at com.sun.media.imageioimpl.common.PackageUtil.<clinit>(Unknown Source)

After decompiling PackageUtil, the error should be in the following lines:

static 
? ? {
? ? ? ? try
? ? ? ? {
? ? ? ? ? ? isCodecLibAvailable = Util.isCodecLibAvailable();
? ? ? ? }
? ? ? ? catch(Throwable e)
? ? ? ? {
? ? ? ? ? ? isCodecLibAvailable = false;
? ? ? ? }
? ? ? ? try
? ? ? ? {
? ? ? ? ? ? Class thisClass = Class.forName("com.sun.media.imageioimpl.common.PackageUtil");
? ? ? ? ? ? Package thisPackage = thisClass.getPackage();
? ? ? ? ? ? version = thisPackage.getImplementationVersion();
? ? ? ? ? ? vendor = thisPackage.getImplementationVendor();
? ? ? ? }
? ? ? ? catch(ClassNotFoundException e) { }
? ? }

I think that 'thisPackage' is null.

I use dynamic loading and my prj file is the following :

%%Excelsior JET v3.60 project file
+NOLAUNCHPAD
-OUTPUTNAME=jai_imageio
-GENDLL+
-BINDRESOURCES+
-BINDCLASSES+
-CLASSABSENCE=IGNORE
-IGNOREMEMBERABSENCE+
-GUI-
-CPU=PENTIUMPRO
-GENSTACKALLOC+
-JETVMPROP=-Djet.gc.defragment
-JETVMPROP=-Djet.gc.ratio:50



-LOOKUP=*.obj=./obj_$(OUTPUTNAME)
-LOOKUP=*.jar=C:\j2sdk1.4.2_06\jre\lib\ext
!module clibwrapper_jiio.jar
!module jai_imageio.jar

!batch *.class "com"
!batch *.class "jj2000"

Any idea to help us ?

Best regards.

H. Deslandes

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×