Hi Chirstopher,
Thanks for looking into possible reasons for the exceptions. I don't get any exceptions when the vergil shows up the JAI actors now , as you suggested JAI implementation jars namely jai_core.jar & jai_codec.jar needed to be placed it in the right JDK.
Currently I have the class files for all JAI actors in ptolemy/actor/lib/jai & the implementation jars in the JDK folder.However, now when I run the the actors/ other demos , I get the following exception:
Error: IOException occurs when search for propriate codecs.
Occurs in: com.sun.media.jai.codec.ImageCodec
java.io.IOException: The handle is invalid
at java.io.RandomAccessFile.seek(Native Method)
at com.sun.media.jai.codec.FileCacheSeekableStream.readUntil(FileCacheSe
ekableStream.java:129)
at com.sun.media.jai.codec.FileCacheSeekableStream.read(FileCacheSeekabl
eStream.java:266)
at com.sun.media.jai.codec.SeekableStream.readFully(SeekableStream.java:
327)
at com.sun.media.jai.codec.SeekableStream.readFully(SeekableStream.java:
306)
at com.sun.media.jai.codec.ImageCodec.getDecoderNames(ImageCodec.java:27
4)
at com.sun.media.jai.opimage.StreamRIF.create(StreamRIF.java:80)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at javax.media.jai.FactoryCache.invoke(FactoryCache.java:130)
at javax.media.jai.OperationRegistry.invokeFactory(OperationRegistry.jav
a:1682)
at javax.media.jai.ThreadSafeOperationRegistry.invokeFactory(ThreadSafeO
perationRegistry.java:481)
at javax.media.jai.registry.RIFRegistry.create(RIFRegistry.java:340)
at javax.media.jai.RenderedOp.createInstance(RenderedOp.java:830)
at javax.media.jai.RenderedOp.createRendering(RenderedOp.java:878)
at javax.media.jai.RenderedOp.getRendering(RenderedOp.java:899)
&nb! sp; at javax.media.jai.RenderedOp.createInstance(RenderedOp.java:810)
at javax.media.jai.RenderedOp.createRendering(RenderedOp.java:878)
at javax.media.jai.RenderedOp.getRendering(RenderedOp.java:899)
at ptolemy.actor.lib.jai.JAIImageToken.asAWTImage(JAIImageToken.java:95)
at ptolemy.actor.lib.image.ImageTableau.display(ImageTableau.java:197)
at ptolemy.actor.lib.image.ImageTableau.append(ImageTableau.java:139)
at ptolemy.actor.gui.TokenEffigy.setTokens(TokenEffigy.java:218)
at ptolemy.actor.lib.image.ImageDisplay._display(ImageDisplay.java:243)
at ptolemy.actor.lib.image.ImageDisplay$2.run(ImageDisplay.java:209)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:461)
at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchTh
read.java:242)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThre
ad.java:163)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:157)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:149)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)
Exception in thread "AWT-EventQueue-0" java.lang.RuntimeException: - Unable to render RenderedOp for this operation.
at javax.media.jai.RenderedOp.createInstance(RenderedOp.java:838)
at javax.media.jai.RenderedOp.createRendering(RenderedOp.java:878)
at javax.media.jai.RenderedOp.getRendering(RenderedOp.java:899)
at javax.media.jai.RenderedOp.createInstance(RenderedOp.java:810)
at javax.media.jai.RenderedOp.createRendering(RenderedOp.java:878)
at javax.media.jai.RenderedOp.getRendering(RenderedOp.java:899)
at ptolemy.actor.lib.jai.JAIImageToken.asAWTImage(JAIImageToken.java:95)
at ptolemy.actor.lib.image.ImageTableau.display(ImageTableau.java:197)
at ptolemy.actor.lib.image.ImageTableau.append(ImageTableau.java:139)
at ptolemy.actor.gui.TokenEffigy.setTokens(TokenEffigy.java:218)
at ptolemy.actor.lib.image.ImageDisplay._display(ImageDisplay.java:243)
at ptolemy.actor.lib.image.ImageDisplay$2.run(ImageDisplay.java:209)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:461)
at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchTh
read.java:242)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThre
ad.java:163)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:157)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:149)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)
I tried jpg,png,gif image files with the JAIImageReader, but similar exception
Any ideas...
Thanks for your help!
nandita.
Christopher Brooks <[EMAIL PROTECTED]> wrote:
Thanks for looking into possible reasons for the exceptions. I don't get any exceptions when the vergil shows up the JAI actors now , as you suggested JAI implementation jars namely jai_core.jar & jai_codec.jar needed to be placed it in the right JDK.
Currently I have the class files for all JAI actors in ptolemy/actor/lib/jai & the implementation jars in the JDK folder.However, now when I run the the actors/ other demos , I get the following exception:
Error: IOException occurs when search for propriate codecs.
Occurs in: com.sun.media.jai.codec.ImageCodec
java.io.IOException: The handle is invalid
at java.io.RandomAccessFile.seek(Native Method)
at com.sun.media.jai.codec.FileCacheSeekableStream.readUntil(FileCacheSe
ekableStream.java:129)
at com.sun.media.jai.codec.FileCacheSeekableStream.read(FileCacheSeekabl
eStream.java:266)
at com.sun.media.jai.codec.SeekableStream.readFully(SeekableStream.java:
327)
at com.sun.media.jai.codec.SeekableStream.readFully(SeekableStream.java:
306)
at com.sun.media.jai.codec.ImageCodec.getDecoderNames(ImageCodec.java:27
4)
at com.sun.media.jai.opimage.StreamRIF.create(StreamRIF.java:80)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at javax.media.jai.FactoryCache.invoke(FactoryCache.java:130)
at javax.media.jai.OperationRegistry.invokeFactory(OperationRegistry.jav
a:1682)
at javax.media.jai.ThreadSafeOperationRegistry.invokeFactory(ThreadSafeO
perationRegistry.java:481)
at javax.media.jai.registry.RIFRegistry.create(RIFRegistry.java:340)
at javax.media.jai.RenderedOp.createInstance(RenderedOp.java:830)
at javax.media.jai.RenderedOp.createRendering(RenderedOp.java:878)
at javax.media.jai.RenderedOp.getRendering(RenderedOp.java:899)
&nb! sp; at javax.media.jai.RenderedOp.createInstance(RenderedOp.java:810)
at javax.media.jai.RenderedOp.createRendering(RenderedOp.java:878)
at javax.media.jai.RenderedOp.getRendering(RenderedOp.java:899)
at ptolemy.actor.lib.jai.JAIImageToken.asAWTImage(JAIImageToken.java:95)
at ptolemy.actor.lib.image.ImageTableau.display(ImageTableau.java:197)
at ptolemy.actor.lib.image.ImageTableau.append(ImageTableau.java:139)
at ptolemy.actor.gui.TokenEffigy.setTokens(TokenEffigy.java:218)
at ptolemy.actor.lib.image.ImageDisplay._display(ImageDisplay.java:243)
at ptolemy.actor.lib.image.ImageDisplay$2.run(ImageDisplay.java:209)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:461)
at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchTh
read.java:242)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThre
ad.java:163)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:157)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:149)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)
Exception in thread "AWT-EventQueue-0" java.lang.RuntimeException: - Unable to render RenderedOp for this operation.
at javax.media.jai.RenderedOp.createInstance(RenderedOp.java:838)
at javax.media.jai.RenderedOp.createRendering(RenderedOp.java:878)
at javax.media.jai.RenderedOp.getRendering(RenderedOp.java:899)
at javax.media.jai.RenderedOp.createInstance(RenderedOp.java:810)
at javax.media.jai.RenderedOp.createRendering(RenderedOp.java:878)
at javax.media.jai.RenderedOp.getRendering(RenderedOp.java:899)
at ptolemy.actor.lib.jai.JAIImageToken.asAWTImage(JAIImageToken.java:95)
at ptolemy.actor.lib.image.ImageTableau.display(ImageTableau.java:197)
at ptolemy.actor.lib.image.ImageTableau.append(ImageTableau.java:139)
at ptolemy.actor.gui.TokenEffigy.setTokens(TokenEffigy.java:218)
at ptolemy.actor.lib.image.ImageDisplay._display(ImageDisplay.java:243)
at ptolemy.actor.lib.image.ImageDisplay$2.run(ImageDisplay.java:209)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:461)
at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchTh
read.java:242)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThre
ad.java:163)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:157)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:149)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)
I tried jpg,png,gif image files with the JAIImageReader, but similar exception
Any ideas...
Thanks for your help!
nandita.
Christopher Brooks <[EMAIL PROTECTED]> wrote:
Hi there,
I have a very basic question on importing the jar files for the JAI act
ors.
Currently I am able to make the cla! ss files in pttII/ptolemy/actor/lib/
jai folder.
And when I run vergil (it shows up JAI actors with exceptions)....basi
cally I am unable to make ptolemy load the jai jar files during vergil.
I placed the jar files in actor/lib.
I refered to "Add an Actor" page & my actors do show up , but am facing t
he jar issue, probably not doing something right...
thanks,
nandita.
------
Hi Nandita,
I'm assuming your problem is with Ptolemy and vergil here, not with
Kepler.
$PTII/bin/vergil is a shell script that sets the classpath and invokes
ptolemy.vergil.VergilApplication
If you run "$PTII/bin/vergil -verbose" you will see the classpath
that is used.
The vergil script includes $PTII in the classpath, so the .class files
in ptolemy/actor/lib/jai should be automatically included in the
classpath and be visible to vergil. You need not construct a jar
file containing ! the actors.
Note that you would need to modify the configuration so that
any new actors are visible. To do this, edit
ptII/ptolemy/actor/lib/jai/jai.xml
The way the configuration works is a tad complex, but briefly
when you run the ptolemy.vergil.VergilApplication class, it uses
the "full" configuration, which is found in
ptolemy/configs/full/configuratoin.xml
That file refers to ptolemy/configs/defaultFullConfiguration.xml,
which includes image.xml:
image.xml includes jai.xml:
You say you are getting exceptions, what exceptions are you seeing?
There is a separate issue with the JAI jar files from Sun. These
jar files include the JAI implementation and under Windows for me
are found in
c:/j2sdk1.4.2_08/jre/lib/ext
For me, the JAI implementation jar files found in that directory are
mlibwrapper_jai.jar
jai_core.jar
jai_codec.jar
I just want to be sure we are talking about the JAI actor jar files,
not the JAI implementation jar files from Sun.
If the JAI implementation jar files are not in the right place,
then the JAI actors will not work. I've seen various problems here,
most center around multiple JDKs and JREs are installed, and the JAI
jar files are in one JDK or JRE, but not the right one.
_Christopher
----------------------------------------------------------------------------
Posted to the ptolemy-hackers mailing list. Please send administrative
mail for this list to: [EMAIL PROTECTED]
Yahoo! Photos
Got holiday prints? See all the ways to get quality prints in your hands ASAP.