View SVG Image problem?

View: New views
4 Messages — Rating Filter:   Alert me  

View SVG Image problem?

by krunchie :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I want to view SVG image but when I run my code I got exception

This is my code, what is wrong? How I can view simple SVG image - please help me?

                JSVGCanvas jsvgc = new JSVGCanvas();
                jsvgc.setURI(new java.io.File("D:\\Documents and Settings/Czgrada_try_1.svg").toURL().toString());
                panel2.add(jsvgc);


this is exception:


java.lang.NoClassDefFoundError: java/awt/image/renderable/RenderableImage
        at java.lang.Class.loadSuperClasses(Class.java:1817)
        at sun.misc.Launcher$AppClassLoader.defineClassPrivate(Launcher.java:539)
        at sun.misc.Launcher$AppClassLoader.access$500(Launcher.java:344)
        at sun.misc.Launcher$4.run(Launcher.java:565)
        at java.security.AccessController.doPrivileged(AccessController.java:351)
        at java.security.AccessController.doPrivileged(AccessController.java:320)
        at sun.misc.Launcher$AppClassLoader.doClassFind(Launcher.java:559)
        at sun.misc.Launcher$AppClassLoader.findClass(Launcher.java:607)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:349)
        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:420)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:291)
        at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:365)
        at org.apache.batik.bridge.BridgeContext.<init>(Unknown Source)
        at org.apache.batik.bridge.BridgeContext.<init>(Unknown Source)
        at org.apache.batik.swing.svg.AbstractJSVGComponent.createBridgeContext(Unknown Source)
        at org.apache.batik.swing.svg.AbstractJSVGComponent.installSVGDocument(Unknown Source)
        at org.apache.batik.swing.JSVGCanvas.installSVGDocument(Unknown Source)
        at org.apache.batik.swing.svg.AbstractJSVGComponent$2.run(Unknown Source)
        at org.apache.batik.swing.svg.AbstractJSVGComponent.stopThenRun(Unknown Source)
        at org.apache.batik.swing.svg.AbstractJSVGComponent.setSVGDocument(Unknown Source)
        at org.apache.batik.swing.svg.AbstractJSVGComponent$SVGListener.documentLoadingCompleted(Unknown Source)
        at org.apache.batik.swing.svg.SVGDocumentLoader$2.dispatch(Unknown Source)
        at org.apache.batik.util.EventDispatcher.dispatchEvent(Unknown Source)
        at org.apache.batik.util.EventDispatcher.fireEvent(Unknown Source)
        at org.apache.batik.util.EventDispatcher$1.run(Unknown Source)
        at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:165)
        at java.awt.EventQueue.dispatchEvent(EventQueue.java:312)
        at java.awt.EventQueueProxy.dispatchEvent(EventDispatchThread.java:325)
        at java.awt.AGUIEventDispatchThread.pumpOneEventForHierarchy(AGUIEventDispatchThread.java:95)
        at java.awt.AGUIEventDispatchThread.pumpEventsForHierarchy(AGUIEventDispatchThread.java:30)
        at java.awt.AGUIEventDispatchThread.pumpEvents(AGUIEventDispatchThread.java:24)
        at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:122)
        at java.awt.EventDispatchThread.run(EventDispatchThread.java:113)
        at java.lang.Thread.startup(Thread.java:782)

Re: View SVG Image problem?

by Helder Magalhães :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi krunchie,


> I want to view SVG image but when I run my code I got exception
>
> This is my code, what is wrong? How I can view simple SVG image - please
> help me?
>
>                JSVGCanvas jsvgc = new JSVGCanvas();
>                jsvgc.setURI(new java.io.File("D:\\Documents and
> Settings/Czgrada_try_1.svg").toURL().toString());
>                panel2.add(jsvgc);

Note that you provide too little information: no operating system,
Java version, Batik version, etc.. Trying to look at this single
snippet, though I'd say it seems OK.


> this is exception:
> java.lang.NoClassDefFoundError: java/awt/image/renderable/RenderableImage

A quick search on this symptom lead to the likely issue: it seems like
you are using GNU Classpath (Java implementation), which is not yet
compatible with Batik (or the way around). Take a look at a tightly
related Wiki page [1]. Also, you will likely find more information by
crawling the mailing list [2] for this (i recall a couple of threads
on the subject).

Please reply with more information if that's not the case.


Hope this helps,
 Helder


[1] http://wiki.apache.org/xmlgraphics/GnuClasspathCompatibility
[2] http://www.nabble.com/Batik-f308.html

---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@...
For additional commands, e-mail: batik-users-help@...


Re: View SVG Image problem?

by krunchie :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi Helder, Thank you for your reply

I am using Windows XP, jdk1.6.0_10, working in netbeans 6.7.1,
batik version is latest - batik-src-1.7.zip

I am beginner and i am programming in java, i am developing cdc application, i don't even know what is GNU Classpath, so i assume that i am not using that

I could post you whole code if necessarily, just say and next time i will

Hope that you have solution for me


Helder Magalhães wrote:
Hi krunchie,


> I want to view SVG image but when I run my code I got exception
>
> This is my code, what is wrong? How I can view simple SVG image - please
> help me?
>
>                JSVGCanvas jsvgc = new JSVGCanvas();
>                jsvgc.setURI(new java.io.File("D:\\Documents and
> Settings/Czgrada_try_1.svg").toURL().toString());
>                panel2.add(jsvgc);

Note that you provide too little information: no operating system,
Java version, Batik version, etc.. Trying to look at this single
snippet, though I'd say it seems OK.


> this is exception:
> java.lang.NoClassDefFoundError: java/awt/image/renderable/RenderableImage

A quick search on this symptom lead to the likely issue: it seems like
you are using GNU Classpath (Java implementation), which is not yet
compatible with Batik (or the way around). Take a look at a tightly
related Wiki page [1]. Also, you will likely find more information by
crawling the mailing list [2] for this (i recall a couple of threads
on the subject).

Please reply with more information if that's not the case.


Hope this helps,
 Helder


[1] http://wiki.apache.org/xmlgraphics/GnuClasspathCompatibility
[2] http://www.nabble.com/Batik-f308.html

---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org

Re: View SVG Image problem?

by thomas.deweese :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi Krunchie,

krunchie <dkrunchie@...> wrote on 11/06/2009 03:44:27 AM:

> I am beginner and i am programming in java, i am developing cdc application,
> i don't even know what is GNU Classpath, so i assume that i am not using
> that

    The Java CDC (Connnected Device Configuration) does not include all
of the Java classes that Batik needs.  So unless you want to rewrite
large sections of Batik you can't use it with CDC.