Notes error: JVM: Attempt to retrieve Java agent attachments failed
Pergunta
I'm having a problem when using a JDBC connection to POSTGREE database. Lotus appears on the console the following error:
16/02/2012 15:34:36 Agent error: JVMDUMP006I Processando Evento de Dump "systhrow", detalhe "java/lang/OutOfMemoryError" - Aguarde.
16/02/2012 15:34:36 Agent error: JVMDUMP032I
16/02/2012 15:34:36 Agent error: JVMDUMP010I Snap Dump gravado em /local/notesdata/Snap.20120216.153437.18971.0001.trc
16/02/2012 15:34:36 Agent error: JVMDUMP032I
16/02/2012 15:34:36 Agent error: JVMDUMP010I Heap Dump gravado em /local/notesdata/heapdump.20120216.153437.18971.0002.phd
16/02/2012 15:34:36 Agent error: JVMDUMP032I
16/02/2012 15:34:37 Agent error: JVMDUMP010I Java Dump gravado em /local/notesdata/javacore.20120216.153437.18971.0003.txt
16/02/2012 15:34:37 Agent error: JVMDUMP013I Evento de Dump Processado "systhrow", detalhe "java/lang/OutOfMemoryError".
16/02/2012 15:34:37 Agent error: Exce∑∫∑˙o no encadeamento "Thread-60"
16/02/2012 15:34:37 Agent error: java.lang.OutOfMemoryError
16/02/2012 15:34:37 Agent error: at
16/02/2012 15:34:37 Agent error: java.util.Arrays
16/02/2012 15:34:37 Agent error: .
16/02/2012 15:34:37 Agent error: copyOfRange
16/02/2012 15:34:37 Agent error: (
16/02/2012 15:34:37 Agent error: Arrays.java
16/02/2012 15:34:37 Agent error: :
16/02/2012 15:34:37 Agent error: 4
16/02/2012 15:34:37 Agent error: 0
16/02/2012 15:34:37 Agent error: 5
16/02/2012 15:34:37 Agent error: 4
16/02/2012 15:34:37 Agent error: )
16/02/2012 15:34:37 Agent error: at
16/02/2012 15:34:37 Agent error: java.util.Arrays
16/02/2012 15:34:37 Agent error: .
16/02/2012 15:34:37 Agent error: copyOf
16/02/2012 15:34:37 Agent error: (
16/02/2012 15:34:37 Agent error: Arrays.java
16/02/2012 15:34:37 Agent error: :
16/02/2012 15:34:37 Agent error: 3
16/02/2012 15:34:37 Agent error: 7
16/02/2012 15:34:37 Agent error: 8
16/02/2012 15:34:37 Agent error: 6
16/02/2012 15:34:37 Agent error: )
16/02/2012 15:34:37 Agent error: at
16/02/2012 15:34:37 Agent error: java.io.ByteArrayOutputStream
16/02/2012 15:34:37 Agent error: .
16/02/2012 15:34:37 Agent error: write
16/02/2012 15:34:37 Agent error: (
16/02/2012 15:34:37 Agent error: ByteArrayOutputStream.java
16/02/2012 15:34:37 Agent error: :
16/02/2012 15:34:37 Agent error: 9
16/02/2012 15:34:37 Agent error: 3
16/02/2012 15:34:37 Agent error: )
16/02/2012 15:34:37 Agent error: at
16/02/2012 15:34:37 Agent error: lotus.domino.ClassHashtable
16/02/2012 15:34:37 Agent error: .
16/02/2012 15:34:37 Agent error: explodeArchive
16/02/2012 15:34:37 Agent error: (Unknown Source)
16/02/2012 15:34:37 Agent error: at
16/02/2012 15:34:37 Agent error: lotus.domino.ClassHashtable
16/02/2012 15:34:37 Agent error: .
16/02/2012 15:34:37 Agent error: addAttachment
16/02/2012 15:34:37 Agent error: (Unknown Source)
16/02/2012 15:34:37 Agent error: at
16/02/2012 15:34:37 Agent error: lotus.domino.AgentLoader
16/02/2012 15:34:37 Agent error: .
16/02/2012 15:34:37 Agent error: addAttachment
16/02/2012 15:34:37 Agent error: (Unknown Source)
16/02/2012 15:34:37 JVM: The addAttachment (Ljava/lang/String;[B)V() method failed.
Cleaned up the exception is:
JVMDUMP006I Processando Evento de Dump "systhrow", detalhe "java/lang/OutOfMemoryError" - Aguarde.
JVMDUMP032I
JVMDUMP010I Snap Dump gravado em /local/notesdata/Snap.20120216.153437.18971.0001.trc
JVMDUMP032I
JVMDUMP010I Heap Dump gravado em /local/notesdata/heapdump.20120216.153437.18971.0002.phd
JVMDUMP032I
JVMDUMP010I Java Dump gravado em /local/notesdata/javacore.20120216.153437.18971.0003.txt
JVMDUMP013I Evento de Dump Processado "systhrow", detalhe "java/lang/OutOfMemoryError".
Exce∑∫∑˙o no encadeamento "Thread-60"
java.lang.OutOfMemoryError
at java.util.Arrays.copyOfRange(Arrays.java:4054)
at java.util.Arrays.copyOf(Arrays.java:3786)
at java.io.ByteArrayOutputStream.write(ByteArrayOutputStream.java:93)
at lotus.domino.ClassHashtable.explodeArchive(Unknown Source)
at lotus.domino.ClassHashtable.addAttachment(Unknown Source)
at lotus.domino.AgentLoader.addAttachment(Unknown Source)
JVM: The addAttachment (Ljava/lang/String;[B)V() method failed.
Does anyone know how to solve this problem?
Solução
So the important part is this:
lotus.domino.AgentLoader.addAttachment(Unknown Source)
AgentLoader.addAttachment is a method that runs when your agent is first starting to be executed. What it does is checks your agent for any JARs contained within the agent and downloads (if on client) and detaches them to the system before loading them into the JVM.
When your agent completes it cleans these up. So every time the agent runs it has to do this step.
This error can occur for a few reasons.
Reason 1: (main one)
There is overhead both in network and processing to detach load/jars to the system. If you are under a heavy load it is possible that the system does not have enough memory to complete the action.
Reason 2:
Some third party APIs will not work in this fashion. Google API for example I have seen fail in this way.
Reason 3:
There was a memory leak in V8.0 (SPR KPAL6YWRN9) in relation to web services. This has since been fixed.
How to resolve the issue:
Remove any jars you have contained in your agent and drop them into the jvm/lib/ext folder. You will need to restart Domino/Notes. The jars will then be loaded by the JVM only once.
If you are still getting the error at that point, then is more likely another Java agent is not cleaning up correctly after itself.