Hi Naveed. noni_4444: > I receive an exception while loading an SVG document from within a batik > applet. The SVG document is being loaded from the Tomcat server, where it is > placed in the ROOT directory. The line of code which causes the exception > is: > > Caused by: java.lang.NullPointerException > at org.apache.batik.Version.getVersion(Version.java:70) > at org.apache.batik.util.ParsedURL.<clinit>(Unknown Source) > ... 5 more > > Does this exception occur because of the url? I have previously opened an > SVG being served from a servlet successfully. > Why is there a getVersion error message? I already have all the relevant > class files placed on the ROOT directory of the TOMCAT server. > > Details: Might be irrelevant > I extracted all the batik jar files into a single folder named org, and > placed it at the ROOT directory so that it can be directly accessed. Did > this because the requests for class files did not succeed when i had only > the jar files placed in tomcat ROOT directory. The applet has been loaded > from the same web server from which we are trying to load the svg file. So > that scenario goes something like this
These details are actually relevant! The line of org.apache.batik.Version that causes the NPE is: String version = Version.class.getPackage().getImplementationVersion(); where Class.getPackage() returns an object representing the jar file that the Version class came from. The version number is actually extracted from the Implementation-Version entry of the jar’s manifest file. If you’ve extracted all the files from the jars, then getPackage() will return null and hence the NPE occurs. That line should probably be changed to avoid an exception in this case. *changes it now* OK I just committed a fix for that. Try compiling the code from SVN to see if it fixes your problem. Cameron -- Cameron McCormack, http://mcc.id.au/ xmpp:[EMAIL PROTECTED] ▪ ICQ 26955922 ▪ MSN [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
