Re: loadSVGDocument generates NullPointerException

MaGaM <[email protected]>
Newsgroups gmane.text.xml.batik.user
Message-ID <[email protected]>
Kenneth B. Harwood wrote
> loadSVGDocument() generates a call to the XML parser (component).
> According to the (Class XMLResourceDescriptor) docs, if an XML parser
> has not been explicitly set, Batik will attempt to assign one based on
> the entry in the resources/XMLResourceDescriptor.properties file.
> 
> Although Batik installs this .properties file on my machine,  unlike a
> java application, *** an applet cannot read local files (such as 
> .properties) without explicit permission (ie. granted in the .policy
> file). 
> ***  This caused my XMLParserClassName field to be uninitialized (it 
> was NULL), which lead to the NPE.  btw, there is also a 
> CSSParserClassName field that has to be set to avoid the same kind 
> of error.

I had the same problem, but with running my application from an Ant build
file instead of your applet context. This made me realize that the
batik-src/resources directory was not on the classpath. After adding it, it
(also) worked like a charm!

Thanks for taking the time to post your solution after you found it. As you
can see, it helps others greatly!




--
View this message in context: http://batik.2283329.n4.nabble.com/Fw-loadSVGDocument-generates-NullPointerException-tp2971376p4655313.html
Sent from the Batik - Users mailing list archive at Nabble.com.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.