Jeremias Maerki wrote:

> In the past, I've written a number of Xalan-J extension, one of them
> the Xalan extension of Barcode4J. Standing just before the 1.0
> release of Barcode4J (finally, sigh) I checked the whole thing with
> JDK 5.0 and, d'oh, the Xalan extension doesn't work. Xalan-J can't
> compile my stylesheet because the XSLT compiler doesn't find
> org.apache.xalan.extensions.XSLTProcessorContext which I use in the
> extension. That's because this class in now at
> com.sun.org.apache.xalan.extensions.XSLTProcessorContext.

I just ran into this problem and I'm trying to understand what's
really going on.  I recently had occasion to run my batik-based
program under ant and Java 1.5 without forking (<java fork="no">).
[side note: I needed to do this in order to get the new Netbeans
profiler to work with my code.]

When I fork, everything works great.  But when I ask ant to run the
code with fork="no" I get the following:

Exception in thread "Thread-1" javax.xml.transform.TransformerFactoryConfigurationError: Provider com.sun.org.apache.xalan.internal.xsltc.trax.TransformerFactoryImpl could not be instantiated: java.lang.NullPointerException
at javax.xml.transform.TransformerFactory.newInstance(TransformerFactory.java:109)
at java.util.prefs.XmlSupport.writeDoc(XmlSupport.java:247)
at java.util.prefs.XmlSupport.exportMap(XmlSupport.java:327)
at java.util.prefs.FileSystemPreferences$8.run(FileSystemPreferences.java:607)
at java.security.AccessController.doPrivileged(Native Method)
at java.util.prefs.FileSystemPreferences.writeBackCache(FileSystemPreferences.java:600)
at java.util.prefs.FileSystemPreferences.syncSpiPrivileged(FileSystemPreferences.java:784)
at java.util.prefs.FileSystemPreferences.access$2300(FileSystemPreferences.java:33)
at java.util.prefs.FileSystemPreferences$13.run(FileSystemPreferences.java:754)
at java.security.AccessController.doPrivileged(Native Method)
at java.util.prefs.FileSystemPreferences.syncSpi(FileSystemPreferences.java:752)
at java.util.prefs.AbstractPreferences.sync2(AbstractPreferences.java:1312)
at java.util.prefs.AbstractPreferences.sync2(AbstractPreferences.java:1317)
at java.util.prefs.AbstractPreferences.sync2(AbstractPreferences.java:1317)
at java.util.prefs.AbstractPreferences.sync2(AbstractPreferences.java:1317)
at java.util.prefs.AbstractPreferences.sync2(AbstractPreferences.java:1317)
at java.util.prefs.AbstractPreferences.sync(AbstractPreferences.java:1303)
at java.util.prefs.FileSystemPreferences.sync(FileSystemPreferences.java:731)
at java.util.prefs.FileSystemPreferences.flush(FileSystemPreferences.java:807)
at java.util.prefs.FileSystemPreferences.syncWorld(FileSystemPreferences.java:451)
at java.util.prefs.FileSystemPreferences.access$1200(FileSystemPreferences.java:33)
at java.util.prefs.FileSystemPreferences$5$1.run(FileSystemPreferences.java:429)



As Jeremias suggested, putting xalan.jar in my classpath makes everything OK... but why is this needed only when run inside ant's JVM? It seems like ant somehow has some "bad" property or classpath entry in its environment that disagrees with Java 1.5; if I fork, it's avoided. Sure, I could put xalan.jar in my CLASSPATH and be done, but I think it's only masking the real problem. My apps don't seem to need xalan unless run under ant.


My environment is the following:

  - java version "1.5.0_01"
  - Apache Ant version 1.6.2 compiled on July 16 2004
  - Batik built from (recent) CVS
  - Fedora Core 3, kernel 2.6.10

Thanks for your time.

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



Reply via email to