Community
Participate
Working Groups
Invoking /usr/bin/sign on build.eclipse.org answers: Error: Could not find or load main class org.apache.tools.ant.launch.Launcher I figured that ant was not correctly found, so I did: $ export ANT_HOME=/opt/public/common/apache-ant-1.8.1 Then I got: Buildfile: /opt/public/download-staging.priv/tools/objectteams/in/otdt.zip.ant.xml doIt: [addPackProperties] verbose logging is enabled [addPackProperties] filenameonly: otdt [addPackProperties] Finding jars already signed [addPackProperties] destinationdirectory: /tmp/otdt/ [addPackProperties] successfully removed temporary desination directory: /tmp/otdt [addPackProperties] entryname: features/org.eclipse.objectteams.otequinox_2.5.0.201603191911.jar BUILD FAILED /opt/public/download-staging.priv/tools/objectteams/in/otdt.zip.ant.xml:9: java.io.FileNotFoundException: /tmp/otdt/features/org.eclipse.objectteams.otequinox_2.5.0.201603191911.jar (No such file or directory)
(In reply to Stephan Herrmann from comment #0) > [addPackProperties] successfully removed temporary desination directory: > /tmp/otdt ... > /opt/public/download-staging.priv/tools/objectteams/in/otdt.zip.ant.xml:9: > java.io.FileNotFoundException: > /tmp/otdt/features/org.eclipse.objectteams.otequinox_2.5.0.201603191911.jar > (No such file or directory) Looks like something is looking for a file in a temp dir that got removed just moments before.
This looks like the same issue as bug 489890, which is blocking the Mylyn release build.
*** This bug has been marked as a duplicate of bug 489890 ***
Verified as working after the fixes in bug 489890 *iff* ANT_HOME is set prior to calling /usr/bin/sign (this wasn't needed previously).
(In reply to Stephan Herrmann from comment #4) > Verified as working after the fixes in bug 489890 *iff* ANT_HOME is set > prior to calling /usr/bin/sign (this wasn't needed previously). An ant task has been added as part Bug 487857 (reason why there is some changes compared to previously). However, it is weird you have to set it by yourself. ANT_HOME is defined that way in for /usr/bin/sign ANT_HOME="${ANT_HOME:-/shared/common/apache-ant-latest}" Meaning ANT_HOME keeps its value if it set and not null, otherwise, it takes the value "/shared/common/apache-ant-latest". So in your environment $ANT_HOME must be defined to an incorrect path and you need to fix it. Could you try to echo $ANT_HOME before you set it to call /usr/bin/sign? Thanks.
(In reply to Mikaël Barbero from comment #5) > [...] > So in your environment $ANT_HOME must be defined to an incorrect path and > you need to fix it. Could you try to echo $ANT_HOME before you set it to > call /usr/bin/sign? Thanks. If ANT_HOME is unset prior to calling sign then all I get is: "Error: Could not find or load main class org.apache.tools.ant.launch.Launcher" (In reply to Mikaël Barbero from comment #5) > However, it is weird you have to set it by yourself. ANT_HOME is defined > that way in for /usr/bin/sign > > ANT_HOME="${ANT_HOME:-/shared/common/apache-ant-latest}" I don't see anything like that in /usr/bin/sign
(In reply to Stephan Herrmann from comment #6) > (In reply to Mikaël Barbero from comment #5) > > [...] > > So in your environment $ANT_HOME must be defined to an incorrect path and > > you need to fix it. Could you try to echo $ANT_HOME before you set it to > > call /usr/bin/sign? Thanks. > > If ANT_HOME is unset prior to calling sign then all I get is: > > "Error: Could not find or load main class > org.apache.tools.ant.launch.Launcher" You're sure it is "unset" (in the bash sense)? It looks like the ant bin is properly started but the computed classpath to actually start the ant main class is incorrect. Could you please try to to print the value of $ANT_HOME *before* your call to /usr/bin/sign? > (In reply to Mikaël Barbero from comment #5) > > However, it is weird you have to set it by yourself. ANT_HOME is defined > > that way in for /usr/bin/sign > > > > ANT_HOME="${ANT_HOME:-/shared/common/apache-ant-latest}" > > I don't see anything like that in /usr/bin/sign It is defined in the source "config" file from http://git.eclipse.org/c/cbi/org.eclipse.cbi.git/tree/cli-tools/signing/jar/sign#n36. An example of such a file can be seen here http://git.eclipse.org/c/cbi/org.eclipse.cbi.git/tree/cli-tools/signing/jar/config.sample. On build.eclipse.org, ANT_HOME is define like this ANT_HOME="${ANT_HOME:-/shared/common/apache-ant-latest}" in the config file.
(In reply to Mikaël Barbero from comment #7) > You're sure it is "unset" (in the bash sense)? yes > It looks like the ant bin is > properly started but the computed classpath to actually start the ant main > class is incorrect. FWIW: $ which ant /usr/local/bin/ant > Could you please try to to print the value of $ANT_HOME > *before* your call to /usr/bin/sign? echo "signing will use ANT_HOME=\"${ANT_HOME}\"" prints: signing will use ANT_HOME="" > > (In reply to Mikaël Barbero from comment #5) > On build.eclipse.org, ANT_HOME is define like this > > ANT_HOME="${ANT_HOME:-/shared/common/apache-ant-latest}" > > in the config file. I'm on build and I do see that line in the config file in sign's real directory. Maybe the ANT_HOME declaration just needs to be "export"ed? Compare: $ ANT_HOME="${ANT_HOME:-/shared/common/apache-ant-latest}" $ myScriptInvokingSign signing will use ANT_HOME="" Error: Could not find or load main class org.apache.tools.ant.launch.Launcher $ export ANT_HOME="${ANT_HOME:-/shared/common/apache-ant-latest}" $ myScriptInvokingSign works (only floods the console with "[addPackProperties] ..." log messages)
(In reply to Stephan Herrmann from comment #8) > > Could you please try to to print the value of $ANT_HOME > > *before* your call to /usr/bin/sign? > > echo "signing will use ANT_HOME=\"${ANT_HOME}\"" > prints: > signing will use ANT_HOME="" uhm... weird > > > (In reply to Mikaël Barbero from comment #5) > > On build.eclipse.org, ANT_HOME is define like this > > > > ANT_HOME="${ANT_HOME:-/shared/common/apache-ant-latest}" > > > > in the config file. > > I'm on build and I do see that line in the config file in sign's real > directory. > > Maybe the ANT_HOME declaration just needs to be "export"ed? > > Compare: > $ ANT_HOME="${ANT_HOME:-/shared/common/apache-ant-latest}" > $ myScriptInvokingSign > signing will use ANT_HOME="" > Error: Could not find or load main class org.apache.tools.ant.launch.Launcher > > $ export ANT_HOME="${ANT_HOME:-/shared/common/apache-ant-latest}" > $ myScriptInvokingSign > > works (only floods the console with "[addPackProperties] ..." log messages) Initially, I wanted to avoid to export the variables from the config file as we just need them in the current sign script and I did not want these variables to affect any subshell command. I overlooked that ${ANT_HOME}/bin/ant use ${ANT_HOME} itself so if ${ANT_HOME} is used to start the ant bin, ${ANT_HOME} need to be exported. I just fixed that in the config file (both on the deployed service and in the sample file on git). Thanks for your help.
Merged in master http://git.eclipse.org/c/cbi/org.eclipse.cbi.git/commit/?id=921862e0af8c022b92774f5765dda0c3ec113a4d