I am seeing a NullPointerException in parsing an SVG file that has a
DOCTYPE in an applet,
if the applet is in a jar file and I am behind a firewall.

Background:
I have an applet that will uses Batik to display SVG. To simplify
testing, I developed the
code to be run by one of two drivers: a "main" class and an "applet"
class.

I recently ran into a problem with NullPointExceptions when I tried to
deploy the applet
as a JAR file. I found that the application would run either way but the
applet would
only run as separate class files. More importantly, neither applet
approach worked when
the applet was served from a Tomcat server. (my production environment.)

I got the latest CVS version (this morning) and verified that it still
exhibited the same
behavior. I compiled with debugging on and optimization off. Using that
version of the
Batik jars, I was able to track the exception to

org.apache.batik.dom.util.SAXDocumentFactory.createDocument(SAXDocumentFactory.java:353)

I added some further debugging code and tracked that exception to

org.apache.batik.dom.svgSAXSVGDocumentFactory.resolveEntity(SAXSVGDocumentFactory.java:311)

With this in hand, I went back to some of my reference SVG and removed
the DOCTYPE and
added the namespace for xlink. This workaround appears to work without
issue.

Questions:
 1. Is there some way to make the code use the proxy information in the
browser?
    - That is one of the major technical reasons behind doing this as an
applet. (The other
       reasons are out of my control.)

 2. Any idea why the class file version works and the JAR file version
doesn't?

 3. Am I doing something incredibly wrong and there is an obvious
solution I haven't
     noticed? <grin/> (At the rate I'm going, I'm not willing to rule
this out.)

Thanks in advance,
G. Wade


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to