2015-10-20 47 views
3

當我啓動遠程代理時,爲什麼會出現以下錯誤?如何使用名稱'agentConfiguration'從創建bean的錯誤中恢復?

代理無法啓動,並持續顯示此錯誤

INFO | jvm 21 | 2015/10/20 12:12:27 | [Fatal Error] :-1:-1: Premature end of file. 
INFO | jvm 21 | 2015/10/20 12:12:27 | Exiting due to fatal exception. 
INFO | jvm 21 | 2015/10/20 12:12:27 | java.lang.reflect.InvocationTargetException 
INFO | jvm 21 | 2015/10/20 12:12:27 |  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 
INFO | jvm 21 | 2015/10/20 12:12:27 |  at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) 
INFO | jvm 21 | 2015/10/20 12:12:27 |  at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) 
INFO | jvm 21 | 2015/10/20 12:12:27 |  at java.lang.reflect.Method.invoke(Method.java:606) 
INFO | jvm 21 | 2015/10/20 12:12:27 |  at com.atlassian.bamboo.agent.bootstrap.AgentRunner.run(AgentRunner.java:28) 
INFO | jvm 21 | 2015/10/20 12:12:27 |  at java.lang.Thread.run(Thread.java:745) 
INFO | jvm 21 | 2015/10/20 12:12:27 | Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'agentConfiguration' defined in class path resource [applicationContextRemoteAgent.xml]: Invocation of init method failed; nested exception is com.atlassian.bamboo.configuration.ConfigurationException: Could not load configuration file bamboo-agent.cfg.xml from /home/bamboo_path/bamboo-agent-home 
INFO | jvm 21 | 2015/10/20 12:12:27 |  at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1553) 
INFO | jvm 21 | 2015/10/20 12:12:27 |  at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:539) 
INFO | jvm 21 | 2015/10/20 12:12:27 |  at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:475) 
INFO | jvm 21 | 2015/10/20 12:12:27 |  at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:302) 
INFO | jvm 21 | 2015/10/20 12:12:27 |  at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:228) 
... 
INFO | jvm 21 | 2015/10/20 12:12:27 |  at com.atlassian.bamboo.v2.build.agent.remote.RemoteAgent.start(RemoteAgent.java:68) 
INFO | jvm 21 | 2015/10/20 12:12:27 |  ... 6 more 
INFO | jvm 21 | 2015/10/20 12:12:27 | Caused by: com.atlassian.bamboo.configuration.ConfigurationException: Could not load configuration file bamboo-agent.cfg.xml from /home/bamboo_path/bamboo-agent-home 
INFO | jvm 21 | 2015/10/20 12:12:27 |  at com.atlassian.bamboo.v2.build.agent.remote.AgentConfiguration.initConfiguration(AgentConfiguration.java:101) 
INFO | jvm 21 | 2015/10/20 12:12:27 |  at com.atlassian.bamboo.v2.build.agent.remote.AgentConfiguration.init(AgentConfiguration.java:62) 
INFO | jvm 21 | 2015/10/20 12:12:27 |  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 
... 
INFO | jvm 21 | 2015/10/20 12:12:27 |  ... 19 more 
INFO | jvm 21 | 2015/10/20 12:12:27 | Caused by: org.apache.commons.configuration.ConfigurationException: Premature end of file. 
INFO | jvm 21 | 2015/10/20 12:12:27 |  at org.apache.commons.configuration.XMLConfiguration.load(XMLConfiguration.java:673) 

我使用竹Server實例,5.8.1 代理在JDK 1.7

回答

2

運行正如你可以看到從:

INFO | jvm 21 | 2015/10/20 12:12:27 | Caused by: com.atlassian.bamboo.configuration.ConfigurationException: Could not load configuration file bamboo-agent.cfg.xml from /home/bamboo_path/bamboo-agent-home 
INFO | jvm 21 | 2015/10/20 12:12:27 |  at com.atlassian.bamboo.v2.build.agent.remote.AgentConfiguration.initConfiguration(AgentConfiguration.java:101) 

文件竹agent.cfg.xml無法加載。在這種情況下,我發現文件已損壞,使代理在啓動時掛起。

此文件應採用以下格式:

<?xml version="1.0" encoding="UTF-8" standalone="no"?> 
<configuration> 
<buildWorkingDirectory>/home/bamboo_path/bamboo-agent-home/xml-data/build-dir</buildWorkingDirectory> 
<agentUuid>aaaaaaaa-bbbb-aaaa-aaaa-aaaaaaaaaaaa</agentUuid> 
<agentDefinition> 
<id>14221333</id> 
<name>Java Compiler</name> 
</agentDefinition> 
</configuration> 

我發現那是什麼,當我刪除損壞的文件,然後重新啓動代理,它將開始。但它會註冊爲新代理。使所有代理專用或自定義功能設置丟失。

您可以找到舊的代理的定義,竹管理面板

的https _ // bamboo.myurl.com/admin/agent/viewAgent.action?agentId=1234567

複製粘貼名稱和代理商ID爲bamboo-agent.cfg.xml並啓動代理。

相關問題