You are viewing a plain text version of this content. The canonical link for it is here.
Posted to batik-users@xmlgraphics.apache.org by ar...@netscape.net on 2003/03/15 17:32:04 UTC

reading svg, missing resource exception

I've been able to use batik to create and write svg's though I'm having trouble reading an svg file into the internal batik format.  I've simplified the error that I keep getting using the following program, following the example on the batik webpage  to create a document from an svg... 

-------------------------------------------------------------------------

public static void main(String args[]){
            try {
                String parser = XMLResourceDescriptor.getXMLParserClassName();
                System.out.println(parser);
                SAXSVGDocumentFactory f = new SAXSVGDocumentFactory(parser);
                String uri = "file://test.svg";
                Document doc = f.createDocument(uri);
            } catch (IOException ex) {
                System.out.println("exception caught?");
                // ...
            }
        }
-----------------------------------------------------------------------

When running this program I get the following runtime error:

----------------------------------------------------------------------

michael@debian:~/webDesign/software/svgtools$ LANG="en_US" java svgTool
Exception in thread "main" java.lang.ExceptionInInitializerError
    at svgTool.main(svgTest.java:14)
Caused by: java.util.MissingResourceException: Can't find bundle for base name org.apache.batik.util.resources.XMLResourceDescriptor, locale en_US
    at java.util.ResourceBundle.throwMissingResourceException(ResourceBundle.java:804)
    at java.util.ResourceBundle.getBundleImpl(ResourceBundle.java:773)
    at java.util.ResourceBundle.getBundle(ResourceBundle.java:538)
    at org.apache.batik.util.XMLResourceDescriptor.<clinit>(XMLResourceDescriptor.java:57)
    ... 1 more

---------------------------------------------------------------------

I've tried this example under sun virtual machine 1.3 and 1.4.1, on a RedHat system, on a Debian system, and also with several different locales.

As I'm still fairly new to the java language itself I'm wondering if I'm not doing something correct that would be obvious to someone with more experience using either java or the sax parser which the XMLResourceDescriptor seems to use.

If anyone has advice on what I can do to avoid the runtime error it would be much appreciated... or, what exactly is going on when the program goes to get a "resource bundel."  I'm assuming that some of this question might be more approriate for some of more general java or xml forums, though I'm tring to learn enough of what I need to, to get back to considering using batik...

Michael

p.s. the link on the website to batik as an artform seemed to be broken last night


__________________________________________________________________
Try AOL and get 1045 hours FREE for 45 days!
http://free.aol.com/tryaolfree/index.adp?375380

Get AOL Instant Messenger 5.1 for FREE! Download Now!
http://aim.aol.com/aimnew/Aim/register.adp?promos=380455

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


Re: reading svg, missing resource exception

Posted by Thomas E Deweese <th...@kodak.com>.
>>>>> "MT" == Michael Tench <Te...@netscape.net> writes:

MT> somewhat unfamiliar with Java I linked the path of the org classes
MT> into the local directory of my project, without having the
MT> resources org directory in a place where the compiler would find
MT> them, though I haven't had a chance to confim this, I'm fairly
MT> certain that was my error...

    Assuming you are also 'artfullhippie' :) Then yes that is exactly
what it looks like the error was, you need to have the contents of the
'resources' directory of Batik on your class path.



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


Re: reading svg, missing resource exception

Posted by Michael Tench <Te...@netscape.net>.
somewhat unfamiliar with Java I linked the path of the org classes into 
the local directory of my project, without having the resources org 
directory in a place where the compiler would find them, though I 
haven't had a chance to confim this, I'm fairly certain that was my error...



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