Vijayakumar
Vijayakumar

Reputation: 85

Java Agent:- Notes Error : JVM : Attempt to retrieve java agent attachments failed

I have got problem while working with Java agent in Notes client. I need to upload the file from particular path in Notes client memo form. I am using Java agent. It uses Alfresco's API to upload file to alfresco server. It works fine in standalone Java application. It is working fine for the first time in Lotus Notes also. But when I want to update for the second time or if I run any Java agent which has JAR files imported for the second time, it throws the following error:

Notes Error : JVM : Attempt to retrieve java agent attachments failed.

I added necessary jar files in the server's jvm/lib/ext path. After restarting server, it works for first time, then it fails for second time. Any solutions would be appreciated.

Upvotes: 0

Views: 2380

Answers (2)

Frantisek Kossuth
Frantisek Kossuth

Reputation: 3524

It is known issue with memory leak if Java agent or Java script library contains JAR files. The bigger the sooner your server/amgr crashes. Not fixed since beginning of Java agents :-(.

Common workaround is to put all JARs into jvm/lib/ext folder, as @Simon O'Doherty mentioned.

Modern approach is to use XAgents or servlet.

Upvotes: 1

Richard Schwartz
Richard Schwartz

Reputation: 14628

The 'Attempt to retrieve java agent attachments failed' error on the second run is almost certainly caused by memory exhaustion. That means that on the first run, your agent is grabbing a lot of memory and failing to free it.

This can happen if your code is accessing a large number of objects in the lotus.domino.* classes and failing to call their recycle() method. (Each such object allocates some non-JVM memory, which is not freed by the JVM's garbage collector. It is essential that you call the recycle() method to free that memory. Usually, the finally clause is a good place to do this.)

I don't know anything about the Alfresco API, but it may also leak memory if it is not used properly.

Upvotes: 2

Related Questions