1

I am doing a proof of concept for Ehcache-RMI Replication.

I am using 2 laptops, both running terracotta server. (And both are in same network). ehcache.xml is configured for Automatic peer discovery using multicast IP.

Both have a stand alone java program.

I ran the main program in one laptop first,Since its a cache miss for first time, it will write into the cache. When I ran program from another laptop, i am getting this exception..

13 Mar, 2012 12:12:15 AM net.sf.ehcache.pool.sizeof.AgentLoader <clinit> INFO: Unavailable or unrecognised attach API : java.lang.ClassNotFoundException: com.sun.tools.attach.VirtualMachine 13 Mar, 2012 12:12:15 AM net.sf.ehcache.pool.sizeof.JvmInformation <clinit> INFO: Detected JVM data model settings of: 32-Bit HotSpot JVM 

But, on another laptop, it just seems perfect. Its saying,

Mar 13, 2012 12:07:31 AM net.sf.ehcache.pool.sizeof.AgentLoader$1 run INFO: Located valid 'tools.jar' at 'C:\Program Files\Java\jdk1.6.0_24\jre\..\lib\tools.jar' 

I am really stuck..

Can somebody help!

2 Answers 2

1

As you can see this only informational. Basically, Ehcache will try to load an Agent it packages within its own jar to do object sizeOf measurements. Ehcache comes with 3 bundled SizeOfEngine implementations: The reflection based one, the Unsafe based one and the Agent one. It will try to load them from last to first one (reversed order listed). Apparently, you're using different JDK/VM on these two machines. The Agent one can only be loaded if you are running a JDK 1.6 and if it can locate the Attach API (not on the classpath on all platforms, but it tries to locate the jar nonetheless). This seems to fail on the former for some reason. There isn't really a reason for you to do anything about this... If you really want to use the agent (and hence it'd have to attach to the VM) you either need to make sure you run JDK 1.6, or extract the agent jar from the ehcache jar and declare the agent when starting the VM.

Now, if you do use JDK 1.6 on that machine, I'd love to know the details (OS, version, location of the tools.jar in the JDK installation) and see if we've missed a corner case somehow...

Sign up to request clarification or add additional context in comments.

Comments

0

The solution is to just use the java -classpath approach and load the two libraries then execute the HotThread program:

java -classpath "/opt/jdk1.6/lib/tools.jar:/home/samba/HotThread.jar" hotthread.Main 3223 

Ref : Here

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.