Skip to main content

[JAI-IMAGEIO] jai_imageio.jar on Mac OS X

12 replies [Last post]
Anonymous

Hi to everybody.

I am obtaining a strange behavior related to JAI Image I/O Tools on Mac OS
X.

If I copy the "jai_imageio.jar" into the "/Library/Java/Extensions" folder
of my Mac, then my Java Web Start application (which uses some non-native
portions of the JAI Image I/O Tools library) is working fine.
On the other side, if I DO NOT copy the "jai_imageio.jar" file into the
"/Library/Java/Extensions" folder, but I specify it as a resource in my JNLP
file:

[...]

[...]

then my application does not work. In particular, the following call in my
code:

============
...
Iterator iter = ImageIO.getImageReadersByFormatName("raw");
...
============

returns an empty iterator, while the correct ImageReader is returned if I
copy the "jai_imageio.jar" file into the "/Library/Java/Extensions" folder
of my Mac. Can you guess why?

When my Java Web Start application is downloaded for the first time, I can
see that the "image_io.jar" file is actually downloaded and validated by
Java Web Start, so it is correctly retrieved and stored in the JWS Cache.
But then, it seems that the Java Runtime Environment is unable to use that
"image_io.jar"...

Any thoughts or suggestions would be greatly appreciated.

Thank you in advance and best regards,

Marco.

---------------------------------------------------------------------
To unsubscribe, e-mail: interest-unsubscribe@jai-imageio.dev.java.net
For additional commands, e-mail: interest-help@jai-imageio.dev.java.net

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Marco Sambin - NeoLogica

Hi Robert,

thank you for your contibution.

Are you testing with a Intel-based of PowerPC-based Mac? Which JRE version
are you using?

Are you loading the "jai_imageio.jar" file as a resource in the JNLP file,
and then you call ImageIO.getImageReadersByFormatName() in your code, and it
is working fine? Which JAI Image I/O readers or writers are you using?

Thank you for your feedback, it is really appreciated.

Regards,

Marco.

-----Original Message-----
From: robert engels [mailto:rengels@ix.netcom.com]
Sent: mercoledì 25 aprile 2007 18.20
To: interest@jai-imageio.dev.java.net
Subject: Re: [JAI-IMAGEIO] jai_imageio.jar on Mac OS X

FYI, we use ImageIO on Mac OSX (10.4.8) deployed via JWS and it works fine
(without using scanForPlugins).

On Apr 25, 2007, at 11:10 AM, Brian Burkhalter wrote:

> So did you say that this stuff worked on other platforms than Mac OS X
> *without* the call to scanForPlugins()?
>
> Brian
>
> On Tue, 24 Apr 2007, Marco Sambin - NeoLogica wrote:
>
>> Hi Marco,
>>
>> thank you for your comments.
>>
>> I've just discovered that an initial call to:
>>
>> ImageIO.scanForPlugins();
>>
>> in my Java Web Start application actually solves the problem.
>>
>> So it looks like all Image I/O classes are actually present in the
>> classpath of my JWS application. But, as you mentioned in your last
>> post, probably there are some problems with the initial registration
>> of the Image I/O codecs. If anybody has a more detailed understanding
>> about the reason why this problem may happen on Mac, I would really
>> appreciate hearing some comments.
>>
>> Thank you and best regards,
>>
>> Marco Sambin.
>>
>>
>>
>> -----Original Message-----
>> From: mjacob@union06.de [mailto:mjacob@union06.de]
>> Sent: martedì 24 aprile 2007 10.18
>> To: interest@jai-imageio.dev.java.net
>> Subject: RE: [JAI-IMAGEIO] jai_imageio.jar on Mac OS X
>>
>> Hi Marco,
>>
>> I don't know about JWS special problems. When it is a problem on Mac
>> only I would "blame" the JWS loader on that platform.
>> Maybe it is how the codecs of jai_imageio register with imageio in
>> JWS on Mac. Is there any hint in a forum about JWS on MAC?
>> What about other Writers provided only by jai_imageio? Is "raw"
>> the only writer not accessible?
>>
>> Kind regards,
>> Marco
>> --
>> Marco Jacob, PMP
>> Prisma GmbH, Germany
>>
>>
>>> thank you for your reply.
>>> Please notice that I actually add the "jai_imageio.jar" in my JNLP
>>> file, so it shall go into the classpath for my JWS application:
>>>
>>> [...]
>>>
>>> As I told, the "jai_imageio.jar" file actually gets downloaded the
>>> first time I load my Java Web Start application, and it shall go
>>> into the classpath for my JWS application, as it does on all other
>>> platforms I've tested. But then on Mac the call to
>>> ImageIO.getImageReadersByFormatName("raw"); returns and empty
>>> Iterator.
>>> It does not seem normal to me.
>>>
>>> Any comment would be highly appreciated.
>>>
>>> Kind regards,
>>>
>>> Marco.
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: interest-unsubscribe@jai-imageio.dev.java.net
>> For additional commands, e-mail: interest-help@jai-
>> imageio.dev.java.net
>>
>>
>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: interest-unsubscribe@jai-imageio.dev.java.net
>> For additional commands, e-mail: interest-help@jai-
>> imageio.dev.java.net
>>
>>
>
> ----------------
> Brian Burkhalter
> Java Media, Imaging, and Graphics
> Sun Microsystems, Inc.
>
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> This email message is for the sole use of the intended recipient(s)
> and may contain confidential and privileged information. Any
> unauthorized review, use, disclosure or distribution is prohibited.
> If you are not the intended recipient, please contact the sender by
> reply email and destroy all copies of the original message.
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: interest-unsubscribe@jai-imageio.dev.java.net
> For additional commands, e-mail: interest-help@jai-
> imageio.dev.java.net

---------------------------------------------------------------------
To unsubscribe, e-mail: interest-unsubscribe@jai-imageio.dev.java.net
For additional commands, e-mail: interest-help@jai-imageio.dev.java.net

---------------------------------------------------------------------
To unsubscribe, e-mail: interest-unsubscribe@jai-imageio.dev.java.net
For additional commands, e-mail: interest-help@jai-imageio.dev.java.net

robert engels

An Intel based mac. JRE 1.5_07 (although it worked with previous 1.4
versions as well).

Yes, jai_imageio.jar is loaded via the JNLP.

We use ImageIO.getImageReaders(ImageInputStream), and
ImageIO.getImageWriters(ImageSpecifierType,formatname).

So we don't use your particular method, but both of the above need to
iterate through the available readers/writers just the same.

We only really use TIFF, PNG, and JPEG. I am certain the imageio TIFF
plugin is being used, because we specifically avoid the built-in tiff
plugin returned on the Mac platform, and look for the imageio one
specifically when iterating.

Hope this helps.

Robert

On Apr 26, 2007, at 5:21 AM, Marco Sambin - NeoLogica wrote:

> Hi Robert,
>
> thank you for your contibution.
>
> Are you testing with a Intel-based of PowerPC-based Mac? Which JRE
> version
> are you using?
>
> Are you loading the "jai_imageio.jar" file as a resource in the
> JNLP file,
> and then you call ImageIO.getImageReadersByFormatName() in your
> code, and it
> is working fine? Which JAI Image I/O readers or writers are you using?
>
> Thank you for your feedback, it is really appreciated.
>
> Regards,
>
> Marco.
>
>
>
> -----Original Message-----
> From: robert engels [mailto:rengels@ix.netcom.com]
> Sent: mercoledì 25 aprile 2007 18.20
> To: interest@jai-imageio.dev.java.net
> Subject: Re: [JAI-IMAGEIO] jai_imageio.jar on Mac OS X
>
> FYI, we use ImageIO on Mac OSX (10.4.8) deployed via JWS and it
> works fine
> (without using scanForPlugins).
>
> On Apr 25, 2007, at 11:10 AM, Brian Burkhalter wrote:
>
>> So did you say that this stuff worked on other platforms than Mac
>> OS X
>> *without* the call to scanForPlugins()?
>>
>> Brian
>>
>> On Tue, 24 Apr 2007, Marco Sambin - NeoLogica wrote:
>>
>>> Hi Marco,
>>>
>>> thank you for your comments.
>>>
>>> I've just discovered that an initial call to:
>>>
>>> ImageIO.scanForPlugins();
>>>
>>> in my Java Web Start application actually solves the problem.
>>>
>>> So it looks like all Image I/O classes are actually present in the
>>> classpath of my JWS application. But, as you mentioned in your last
>>> post, probably there are some problems with the initial registration
>>> of the Image I/O codecs. If anybody has a more detailed
>>> understanding
>>> about the reason why this problem may happen on Mac, I would really
>>> appreciate hearing some comments.
>>>
>>> Thank you and best regards,
>>>
>>> Marco Sambin.
>>>
>>>
>>>
>>> -----Original Message-----
>>> From: mjacob@union06.de [mailto:mjacob@union06.de]
>>> Sent: martedì 24 aprile 2007 10.18
>>> To: interest@jai-imageio.dev.java.net
>>> Subject: RE: [JAI-IMAGEIO] jai_imageio.jar on Mac OS X
>>>
>>> Hi Marco,
>>>
>>> I don't know about JWS special problems. When it is a problem on Mac
>>> only I would "blame" the JWS loader on that platform.
>>> Maybe it is how the codecs of jai_imageio register with imageio in
>>> JWS on Mac. Is there any hint in a forum about JWS on MAC?
>>> What about other Writers provided only by jai_imageio? Is "raw"
>>> the only writer not accessible?
>>>
>>> Kind regards,
>>> Marco
>>> --
>>> Marco Jacob, PMP
>>> Prisma GmbH, Germany
>>>
>>>
>>>> thank you for your reply.
>>>> Please notice that I actually add the "jai_imageio.jar" in my JNLP
>>>> file, so it shall go into the classpath for my JWS application:
>>>>
>>>> [...]
>>>>
>>>> As I told, the "jai_imageio.jar" file actually gets downloaded the
>>>> first time I load my Java Web Start application, and it shall go
>>>> into the classpath for my JWS application, as it does on all other
>>>> platforms I've tested. But then on Mac the call to
>>>> ImageIO.getImageReadersByFormatName("raw"); returns and empty
>>>> Iterator.
>>>> It does not seem normal to me.
>>>>
>>>> Any comment would be highly appreciated.
>>>>
>>>> Kind regards,
>>>>
>>>> Marco.
>>>
>>> --------------------------------------------------------------------
>>> -
>>> To unsubscribe, e-mail: interest-unsubscribe@jai-
>>> imageio.dev.java.net
>>> For additional commands, e-mail: interest-help@jai-
>>> imageio.dev.java.net
>>>
>>>
>>>
>>>
>>>
>>> --------------------------------------------------------------------
>>> -
>>> To unsubscribe, e-mail: interest-unsubscribe@jai-
>>> imageio.dev.java.net
>>> For additional commands, e-mail: interest-help@jai-
>>> imageio.dev.java.net
>>>
>>>
>>
>> ----------------
>> Brian Burkhalter
>> Java Media, Imaging, and Graphics
>> Sun Microsystems, Inc.
>>
>> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>> This email message is for the sole use of the intended recipient(s)
>> and may contain confidential and privileged information. Any
>> unauthorized review, use, disclosure or distribution is prohibited.
>> If you are not the intended recipient, please contact the sender by
>> reply email and destroy all copies of the original message.
>> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: interest-unsubscribe@jai-imageio.dev.java.net
>> For additional commands, e-mail: interest-help@jai-
>> imageio.dev.java.net
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: interest-unsubscribe@jai-imageio.dev.java.net
> For additional commands, e-mail: interest-help@jai-
> imageio.dev.java.net
>
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: interest-unsubscribe@jai-imageio.dev.java.net
> For additional commands, e-mail: interest-help@jai-
> imageio.dev.java.net
>

---------------------------------------------------------------------
To unsubscribe, e-mail: interest-unsubscribe@jai-imageio.dev.java.net
For additional commands, e-mail: interest-help@jai-imageio.dev.java.net

mnidel
Offline
Joined: 2005-04-08

I had some recent experiences with ImageIO (under BEA Weblogic) that brought me back to this problem with scanForPlugins().

With dynamic loading of your ImageIO plugins, it all comes down to WHEN the ImageIO class is loaded. It's at this point that any plugins are picked up. In some applications or environments, this can happen BEFORE your application's jar files (containing your ImageIO plugins) are loaded, and therefore those plugins (including potentially the JAI ImageIO tools plugins) are not found.

Unfortunately the only way to overcome this is scanForPlugins(). Any environment with a dynamic ClassLoader hierarchy (e.g. anything other than a command-line Java app possibly) is susceptible to this problem. If you can't install JAI ImageIO tools in your JRE/JDK then you are at the mercy of whichever scheme is loading your jars, whether it is a web application container like Weblogic or a launcher like Java Webstart.

Mike

Marco Sambin - NeoLogica

Hi Brian,

yes, on Windows putting the following lines in my JNLP descriptor is enough
to have my JAI and JIIO -based application working fine and with all
ImageReaders/Writers (including native) available and properly registered,
without requiring any call to scanForPlugins():

[...]




download="eager"/>



download="eager"/>


[...]

Is this behavior unexpected?
On the other side, on my Mac OS X v10.4.9, JRE v1.5.0_07 (iMac PowerPC G5),
JAI Image I/O Readers are not properly registered in my JWS application if I
do not call scanForPlugins() at the beginning of my app's code.

Regards,

Marco.

-----Original Message-----
From: Brian.Burkhalter@Sun.COM [mailto:Brian.Burkhalter@Sun.COM]
Sent: mercoledì 25 aprile 2007 18.11
To: interest@jai-imageio.dev.java.net
Subject: RE: [JAI-IMAGEIO] jai_imageio.jar on Mac OS X

So did you say that this stuff worked on other platforms than Mac OS X
*without* the call to scanForPlugins()?

Brian

On Tue, 24 Apr 2007, Marco Sambin - NeoLogica wrote:

> Hi Marco,
>
> thank you for your comments.
>
> I've just discovered that an initial call to:
>
> ImageIO.scanForPlugins();
>
> in my Java Web Start application actually solves the problem.
>
> So it looks like all Image I/O classes are actually present in the
> classpath of my JWS application. But, as you mentioned in your last
> post, probably there are some problems with the initial registration
> of the Image I/O codecs. If anybody has a more detailed understanding
> about the reason why this problem may happen on Mac, I would really
> appreciate hearing some comments.
>
> Thank you and best regards,
>
> Marco Sambin.
>
>
>
> -----Original Message-----
> From: mjacob@union06.de [mailto:mjacob@union06.de]
> Sent: martedì 24 aprile 2007 10.18
> To: interest@jai-imageio.dev.java.net
> Subject: RE: [JAI-IMAGEIO] jai_imageio.jar on Mac OS X
>
> Hi Marco,
>
> I don't know about JWS special problems. When it is a problem on Mac
> only I would "blame" the JWS loader on that platform.
> Maybe it is how the codecs of jai_imageio register with imageio in JWS
> on Mac. Is there any hint in a forum about JWS on MAC?
> What about other Writers provided only by jai_imageio? Is "raw"
> the only writer not accessible?
>
> Kind regards,
> Marco
> --
> Marco Jacob, PMP
> Prisma GmbH, Germany
>
>
>> thank you for your reply.
>> Please notice that I actually add the "jai_imageio.jar" in my JNLP
>> file, so it shall go into the classpath for my JWS application:
>>
>> [...]
>>
>> As I told, the "jai_imageio.jar" file actually gets downloaded the
>> first time I load my Java Web Start application, and it shall go into
>> the classpath for my JWS application, as it does on all other
>> platforms I've tested. But then on Mac the call to
>> ImageIO.getImageReadersByFormatName("raw"); returns and empty Iterator.
>> It does not seem normal to me.
>>
>> Any comment would be highly appreciated.
>>
>> Kind regards,
>>
>> Marco.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: interest-unsubscribe@jai-imageio.dev.java.net
> For additional commands, e-mail:
> interest-help@jai-imageio.dev.java.net
>
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: interest-unsubscribe@jai-imageio.dev.java.net
> For additional commands, e-mail:
> interest-help@jai-imageio.dev.java.net
>
>

----------------
Brian Burkhalter
Java Media, Imaging, and Graphics
Sun Microsystems, Inc.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This email message is for the sole use of the intended recipient(s) and may
contain confidential and privileged information. Any unauthorized review,
use, disclosure or distribution is prohibited.
If you are not the intended recipient, please contact the sender by reply
email and destroy all copies of the original message.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

---------------------------------------------------------------------
To unsubscribe, e-mail: interest-unsubscribe@jai-imageio.dev.java.net
For additional commands, e-mail: interest-help@jai-imageio.dev.java.net

Brian Burkhalter

So did you say that this stuff worked on other platforms than Mac OS X
*without* the call to scanForPlugins()?

Brian

On Tue, 24 Apr 2007, Marco Sambin - NeoLogica wrote:

> Hi Marco,
>
> thank you for your comments.
>
> I've just discovered that an initial call to:
>
> ImageIO.scanForPlugins();
>
> in my Java Web Start application actually solves the problem.
>
> So it looks like all Image I/O classes are actually present in the classpath
> of my JWS application. But, as you mentioned in your last post, probably
> there are some problems with the initial registration of the Image I/O
> codecs. If anybody has a more detailed understanding about the reason why
> this problem may happen on Mac, I would really appreciate hearing some
> comments.
>
> Thank you and best regards,
>
> Marco Sambin.
>
>
>
> -----Original Message-----
> From: mjacob@union06.de [mailto:mjacob@union06.de]
> Sent: martedì 24 aprile 2007 10.18
> To: interest@jai-imageio.dev.java.net
> Subject: RE: [JAI-IMAGEIO] jai_imageio.jar on Mac OS X
>
> Hi Marco,
>
> I don't know about JWS special problems. When it is a problem on Mac only I
> would "blame" the JWS loader on that platform.
> Maybe it is how the codecs of jai_imageio register with imageio in JWS on
> Mac. Is there any hint in a forum about JWS on MAC?
> What about other Writers provided only by jai_imageio? Is "raw"
> the only writer not accessible?
>
> Kind regards,
> Marco
> --
> Marco Jacob, PMP
> Prisma GmbH, Germany
>
>
>> thank you for your reply.
>> Please notice that I actually add the "jai_imageio.jar" in my JNLP
>> file, so it shall go into the classpath for my JWS application:
>>
>> [...]
>>
>> As I told, the "jai_imageio.jar" file actually gets downloaded the
>> first time I load my Java Web Start application, and it shall go into
>> the classpath for my JWS application, as it does on all other platforms
>> I've tested. But then on Mac the call to
>> ImageIO.getImageReadersByFormatName("raw"); returns and empty Iterator.
>> It does not seem normal to me.
>>
>> Any comment would be highly appreciated.
>>
>> Kind regards,
>>
>> Marco.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: interest-unsubscribe@jai-imageio.dev.java.net
> For additional commands, e-mail: interest-help@jai-imageio.dev.java.net
>
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: interest-unsubscribe@jai-imageio.dev.java.net
> For additional commands, e-mail: interest-help@jai-imageio.dev.java.net
>
>

----------------
Brian Burkhalter
Java Media, Imaging, and Graphics
Sun Microsystems, Inc.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This email message is for the sole use of the intended recipient(s)
and may contain confidential and privileged information. Any
unauthorized review, use, disclosure or distribution is prohibited.
If you are not the intended recipient, please contact the sender by
reply email and destroy all copies of the original message.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

---------------------------------------------------------------------
To unsubscribe, e-mail: interest-unsubscribe@jai-imageio.dev.java.net
For additional commands, e-mail: interest-help@jai-imageio.dev.java.net

robert engels

FYI, we use ImageIO on Mac OSX (10.4.8) deployed via JWS and it works
fine (without using scanForPlugins).

On Apr 25, 2007, at 11:10 AM, Brian Burkhalter wrote:

> So did you say that this stuff worked on other platforms than Mac
> OS X *without* the call to scanForPlugins()?
>
> Brian
>
> On Tue, 24 Apr 2007, Marco Sambin - NeoLogica wrote:
>
>> Hi Marco,
>>
>> thank you for your comments.
>>
>> I've just discovered that an initial call to:
>>
>> ImageIO.scanForPlugins();
>>
>> in my Java Web Start application actually solves the problem.
>>
>> So it looks like all Image I/O classes are actually present in the
>> classpath
>> of my JWS application. But, as you mentioned in your last post,
>> probably
>> there are some problems with the initial registration of the Image
>> I/O
>> codecs. If anybody has a more detailed understanding about the
>> reason why
>> this problem may happen on Mac, I would really appreciate hearing
>> some
>> comments.
>>
>> Thank you and best regards,
>>
>> Marco Sambin.
>>
>>
>>
>> -----Original Message-----
>> From: mjacob@union06.de [mailto:mjacob@union06.de]
>> Sent: martedì 24 aprile 2007 10.18
>> To: interest@jai-imageio.dev.java.net
>> Subject: RE: [JAI-IMAGEIO] jai_imageio.jar on Mac OS X
>>
>> Hi Marco,
>>
>> I don't know about JWS special problems. When it is a problem on
>> Mac only I
>> would "blame" the JWS loader on that platform.
>> Maybe it is how the codecs of jai_imageio register with imageio in
>> JWS on
>> Mac. Is there any hint in a forum about JWS on MAC?
>> What about other Writers provided only by jai_imageio? Is "raw"
>> the only writer not accessible?
>>
>> Kind regards,
>> Marco
>> --
>> Marco Jacob, PMP
>> Prisma GmbH, Germany
>>
>>
>>> thank you for your reply.
>>> Please notice that I actually add the "jai_imageio.jar" in my JNLP
>>> file, so it shall go into the classpath for my JWS application:
>>>
>>> [...]
>>>
>>> As I told, the "jai_imageio.jar" file actually gets downloaded the
>>> first time I load my Java Web Start application, and it shall go
>>> into
>>> the classpath for my JWS application, as it does on all other
>>> platforms
>>> I've tested. But then on Mac the call to
>>> ImageIO.getImageReadersByFormatName("raw"); returns and empty
>>> Iterator.
>>> It does not seem normal to me.
>>>
>>> Any comment would be highly appreciated.
>>>
>>> Kind regards,
>>>
>>> Marco.
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: interest-unsubscribe@jai-imageio.dev.java.net
>> For additional commands, e-mail: interest-help@jai-
>> imageio.dev.java.net
>>
>>
>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: interest-unsubscribe@jai-imageio.dev.java.net
>> For additional commands, e-mail: interest-help@jai-
>> imageio.dev.java.net
>>
>>
>
> ----------------
> Brian Burkhalter
> Java Media, Imaging, and Graphics
> Sun Microsystems, Inc.
>
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> This email message is for the sole use of the intended recipient(s)
> and may contain confidential and privileged information. Any
> unauthorized review, use, disclosure or distribution is prohibited.
> If you are not the intended recipient, please contact the sender by
> reply email and destroy all copies of the original message.
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: interest-unsubscribe@jai-imageio.dev.java.net
> For additional commands, e-mail: interest-help@jai-
> imageio.dev.java.net

---------------------------------------------------------------------
To unsubscribe, e-mail: interest-unsubscribe@jai-imageio.dev.java.net
For additional commands, e-mail: interest-help@jai-imageio.dev.java.net

Brian Burkhalter

I guess that's the answer.

Thanks ...

On Wed, 25 Apr 2007, robert engels wrote:

> FYI, we use ImageIO on Mac OSX (10.4.8) deployed via JWS and it works fine
> (without using scanForPlugins).
>
> On Apr 25, 2007, at 11:10 AM, Brian Burkhalter wrote:
>
>> So did you say that this stuff worked on other platforms than Mac OS X
>> *without* the call to scanForPlugins()?
>>
>> Brian
>>
>> On Tue, 24 Apr 2007, Marco Sambin - NeoLogica wrote:
>>
>>> Hi Marco,
>>>
>>> thank you for your comments.
>>>
>>> I've just discovered that an initial call to:
>>>
>>> ImageIO.scanForPlugins();
>>>
>>> in my Java Web Start application actually solves the problem.
>>>
>>> So it looks like all Image I/O classes are actually present in the
>>> classpath
>>> of my JWS application. But, as you mentioned in your last post, probably
>>> there are some problems with the initial registration of the Image I/O
>>> codecs. If anybody has a more detailed understanding about the reason why
>>> this problem may happen on Mac, I would really appreciate hearing some
>>> comments.
>>>
>>> Thank you and best regards,
>>>
>>> Marco Sambin.
>>>
>>>
>>>
>>> -----Original Message-----
>>> From: mjacob@union06.de [mailto:mjacob@union06.de]
>>> Sent: martedì 24 aprile 2007 10.18
>>> To: interest@jai-imageio.dev.java.net
>>> Subject: RE: [JAI-IMAGEIO] jai_imageio.jar on Mac OS X
>>>
>>> Hi Marco,
>>>
>>> I don't know about JWS special problems. When it is a problem on Mac only
>>> I
>>> would "blame" the JWS loader on that platform.
>>> Maybe it is how the codecs of jai_imageio register with imageio in JWS on
>>> Mac. Is there any hint in a forum about JWS on MAC?
>>> What about other Writers provided only by jai_imageio? Is "raw"
>>> the only writer not accessible?
>>>
>>> Kind regards,
>>> Marco
>>> --
>>> Marco Jacob, PMP
>>> Prisma GmbH, Germany
>>>
>>>
>>>> thank you for your reply.
>>>> Please notice that I actually add the "jai_imageio.jar" in my JNLP
>>>> file, so it shall go into the classpath for my JWS application:
>>>>
>>>> [...]
>>>>
>>>> As I told, the "jai_imageio.jar" file actually gets downloaded the
>>>> first time I load my Java Web Start application, and it shall go into
>>>> the classpath for my JWS application, as it does on all other platforms
>>>> I've tested. But then on Mac the call to
>>>> ImageIO.getImageReadersByFormatName("raw"); returns and empty Iterator.
>>>> It does not seem normal to me.
>>>>
>>>> Any comment would be highly appreciated.
>>>>
>>>> Kind regards,
>>>>
>>>> Marco.
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: interest-unsubscribe@jai-imageio.dev.java.net
>>> For additional commands, e-mail: interest-help@jai-imageio.dev.java.net
>>>
>>>
>>>
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: interest-unsubscribe@jai-imageio.dev.java.net
>>> For additional commands, e-mail: interest-help@jai-imageio.dev.java.net
>>>
>>>
>>
>> ----------------
>> Brian Burkhalter
>> Java Media, Imaging, and Graphics
>> Sun Microsystems, Inc.
>>
>> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>> This email message is for the sole use of the intended recipient(s)
>> and may contain confidential and privileged information. Any
>> unauthorized review, use, disclosure or distribution is prohibited.
>> If you are not the intended recipient, please contact the sender by
>> reply email and destroy all copies of the original message.
>> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: interest-unsubscribe@jai-imageio.dev.java.net
>> For additional commands, e-mail: interest-help@jai-imageio.dev.java.net
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: interest-unsubscribe@jai-imageio.dev.java.net
> For additional commands, e-mail: interest-help@jai-imageio.dev.java.net
>

----------------
Brian Burkhalter
Java Media, Imaging, and Graphics
Sun Microsystems, Inc.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This email message is for the sole use of the intended recipient(s)
and may contain confidential and privileged information. Any
unauthorized review, use, disclosure or distribution is prohibited.
If you are not the intended recipient, please contact the sender by
reply email and destroy all copies of the original message.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

---------------------------------------------------------------------
To unsubscribe, e-mail: interest-unsubscribe@jai-imageio.dev.java.net
For additional commands, e-mail: interest-help@jai-imageio.dev.java.net

mjacob@union06.de

Hi Marco,

I don't know about JWS special problems. When it is a problem on
Mac only I would "blame" the JWS loader on that platform.
Maybe it is how the codecs of jai_imageio register with imageio
in JWS on Mac. Is there any hint in a forum about JWS on MAC?
What about other Writers provided only by jai_imageio? Is "raw"
the only writer not accessible?

Kind regards,
Marco
--
Marco Jacob, PMP
Prisma GmbH, Germany

>thank you for your reply.
>Please notice that I actually add the "jai_imageio.jar" in my JNLP file, so
>it shall go into the classpath for my JWS application:
>
>[...]
>
>As I told, the "jai_imageio.jar" file actually gets downloaded the first
>time I load my Java Web Start application, and it shall go into the
>classpath for my JWS application, as it does on all other platforms I've
>tested. But then on Mac the call to
>ImageIO.getImageReadersByFormatName("raw"); returns and empty Iterator. It
>does not seem normal to me.
>
>Any comment would be highly appreciated.
>
>Kind regards,
>
>Marco.

---------------------------------------------------------------------
To unsubscribe, e-mail: interest-unsubscribe@jai-imageio.dev.java.net
For additional commands, e-mail: interest-help@jai-imageio.dev.java.net

Marco Sambin - NeoLogica

Hi Marco,

thank you for your comments.

I've just discovered that an initial call to:

ImageIO.scanForPlugins();

in my Java Web Start application actually solves the problem.

So it looks like all Image I/O classes are actually present in the classpath
of my JWS application. But, as you mentioned in your last post, probably
there are some problems with the initial registration of the Image I/O
codecs. If anybody has a more detailed understanding about the reason why
this problem may happen on Mac, I would really appreciate hearing some
comments.

Thank you and best regards,

Marco Sambin.

-----Original Message-----
From: mjacob@union06.de [mailto:mjacob@union06.de]
Sent: martedì 24 aprile 2007 10.18
To: interest@jai-imageio.dev.java.net
Subject: RE: [JAI-IMAGEIO] jai_imageio.jar on Mac OS X

Hi Marco,

I don't know about JWS special problems. When it is a problem on Mac only I
would "blame" the JWS loader on that platform.
Maybe it is how the codecs of jai_imageio register with imageio in JWS on
Mac. Is there any hint in a forum about JWS on MAC?
What about other Writers provided only by jai_imageio? Is "raw"
the only writer not accessible?

Kind regards,
Marco
--
Marco Jacob, PMP
Prisma GmbH, Germany

>thank you for your reply.
>Please notice that I actually add the "jai_imageio.jar" in my JNLP
>file, so it shall go into the classpath for my JWS application:
>
>[...]
>
>As I told, the "jai_imageio.jar" file actually gets downloaded the
>first time I load my Java Web Start application, and it shall go into
>the classpath for my JWS application, as it does on all other platforms
>I've tested. But then on Mac the call to
>ImageIO.getImageReadersByFormatName("raw"); returns and empty Iterator.
>It does not seem normal to me.
>
>Any comment would be highly appreciated.
>
>Kind regards,
>
>Marco.

---------------------------------------------------------------------
To unsubscribe, e-mail: interest-unsubscribe@jai-imageio.dev.java.net
For additional commands, e-mail: interest-help@jai-imageio.dev.java.net

---------------------------------------------------------------------
To unsubscribe, e-mail: interest-unsubscribe@jai-imageio.dev.java.net
For additional commands, e-mail: interest-help@jai-imageio.dev.java.net

Nidel, Mike

I'm looking at the Java 5 source code.

In the Sun implementation of the ImageIO class, there is a static member declaration
of an IIORegistry that is initialized to IIORegistry.getDefaultInstance().
This results in an attempt to get the AppContext, and then to retrieve the
IIORegistry from it. If the returned IIORegistry is null, then a new one is
constructed and placed in the AppContext. If you follow this to the constructor
of IIORegistry, you see that it calls registerStandardSpis() and
registerApplicationClasspathSpis(). This second method, registerApplicationClasspathSpis()
is the same thing called by ImageIO.scanForPlugins. It uses the Thread's context
class loader to locate the plugins.

So my guess is that one of the following two things is going on with Apple's
implementation:

either
1. There is a difference in the way the thread context classloader is returned,

or
2. Apple's implementation does not automatically call registerApplicationClasspathSpis()
or the equivalent.

Since Apple doesn't publish their JDK source (not that I know), it might be hard to
figure out what problem it really is. So this might really be just an academic
discussion, unless maybe you could step through the core classes with a debugger
or something.

Or, you could obviously just call scanForPlugins() and leave it at that. But that's
no fun at all!

Mike

> -----Original Message-----
> From: Marco Sambin - NeoLogica [mailto:marco.sambin@neologica.it]
> Sent: Tuesday, April 24, 2007 6:24 AM
> To: interest@jai-imageio.dev.java.net
> Subject: RE: [JAI-IMAGEIO] jai_imageio.jar on Mac OS X
>
> Hi Marco,
>
> thank you for your comments.
>
> I've just discovered that an initial call to:
>
> ImageIO.scanForPlugins();
>
> in my Java Web Start application actually solves the problem.
>
> So it looks like all Image I/O classes are actually present
> in the classpath of my JWS application. But, as you mentioned
> in your last post, probably there are some problems with the
> initial registration of the Image I/O codecs. If anybody has
> a more detailed understanding about the reason why this
> problem may happen on Mac, I would really appreciate hearing
> some comments.
>
> Thank you and best regards,
>
> Marco Sambin.
>
>
>
> -----Original Message-----
> From: mjacob@union06.de [mailto:mjacob@union06.de]
> Sent: martedì 24 aprile 2007 10.18
> To: interest@jai-imageio.dev.java.net
> Subject: RE: [JAI-IMAGEIO] jai_imageio.jar on Mac OS X
>
> Hi Marco,
>
> I don't know about JWS special problems. When it is a problem
> on Mac only I would "blame" the JWS loader on that platform.
> Maybe it is how the codecs of jai_imageio register with
> imageio in JWS on Mac. Is there any hint in a forum about JWS on MAC?
> What about other Writers provided only by jai_imageio? Is "raw"
> the only writer not accessible?
>
> Kind regards,
> Marco
> --
> Marco Jacob, PMP
> Prisma GmbH, Germany
>
>
> >thank you for your reply.
> >Please notice that I actually add the "jai_imageio.jar" in my JNLP
> >file, so it shall go into the classpath for my JWS application:
> >
> >[...]
> >
> >As I told, the "jai_imageio.jar" file actually gets downloaded the
> >first time I load my Java Web Start application, and it
> shall go into
> >the classpath for my JWS application, as it does on all
> other platforms
> >I've tested. But then on Mac the call to
> >ImageIO.getImageReadersByFormatName("raw"); returns and
> empty Iterator.
> >It does not seem normal to me.
> >
> >Any comment would be highly appreciated.
> >
> >Kind regards,
> >
> >Marco.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: interest-unsubscribe@jai-imageio.dev.java.net
> For additional commands, e-mail:
> interest-help@jai-imageio.dev.java.net
>
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: interest-unsubscribe@jai-imageio.dev.java.net
> For additional commands, e-mail:
> interest-help@jai-imageio.dev.java.net
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: interest-unsubscribe@jai-imageio.dev.java.net
For additional commands, e-mail: interest-help@jai-imageio.dev.java.net

mjacob@union06.de

Hi Marco,

it seems to me like a normal behaviour. jai_imageio.jar adds
the codec/reader to read raw format. You should always expect
getImageReadersByFormatName(String) to return an empty Iterator
when no ImageReader for that format is in classpath.

This is not a special MAC behaviour.

Kind regards,
--
Marco Jacob, PMP
Prisma GmbH

---------------------------------------------------------------------
To unsubscribe, e-mail: interest-unsubscribe@jai-imageio.dev.java.net
For additional commands, e-mail: interest-help@jai-imageio.dev.java.net

Marco Sambin - NeoLogica

Hi Marco,

thank you for your reply.

Please notice that I actually add the "jai_imageio.jar" in my JNLP file, so
it shall go into the classpath for my JWS application:

[...]


[...]

[...]

[...]

As I told, the "jai_imageio.jar" file actually gets downloaded the first
time I load my Java Web Start application, and it shall go into the
classpath for my JWS application, as it does on all other platforms I've
tested. But then on Mac the call to
ImageIO.getImageReadersByFormatName("raw"); returns and empty Iterator. It
does not seem normal to me.

Any comment would be highly appreciated.

Kind regards,

Marco.

-----Original Message-----
From: mjacob@union06.de [mailto:mjacob@union06.de]
Sent: martedì 24 aprile 2007 7.41
To: interest@jai-imageio.dev.java.net
Subject: RE: [JAI-IMAGEIO] jai_imageio.jar on Mac OS X

Hi Marco,

it seems to me like a normal behaviour. jai_imageio.jar adds the
codec/reader to read raw format. You should always expect
getImageReadersByFormatName(String) to return an empty Iterator when no
ImageReader for that format is in classpath.

This is not a special MAC behaviour.

Kind regards,
--
Marco Jacob, PMP
Prisma GmbH

---------------------------------------------------------------------
To unsubscribe, e-mail: interest-unsubscribe@jai-imageio.dev.java.net
For additional commands, e-mail: interest-help@jai-imageio.dev.java.net

---------------------------------------------------------------------
To unsubscribe, e-mail: interest-unsubscribe@jai-imageio.dev.java.net
For additional commands, e-mail: interest-help@jai-imageio.dev.java.net