AppD Archive

appdynamic reports HttpURLConnection.getResponseCode error

CommunityUser
Splunk Employee
Splunk Employee

Hello 

We are using appdynamics for monitoring and our load test fails. we are trying to call a third party api below

URL obj = new URL("https://somewebsite.com/api/v1/discussion.json?Discussion.ForeignID=bd43537ec7509e4eafae63e037325300");
        con = (HttpURLConnection) obj.openConnection();
 
        con.setRequestMethod("GET");
        con.setRequestProperty("User-Agent",
            "Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9.1.2) Gecko/20090729 Firefox/3.5.2 (.NET CLR 3.5.30729)");
        con.setConnectTimeout(500);
        con.setRequestProperty("Accept","*/*");
        con.connect();
 
        if (con.getResponseCode() == HttpURLConnection.HTTP_OK) { 

Once we establish a connection and call con.getResponseCode() in our java program the response code is 404 and it behaves fine there is no error in tomcat log file , but appdynamic registers an error as below and as a result because of exception per minute the load test fail.

java.io.FileNotFoundException.http://somestufff.com/api/v1/discussion.json?Discussion.ForeignID=fb7a4ce5025a0ef015f19c452b1da541
      at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1624)
      at java.net.HttpURLConnection.getResponseCode(HttpURLConnection.java:468)
      at com.website.editorial.util.ConsumerCommentUtil.getVanillaUrl(ConsumerCommentUtil.java:119)

 As of now in order to fix this we have put a ignore filter  in place but is there any advice or suggestion to overcome this.

0 Karma

CommunityUser
Splunk Employee
Splunk Employee

We're having the same issue.  It seems like when the app uses HttpUrlConnection to call getResponseCode(), the getResponseCode() method also calls getInputStream(), which is the method that ultimately throws the error.  The FileNotFoundException in this case is bundled in the rememberedException field in HttpUrlConnection class, which is protected.  If you call HttpUrlConnection.getInputStream() from the app code, you'll see the FileNotFoundException in the console, which you can catch, but that doesn't prevent AppDynamics from logging it as an error in a Transaction.

How was the ignore filter configured specifically?  I've tried java.io.FileNotFoundException with Is Not Empty and NOT (Is Not Empty) for the class name and exception message respectfully, but it still reports as an error.

0 Karma

Arun_Dasetty
Super Champion

Hi Steven,

Can you share the screenshot (if possible the exported snapshot PDF) with error details in view and also archive of agent logs? ,logs could be download from UI (refer screenshot attached)

Plan is to check the exact error or it is a message and the rule defined from logs requested

0 Karma

CommunityUser
Splunk Employee
Splunk Employee

I don't have access to download agent log files unfortunately.

0 Karma

CommunityUser
Splunk Employee
Splunk Employee
Ignoring the error seems like the best solution - other than figuring out
what is actually causing the error and fixing it which would be the
long-term fix.

0 Karma
Get Updates on the Splunk Community!

Index This | What is broken 80% of the time by February?

December 2025 Edition   Hayyy Splunk Education Enthusiasts and the Eternally Curious!    We’re back with this ...

Unlock Faster Time-to-Value on Edge and Ingest Processor with New SPL2 Pipeline ...

Hello Splunk Community,   We're thrilled to share an exciting update that will help you manage your data more ...

Splunk MCP & Agentic AI: Machine Data Without Limits

Discover how the Splunk Model Context Protocol (MCP) Server can revolutionize the way your organization uses ...