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

FW: Environment problem

Sorry for crossposting, but the problem occures, if I try to get the Parser
from FOInputHandler in the junit test case. inputHandler.getParser() throws
a FOPException:

org.apache.fop.apps.FOPException: org.apache.xerces.parsers.SAXParser is not
a SAX driver
at org.apache.fop.apps.InputHandler.createParser(InputHandler.java:75)
at org.apache.fop.apps.FOInputHandler.getParser(FOInputHandler.java:40)
....

based on a ClassCastException:

java.lang.ClassCastException:
org.apache.xerces.parsers.StandardParserConfiguration
at org.apache.xerces.parsers.SAXParser.<init>(SAXParser.java:95)
at java.lang.Class.newInstance0(Native Method) 	at
java.lang.Class.newInstance(Class.java:232)
at org.apache.fop.apps.InputHandler.createParser(InputHandler.java:66)
at org.apache.fop.apps.FOInputHandler.getParser(FOInputHandler.java:40)
...

The SAX2 final version isn't correct set only in the test case (in the
application every thing works fine)!?

> -----Original Message-----
> From: Torsten Erler [mailto:erlto@net-linx.de]
> Sent: Donnerstag, 16. Mai 2002 09:37
> To: Xalan-Dev (E-mail)
> Subject: 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:\jav
> asoft\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\li
> b\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:\jav
> asoft\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\li
> b\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
>


---------------------------------------------------------------------
To unsubscribe, e-mail: fop-dev-unsubscribe@xml.apache.org
For additional commands, email: fop-dev-help@xml.apache.org


RE: Environment problem (fixed)

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


---------------------------------------------------------------------
To unsubscribe, e-mail: fop-dev-unsubscribe@xml.apache.org
For additional commands, email: fop-dev-help@xml.apache.org