NOTE: The current preferred location for bug reports is the GitHub issue tracker.
Bug 590 - build.py run gives ClassCastException
build.py run gives ClassCastException
Status: RESOLVED FIXED
Product: Validator.nu
Classification: Unclassified
Component: General
HEAD
All All
: P2 normal
Assigned To: Henri Sivonen
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2009-07-05 06:54 CEST by J David Eisenberg
Modified: 2009-07-07 08:44 CEST (History)
1 user (show)

See Also:


Attachments
Output from build using Java 1.6 (43.29 KB, text/plain)
2009-07-06 03:22 CEST, J David Eisenberg
Details

Note You need to log in before you can comment on or make changes to this bug.
Description J David Eisenberg 2009-07-05 06:54:23 CEST
Running Mandriva Linux, Java version: Java(TM) SE Runtime Environment (build 1.6.0_06-b02) Java HotSpot(TM) Server VM (build 10.0-b22, mixed mode).

[david@localhost checker]$ python build/build.py run
"svn" co "http://svn.versiondude.net/whattf/build/trunk/" "build"
Checked out revision 74.
java -Xms65536k -Xmx65536k -XX:ThreadStackSize=2048 -cp ./dependencies/commons-codec-1.3/commons-codec-1.3.jar:./dependencies/commons-httpclient-3.1/commons-httpclient-3.1.jar:./dependencies/commons-logging-1.1.1/commons-logging-1.1.1.jar:./dependencies/commons-logging-1.1.1/commons-logging-adapters-1.1.1.jar:./dependencies/commons-logging-1.1.1/commons-logging-api-1.1.1.jar:./dependencies/icu4j-charsets-4_0.jar:./dependencies/icu4j-4_0.jar:./dependencies/iri-0.5/lib/iri.jar:./dependencies/jetty-6.1.11/lib/servlet-api-2.5-6.1.11.jar:./dependencies/jetty-6.1.11/lib/jetty-6.1.11.jar:./dependencies/jetty-6.1.11/lib/jetty-util-6.1.11.jar:./dependencies/jetty-6.1.11/lib/ext/jetty-ajp-6.1.11.jar:./dependencies/apache-log4j-1.2.15/log4j-1.2.15.jar:./dependencies/rhino1_7R1/js.jar:./dependencies/xerces-2_9_1/xercesImpl.jar:./dependencies/xerces-2_9_1/xml-apis.jar:./dependencies/slf4j-1.5.2/slf4j-log4j12-1.5.2.jar:./dependencies/commons-fileupload-1.2.1/lib/commons-fileupload-1.2.1.jar:./dependencies/isorelax.jar:./dependencies/mozilla/intl/chardet/java/dist/lib/chardet.jar:./dependencies/saxon9.jar:./jars/non-schema.jar:./jars/io-xml-util.jar:./jars/htmlparser.jar:./jars/hs-aelfred2.jar:./jars/html5-datatypes.jar:./jars/validator.jar:jing-trang/build/jing.jar -Dnu.validator.servlet.log4j-properties=validator/log4j.properties -Dnu.validator.servlet.version=3 -Dnu.validator.servlet.service-name=Validator.nu -Dorg.whattf.datatype.lang-registry=http://www.iana.org/assignments/language-subtag-registry -Dnu.validator.servlet.about-page=http://about.validator.nu/ -Dnu.validator.servlet.style-sheet=http://about.validator.nu/style.css -Dnu.validator.servlet.icon=http://about.validator.nu/icon.png -Dnu.validator.servlet.script=http://about.validator.nu/script.js -Dnu.validator.spec.microsyntax-descriptions=http://wiki.whatwg.org/wiki/MicrosyntaxDescriptions -Dnu.validator.spec.alt-advice=http://wiki.whatwg.org/wiki/Validator.nu_alt_advice -Dnu.validator.spec.html5-load=file:validator/spec/html5.html -Dnu.validator.spec.html5-link=http://www.whatwg.org/specs/web-apps/current-work/ -Dnu.validator.servlet.max-file-size=4194304 -Dorg.mortbay.http.HttpRequest.maxFormContentSize=4194304 -Dnu.validator.servlet.host.generic= -Dnu.validator.servlet.host.html5= -Dnu.validator.servlet.host.parsetree= -Dnu.validator.servlet.path.generic=/ -Dnu.validator.servlet.path.html5=/html5/ -Dnu.validator.servlet.path.parsetree=/parsetree/ nu.validator.servlet.Main 8888
2009-07-04 20:50:23.652::INFO:  Logging to STDERR via org.mortbay.log.StdErrLog
nu.validator.servlet.VerifierServletTransaction - Starting static initializer.
nu.validator.servlet.VerifierServletTransaction - Starting to loop over config file lines.
nu.validator.servlet.VerifierServletTransaction - Finished reading config.
nu.validator.servlet.VerifierServletTransaction - Converted config to arrays.
nu.validator.servlet.VerifierServletTransaction - Prepared namespace array.
nu.validator.servlet.VerifierServletTransaction - Parsed doctype numbers into ints.
nu.validator.servlet.VerifierServletTransaction - The cache path prefix is: null
nu.validator.servlet.VerifierServletTransaction - Parsing set up. Starting to read schemas.
nu.validator.servlet.VerifierServletTransaction - Will load schema: http://s.validator.nu/html5/html5full.rnc
nu.validator.servlet.VerifierServletTransaction - http://s.validator.nu/html5/html5full.rnc
java.lang.ClassCastException: org.xml.sax.InputSource cannot be cast to nu.validator.xml.TypedInputSource
        at nu.validator.servlet.VerifierServletTransaction.schemaByUrl(VerifierServletTransaction.java:1205)
        at nu.validator.servlet.VerifierServletTransaction.<clinit>(VerifierServletTransaction.java:440)
        at nu.validator.servlet.VerifierServlet.<clinit>(VerifierServlet.java:84)
        at nu.validator.servlet.Main.main(Main.java:89)
Exception in thread "main" java.lang.ExceptionInInitializerError
        at nu.validator.servlet.VerifierServlet.<clinit>(VerifierServlet.java:84)
        at nu.validator.servlet.Main.main(Main.java:89)
Caused by: java.lang.RuntimeException: java.lang.ClassCastException: org.xml.sax.InputSource cannot be cast to nu.validator.xml.TypedInputSource
        at nu.validator.servlet.VerifierServletTransaction.<clinit>(VerifierServletTransaction.java:474)
        ... 2 more
Caused by: java.lang.ClassCastException: org.xml.sax.InputSource cannot be cast to nu.validator.xml.TypedInputSource
        at nu.validator.servlet.VerifierServletTransaction.schemaByUrl(VerifierServletTransaction.java:1205)
        at nu.validator.servlet.VerifierServletTransaction.<clinit>(VerifierServletTransaction.java:440)
        ... 2 more
Comment 1 Michael[tm] Smith 2009-07-05 10:57:52 CEST
I tried reproducing this by building and running v.nu with the latest version of the Sun JDK package for Debian (see version info below) but was not able to reproduce it.

java version "1.6.0_14"
Java(TM) SE Runtime Environment (build 1.6.0_14-b08)
Java HotSpot(TM) Client VM (build 14.0-b16, mixed mode, sharing)
Comment 2 J David Eisenberg 2009-07-05 19:31:38 CEST
Does not work on a different Mandriva system; gives a completely different error.  Also, I could not find a website "v.nu", so I went to "validator.nu" instead. It is running java version "1.6.0_06"
Java(TM) SE Runtime Environment (build 1.6.0_06-b02)
Java HotSpot(TM) Client VM (build 10.0-b22, mixed mode)

[teacher@LINUX-PRINT checker]$ python build/build.py run
"svn" co "http://svn.versiondude.net/whattf/build/trunk/" "build"
Checked out revision 74.
java -Xms65536k -Xmx65536k -XX:ThreadStackSize=2048 -cp ./dependencies/commons-codec-1.3/commons-codec-1.3.jar:./dependencies/commons-httpclient-3.1/commons-httpclient-3.1.jar:./dependencies/commons-logging-1.1.1/commons-logging-1.1.1.jar:./dependencies/commons-logging-1.1.1/commons-logging-adapters-1.1.1.jar:./dependencies/commons-logging-1.1.1/commons-logging-api-1.1.1.jar:./dependencies/icu4j-charsets-4_0.jar:./dependencies/icu4j-4_0.jar:./dependencies/iri-0.5/lib/iri.jar:./dependencies/jetty-6.1.11/lib/servlet-api-2.5-6.1.11.jar:./dependencies/jetty-6.1.11/lib/jetty-6.1.11.jar:./dependencies/jetty-6.1.11/lib/jetty-util-6.1.11.jar:./dependencies/jetty-6.1.11/lib/ext/jetty-ajp-6.1.11.jar:./dependencies/apache-log4j-1.2.15/log4j-1.2.15.jar:./dependencies/rhino1_7R1/js.jar:./dependencies/xerces-2_9_1/xercesImpl.jar:./dependencies/xerces-2_9_1/xml-apis.jar:./dependencies/slf4j-1.5.2/slf4j-log4j12-1.5.2.jar:./dependencies/commons-fileupload-1.2.1/lib/commons-fileupload-1.2.1.jar:./dependencies/isorelax.jar:./dependencies/mozilla/intl/chardet/java/dist/lib/chardet.jar:./dependencies/saxon9.jar:./jars/non-schema.jar:./jars/io-xml-util.jar:./jars/htmlparser.jar:./jars/hs-aelfred2.jar:./jars/html5-datatypes.jar:./jars/validator.jar:jing-trang/build/jing.jar -Dnu.validator.servlet.log4j-properties=validator/log4j.properties -Dnu.validator.servlet.version=3 -Dnu.validator.servlet.service-name=Validator.nu -Dorg.whattf.datatype.lang-registry=http://www.iana.org/assignments/language-subtag-registry -Dnu.validator.servlet.about-page=http://about.validator.nu/ -Dnu.validator.servlet.style-sheet=http://about.validator.nu/style.css -Dnu.validator.servlet.icon=http://about.validator.nu/icon.png -Dnu.validator.servlet.script=http://about.validator.nu/script.js -Dnu.validator.spec.microsyntax-descriptions=http://wiki.whatwg.org/wiki/MicrosyntaxDescriptions -Dnu.validator.spec.alt-advice=http://wiki.whatwg.org/wiki/Validator.nu_alt_advice -Dnu.validator.spec.html5-load=file:validator/spec/html5.html -Dnu.validator.spec.html5-link=http://www.whatwg.org/specs/web-apps/current-work/ -Dnu.validator.servlet.max-file-size=4194304 -Dorg.mortbay.http.HttpRequest.maxFormContentSize=4194304 -Dnu.validator.servlet.host.generic= -Dnu.validator.servlet.host.html5= -Dnu.validator.servlet.host.parsetree= -Dnu.validator.servlet.path.generic=/ -Dnu.validator.servlet.path.html5=/html5/ -Dnu.validator.servlet.path.parsetree=/parsetree/ nu.validator.servlet.Main 8888
Exception in thread "main" java.lang.NoClassDefFoundError: nu/validator/servlet/Main
Caused by: java.lang.ClassNotFoundException: nu.validator.servlet.Main
        at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:276)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
        at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
Comment 3 J David Eisenberg 2009-07-06 03:22:53 CEST
Created attachment 108 [details]
Output from build using Java 1.6

This is the output of the following command:
build/build.py all > build_output.txt 2>&1

javac -version returns javac 1.6.0_06
Comment 4 Michael[tm] Smith 2009-07-06 18:26:33 CEST
David,

About the problem in http://bugzilla.validator.nu/attachment.cgi?id=108 - I was able to reproduce that, and Henri checked in a change that fixed it for me. Can sync up the to the latest svn sources and see if it works for you now? 
Comment 5 J David Eisenberg 2009-07-06 19:37:56 CEST
Thank you. The compile errors in the attachment came from a missing JAVA_HOME declaration (I didn't read absolutely everything before submitting; sorry).

Redoing a complete build works great now. Thanks! 
Comment 6 Michael[tm] Smith 2009-07-07 08:44:35 CEST
(In reply to comment #5)
> Thank you. The compile errors in the attachment came from a missing JAVA_HOME
> declaration (I didn't read absolutely everything before submitting; sorry).
> 
> Redoing a complete build works great now. Thanks! 

OK -- so I'll take the liberty of closing this out as resolved, status=fixed