Could not initialize class com.intellij.util.ui.UIUtil

Server fails to apply patch. Here is the last lines of logs/teamcity-agent.log:

[2010-01-07 10:46:24,670]   INFO -    jetbrains.buildServer.AGENT - Checkout directory: /home/daniel/BuildAgent/work/33386dcf6647d9a3
[2010-01-07 10:46:24,670]   INFO - rver.agent.impl.BuildRunAction - Call stage jetbrains.buildServer.agent.impl.runStages.CheckoutSourcesStage
[2010-01-07 10:46:24,670]   INFO -    jetbrains.buildServer.AGENT - Getting sources...
[2010-01-07 10:46:24,671]   INFO -    jetbrains.buildServer.AGENT - Requesting patch from server, full checkout - true
[2010-01-07 10:46:24,671]   INFO -    jetbrains.buildServer.AGENT - Copying patch to temp file...
[2010-01-07 10:46:59,396]   WARN -    jetbrains.buildServer.AGENT - Exception occurred while patch applying:Could not initialize class com.intellij.util.ui.UIUtil
java.lang.NoClassDefFoundError: Could not initialize class com.intellij.util.ui.UIUtil
        at com.intellij.CommonBundle.messageOrDefault(
        at com.intellij.CommonBundle.message(
        at com.intellij.CommonBundle.message(
        at com.intellij.openapi.util.text.StringUtil.formatFileSize(
        at jetbrains.buildServer.util.StringUtil.formatFileSize(
        at jetbrains.buildServer.agent.impl.patch.ProjectSourcesGetter$8.nextPortionWritten(
        at jetbrains.buildServer.util.TCStreamUtil.writeBinary(
        at jetbrains.buildServer.agent.impl.patch.ProjectSourcesGetter.copyStreamToFileAndCloseStream(
        at jetbrains.buildServer.agent.impl.patch.ProjectSourcesGetter.copyPatchToTempFile(
        at jetbrains.buildServer.agent.impl.patch.ProjectSourcesGetter.loadAndApplyPatch(
        at jetbrains.buildServer.agent.impl.patch.ProjectSourcesGetter.access$400(
        at jetbrains.buildServer.agent.impl.patch.ProjectSourcesGetter$4.execute(
        at jetbrains.buildServer.agent.impl.patch.ProjectSourcesGetter.executePatchProcess(
        at jetbrains.buildServer.agent.impl.patch.ProjectSourcesGetter.applyPatch(
        at jetbrains.buildServer.agent.impl.patch.ProjectSourcesGetter.execute(
        at jetbrains.buildServer.agent.impl.runStages.CheckoutSourcesStage.doGetSources(
        at jetbrains.buildServer.agent.impl.runStages.CheckoutSourcesStage.doRecoverableStage(
        at jetbrains.buildServer.agent.impl.runStages.RecoverableBuildStage.doBuildStage(
        at jetbrains.buildServer.agent.impl.BuildRunAction.doStages(
        at jetbrains.buildServer.agent.impl.BuildRunAction.access$000(
        at jetbrains.buildServer.agent.impl.BuildRunAction$
[2010-01-07 10:46:59,398]   INFO -    jetbrains.buildServer.AGENT - Sources updated for 34s
[2010-01-07 10:46:59,403]   WARN - runStages.CheckoutSourcesStage - Cannot apply patch. Status: UNSUCCESSFUL. Build 7761 will be interrupted.
[2010-01-07 10:46:59,404]   INFO -    jetbrains.buildServer.AGENT - Build finished: 7761
[2010-01-07 10:46:59,412]   INFO - ctories.CleanupRegistryCleaner - Start deleting files from /home/daniel/BuildAgent/temp/.old
[2010-01-07 10:46:59,483]   INFO - ctories.CleanupRegistryCleaner - Stop deleting files from /home/daniel/BuildAgent/temp/.old. 3 file(s) were deleted.

What could be the problem? Server 4.5.5 and agent is Ubuntu 8.04:

roger:/home/daniel/BuildAgent/work/33386dcf6647d9a3> uname -a
Linux roger 2.6.24-16-server #1 SMP Thu Apr 10 13:58:00 UTC 2008 i686 GNU/Linux

Thanks in advance!

This bug is already fixed in TeamCity 5.0.1. It seems it has something to do with locale. Please check under what locale the agent is running, try to change it to english.


I have another agent running Ubuntu 9.04 which is working fine. It seems both agents, the one with the problem and the one that is working, both have the same locale set.

Working (with Ubuntu 9.04):

georog-dev:/home/daniel/projects> echo $LANG

Faulty (with Ubuntu 8.04):
roger:/home/daniel/BuildAgent/bin> echo $LANG

Should I try to set LANG to something else? Or is there anything else I can try? We are not quite ready to upgrade to TC 5 yet.
Thanks in advance!

Here's additional information about the problematic agent:

Additional properties defined by JVM and agent runtime

agent.home.dir /home/daniel/BuildAgent Roger The Great /home/daniel/BuildAgent/work
file.encoding UTF-8
file.separator /
os.arch i386 Linux
os.version 2.6.24-16-server
path.separator : /home/daniel/BuildAgent/temp/buildTmp US
user.home /home/daniel
user.language en daniel
user.timezone Europe/Stockholm

Do you have X windows started on the agent where all works correctly?


I did export TEAMCITY_AGENT_OPTS=-Duser.language=en and then restarted agent. It seems to work ok now. Thank you very much!


Please sign in to leave a comment.