[kepler-dev] JAI actors

Nandita Mangal nmangal at sdsc.edu
Mon May 1 00:25:18 PDT 2006


Hi Chirstopher,
I am running Windows XP and jdk1.5.
Here are the JAI jars i have:
C:\jdk1.5.0_05\jre\lib\ext & C:\jre1.5.0_05\lib\ext
jai_codec.jar
jai_core.jar
mlib_wrapper.jar

C:\jdk1.5.0_05\jre\bin
mlib_jai.dll
checkmmx.exe
mlib_jai_mmx.dll

I have jai-1.1.2

 From our discussion last time, i suspect that since JAI actors work in 
general and I have the
above 3 jars.. could it still be a native JAI library problem? Maybe i 
am wrong.
The JAI test cases and all other JAI actors work for me under the Kepler 
as well
as stand alone applications(w/o kepler). However JAIImageReader and the 
SeekableStream
gives the codec IOexceptions.

The test case that I run is the Ptolemy jai test workflow under 
ptolemy/actor/lib/jai/test/auto. I have
tried with PNG and JPG formats..however i get same exception.


thanks,
nandita.


Christopher Brooks wrote:

>Hi Nandita,
>Do you have a test case for this?
>
>Also, what OS are you running?
>
>I suspect the problem is that the native JAI library is not being
>found?
>
>Our discussion from January can be found at
>http://www.mail-archive.com/ptolemy-hackers@bennett.eecs.berkeley.edu/msg00100.html
>
>_Christopher
>
>--------
>
>    hi Christopher,
>    Sorry i haven't visited this topic for a long time...
>    
>     I believe that the ptolemy JAIImageReader is causing some codec 
>    problem  in reading certain images.I have JAI actors working in Kepler 
>    otherwise.
>    
>    I wrote another way of getting the Image and then passed the image ( as 
>    a JAIImageToken) on to Ptolemy JAI actors and got no codec related
>    exceptions in reading/processing the image.
>    I believe using the SeekableStream in JAIImageReader might generate 
>    similar factory error in some cases?? We can catch such codec exceptions
>    in the JAIImageReader and try a second way of reading the image?
>    Here is another way of reading the image (which can be used in the case 
>    that the normal loading file way fails)
>            //_fileRoot indicates the filepath of image
>             ParameterBlock pb =  (new ParameterBlock()).add(_fileRoot);
>              RenderedOp img = new RenderedOp("fileload", pb, null);
>             output.broadcast(new JAIImageToken(img));
>    Once I add the above, we can make Ptolemy JAI classes compile also from 
>    the build-ptolemy.xml buildfile in Kepler and add the actors to Kepler 
>    library.
>    
>    thanks,
>    nandita.
>    
>    
>    Here is the exception:
>         [java] Error: IOException occurs when search for propriate codecs.
>         [java] Occurs in: com.sun.media.jai.codec.ImageCodec
>         [java] java.io.IOException: The handle is invalid
>         [java]     at java.io.RandomAccessFile.seek(Native Method)
>         [java]     at 
>    com.sun.media.jai.codec.FileCacheSeekableStream.readUntil(Fil
>    eCacheSeekableStream.java:129)
>         [java]     at 
>    com.sun.media.jai.codec.FileCacheSeekableStream.read(FileCach
>    eSeekableStream.java:266)
>         [java]     at 
>    com.sun.media.jai.codec.SeekableStream.readFully(SeekableStre
>    am.java:327)
>         [java]     at 
>    com.sun.media.jai.codec.SeekableStream.readFully(SeekableStre
>    am.java:306)
>         [java]     at 
>    com.sun.media.jai.codec.ImageCodec.getDecoderNames(ImageCodec
>    .java:274)
>         [java]     at 
>    com.sun.media.jai.opimage.StreamRIF.create(StreamRIF.java:80)
>    
>         [java]     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native 
>    Method)
>         [java]     at 
>    sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcces
>    sorImpl.java:39)
>         [java]     at 
>    sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMet
>    hodAccessorImpl.java:25)
>         [java]     at java.lang.reflect.Method.invoke(Method.java:585)
>         [java]     at 
>    javax.media.jai.FactoryCache.invoke(FactoryCache.java:130)
>         [java]     at 
>    javax.media.jai.OperationRegistry.invokeFactory(OperationRegi
>    stry.java:1682)
>         [java]     at 
>    javax.media.jai.ThreadSafeOperationRegistry.invokeFactory(Thr
>    eadSafeOperationRegistry.java:481)
>         [java]     at 
>    javax.media.jai.registry.RIFRegistry.create(RIFRegistry.java:
>    340)
>         [java]     at 
>    javax.media.jai.RenderedOp.createInstance(RenderedOp.java:830
>    )
>         [java]     at 
>    javax.media.jai.RenderedOp.createRendering(RenderedOp.java:87
>    8)
>         [java]     at 
>    javax.media.jai.RenderedOp.getRendering(RenderedOp.java:899)
>         [java]     at 
>    javax.media.jai.RenderedOp.createInstance(RenderedOp.java:810
>    )
>         [java]     at 
>    javax.media.jai.RenderedOp.createRendering(RenderedOp.java:87
>    8)
>         [java]     at 
>    javax.media.jai.RenderedOp.getRendering(RenderedOp.java:899)
>         [java]     at 
>    ptolemy.actor.lib.jai.JAIImageToken.asAWTImage(JAIImageToken.
>    java:95)
>         [java]     at 
>    ptolemy.actor.lib.image.ImageTableau.display(ImageTableau.jav
>    a:197)
>         [java]     at 
>    ptolemy.actor.lib.image.ImageTableau.append(ImageTableau.java
>    :139)
>         [java]     at 
>    ptolemy.actor.gui.TokenEffigy.setTokens(TokenEffigy.java:226)
>    
>         [java]     at 
>    ptolemy.actor.lib.image.ImageDisplay._display(ImageDisplay.ja
>    va:243)
>         [java]     at 
>    ptolemy.actor.lib.image.ImageDisplay$2.run(ImageDisplay.java:
>    209)
>         [java]     at 
>    java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:
>    209)
>         [java]     at java.awt.EventQueue.dispatchEvent(EventQueue.java:461)
>         [java]     at 
>    java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDi
>    spatchThread.java:242)
>         [java]     at 
>    java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDisp
>    atchThread.java:163)
>         [java]     at 
>    java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.j
>    ava:157)
>         [java]     at 
>    java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.j
>    ava:149)
>         [java]     at 
>    java.awt.EventDispatchThread.run(EventDispatchThread.java:110
>    )
>         [java] Exception in thread "AWT-EventQueue-0" 
>    java.lang.RuntimeException: -
>     Unable to render RenderedOp for this operation.
>         [java]     at 
>    javax.media.jai.RenderedOp.createInstance(RenderedOp.java:838
>    )
>         [java]     at 
>    javax.media.jai.RenderedOp.createRendering(RenderedOp.java:87
>    8)
>         [java]     at 
>    javax.media.jai.RenderedOp.getRendering(RenderedOp.java:899)
>         [java]     at 
>    javax.media.jai.RenderedOp.createInstance(RenderedOp.java:810
>    )
>         [java]     at 
>    javax.media.jai.RenderedOp.createRendering(RenderedOp.java:87
>    8)
>         [java]     at 
>    javax.media.jai.RenderedOp.getRendering(RenderedOp.java:899)
>         [java]     at 
>    ptolemy.actor.lib.jai.JAIImageToken.asAWTImage(JAIImageToken.
>    java:95)
>         [java]     at 
>    ptolemy.actor.lib.image.ImageTableau.display(ImageTableau.jav
>    a:197)
>         [java]     at 
>    ptolemy.actor.lib.image.ImageTableau.append(ImageTableau.java
>    :139)
>         [java]     at 
>    ptolemy.actor.gui.TokenEffigy.setTokens(TokenEffigy.java:226)
>    
>         [java]     at 
>    ptolemy.actor.lib.image.ImageDisplay._display(ImageDisplay.ja
>    va:243)
>         [java]     at 
>    ptolemy.actor.lib.image.ImageDisplay$2.run(ImageDisplay.java:
>    209)
>         [java]     at 
>    java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:
>    209)
>         [java]     at java.awt.EventQueue.dispatchEvent(EventQueue.java:461)
>         [java]     at 
>    java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDi
>    spatchThread.java:242)
>         [java]     at 
>    java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDisp
>    atchThread.java:163)
>         [java]     at 
>    java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.j
>    ava:157)
>         [java]     at 
>    java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.j
>    ava:149)
>         [java]     at 
>    java.awt.EventDispatchThread.run(EventDispatchThread.java:110
>    )
>    
>    
>    
>--------
>  
>




More information about the Kepler-dev mailing list