-
Notifications
You must be signed in to change notification settings - Fork 112
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Agent JAR not found or no Agent-Class attribute #137
Comments
That looks like JDK 15 rather than JDK 17. Are you sure that you're running JDK 17? |
yes its 17, same error in both, Open jdk 15 and 17 |
Is this project being actively supported? |
The most recent release is from June 2023 and refers to using Java 11 language features where possible. In that sense, I think that it is actively supported, at least as the library is being used in the Jenkins project. The most recent commit was 3 weeks ago and adds testing on Java 21. In that sense, I think that it is actively supported, at least as the library is being used in the Jenkins project. If "actively supported" means something different for you, then you'll need to elaborate further on what you're trying to achieve. |
Jenkins and plugins versions report
Environment
What Operating System are you using (both controller, and any agents involved in the problem)?
Getting below error while running this agent in open jdk 17 in windows machine in Intellij IDEA
"C:\Program Files\Java\jdk-15.0.2\bin\java.exe" -agentlib:jdwp=transport=dt_socket,address=127.0.0.1:63036,suspend=y,server=n -javaagent:C:\Users\nihir.shah.m2\repository\org\kohsuke\file-leak-detector\1.16-SNAPSHOT\file-leak-detector-1.16-SNAPSHOT.jar -javaagent:C:\Users\nihir.shah\AppData\Local\JetBrains\IdeaIC2021.3\captureAgent\debugger-agent.jar -Dfile.encoding=UTF-8 -classpath "D:\Platform\lib-file-leak-detector\target\classes;C:\Users\nihir.shah.m2\repository\args4j\args4j\2.33\args4j-2.33.jar;C:\Users\nihir.shah.m2\repository\org\ow2\asm\asm\9.5\asm-9.5.jar;C:\Users\nihir.shah.m2\repository\org\ow2\asm\asm-analysis\9.5\asm-analysis-9.5.jar;C:\Users\nihir.shah.m2\repository\org\ow2\asm\asm-commons\9.5\asm-commons-9.5.jar;C:\Users\nihir.shah.m2\repository\org\ow2\asm\asm-tree\9.5\asm-tree-9.5.jar;C:\Users\nihir.shah.m2\repository\org\ow2\asm\asm-util\9.5\asm-util-9.5.jar;C:\Program Files\JetBrains\IntelliJ\lib\idea_rt.jar" org.kohsuke.file_leak_detector.Main 16808
Connected to the target VM, address: '127.0.0.1:63036', transport: 'socket'
Could not load field socket from SocketImpl: java.lang.NoSuchFieldException: socket
Could not load field serverSocket from SocketImpl: java.lang.NoSuchFieldException: serverSocket
File leak detector installed
Connecting to 16808
Activating file leak detector at D:\Platform\lib-file-leak-detector\target\classes
com.sun.tools.attach.AgentLoadException: Agent JAR not found or no Agent-Class attribute
at jdk.attach/sun.tools.attach.HotSpotVirtualMachine.loadAgent(HotSpotVirtualMachine.java:159)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:64)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:564)
at org.kohsuke.file_leak_detector.Main.run(Main.java:74)
at org.kohsuke.file_leak_detector.Main.main(Main.java:38)
java -jar file-leak-detector.jar PID [OPTSTR]
PID : Process ID to activate file leak detector
OPTSTR : Packed option string of the form key1[=value1],key2[=value2],...
Options:
help - Show the help screen.
noexit - Don't exit after showing the help screen.
trace - Log every open/close operation to stderr.
trace=FILE - Log every open/close operation to the given file.
error=FILE - If 'too many open files' error is detected, send the dump here.
By default it goes to stderr.
threshold=N - Instead of waiting until 'too many open files', dump once
we have N descriptors open.
http=PORT - Run a mini HTTP server that you can access to get stats on demand.
Specify 0 to choose random available port, -1 to disable, which is default.
strong - Don't let GC auto-close leaking file descriptors.
listener=S - Specify the fully qualified name of ActivityListener class to activate from beginning.
dumpatshutdown - Dump open file handles at shutdown.
excludes=FILE - Ignore files opened directly/indirectly in specific methods.
File lists 'some.pkg.ClassName.methodName' patterns.
Disconnected from the target VM, address: '127.0.0.1:63036', transport: 'socket'
Process finished with exit code 1
Reproduction steps
run in intellij by adding VM parameter as -javaagent:"C:\Users\nihir.shah.m2\repository\org\kohsuke\file-leak-detector\1.16-SNAPSHOT\file-leak-detector-1.16-SNAPSHOT.jar" and argument as
Expected Results
na
Actual Results
"C:\Program Files\Java\jdk-15.0.2\bin\java.exe" -agentlib:jdwp=transport=dt_socket,address=127.0.0.1:63036,suspend=y,server=n -javaagent:C:\Users\nihir.shah.m2\repository\org\kohsuke\file-leak-detector\1.16-SNAPSHOT\file-leak-detector-1.16-SNAPSHOT.jar -javaagent:C:\Users\nihir.shah\AppData\Local\JetBrains\IdeaIC2021.3\captureAgent\debugger-agent.jar -Dfile.encoding=UTF-8 -classpath "D:\Platform\lib-file-leak-detector\target\classes;C:\Users\nihir.shah.m2\repository\args4j\args4j\2.33\args4j-2.33.jar;C:\Users\nihir.shah.m2\repository\org\ow2\asm\asm\9.5\asm-9.5.jar;C:\Users\nihir.shah.m2\repository\org\ow2\asm\asm-analysis\9.5\asm-analysis-9.5.jar;C:\Users\nihir.shah.m2\repository\org\ow2\asm\asm-commons\9.5\asm-commons-9.5.jar;C:\Users\nihir.shah.m2\repository\org\ow2\asm\asm-tree\9.5\asm-tree-9.5.jar;C:\Users\nihir.shah.m2\repository\org\ow2\asm\asm-util\9.5\asm-util-9.5.jar;C:\Program Files\JetBrains\IntelliJ\lib\idea_rt.jar" org.kohsuke.file_leak_detector.Main 16808
Connected to the target VM, address: '127.0.0.1:63036', transport: 'socket'
Could not load field socket from SocketImpl: java.lang.NoSuchFieldException: socket
Could not load field serverSocket from SocketImpl: java.lang.NoSuchFieldException: serverSocket
File leak detector installed
Connecting to 16808
Activating file leak detector at D:\Platform\lib-file-leak-detector\target\classes
com.sun.tools.attach.AgentLoadException: Agent JAR not found or no Agent-Class attribute
at jdk.attach/sun.tools.attach.HotSpotVirtualMachine.loadAgent(HotSpotVirtualMachine.java:159)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:64)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:564)
at org.kohsuke.file_leak_detector.Main.run(Main.java:74)
at org.kohsuke.file_leak_detector.Main.main(Main.java:38)
java -jar file-leak-detector.jar PID [OPTSTR]
PID : Process ID to activate file leak detector
OPTSTR : Packed option string of the form key1[=value1],key2[=value2],...
Options:
help - Show the help screen.
noexit - Don't exit after showing the help screen.
trace - Log every open/close operation to stderr.
trace=FILE - Log every open/close operation to the given file.
error=FILE - If 'too many open files' error is detected, send the dump here.
By default it goes to stderr.
threshold=N - Instead of waiting until 'too many open files', dump once
we have N descriptors open.
http=PORT - Run a mini HTTP server that you can access to get stats on demand.
Specify 0 to choose random available port, -1 to disable, which is default.
strong - Don't let GC auto-close leaking file descriptors.
listener=S - Specify the fully qualified name of ActivityListener class to activate from beginning.
dumpatshutdown - Dump open file handles at shutdown.
excludes=FILE - Ignore files opened directly/indirectly in specific methods.
File lists 'some.pkg.ClassName.methodName' patterns.
Disconnected from the target VM, address: '127.0.0.1:63036', transport: 'socket'
Process finished with exit code 1
Anything else?
No response
The text was updated successfully, but these errors were encountered: