Problems building develoment version

Help
2010-03-24
2013-04-08
  • I have some problems in building the development version (downloaded through cvs). While I have no problem when launching ccg-build on the stable 0.9.3 version, with de development version I get the following message:

    java.lang.ClassNotFoundException: org.apache.tools.ant.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:307)
            at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
            at org.apache.tools.ant.launch.Launcher.run(Launcher.java:255)
            at org.apache.tools.ant.launch.Launcher.main(Launcher.java:104)

    I noticed that the build.xml file has been changed, by my knowledge of ant is insufficient to understand where the error came from.

    Thank you,

    Giuliano Lancioni

     
  • Michael White
    Michael White
    2010-03-24

    Looks like a classpath problem.  This class is supposed to be in ant.jar, as shown below.  The first thing is to check that your lib directory is up to date, but it looks like this jar hasn't been updated for a while.  The next thing to check is that your bin directory is up to date.  If you look at the ccg-build and ccg-env scripts, you can see how the classpaths are set (differently for unix, cygwin and windows).  If you play around with those (eg throw in some echo statements) you should be able to verify what command is being called exactly.  That may help to figure out why the classpath is not working for you.

    mwhite@solanio:~/dev/openccg/lib$ jar tf ant.jar | grep Main
    org/apache/tools/ant/Main.class

     
  • Thank you for your answer. In fact, one major difference (between some added references) between the old, working, ccg-build.bat and the new one which gives some problems is that the classpath

    %JAVA% -classpath %CP% %PROPS% org.apache.tools.ant.Main %*

    has been replaced by

    %JAVA% -classpath %CP% %PROPS% org.apache.tools.ant.launch.Launcher %*

    Could this be the problem?

     
  • Michael White
    Michael White
    2010-03-25

    That shouldn't be the problem, as the 'Launcher' entry point is more general, and works fine on my old XP machine.  I'm using Java 1.5 there, not sure if that's an issue.  It could be that using the old 'Main' entry point in your version will serve as a work-around.

     
  • In fact, it seems to have to do with the libraries.
    If I type jar -tf ant.jar with the 'old' library (openccg version 0.9.3) I correctly get the list of files within the jar.
    If I do the same with the 'new' ant.jar (developer version) I get an error:

    java.lang.IllegalArgumentException
            at java.util.zip.ZipInputStream.getUTF8String(ZipInputStream.java:304)
            at java.util.zip.ZipInputStream.readLOC(ZipInputStream.java:243)
            at java.util.zip.ZipInputStream.getNextEntry(ZipInputStream.java:73)
            at sun.tools.jar.Main.list(Main.java:735)
            at sun.tools.jar.Main.run(Main.java:191)
            at sun.tools.jar.Main.main(Main.java:903)

    In fact, the two ant.jar files have the same date (26/1/2007 in my Italian OS) but slightly different sizes (the 'older' one 1289806 bytes, the 'newer' one 1296145). It looks like the version used in developer has been zipped in a way not understood by my jar utility. I think you can check the same difference if you compare the ant.jar file in your 0.9.3 version with what you're using in the developer version.

    I wonder if replacing the 'newer' ant.jar with the 'older' one will do, and if any difference is implied in that.

     
  • Ok, I found a workaround. I replaced 5 .jar files that were not working:

    ant.jar
    jdom.jar
    jline.jar
    trove.jar
    xercesImpl.jar

    with the versions I found in 0.9.3. The build works fine and I could correctly lanch tccg, but I'm not sure this is the right thing to do…

     
  • Michael White
    Michael White
    2010-04-07

    Thanks for reporting this problem.  I'm not actually able to reproduce it, on linux or windows.  The correct file size for ant.jar should be 1289806 and the correct date should be 2007/01/26.  I think it's a cvs problem, with cvs not realizing it should be treated as a binary file.  There's some chance we'll soon switch over to git, so I think we'll defer this issue for the moment.

     
  • Fine: having things work is good enough. In fact I found a small bug in ccg-editor too (a little black rectangle below the symbols marking direction in the Lexicon tab) - which is strange, since I think the python tool hasn't been touched in 0.9.4 - but I think it's safer to defer non-essential problem to the final release. I'm still mostly using 0.9.3 myself… just curiosity for the hypertagger and other novelties: I couldn't wait!

     
  • Michael White
    Michael White
    2010-04-08

    Glad to hear of your interest in the latest developments.  We appreciate the feedback!  Wish us luck with the next release, it will probably be this summer.

     
  • I confirm Mike is right: the problem is that cvs interprets .jar files as text files. I could find no way to change this in my own computer (using TortoiseCVS); a workaround is manually downloading jar files (from Develop->browse files) and overwriting existing files in lib folder, which will afterwards be recognized as binaries without being overwritten again.

     
  • I was forgetting: good luck with the next release!