jvisualvm: Software caused connection abort: socket write error
Asked Answered
M

2

9

When I want to profile a java programm started from eclipse with jvisualvm 1.3.8 I get the error message within eclipse console:

Software caused connection abort: socket write error.

This also happens when I start the program without eclipse (java -jar ...) from command line console. I tested jvisualvm from JDK 1.8.0_20 and downloaded the newest version 1.3.8. Here is the stacktrace:

Profiler Agent: Waiting for connection on port 5140 (Protocol version: 15) 
Profiler Agent: Established connection with the tool 
Profiler Agent: Local accelerated session 
Profiler Agent: Connection with agent closed 
Profiler Agent Error: Exception when trying to send response or command to client: 
java.net.SocketException: Software caused connection abort: socket write error 
*** Profiler engine warning: class load hook invoked at inappropriate time for java.lang.Throwable$PrintStreamOrWriter, loader = null 
*** This class will not be instrumented unless you re-run the instrumentation command 
*** Please report this problem to [email protected] 
=============================== Stack trace ===================== 
*** Profiler engine warning: class load hook invoked at inappropriate time for java.lang.Throwable$WrappedPrintStream, loader = null 
*** This class will not be instrumented unless you re-run the instrumentation command 
*** Please report this problem to [email protected] 
=============================== Stack trace ===================== 
*** Profiler engine warning: class load hook invoked at inappropriate time for java.util.IdentityHashMap$KeySet, loader = null 
*** This class will not be instrumented unless you re-run the instrumentation command 
*** Please report this problem to [email protected] 
=============================== Stack trace ===================== 
java.lang.Exception: Stack trace 
        at java.lang.Thread.dumpStack(Thread.java:1329) 
        at org.netbeans.lib.profiler.server.ProfilerInterface.classLoadHook(ProfilerInterface.java:912) 
        at java.util.IdentityHashMap.keySet(IdentityHashMap.java:976) 
        at java.util.Collections$SetFromMap.<init>(Collections.java:5512) 
        at java.util.Collections.newSetFromMap(Collections.java:5496) 
        at java.lang.Throwable.printStackTrace(Throwable.java:650) 
        at java.lang.Throwable.printStackTrace(Throwable.java:643) 
        at java.lang.Throwable.printStackTrace(Throwable.java:634) 
        at java.lang.Thread.dumpStack(Thread.java:1329) 
        at org.netbeans.lib.profiler.server.ProfilerInterface.classLoadHook(ProfilerInterface.java:912) 
        at java.lang.Throwable.printStackTrace(Throwable.java:643) 
        at java.lang.Throwable.printStackTrace(Throwable.java:634) 
        at java.lang.Thread.dumpStack(Thread.java:1329) 
        at org.netbeans.lib.profiler.server.ProfilerInterface.classLoadHook(ProfilerInterface.java:912) 
        at java.lang.Throwable.printStackTrace(Throwable.java:643) 
        at org.netbeans.lib.profiler.server.ProfilerServer.handleIOExceptionOnSend(ProfilerServer.java:1698) 
        at org.netbeans.lib.profiler.server.ProfilerServer.sendComplexCmdToClient(ProfilerServer.java:706) 
        at org.netbeans.lib.profiler.server.ProfilerInterface.sendRootClassLoadedCommand(ProfilerInterface.java:1418) 
        at org.netbeans.lib.profiler.server.ProfilerInterface.access$900(ProfilerInterface.java:70) 
        at org.netbeans.lib.profiler.server.ProfilerInterface$InitiateProfilingThread.initiateInstrumentation(ProfilerInterface.java:232) 
        at org.netbeans.lib.profiler.server.ProfilerInterface$InitiateProfilingThread.run(ProfilerInterface.java:137) 
=============================== End stack trace ================= 
java.lang.Exception: Stack trace 
        at java.lang.Thread.dumpStack(Thread.java:1329) 
        at org.netbeans.lib.profiler.server.ProfilerInterface.classLoadHook(ProfilerInterface.java:912) 
        at java.lang.Throwable.printStackTrace(Throwable.java:643) 
        at java.lang.Throwable.printStackTrace(Throwable.java:634) 
        at java.lang.Thread.dumpStack(Thread.java:1329) 
        at org.netbeans.lib.profiler.server.ProfilerInterface.classLoadHook(ProfilerInterface.java:912) 
        at java.lang.Throwable.printStackTrace(Throwable.java:643) 
        at org.netbeans.lib.profiler.server.ProfilerServer.handleIOExceptionOnSend(ProfilerServer.java:1698) 
        at org.netbeans.lib.profiler.server.ProfilerServer.sendComplexCmdToClient(ProfilerServer.java:706) 
        at org.netbeans.lib.profiler.server.ProfilerInterface.sendRootClassLoadedCommand(ProfilerInterface.java:1418) 
        at org.netbeans.lib.profiler.server.ProfilerInterface.access$900(ProfilerInterface.java:70) 
        at org.netbeans.lib.profiler.server.ProfilerInterface$InitiateProfilingThread.initiateInstrumentation(ProfilerInterface.java:232) 
        at org.netbeans.lib.profiler.server.ProfilerInterface$InitiateProfilingThread.run(ProfilerInterface.java:137) 
=============================== End stack trace ================= 
java.lang.Exception: Stack trace 
        at java.lang.Thread.dumpStack(Thread.java:1329) 
        at org.netbeans.lib.profiler.server.ProfilerInterface.classLoadHook(ProfilerInterface.java:912) 
        at java.lang.Throwable.printStackTrace(Throwable.java:643) 
        at org.netbeans.lib.profiler.server.ProfilerServer.handleIOExceptionOnSend(ProfilerServer.java:1698) 
        at org.netbeans.lib.profiler.server.ProfilerServer.sendComplexCmdToClient(ProfilerServer.java:706) 
        at org.netbeans.lib.profiler.server.ProfilerInterface.sendRootClassLoadedCommand(ProfilerInterface.java:1418) 
        at org.netbeans.lib.profiler.server.ProfilerInterface.access$900(ProfilerInterface.java:70) 
        at org.netbeans.lib.profiler.server.ProfilerInterface$InitiateProfilingThread.initiateInstrumentation(ProfilerInterface.java:232) 
        at org.netbeans.lib.profiler.server.ProfilerInterface$InitiateProfilingThread.run(ProfilerInterface.java:137) 
=============================== End stack trace ================= 
java.net.SocketException: Software caused connection abort: socket write error 
        at java.net.SocketOutputStream.socketWrite0(Native Method) 
        at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:109) 
        at java.net.SocketOutputStream.write(SocketOutputStream.java:153) 
        at java.io.ObjectOutputStream$BlockDataOutputStream.drain(ObjectOutputStream.java:1877) 
        at java.io.ObjectOutputStream$BlockDataOutputStream.writeBytes(ObjectOutputStream.java:1985) 
        at java.io.ObjectOutputStream$BlockDataOutputStream.writeUTF(ObjectOutputStream.java:2168) 
        at java.io.ObjectOutputStream$BlockDataOutputStream.writeUTF(ObjectOutputStream.java:2007) 
        at java.io.ObjectOutputStream.writeUTF(ObjectOutputStream.java:869) 
        at org.netbeans.lib.profiler.wireprotocol.RootClassLoadedCommand.writeObject(RootClassLoadedCommand.java:159) 
        at org.netbeans.lib.profiler.wireprotocol.WireIO.sendComplexCommand(WireIO.java:301) 
        at org.netbeans.lib.profiler.server.ProfilerServer.sendComplexCmdToClient(ProfilerServer.java:703) 
        at org.netbeans.lib.profiler.server.ProfilerInterface.sendRootClassLoadedCommand(ProfilerInterface.java:1418) 
        at org.netbeans.lib.profiler.server.ProfilerInterface.access$900(ProfilerInterface.java:70) 
        at org.netbeans.lib.profiler.server.ProfilerInterface$InitiateProfilingThread.initiateInstrumentation(ProfilerInterface.java:232) 
        at org.netbeans.lib.profiler.server.ProfilerInterface$InitiateProfilingThread.run(ProfilerInterface.java:137) 
Profiler Agent Error: Exception when handling command from client: 
java.net.SocketException: Software caused connection abort: recv failed 
Profiler Agent: Connection with agent closed 

After this the port 5140 is opened by my application to be profiled. I googled a lot and could not find any help with this. I also wrote another simple program and the error occured as well.

What can I do?

Mistook answered 4/9, 2014 at 7:7 Comment(1)
Are you running in a corporate environment? I get the same issue and suspect it is due to either the company firewall or other network monitoring software running on the local machine.Prang
M
1

I've encountered this a few times. What OS platform are you running this on? Windows? or *nix?

On Windows, you'll almost certainly need to run your Eclipse and/or the jvisualvm using Admin privs...I typically set up a command prompt, Run As ... Administrator.

On Linux, you'll need to be running Eclipse and/or jvisualvm as either root or with an account that has privs that match or exceed the account running the pid you are trying to monitor.

Milled answered 14/9, 2015 at 23:56 Comment(0)
G
0

This is definitely a firewall issue. Most likely you will not have rights to disable your firewall if an OS is not asking you (Windows). In my case I had eventually ran the application on another box where I had rights to allow JVisualVM to connect to my application.

Gramicidin answered 20/5, 2016 at 8:59 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.