You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@xalan.apache.org by Torsten Erler <er...@net-linx.de> on 2002/05/16 09:37:10 UTC

Environment problem

Hi all

I've a incomprehensibly problem with the SAX environment.

If I start my project and run EnvironmentCheck all is ok:

#---- BEGIN writeEnvironmentReport($Revision: 1.10 $): Useful stuff
found: ----
version.DOM.draftlevel=2.0fd
java.class.path=>snip (too long)
version.JAXP=1.1
java.ext.dirs=D:\javasoft\jdk1.3.1\jre\lib\ext
version.xerces2=Xerces-J 2.0.1
version.xerces1=not-present
version.xalan2_2=Xalan Java 2.3.1
version.xalan1=not-present
version.ant=not-present
java.version=1.3.1_03
version.DOM=2.0
version.crimson=not-present
sun.boot.class.path=D:\javasoft\jdk1.3.1\jre\lib\rt.jar;D:\javasoft\jdk1.3.1
\jre\lib\i18n.jar;D:\javasoft\jdk1.3.1\jre\lib\sunrsasign.jar;D:\javasoft\jd
k1.3.1\jre\classes
#---- BEGIN Listing XML-related jars in: foundclasses.java.class.path ----
xml-apis.jar-apparent.version=xml-apis.jar from xalan-j_2_3_0 from
xml-commons-1.0.b2
xml-apis.jar-path=f:\java\projects\star\beta\java\ext\tools\lib\xalan-2.3.1_
xml-apis.jar
#----- END Listing XML-related jars in: foundclasses.java.class.path -----
version.SAX=2.0
version.xalan2x=Xalan Java 2.3.1
#----- END writeEnvironmentReport: Useful properties found: -----
# YAHOO! Your environment seems to be OK.

Then, I have a test class and if I start this unit test with 100%
identically classpath the result is:

#---- BEGIN writeEnvironmentReport($Revision: 1.10 $): Useful stuff
found: ----
version.DOM.draftlevel=2.0fd
java.class.path=>snip (too long)
version.JAXP=1.1
java.ext.dirs=D:\javasoft\jdk1.3.1\jre\lib\ext
version.xerces2=Xerces-J 2.0.1
version.xerces1=not-present
version.xalan2_2=Xalan Java 2.3.1
ERROR.version.SAX=ERROR attempting to load SAX version 2 class:
java.lang.NoSuchMethodException: setAttributes
ERROR.=At least one error was found!
version.xalan1=not-present
version.ant=not-present
version.SAX-backlevel=2.0beta2-or-earlier
java.version=1.3.1_03
version.DOM=2.0
version.crimson=not-present
sun.boot.class.path=D:\javasoft\jdk1.3.1\jre\lib\rt.jar;D:\javasoft\jdk1.3.1
\jre\lib\i18n.jar;D:\javasoft\jdk1.3.1\jre\lib\sunrsasign.jar;D:\javasoft\jd
k1.3.1\jre\classes
#---- BEGIN Listing XML-related jars in: foundclasses.java.class.path ----
xml-apis.jar-apparent.version=xml-apis.jar from xalan-j_2_3_0 from
xml-commons-1.0.b2
xml-apis.jar-path=f:\java\projects\star\beta\java\ext\tools\lib\xalan-2.3.1_
xml-apis.jar
#----- END Listing XML-related jars in: foundclasses.java.class.path -----
version.xalan2x=Xalan Java 2.3.1
#----- END writeEnvironmentReport: Useful properties found: -----
# WARNING: Potential problems found in your environment!
#    Check any 'ERROR' items above against the Xalan FAQs
#    to correct potential problems with your classes/jars
#    http://xml.apache.org/xalan-j/faq.html

Can anyone help me? I don't understand the difference, because the classpath
and the sequence of jar files is the same in both cases!

ThanX Torsten


RE: Environment problem

Posted by Torsten Erler <er...@net-linx.de>.
Hi,

just for information, for anyone, who gets in the same trouble!

I've found the problem with the obsoleter SAX-2 implementation. In my
classpath are 2 different xml-api's (I know about that, but I cannot avoid
that, because of foreign parts in our app are delivered with this api
contained in the jar file).
To solve this, the xalan/xerxes libraries are in front of my classpath and
it works fine, but JUnit uses two different classloader, the System
ClassLoader and for reloading classes in gui (swing) testing they are using
their own Class Loader. This loader seems to ignore the sequence of
libraries in the classpath and returns the wrong implementation class (SAX
2.0beta2).
Now I've disabled class reloading and all works perfect (May god be
praised).

cu Torsten :)

---snip