[kaffe] Adventures in building JBoss with Kaffe
Dalibor Topic
robilad at kaffe.org
Fri Jun 18 18:49:02 PDT 2004
Hi all,
I decided to start a small JBoss building experiment today, by going
back in time, and starting with the earliest Jboss release for which I
could find source [1], trying to build it with anrt and kaffe. Here are
the results:
JBoss 2.4.3:
bash-2.05a$ tail -f /tmp/topic/orig/2.4.3/build.log.kjc
[snip]
/var/tmp/topic/orig/2.4.3/jboss/src/main/org/jboss/util/FileURLPatch.java:51:
error:Cannot find type "sun/net/www/protocol/file/Handler"
Yeah, well, everyone knows you should not use sun.* classes, right? Or
at least be sane enough not to import them directly. :)
JBoss 2.4.4:
[javac]
/var/tmp/topic/orig/JBoss-2.4.4-src/jboss/src/main/org/jboss/util/FileURLPatch.java:51:
error:Cannot find type "sun/net/www/protocol/file/Handler"
Ahem. On a side note, the ant build uses CVS to check out some stuff
from the JBoss server. Doesn't make too much sense to me in a released
source tarball.
JBoss 2.4.9:
It still tries to grab something from the JBoss CVS server, whatever it
is. It takes half an hour to do it, ao it has improved at least tenfold
since 2.4.4, which took just a few minutes. It still fails with:
[javac]
/var/tmp/topic/orig/JBoss-2.4.9-src/jboss/src/main/org/jboss/util/FileURLPatch.java:51:
error:Cannot find type "sun/net/www/protocol/file/Handler"
JBoss 3.0.8:
This one fails squarely on kaffe's URL handler handling, somehow.
bash-2.05a$ ant -verbose -Dbuild.compiler=kjc
-Djava.protocol.handler.pkgs=org.jboss.net.protocol
Unable to locate tools.jar. Expected to find it in
/tmp/topic/orig/current//lib/tools.jar
Apache Ant version 1.6.1 compiled on February 12 2004
Buildfile: build.xml
Detected Java version: 1.4 in: /tmp/topic/orig/current/
Detected OS: Linux
parsing buildfile /var/tmp/topic/orig/jboss-3.0.8-src/build/build.xml
with URI = file:///var/tmp/topic/orig/jboss-3.0.8-src/build/build.xml
Project base dir set to: /var/tmp/topic/orig/jboss-3.0.8-src/build
resolving systemId: resource://org/jboss/tools/buildmagic/common.xml
BUILD FAILED
Error reading project file
/var/tmp/topic/orig/jboss-3.0.8-src/build/build.xml: Protocol handler
not found: resource
at org.apache.tools.ant.helper.ProjectHelper2.parse
(ProjectHelper2.java:238)
at org.apache.tools.ant.helper.ProjectHelper2.parse
(ProjectHelper2.java:133)
at org.apache.tools.ant.ProjectHelper.configureProject
(ProjectHelper.java:89)
at org.apache.tools.ant.Main.runBuild (Main.java:617)
at org.apache.tools.ant.Main.startAnt (Main.java:183)
at org.apache.tools.ant.launch.Launcher.run (Launcher.java:197)
at org.apache.tools.ant.launch.Launcher.main (Launcher.java:56)
Caused by: java.net.MalformedURLException: Protocol handler not found:
resource
at java.net.URL.<init> (URL.java:438)
at java.net.URL.<init> (URL.java:316)
at org.apache.xerces.impl.XMLEntityManager.setupCurrentEntity
(source file unknown)
at org.apache.xerces.impl.XMLEntityManager.startEntity (source file
unknown)
at org.apache.xerces.impl.XMLEntityManager.startEntity (source file
unknown)
at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanEntityReference
(source file unknown)
at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch
(source file unknown)
at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument
(source file unknown)
at org.apache.xerces.parsers.XML11Configuration.parse (source file
unknown)
at org.apache.xerces.parsers.XML11Configuration.parse (source file
unknown)
at org.apache.xerces.parsers.XMLParser.parse (source file unknown)
at org.apache.xerces.parsers.AbstractSAXParser.parse (source file
unknown)
at org.apache.tools.ant.helper.ProjectHelper2.parse
(ProjectHelper2.java:210)
...6 more
--- Nested Exception ---
java.net.MalformedURLException: Protocol handler not found: resource
at java.net.URL.<init> (URL.java:438)
at java.net.URL.<init> (URL.java:316)
at org.apache.xerces.impl.XMLEntityManager.setupCurrentEntity
(source file unknown)
at org.apache.xerces.impl.XMLEntityManager.startEntity (source file
unknown)
at org.apache.xerces.impl.XMLEntityManager.startEntity (source file
unknown)
at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanEntityReference
(source file unknown)
at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch
(source file unknown)
at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument
(source file unknown)
at org.apache.xerces.parsers.XML11Configuration.parse (source file
unknown)
at org.apache.xerces.parsers.XML11Configuration.parse (source file
unknown)
at org.apache.xerces.parsers.XMLParser.parse (source file unknown)
at org.apache.xerces.parsers.AbstractSAXParser.parse (source file
unknown)
at org.apache.tools.ant.helper.ProjectHelper2.parse
(ProjectHelper2.java:210)
at org.apache.tools.ant.helper.ProjectHelper2.parse
(ProjectHelper2.java:133)
at org.apache.tools.ant.ProjectHelper.configureProject
(ProjectHelper.java:89)
at org.apache.tools.ant.Main.runBuild (Main.java:617)
at org.apache.tools.ant.Main.startAnt (Main.java:183)
at org.apache.tools.ant.launch.Launcher.run (Launcher.java:197)
at org.apache.tools.ant.launch.Launcher.main (Launcher.java:56)
JBoss 3.2.4:
The build dies early, too, because of a problem with kjc:
[snip]
Caused by: java.lang.NullPointerException
at at.dms.kjc.CClass.descendsFrom (CClass.java:357)
at at.dms.kjc.CMember.isAccessible (CMember.java:210)
at at.dms.kjc.CClass.isAccessible (CClass.java:1239)
at at.dms.kjc.CClass.lookupClass (CClass.java:570)
at at.dms.kjc.CClassNameType.checkType (CClassNameType.java:194)
at at.dms.kjc.JTypeDeclaration.join (JTypeDeclaration.java:196)
at at.dms.kjc.JClassDeclaration.join (JClassDeclaration.java:127)
at at.dms.kjc.JCompilationUnit.join (JCompilationUnit.java:172)
at at.dms.kjc.Main.join (Main.java:383)
at at.dms.kjc.Main.run (Main.java:160)
at at.dms.kjc.Main.compile (Main.java:70)
at java.lang.reflect.Method.invoke0 (Method.java)
...29 more
JBoss 4.0.0.DR4:
BUILD FAILED
java.lang.NullPointerException
at java.util.zip.ZipFile.getZipData0 (ZipFile.java)
at java.util.zip.ZipFile.getInputStream (ZipFile.java:102)
at org.apache.tools.ant.loader.AntClassLoader2.addPathFile
(AntClassLoader2.java:253)
at org.apache.tools.ant.AntClassLoader.addPathElement
(AntClassLoader.java:448)
at org.apache.tools.ant.AntClassLoader.setClassPath
(AntClassLoader.java:348)
at org.apache.tools.ant.Project.createClassLoader (Project.java:304)
at
org.apache.tools.ant.util.ClasspathUtils.getUniqueClassLoaderForPath
(ClasspathUtils.java:209)
at org.apache.tools.ant.util.ClasspathUtils.getClassLoaderForPath
(ClasspathUtils.java:185)
at org.apache.tools.ant.util.ClasspathUtils$Delegate.getClassLoader
(ClasspathUtils.java:403)
at org.apache.tools.ant.taskdefs.DefBase.createLoader (DefBase.java:136)
at org.apache.tools.ant.taskdefs.Definer.execute (Definer.java:163)
at org.apache.tools.ant.UnknownElement.execute (UnknownElement.java:269)
at org.apache.tools.ant.Task.perform (Task.java:364)
at org.apache.tools.ant.Target.execute (Target.java:301)
at org.apache.tools.ant.Target.performTasks (Target.java:328)
at org.apache.tools.ant.Project.executeTarget (Project.java:1215)
at org.apache.tools.ant.Project.executeTargets (Project.java:1063)
at org.apache.tools.ant.Main.runBuild (Main.java:632)
at org.apache.tools.ant.Main.startAnt (Main.java:183)
at org.apache.tools.ant.launch.Launcher.run (Launcher.java:197)
at org.apache.tools.ant.launch.Launcher.main (Launcher.java:56)
Okay, looks like some problem with our Zip code :(
So, I guess the more interesting JBoss builds are from version 3 on,
since earlier it seems to use some really ugly sun.* classes, that no
free platform can implement. It's still a widely used practice in JBoss
3.0.8, unfortunately, so it's probably impossible to build JBoss 3.0.8
on a free runtime. Finally, I've also looked at 3.2.4, which also
imports sun classes, but much less, only from the somewhat documented as
part of JSSE com.sun.net.ssl package, and of course the classical
mistake, sun's Base64 encoder[2].
cheers,
dalibor topic
[1] Forget the JBoss download page, and go straight to
http://sourceforge.net/project/showfiles.php?group_id=22866 to get all
files.
[2] Why people still use that in 2004 is beyound me. jakarta commons
codec has been there for years now.
More information about the kaffe
mailing list