[prev in list] [next in list] [prev in thread] [next in thread] 

List:       batik-users
Subject:    Re: loadSVGDocument generates NullPointerException
From:       MaGaM <m.s.ganzeboom () rug ! nl>
Date:       2012-10-25 9:32:01
Message-ID: 1351157521372-4655313.post () n4 ! nabble ! com
[Download RAW message or body]

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.

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


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic