AntRunner can't find org.apache.oro. lib

When I run Ant at the commandline my build succeeds, but kicking off the same buildscript/workingdir from TeamCity I get this error:

java.lang.NoClassDefFoundError: org/apache/oro/text/perl/Perl5Util


I tried setting my Ant-home explicitly for my project, but no difference.  Can someone tell me how to get the AntRunner to recognize all the jars under my Ant\lib?

4 comments
Comment actions Permalink

More information:  Here's your commandline when I try to build:

C:\java\jdk1.6.0_05\bin\java.exe "-Dteamcity.buildConfName=Sales Dashboard windows build" -DDotNetFramework1.1_Path=c:\WINDOWS\Microsoft.NET\Framework\v1.1.4322 -Dagent.home.dir=C:\BuildAgent -DDotNetFramework3.0= -Dbuild.number=6 -Dteamcity.dotnet.nunitlauncher2.0=C:\BuildAgent\plugins\dotnetPlugin\bin\JetBrains.BuildServer.NUnitLauncher2.0.exe -Duser.language=en -Dos.version=5.1 -DDotNetFramework3.0_x86= -Dfile.encoding=Cp1252 "-Dteamcity.projectName=System Test 2.0" -DDotNetFramework2.0_x86_Path=c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727 -Dteamcity.dotnet.nunitlauncher2.0.vsts=C:\BuildAgent\plugins\dotnetPlugin\bin\JetBrains.BuildServer.NUnitLauncher2.0.VSTS.exe -DDotNetFramework2.0_Path=c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727 "-DWindowsSDK6.0A_Path=C:\Program Files\Microsoft SDKs\Windows\v6.0A" -Dteamcity.dotnet.coveragelauncher=C:\BuildAgent\plugins\dotnetPlugin\bin\TeamCityRunners\JetBrains.dotTrace.TeamCity.CoverageRunner.exe -Djava.io.tmpdir=C:\BuildAgent\temp\buildTmp -Dteamcity.dotnet.nunitlauncher=C:\BuildAgent\plugins\dotnetPlugin\bin\JetBrains.BuildServer.NUnitLauncher.exe -Duser.name=tcbuild -Dant.task.extensions=jetbrains.buildServer.agent.ant.CompilerAntExtension,jetbrains.buildServer.agent.ant.EchoAntExtension,jetbrains.buildServer.agent.ant.JUnitFirstTestsToRunExtension,jetbrains.buildServer.coverage.AntCoverageAdapter,jetbrains.buildServer.testng.TestNGTaskExtension,jetbrains.buildServer.testng.TestNGFirstTestsToRunExtension, -DDotNetFramework3.5_Path=c:\WINDOWS\Microsoft.NET\Framework\v3.5 "-Dteamcity.version=4.0.1 (build 8171)" -DDotNetFramework3.0_Path=c:\WINDOWS\Microsoft.NET\Framework\v3.0 -Dteamcity.auth.password=Hq9IhNHFpHv4cHSCTvvr8k33FlXen6w2 -Dteamcity.build.checkoutDir=C:\LNTeamCityBuilds\SalesDashboard -DDotNetFramework3.5= -Dteamcity.buildType.id=bt23 "-DDotNetFrameworkSDK2.0_Path=C:\Tools\Microsoft Visual Studio 8\SDK\v2.0" -Dteamcity.dotnet.nunitlauncher1.1=C:\BuildAgent\plugins\dotnetPlugin\bin\JetBrains.BuildServer.NUnitLauncher1.1.exe "-DMSTest.9.0=C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\MSTest.exe" -Duser.variant= "-DWindowsSDK6.0_Path=C:\Program Files\Microsoft SDKs\Windows\v6.0A" -Dagent.classpath=C:/BuildAgent/lib/xstream-1.2.1.jar;C:/BuildAgent/lib/server-logging.jar;C:/BuildAgent/plugins/coveragePlugin/lib/coverageAgentRuntime.jar;C:/BuildAgent/plugins/antPlugin/lib/buildServerAntServerLogging.jar;C:/BuildAgent/lib/xmlrpc-2.0.1.jar;C:/BuildAgent/lib/common-api.jar;C:/BuildAgent/lib/commons-codec-1.3.jar;C:/BuildAgent/plugins/testNGPlugin/lib/testNGAntExtension.jar;C:/BuildAgent/lib/xpp3_min-1.1.3.4.M.jar;C:/BuildAgent/plugins/coveragePlugin/lib/emma.jar -Dteamcity.dotnet.nunitlauncher.msbuild.task=C:\BuildAgent\plugins\dotnetPlugin\bin\JetBrains.BuildServer.MSBuildLoggers.dll -DDotNetFramework3.5_x86_Path=c:\WINDOWS\Microsoft.NET\Framework\v3.5 -Didea.build.server.build.id=1682 -Dant.home=C:\Tools\apache-ant-1.7.0 -Dpath.separator=; -Dteamcity.build.properties.file=C:\BuildAgent\temp\agentTmp\teamcity.build1179.properties -Dteamcity.build.workingDir=C:\LNTeamCityBuilds\SalesDashboard\src\release\SalesDashboard "-DVS2005_Path=C:\Tools\Microsoft Visual Studio 8\Common7\IDE" -DDotNetFrameworkSDK2.0= -Dagent.name=RES-KOVERTON -Dbuild.number.format={0} -DDotNetFramework1.1= -Dteamcity.dotnet.platform=C:\BuildAgent\plugins\dotnetPlugin\bin\JetBrains.TeamCity.PlatformProcessRunner.1.1.exe -DWindowsSDK6.0= -DWindowsSDK6.0A= -Duser.country=US -Duser.timezone=America/New_York -DDotNetFramework2.0_x86= -Dfile.separator=\ -DVS2005= -Dagent.work.dir=C:\BuildAgent\work "-DVS2008_Path=C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE" -Dos.arch=x86 -DDotNetFramework1.1_x86_Path=c:\WINDOWS\Microsoft.NET\Framework\v1.1.4322 -DDotNetFramework3.0_x86_Path=c:\WINDOWS\Microsoft.NET\Framework\v3.0 -DDotNetFramework2.0= -DDotNetFramework1.1_x86= -Dteamcity.build.tempDir=C:\BuildAgent\temp\buildTmp -Dbuild.vcs.number=284451 -Dbuild.vcs.number.1=284451 "-Dos.name=Windows XP" -Dteamcity.dotnet.nunitaddin=C:\BuildAgent\plugins\dotnetPlugin\bin\JetBrains.TeamCity.NUnitAddin-NUnit -Didea.build.agent.port=9090 -DDotNetFramework3.5_x86= -Dteamcity.auth.userId=TeamCityBuildId=1682 -Dagent.flow=793047543630048 -Dteamcity.agent.cpuBenchmark=162 -DDotNetFrameworkSDK2.0_x86= "-Duser.home=C:\Documents and Settings\tcbuild" "-DDotNetFrameworkSDK2.0_x86_Path=C:\Tools\Microsoft Visual Studio 8\SDK\v2.0" -DVS2008= -Dbuild.vcs.number.SalesDashboardP4Client=284451 -classpath C:\Tools\apache-ant-1.7.0\lib\ant-launcher.jar org.apache.tools.ant.launch.Launcher -lib C:/BuildAgent/lib/runtime-util.jar;C:/BuildAgent/plugins/antPlugin/lib/buildServerAntRuntime.jar -listener jetbrains.buildServer.agent.ant.AgentBuildListener -buildfile C:\LNTeamCityBuilds\SalesDashboard\src\release\SalesDashboard\build.xml all Buildfile: C:\LNTeamCityBuilds\SalesDashboard\src\release\SalesDashboard\build.xml

And here's mine when I run ant at the command prompt:
"C:\Program Files\Java\jdk1.6.0_12\bin\java.exe"  -classpath "c:\Tools\apache-ant-1.7.0\lib\ant-launcher.jar" "-Dant.home=c:\Tools\apache-ant-1.7.0" org.apache.tools.ant.launch.Launcher  -cp "C:\TimesTen\tt60\lib\classes14.jar;.;C:\Program Files\Java\jre1.6.0_07\lib\ext\QTJava.zip" build
Buildfile: build.xml


Could it be that somewhere in "-lib C:/BuildAgent/lib/runtime-util.jar;C:/BuildAgent/plugins/antPlugin/lib/buildServerAntRuntime.jar "  you are overriding something loaded by ant-launcher?

0
Comment actions Permalink

I haven't completely solved this, but I did figure out that the lib in question is *not* part of the regular ant distribution, it was a specific jar included on the build path for this Ant build.xml script.

In short, this is not a TeamCity issue, it's just a matter of getting the environment for this build under TeamCity correct.

0
Comment actions Permalink

Hello Ken,

  You should be able to specify custom ANT_HOME path on the TeamCity build runner page. The path can be absolute or relative to checkout directory.

  Hope this helps,
  KIR

0
Comment actions Permalink

Thanks, Kirill, it turns out the jars weren't in *that* directory either.  There were in a deployment-specific location, so I solved this by adding the 'libs <blah>' flag to my ant commandline for that build.

Cheers,

--kov

0

Please sign in to leave a comment.