Skip to main content

RE: [JAI-IMAGEIO] Unable to use ImageRead operation

1 reply [Last post]
Anonymous

Christoph,

try comparing the ClassLoader of the static references to
ImageReadDescriptor and JAI.
Something like:

log.debug("ImageRead ClassLoader:
"+descriptor.getClass().getClassLoader());
log.debug("JAI ClassLoader: "+JAI.class.getClassLoader());

When you execute your code below, it works fine because this code is
loaded such that it can "see" both JAI and JAI ImageIO Tools
(ImageReadDescriptor).
However, in order to load the ImageRead operator, JAI needs to be able
to
"see" the ImageIO tools as well, and I'm pretty confident that in your
case
what's happening is that somehow it can't.

If you try what I suggested above and get the exact same ClassLoader,
then
I am out of ideas.

good luck,

Mike

> -----Original Message-----
> From: Christoph Wagner [mailto:campus@zumcampus.de]
> Sent: Tuesday, February 28, 2006 8:50 AM
> To: interest@jai-imageio.dev.java.net
> Subject: RE: [JAI-IMAGEIO] Unable to use ImageRead operation
>
>
> Hi,
>
> I tried your suggestion and here is the output for my sample code:
>
> ----code i am using-------
> ImageReadDescriptor descriptor = new ImageReadDescriptor ();
> log.debug ("ImageReadDescriptor ="+descriptor); PlanarImage
> source = JAI.create ("imageread", imageFile);
> --------------------------
>
> results in
>
> ----
> [ main] - add
> D:\code\C6\bin\ejp\imagecouch\lib\clibwrapper_jiio.jar to class loader
>
> [ main] - add D:\code\C6\bin\ejp\imagecouch\lib\jai_codec.jar
> to class loader
> [ main] - add D:\code\C6\bin\ejp\imagecouch\lib\jai_core.jar
> to class loader
> [ main] - add
> D:\code\C6\bin\ejp\imagecouch\lib\jai_imageio.jar to class loader
> [ main] - add
> D:\code\C6\bin\ejp\imagecouch\lib\mlibwrapper_jai.jar to class loader
> [ main] - trying to load EJP
> D:\code\C6\bin\ejp\imagecouch\imagecouch.ejp
> [ main] - create class loader for
> file:/D:/code/C6/bin/ejp/imagecouch/imagecouch.ejp including
> file:/D:/code/C6/bin/ejp/imagecouch/imagecouch.ejp
> [ Thread-5] - ImageReadDescriptor
> =com.sun.media.jai.operator.ImageReadDescriptor@173a64a
> java.lang.IllegalArgumentException: imageread: No
> OperationDescriptor is registered in the current operation
> registry under this name.
> at javax.media.jai.JAI.createNS(JAI.java:1070)
> at javax.media.jai.JAI.create(JAI.java:973)
> at javax.media.jai.JAI.create(JAI.java:1408)
> at
> com.canto.cumulus.ejp.imagecouch.ui.ImageCouch.loadImage(ImageCouch.ja
> va:99)
> at
> com.canto.cumulus.ejp.imagecouch.ui.ImageCouch.(ImageCouch.java:
> 51)
> at
> com.canto.cumulus.ejp.imagecouch.ImageCouchEJP$2.handleAction(ImageCou
> chEJP.java:70)
> at
> com.canto.cumulus.ui.MenuItem.fireHandleAction(MenuItem.java:221)
> -----
>
> As you can see all the jars are loded into the classloader
> and the single image io call succeeds. But the imageread
> operation still fails :-(
>
>
> Any hope in this case?
>
> Regards,
> Christoph Wagner
>
>
>
>
> > -----Original Message-----
> > From: Nidel, Mike [mailto:mike.nidel@lmco.com]
> > Sent: Monday, February 27, 2006 7:59 PM
> > To: interest@jai-imageio.dev.java.net
> > Subject: RE: [JAI-IMAGEIO] Unable to use ImageRead operation
> >
> > hm, that is interesting. i misunderstood your classloader
> arrangement.
> >
> > are you able to import the JAI imageIO classes directly?
> > there are public classes that you can import to test whether
> > your own code can see them at least.
> >
> >
> > > -----Original Message-----
> > > From: Christoph Wagner [mailto:campus@zumcampus.de]
> > > Sent: Monday, February 27, 2006 1:55 PM
> > > To: interest@jai-imageio.dev.java.net
> > > Subject: RE: [JAI-IMAGEIO] Unable to use ImageRead operation
> > >
> > >
> > > Hi,
> > >
> > > > all jars EXCEPT the JAI jars.
> > >
> > > No. I don't have any JAI jars in lib/ext. All JAI jars
> > (jai_core.jar,
> > > jai_codec.jar, jai_imageio.jar, mlibwrapper_jai.jar,
> > > clibwrapper_jiio.jar) are found by the custom plugin class
> > loader. But
> > > unfortunately all Image I/O calls seem to fail.
> > >
> > > Regards,
> > > Christoph Wagner
> > >
> > >
> >
> ---------------------------------------------------------------------
> > > 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

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Christoph Wagner

Hi,

> try comparing the ClassLoader of the static references to
> ImageReadDescriptor and JAI.
> Something like:
>
> log.debug("ImageRead ClassLoader:
> "+descriptor.getClass().getClassLoader());
> log.debug("JAI ClassLoader: "+JAI.class.getClassLoader());

and the results are:
[ Thread-3] - ImageReadDescriptor
=com.sun.media.jai.operator.ImageReadDescriptor@e62121
[ Thread-3] - ImageRead ClassLoader:
java.net.URLClassLoader@18f5824
[ Thread-3] - JAI ClassLoader: java.net.URLClassLoader@18f5824

to me this looks like a serious bug of JAI. How does JAI try to find
the ImageRead class? Does JAI uses a specific Classloader explicitly?

Thanks for your help,
Christoph Wagner

>
> When you execute your code below, it works fine because this
> code is loaded such that it can "see" both JAI and JAI
> ImageIO Tools (ImageReadDescriptor).
> However, in order to load the ImageRead operator, JAI needs
> to be able to "see" the ImageIO tools as well, and I'm pretty
> confident that in your case what's happening is that somehow it
can't.
>
> If you try what I suggested above and get the exact same
> ClassLoader, then I am out of ideas.
>
> good luck,
>
> Mike
>
> > -----Original Message-----
> > From: Christoph Wagner [mailto:campus@zumcampus.de]
> > Sent: Tuesday, February 28, 2006 8:50 AM
> > To: interest@jai-imageio.dev.java.net
> > Subject: RE: [JAI-IMAGEIO] Unable to use ImageRead operation
> >
> >
> > Hi,
> >
> > I tried your suggestion and here is the output for my sample code:
> >
> > ----code i am using-------
> > ImageReadDescriptor descriptor = new ImageReadDescriptor
> (); log.debug
> > ("ImageReadDescriptor ="+descriptor); PlanarImage source =
> JAI.create
> > ("imageread", imageFile);
> > --------------------------
> >
> > results in
> >
> > ----
> > [ main] - add
> > D:\code\C6\bin\ejp\imagecouch\lib\clibwrapper_jiio.jar to
> class loader
> >
> > [ main] - add
> D:\code\C6\bin\ejp\imagecouch\lib\jai_codec.jar
> > to class loader
> > [ main] - add
> D:\code\C6\bin\ejp\imagecouch\lib\jai_core.jar
> > to class loader
> > [ main] - add
> > D:\code\C6\bin\ejp\imagecouch\lib\jai_imageio.jar to class loader
> > [ main] - add
> > D:\code\C6\bin\ejp\imagecouch\lib\mlibwrapper_jai.jar to
> class loader
> > [ main] - trying to load EJP
> > D:\code\C6\bin\ejp\imagecouch\imagecouch.ejp
> > [ main] - create class loader for
> > file:/D:/code/C6/bin/ejp/imagecouch/imagecouch.ejp including
> > file:/D:/code/C6/bin/ejp/imagecouch/imagecouch.ejp
> > [ Thread-5] - ImageReadDescriptor
> > =com.sun.media.jai.operator.ImageReadDescriptor@173a64a
> > java.lang.IllegalArgumentException: imageread: No
> OperationDescriptor
> > is registered in the current operation registry under this name.
> > at javax.media.jai.JAI.createNS(JAI.java:1070)
> > at javax.media.jai.JAI.create(JAI.java:973)
> > at javax.media.jai.JAI.create(JAI.java:1408)
> > at
> >
>
com.canto.cumulus.ejp.imagecouch.ui.ImageCouch.loadImage(ImageCouch.ja
> > va:99)
> > at
> >
>
com.canto.cumulus.ejp.imagecouch.ui.ImageCouch.(ImageCouch.java:
> > 51)
> > at
> >
>
com.canto.cumulus.ejp.imagecouch.ImageCouchEJP$2.handleAction(ImageCou
> > chEJP.java:70)
> > at
> > com.canto.cumulus.ui.MenuItem.fireHandleAction(MenuItem.java:221)
> > -----
> >
> > As you can see all the jars are loded into the classloader and the

> > single image io call succeeds. But the imageread operation
> still fails
> > :-(
> >
> >
> > Any hope in this case?
> >
> > Regards,
> > Christoph Wagner
> >
> >
> >
> >
> > > -----Original Message-----
> > > From: Nidel, Mike [mailto:mike.nidel@lmco.com]
> > > Sent: Monday, February 27, 2006 7:59 PM
> > > To: interest@jai-imageio.dev.java.net
> > > Subject: RE: [JAI-IMAGEIO] Unable to use ImageRead operation
> > >
> > > hm, that is interesting. i misunderstood your classloader
> > arrangement.
> > >
> > > are you able to import the JAI imageIO classes directly?
> > > there are public classes that you can import to test whether
your
> > > own code can see them at least.
> > >
> > >
> > > > -----Original Message-----
> > > > From: Christoph Wagner [mailto:campus@zumcampus.de]
> > > > Sent: Monday, February 27, 2006 1:55 PM
> > > > To: interest@jai-imageio.dev.java.net
> > > > Subject: RE: [JAI-IMAGEIO] Unable to use ImageRead operation
> > > >
> > > >
> > > > Hi,
> > > >
> > > > > all jars EXCEPT the JAI jars.
> > > >
> > > > No. I don't have any JAI jars in lib/ext. All JAI jars
> > > (jai_core.jar,
> > > > jai_codec.jar, jai_imageio.jar, mlibwrapper_jai.jar,
> > > > clibwrapper_jiio.jar) are found by the custom plugin class
> > > loader. But
> > > > unfortunately all Image I/O calls seem to fail.
> > > >
> > > > Regards,
> > > > Christoph Wagner
> > > >
> > > >
> > >
> >
>
---------------------------------------------------------------------
> > > > 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
>

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