Splunk AppDynamics

Java agent on Tomcat receiving "Connection Refused"

Dale_Chapman
Explorer

Our organization has been using the AppDynamics Java agent with IBM Websphere for a number of years. This is our first attempt to get the Java agent working with Tomcat. When the Tomcat application server starts up, we get Connection Refused error messages in the java agent logs.

Stack Trace Error Message:

org.apache.http.conn.HttpHostConnectException: Connect to server.domain.name:443 [server.domain.name/<IP Address>] failed: Connection refused (Connection refused)

        at org.apache.http.impl.conn.DefaultHttpClientConnectionOperator.connect(DefaultHttpClientConnectionOperator.java:156) ~[httpclient-4.5.13.jar:4.5.13]

        at org.apache.http.impl.conn.PoolingHttpClientConnectionManager.connect(PoolingHttpClientConnectionManager.java:376) ~[httpclient-4.5.13.jar:4.5.13]

        at org.apache.http.impl.execchain.MainClientExec.establishRoute(MainClientExec.java:393) ~[httpclient-4.5.13.jar:4.5.13]

        at org.apache.http.impl.execchain.MainClientExec.execute(MainClientExec.java:236) ~[httpclient-4.5.13.jar:4.5.13]

        at org.apache.http.impl.execchain.ProtocolExec.execute(ProtocolExec.java:186) ~[httpclient-4.5.13.jar:4.5.13]

        at org.apache.http.impl.execchain.RetryExec.execute(RetryExec.java:89) ~[httpclient-4.5.13.jar:4.5.13]

Configuration information:

      -Dappdynamics.controller.hostName=server.domain.name \

      -Dappdynamics.controller.port=443 \

      -Dappdynamics.agent.applicationName=APP-NAME \

      -Dappdynamics.agent.tierName=Services \

      -Dappdynamics.agent.nodeName=APP1_Node1 \

      -Dappdynamics.agent.accountName=customer1 \

      -Dappdynamics.bciengine.should.implement.new.interfaces=false \

      -Dappdynamics.agent.accountAccessKey=<account number>\

What kind of things could cause a connection refused with the Java agent running in Tomcat?

What should I be looking for in the logs?
Is there a known difference in connection behaviour between Websphere and Tomcat?
Any help would be appreciated.

Thanks!

Dale Chapman

Labels (1)
0 Karma
1 Solution

Morelz
Motivator

Hi Dale

in reality there is no real difference, as both are built on Java, it's the agent itself that is unable to connect

There is only one reason I can see, other than if there are communication problems between the server that Tomcat runs on and the Controller.

I see you have added all the controller config as properties, but the setting for the below is missing, which is needed if you are using a secure port like 443 for SSL/TLS

-Dappdynamics.controller.ssl.enabled=true

A possibility with the previous Websphere agent might be that you added the setting in the agent's controller-info.xml file or it was overlooked when you copied the configuration over to Tomcat.

Ciao

View solution in original post

Morelz
Motivator

Hi Dale

in reality there is no real difference, as both are built on Java, it's the agent itself that is unable to connect

There is only one reason I can see, other than if there are communication problems between the server that Tomcat runs on and the Controller.

I see you have added all the controller config as properties, but the setting for the below is missing, which is needed if you are using a secure port like 443 for SSL/TLS

-Dappdynamics.controller.ssl.enabled=true

A possibility with the previous Websphere agent might be that you added the setting in the agent's controller-info.xml file or it was overlooked when you copied the configuration over to Tomcat.

Ciao

Dale_Chapman
Explorer

Thank you, Mario.

We made the change on the Tomcat server and the data started rolling in immediately.

I really appreciate the help.

Dale Chapman

0 Karma

Dale_Chapman
Explorer

We did more experimentation and discovered an interesting configuration limitation.

We have multiple Tomcat servers on the same Linux server. Each of these Tomcat servers represents a different environment for the same application (test, acceptance, maintenance). As soon as we instrumented the other Tomcat instances, none of the servers reported into the controller.

We had segregated the instances by specifying different application names but used the same tier and node names. In order for the AppDynamics agent to work properly, we had to make sure that each Tomcat instance had its own node name. So now, we have things segregated by application name with each application having its own, unique node name.

Thanks!

Dale Chapman

Got questions? Get answers!

Join the Splunk Community Slack to learn, troubleshoot, and make connections with fellow Splunk practitioners in real time!

Meet up IRL or virtually!

Join Splunk User Groups to connect and learn in-person by region or remotely by topic or industry.

Get Updates on the Splunk Community!

Why Splunk Customers Should Attend Cisco Live 2026 Las Vegas

Why Splunk Customers Should Attend Cisco Live 2026 Las Vegas     Cisco Live 2026 is almost here, and this ...

What Is the Name of the USB Key Inserted by Bob Smith? (BOTS Hint, Not the Answer)

Hello Splunkers,   So you searched, “what is the name of the usb key inserted by bob smith?”  Not gonna lie… ...

Automating Threat Operations and Threat Hunting with Recorded Future

    Automating Threat Operations and Threat Hunting with Recorded Future June 29, 2026 | Register   Is your ...