Error loading java agent in

Troubleshooting Java Agent Issues On this page: Related pages: This topic discusses techniques for troubleshooting agent installation and operation. In particular, it describes how to find and interpret information in agent log files. Resolving Java Agent Startup Issues The first thing the Java agent does upon application startup is register with the Controller. Once […]

Содержание

  1. Troubleshooting Java Agent Issues
  2. Resolving Java Agent Startup Issues
  3. Locating the Java Agent Log Files
  4. Resolving Incomplete Agent Configuration Issues
  5. Unblocking the Controller Port
  6. Correcting File Permission Issues
  7. Maximum Async Handoff Call Graph Samples Error
  8. Troubleshooting Java Agent Issues
  9. Resolve Java Agent Startup Issues
  10. Locate the Java Agent Log Files
  11. Resolve Incomplete Agent Configuration Issues
  12. Unblock the Controller Port
  13. Correct File Permission Issues
  14. Maximum Async Handoff Call Graph Samples Error
  15. Fatal Transport Error W hile Connecting to URL
  16. Troubleshooting Java Agent Issues
  17. Resolving Java Agent Startup Issues
  18. Locating the Java Agent Log Files
  19. Resolving Incomplete Agent Configuration Issues
  20. Unblocking the Controller Port
  21. Correcting File Permission Issues
  22. Maximum Async Handoff Call Graph Samples Error

Troubleshooting Java Agent Issues

On this page:

Related pages:

This topic discusses techniques for troubleshooting agent installation and operation. In particular, it describes how to find and interpret information in agent log files.

Resolving Java Agent Startup Issues

The first thing the Java agent does upon application startup is register with the Controller. Once registered, the agent should appear in the Settings > AppDynamics Agents list.

If you do not see the agent in the list within a few minutes, check the following:

  1. Make sure you have restarted the application server.
  2. Verify that the javaagent argument has been added to the startup script of your JVM.
  3. Verify that you configured the agent-controller communication properties and agent identification properties in the controller-info.xml file or as system properties in the startup script of your JVM. See Java Agent Configuration Properties .
  4. Check the Agent logs directory located at /logs/ for the agent.log file.
  5. Verify that the Agent is compatible with the Controller. For details see Agent and Controller Compatibility .

Locating the Java Agent Log Files

Agent log files are located in the /logs/ folder.

The agent.log file is the recommended file to help you with troubleshooting. This log can indicate the following:

Error messages related to starting the Java Agent use this format:

Resolving Incomplete Agent Configuration Issues

The following table lists the typical error messages for incomplete Agent configuration:

Cannot connect to the Agent — ERROR com.singularity.XMLConfigManager —
Incomplete Agent Identity data, Invalid Controller Port Value

This indicates that the value for the Controller port in controller-info.xml is missing. Add the Controller port and host value to resolve:

  • For on-premises Controller installations: 8090 for HTTP and 8181 for HTTPS.
  • For Controller SaaS service, use the default HTTPS port 443.

Caused by: com.singularity.ee.agent.configuration.a:
Could not resolve agent-controller basic configuration

This is usually caused because of incorrect configuration in the Controller-info.xml file.

Ensure that the information for agent communication (Controller host and port) and agent identification (application, tier and node names) is correctly configured.

Alternatively, you can also use the system properties (-D options) or environment variables to configure these settings.

Unblocking the Controller Port

The following table lists the typical error message when the Controller port is blocked in your network:

ERROR com.singularity.CONFIG.ConfigurationChannel — Fatal transport error: Connection refused
WARN com.singularity.CONFIG.ConfigurationChannel — Could not connect to the controller/invalid response from controller,
cannot get initialization information, controller host x.x.x.x, port 8090, exception Fatal transport error: Connection refused

Try pinging the Controller from the machine where you have configured the application agent.

To check if a port is blocked in the network, use the commands:

  • netstat -an for Windows
  • nmap for Linux.

The default ports are:

  • For on-premises Controller installations: 8090 for HTTP and 8181 for HTTPS.
  • For Controller SaaS service, use the default HTTPS port 443.

Correcting File Permission Issues

Following table lists the typical error message when the file permissions are not correct:

ERROR com.singularity.JavaAgent — Could Not Start Java Agent com.singularity.ee.agent.appagent.kernel.spi.c: Could not start services»

This is usually caused because of incorrect permissions for log files. To troubleshoot:

Confirm whether the user who is running the server has read and write permission on the agent directories.

If the user has chmod a-r equivalent permission, change the permission to chmod a+r «»

Maximum Async Handoff Call Graph Samples Error

The following error indicates that the number of handoffs in an asynchronous has exceeded the limit:

This can result from transactions being misidentified as async transactions. In AppDynamics 3.6 and later, all Runnables, Callables and Threads are instrumented by default except those that are excluded by the agent configuration in app-agent-config.xml.

In some environments, this may result in too many classes being instrumented, or cause common classes in a framework that implements the Runnable interface to be mistaken for asynchronous activity when it is not, for example Groovy applications using Clojure.

To debug, check the call graph for asynchronous activities that are misidentified as asynchronous activities. If found, exclude the packages that are not really asynchronous activities.

Источник

Troubleshooting Java Agent Issues

This page describes techniques for troubleshooting agent installation and operation. In particular, it describes how to find and interpret information in agent log files.

Resolve Java Agent Startup Issues

The first thing the Java agent does upon application startup is to register with the Controller. Once registered, the agent should appear in the Settings > AppDynamics Agents list.

If you do not see the agent in the list within a few minutes, check the following:

  1. Make sure you have restarted the application server.
  2. Verify that the javaagent argument has been added to the startup script of your JVM.
  3. Verify that you configured the agent-controller communication properties and agent identification properties in the controller-info.xml file or as system properties in the startup script of your JVM. See Java Agent Configuration Properties .
  4. Check the Agent logs directory located at /ver /logs/ for the agent.log file.
  5. Verify that the Agent is compatible with the Controller. See Agent and Controller Compatibility, and Troubleshoot Controller Issues.

Locate the Java Agent Log Files

Agent log files are located in the /ver /logs/ folder.

The agent.log file is the recommended file to help you with troubleshooting. This log can indicate the following:

Error messages related to starting the Java Agent use this format:

Resolve Incomplete Agent Configuration Issues

This table lists typical error messages for incomplete Agent configuration:

Cannot connect to the Agent — ERROR com.singularity.XMLConfigManager —
Incomplete Agent Identity data, Invalid Controller Port Value

This indicates that the value for the Controller port in controller-info.xml is missing. Add the Controller port and host value to resolve:

  • For on-premises Controller installations: 8090 for HTTP and 8181 for HTTPS.
  • For Controller SaaS service, use the default HTTPS port 443.

Caused by: com.singularity.ee.agent.configuration.a:
Could not resolve agent-controller basic configuration

This is usually caused because of incorrect configuration in the Controller-info.xml file.

Ensure that the information for agent communication (Controller host and port) and agent identification (application, tier and node names) is correctly configured.

Alternatively, you can also use the system properties (-D options) or environment variables to configure these settings.

Unblock the Controller Port

This table lists the typical error message when the Controller port is blocked in your network:

ERROR com.singularity.CONFIG.ConfigurationChannel — Fatal transport error: Connection refused
WARN com.singularity.CONFIG.ConfigurationChannel — Could not connect to the controller/invalid response from controller,
cannot get initialization information, controller host x.x.x.x, port 8090, exception Fatal transport error: Connection refused

Try pinging the Controller from the machine where you have configured the application agent.

To check if a port is blocked in the network, use the commands:

  • netstat -an for Windows
  • nmap for Linux.

The default ports are:

  • For on-premises Controller installations: 8090 for HTTP and 8181 for HTTPS.
  • For Controller SaaS service, use the default HTTPS port 443.

Correct File Permission Issues

This table lists typical error message when the file permissions are not correct:

ERROR com.singularity.JavaAgent — Could Not Start Java Agent com.singularity.ee.agent.appagent.kernel.spi.c: Could not start services»

This is usually caused because of incorrect permissions for log files. To troubleshoot:

Confirm whether the user who is running the server has read and write permission on the agent directories.

If the user has chmod a-r equivalent permission, change the permission to chmod a+r «»

Maximum Async Handoff Call Graph Samples Error

This error indicates that the number of handoffs in an asynchronous has exceeded the limit:

This can result from transactions being misidentified as async transactions. In AppDynamics >= 3.6, all Runnables, Callables, and Threads are instrumented by default except those that are excluded by the agent configuration in app-agent-config.xml .

In some environments, this may result in too many classes being instrumented, or cause common classes in a framework that implements the Runnable interface to be mistaken for asynchronous activity when it is not, for example, Groovy applications using Clojure.

To debug, check the call graph for asynchronous activities that are misidentified as asynchronous activities. If found, exclude the packages that are not really asynchronous activities. See Configure the Thread Correlation in Java Agent.

Fatal Transport Error W hile Connecting to URL

The Java Agent comes with Network Visibility enabled by default. This error appears if the Network Visibility Agent process is not running on the host:

If Network Visibility is not required in your environment, you can ignore this error.

Источник

Troubleshooting Java Agent Issues

On this page:

Related pages:

This topic discusses techniques for troubleshooting agent installation and operation. In particular, it describes how to find and interpret information in agent log files.

Resolving Java Agent Startup Issues

The first thing the Java agent does upon application startup is register with the Controller. Once registered, the agent should appear in the Settings > AppDynamics Agents list.

If you do not see the agent in the list within a few minutes, check the following:

  1. Make sure you have restarted the application server.
  2. Verify that the javaagent argument has been added to the startup script of your JVM.
  3. Verify that you configured the agent-controller communication properties and agent identification properties in the controller-info.xml file or as system properties in the startup script of your JVM. See Java Agent Configuration Properties .
  4. Check the Agent logs directory located at /logs/ for the agent.log file.
  5. Verify that the Agent is compatible with the Controller. For details see Agent — Controller Compatibility Matrix .

Locating the Java Agent Log Files

Agent log files are located in the /logs/ folder.

The agent.log file is the recommended file to help you with troubleshooting. This log can indicate the following:

Error messages related to starting the Java Agent use this format:

Resolving Incomplete Agent Configuration Issues

The following table lists the typical error messages for incomplete Agent configuration:

Cannot connect to the Agent — ERROR com.singularity.XMLConfigManager —
Incomplete Agent Identity data, Invalid Controller Port Value

This indicates that the value for the Controller port in controller-info.xml is missing. Add the Controller port and host value to resolve:

  • For on-premise Controller installations: 8090 for HTTP and 8181 for HTTPS.
  • For Controller SaaS service, use the default HTTPS port 443.

Caused by: com.singularity.ee.agent.configuration.a:
Could not resolve agent-controller basic configuration

This is usually caused because of incorrect configuration in the Controller-info.xml file.

Ensure that the information for agent communication (Controller host and port) and agent identification (application, tier and node names) is correctly configured.

Alternatively, you can also use the system properties (-D options) or environment variables to configure these settings.

Unblocking the Controller Port

The following table lists the typical error message when the Controller port is blocked in your network:

ERROR com.singularity.CONFIG.ConfigurationChannel — Fatal transport error: Connection refused
WARN com.singularity.CONFIG.ConfigurationChannel — Could not connect to the controller/invalid response from controller,
cannot get initialization information, controller host x.x.x.x, port 8090, exception Fatal transport error: Connection refused

Try pinging the Controller from the machine where you have configured the application agent.

To check if a port is blocked in the network, use the commands:

  • netstat -an for Windows
  • nmap for Linux.

The default ports are:

  • For on-premise Controller installations: 8090 for HTTP and 8181 for HTTPS.
  • For Controller SaaS service, use the default HTTPS port 443.

Correcting File Permission Issues

Following table lists the typical error message when the file permissions are not correct:

ERROR com.singularity.JavaAgent — Could Not Start Java Agent com.singularity.ee.agent.appagent.kernel.spi.c: Could not start services»

This is usually caused because of incorrect permissions for log files. To troubleshoot:

Confirm whether the user who is running the server has read and write permission on the agent directories.

If the user has chmod a-r equivalent permission, change the permission to chmod a+r «»

Maximum Async Handoff Call Graph Samples Error

The following error indicates that the number of handoffs in an asynchronous has exceeded the limit:

This can result from transactions being misidentified as async transactions. In AppDynamics 3.6 and later, all Runnables, Callables and Threads are instrumented by default except those that are excluded by the agent configuration in app-agent-config.xml.

In some environments, this may result in too many classes being instrumented, or cause common classes in a framework that implements the Runnable interface to be mistaken for asynchronous activity when it is not, for example Groovy applications using Clojure.

To debug, check the call graph for asynchronous activities that are misidentified as asynchronous activities. If found, exclude the packages that are not really asynchronous activities.

Источник

Im trying to load a Java Agent into a running JVM. I have the JVMs PID but whenever I try to load the agent into the JVM I get the error com.sun.tools.attach.AgentLoadException: Agent JAR not found or no Agent-Class attribute. Both files are in the same directory. I compile the class and package the class into a JAR archive using javac JavaAgent.java and jar cmf manifest.txt JavaAgent.jar *.class. Any help would be appreciated, thanks in advance.

AgentInstaller

package com.company;
import com.sun.tools.attach.*;

import java.io.IOException;

public class AgentLoader {

    public static void loadAgent() {
        String agentPath = "JavaAgent.jar";

        System.out.println("Dynamically loading java agent");
        String pid = "9484";

        try {
            VirtualMachine vm = VirtualMachine.attach(pid);
            vm.loadAgent(agentPath);
            vm.detach();
        }
        catch (Exception e){
            throw new RuntimeException(e);
        }
    }
}

JavaAgent

package com.company;
import java.lang.instrument.Instrumentation;

class JavaAgent {
    private static Instrumentation instrumentation;

    public static void agentmain (String args, Instrumentation inst){
        System.out.println("Java Agent inserted");
    }

}

Manifest.txt

Main-Class: com.company.MyMainClass
Agent-Class: com.company.AgentLoader
Can-Redefine-Classes: true
Can-Retransform-Classes: true

UPDATE

Thanks to apangin I am now able to load the agent but it fails to initialize com.sun.tools.attach.AgentInitializationException: Agent JAR loaded but agent failed to initialize. I am running a Oracle JDK.

This page describes techniques for troubleshooting agent installation and operation. In particular, it describes how to find and interpret information in agent log files.

Resolve Java Agent Startup Issues

The first thing the Java agent does upon application startup is to register with the Controller. Once registered, the agent should appear in the Settings > AppDynamics Agents list.

If you do not see the agent in the list within a few minutes, check the following: 

  1. Make sure you have restarted the application server.
  2. Verify that the javaagent argument has been added to the startup script of your JVM.
  3. Verify that you configured the agent-controller communication properties and agent identification properties in the controller-info.xml file or as system properties in the startup script of your JVM. See Java Agent Configuration Properties.
  4. Check the Agent logs directory located at <agent_home>/ver<version_number>/logs/<node_name> for the agent.log file.
  5. Verify that the Agent is compatible with the Controller. See Agent and Controller Compatibility, and Troubleshoot Controller Issues.

Locate the Java Agent Log Files

Agent log files are located in the <agent_home>/ver<version_number>/logs/<node_name> folder.

The agent.log file is the recommended file to help you with troubleshooting. This log can indicate the following:

  • Incomplete information in your Agent configuration
  • The Controller port is blocked
  • Incorrect file permissions

Error messages related to starting the Java Agent use this format:

ERROR com.singularity.JavaAgent - Could Not Start Java Agent

CODE

Resolve Incomplete Agent Configuration Issues

This table lists typical error messages for incomplete Agent configuration:

Error Message

Solution

Cannot connect to the Agent — ERROR com.singularity.XMLConfigManager —
Incomplete Agent Identity data, Invalid Controller Port Value

This indicates that the value for the Controller port in controller-info.xml is missing. Add the Controller port and host value to resolve:

  • For on-premises Controller installations: 8090 for HTTP and 8181 for HTTPS. 
  • For Controller SaaS service, use the default HTTPS port 443.

Caused by: com.singularity.ee.agent.configuration.a:
Could not resolve agent-controller basic configuration

This is usually caused because of incorrect configuration in the Controller-info.xml file.

Ensure that the information for agent communication (Controller host and port) and agent identification (application, tier and node names) is correctly configured.

Alternatively, you can also use the system properties (-D options) or environment variables to configure these settings.

Unblock the Controller Port

This table lists the typical error message when the Controller port is blocked in your network:

Error Message

Solution

ERROR com.singularity.CONFIG.ConfigurationChannel — Fatal transport error: Connection refused
WARN com.singularity.CONFIG.ConfigurationChannel — Could not connect to the controller/invalid response from controller,
cannot get initialization information, controller host x.x.x.x, port 8090, exception Fatal transport error: Connection refused

Try pinging the Controller from the machine where you have configured the application agent.

To check if a port is blocked in the network, use the commands:

  • netstat -an for Windows
  • nmap for Linux.

The default ports are:

  • For on-premises Controller installations: 8090 for HTTP and 8181 for HTTPS. 
  • For Controller SaaS service, use the default HTTPS port 443.

Correct File Permission Issues

This table lists typical error message when the file permissions are not correct:

Error Message

Solution

ERROR com.singularity.JavaAgent — Could Not Start Java Agent com.singularity.ee.agent.appagent.kernel.spi.c: Could not start services»

This is usually caused because of incorrect permissions for log files. To troubleshoot:

Confirm whether the user who is running the server has read and write permission on the agent directories.

If the user has chmod a-r equivalent permission, change the permission to chmod a+r «<agent_home>»

Maximum Async Handoff Call Graph Samples Error

This error indicates that the number of handoffs in an asynchronous has exceeded the limit: 

"WARN AsyncHandOffIdentificationInterceptor - Reached maximum limit 500 of async handoff call graph samples. No more samples will be taken" Error

This can result from transactions being misidentified as async transactions. In AppDynamics >= 3.6, all Runnables, Callables, and Threads are instrumented by default except those that are excluded by the agent configuration in app-agent-config.xml.

In some environments, this may result in too many classes being instrumented, or cause common classes in a framework that implements the Runnable interface to be mistaken for asynchronous activity when it is not, for example, Groovy applications using Clojure. 

To debug, check the call graph for asynchronous activities that are misidentified as asynchronous activities. If found, exclude the packages that are not really asynchronous activities. See Configure the Thread Correlation in Java Agent.

Fatal Transport Error While Connecting to URL

The Java Agent comes with Network Visibility enabled by default. This error appears if the Network Visibility Agent process is not running on the host:

[AD Thread Pool-Global0] 27 Apr 2022 07:35:28,539 ERROR NetVizAgentRequest - Fatal transport error while connecting to URL http://127.0.0.1:3892/api/agentinfo?timestamp=0&agentType=APP_AGENT&agentVersion=1.11.4: org.apache.http.conn.HttpHostConnectException: Connect to 127.0.0.1:3892 [/127.0.0.1] failed: Connection refused (Connection refused) 

If Network Visibility is not required in your environment, you can ignore this error.

Trying to load an agent jar into OpenJ9 Java 10 using the attach API, where Java 10 is running a module, results in a AgentLoadException error 102. It works with OpenJDK.

*** java.lang.instrument ASSERTION FAILED ***: "!errorOutstanding" with message find class on InstrumentationImpl failed at JPLISAgent.c line: 493
*** java.lang.instrument ASSERTION FAILED ***: "success" at InvocationAdapter.c line: 395
Agent failed to start!
JVMJ9TI064E Agent initialization function Agent_OnAttach failed for library instrument, return code 102

openjdk version «10.0.1-adoptopenjdk» 2018-04-17
OpenJDK Runtime Environment (build 10.0.1-adoptopenjdk+0-adhoc..openjdk)
Eclipse OpenJ9 VM (build master-6f5a858a, JRE 10 Windows 8.1 amd64-64-Bit Compressed References 20180523_54 (JIT enabled, AOT enabled)
OpenJ9 — 6f5a858
OMR — 1529050
JCL — 228f0625d8 based on jdk-10.0.1+10)

You need to start a Java 10 modular app to connect to, such as jconsole. While running jconsole exhibits the problem you don’t get a console. To get a console run «java -m jdk.jconsole/sun.tools.jconsole.JConsole» instead.

Sample loader code.

		String vmid = com.ibm.tools.attach.target.AttachHandler.getVmId();
		VirtualMachineDescriptor target = null;
		List<VirtualMachineDescriptor> machines = VirtualMachine.list();
		for (VirtualMachineDescriptor vmd : machines) {
			if (vmd.id().equals(vmid)) continue;
			System.out.println(vmd);
			if (vmd.displayName().contains(args[0])) {
				if (target != null) {
					System.out.println("Duplicates!");
					System.exit(1);
				}
				target = vmd;
			}
		}
		if (target == null) {
			System.out.println("No target found");
			System.exit(1);
		}
		VirtualMachine vm = VirtualMachine.attach(target);
		vm.loadAgent("t:\peter\premain.jar");

#java #eclipse

Вопрос:

Я пытаюсь реализовать агент java для запуска перед jar-приложением, для PoC я создал 2 проекта Java в Eclipse, один из которых app.java и agent.java,

app.java

 package test_app;

public class app {

public static void main(String args[]) {
    
    System.out.println("MAIN JAVA CLASS!!!!");
    
}

}
 

agent.java

 package java_agent;

import java.lang.instrument.*;

public class agent {

public static void premain(String agentArgs, Instrumentation inst) {
    
    System.out.println("INSIDE AGENT");
    
}

}
 

мой файл манифеста для app.java выглядит так,

 Main-Class: test_app.app
Class-Path: .
 

мой файл манифеста для agent.java выглядит так,

 PreMain-Class: java_agent.agent
 

Я выполнил для обоих с помощью этих команд,

 javac app.java
javac agent.java

jar -cvfm app.jar manifest.txt app.class
jar -cvfm agent.jar manifest.txt agent.class
 

затем я копирую файл .jar в другой каталог и запускаю,

 java -javaagent:agent.jar -jar app.jar
 

но комбинация, она не работает и выдает такие ошибки, как эта,

 Exception in thread "main" java.lang.ClassNotFoundException: agent_app.agent
    at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:606)
    at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:168)
    at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:522)
    at java.instrument/sun.instrument.InstrumentationImpl.loadClassAndStartAgent(InstrumentationImpl.java:431)
    at java.instrument/sun.instrument.InstrumentationImpl.loadClassAndCallPremain(InstrumentationImpl.java:525)
 *** java.lang.instrument ASSERTION FAILED ***: "result" with message agent load/premain call failed at ./open/src/java.instrument/share/native/libinstrument/JPLISAgent.c line: 422
 FATAL ERROR in native method: processing of -javaagent failed, processJavaStart failed
 

Пожалуйста, помогите мне исправить это и как это сделать. Я полностью занимаюсь Затмением.

Ответ №1:

Это очевидно: вы должны переместить файл .class в указанный вами пакет(путь), который является test_app и java_agent.

После того, как вы это сделаете, сделайте банку и запустите, все должно быть в порядке.

Кроме того, почему бы вам не сделать банку с помощью eclipse?

Комментарии:

1. Спасибо, Вивия, за ответ, я использовал Eclipse для создания jar-файла test_app, но для агента я не знаю, какой из них использовать параметры «Файл JAR» или» Файл JAR». Перемещая файл .class в test_app и java_agent, вы хотите сказать, что мне нужно поместить agent.class и app.class в test_app и java_agent? Извините, что задал глупый вопрос.

2. поскольку вы объявили класс агента в пакете java_agent, вам нужно поместить файл .class в тот же пакет.

Problem

Agents are not connecting and but the server is able to see them loading.

From Cog icon >> Overview >> Agents >> Online remote agents (tab) the following message can be seen: 

Nov 12, 2017 2:55:32 PM A remote agent is loading on 192.168.1.203 (127.0.0.1).

Diagnosis

One of the possible causes could be the address already in use. If this is the case the following can be found in the server logs:

2017-11-12 14:48:44,686 ERROR [localhost-startStop-1] [BambooBrokerService] Unable to start JMS connector at nio://0.0.0.0:54663?wireFormat.maxInactivityDuration=300000
java.io.IOException: Failed to bind to server socket: nio://0.0.0.0:54663?wireFormat.maxInactivityDuration=300000 due to: java.net.BindException: Address already in use
  at org.apache.activemq.util.IOExceptionSupport.create(IOExceptionSupport.java:34)
  at org.apache.activemq.transport.tcp.TcpTransportServer.bind(TcpTransportServer.java:143)
  at org.apache.activemq.transport.tcp.TcpTransportFactory.doBind(TcpTransportFactory.java:62)
  at org.apache.activemq.transport.TransportFactorySupport.bind(TransportFactorySupport.java:40)
  at org.apache.activemq.broker.BrokerService.createTransportConnector(BrokerService.java:2478)
  at org.apache.activemq.broker.BrokerService.addConnector(BrokerService.java:338)
  at com.atlassian.bamboo.amq.BambooBrokerService.startConnector(BambooBrokerService.java:128)
  at com.atlassian.bamboo.amq.BambooBrokerService.addStartedConnectors(BambooBrokerService.java:108)
  at com.atlassian.bamboo.buildqueue.manager.RemoteAgentManagerImpl.startOrStopConnectors(RemoteAgentManagerImpl.java:422)
  at com.atlassian.bamboo.buildqueue.manager.RemoteAgentManagerImpl.start(RemoteAgentManagerImpl.java:539)
  at com.atlassian.bamboo.container.BambooContainer.start(BambooContainer.java:265)
  at com.atlassian.bamboo.upgrade.UpgradeLauncher.upgradeAndStartBamboo(UpgradeLauncher.java:131)
  at com.atlassian.bamboo.upgrade.UpgradeLauncher.contextInitialized(UpgradeLauncher.java:42)
  at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4842)
  at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5303)
  at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:147)
  at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1407)
  at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1397)
  at java.util.concurrent.FutureTask.run(FutureTask.java:266)
  at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
  at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
  at java.lang.Thread.run(Thread.java:745)
Caused by: java.net.BindException: Address already in use
  at sun.nio.ch.Net.bind0(Native Method)
  at sun.nio.ch.Net.bind(Net.java:433)
  at sun.nio.ch.Net.bind(Net.java:425)
  at sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:223)
  at sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:74)
  at org.apache.activemq.transport.nio.NIOTransportFactory$2.createServerSocket(NIOTransportFactory.java:83)
  at org.apache.activemq.transport.tcp.TcpTransportServer.bind(TcpTransportServer.java:140)
  ... 20 more

Cause

This mostly happens when two instances of Bamboo are running on the same server. It could be the case of having both production and development instances with broker configured to listen on 54663.

In cases where there is only one Bamboo instance and binding error still remains, the netstat command can be helpful.
The following can be used to diagnose what process is holding the port:

OS Command
Windows netstat-an | findstr54663
Unix like netstat -an | grep 54663

Resolution

  1. Shutdown the instance with the error Address already in use

  2. Edit the <Bamboo_Home>/bamboo.cfg.xml file and update the port in the following two lines:

    <property name="bamboo.jms.broker.client.uri">failover:(tcp://bamboo_server_host:54663?wireFormat.maxInactivityDuration=300000)?maxReconnectAttempts=10&amp;initialReconnectDelay=15000</property>
    <property name="bamboo.jms.broker.uri">tcp://0.0.0.0:54663?wireFormat.maxInactivityDuration=300000</property>

    tip/resting
    Created with Sketch.

    This change can be performed also from the Bamboo UI (Cog icon >> Overview >> General configuration) in versions above 5.x.

  3. Restart your Bamboo server for the changes to take effect.

Понравилась статья? Поделить с друзьями:
  • Error loading images one or more images were not found
  • Error loading image myproj ezb
  • Error loading image default ezb что это
  • Error loading form что это
  • Error loading form windows 10