Wednesday, July 04, 2012

EM12c: How to fix java.lang.UnsatisfiedLinkError: /tmp/libjamagent.so.1: failed to map segment from shared object: Operation not permitted error while deploying Jamagent?

Problem: While deploying jamagent, following error is seen in jamagent log:
12/07/04 07:58:34 JAM Agent: jaminit.init()
12/07/04 07:58:34 JAM Agent: jaminit.init() Instantiating jamagent
12/07/04 07:58:34 OS is Linux
12/07/04 07:58:34 arch is i386
12/07/04 07:58:34 JAM Agent loadNative() Wrote to [/tmp/libjamagent.so.1]
12/07/04 07:58:34 >>java.library.path: /u01/usr/apps/abc/10.1.3/appsutil/jdk/jre/lib/i386/server:/u01/usr/apps/abc/10.1.3/appsutil/jdk/jre/lib/i386:/u01/usr/apps/abc/10.1.3/appsutil/jdk/
12/07/04 07:58:34 JAM Agent: loadNative Exception loading [/tmp/libjamagent.so.1] /tmp/libjamagent.so.1: /tmp/libjamagent.so.1: failed to map segment from shared object: Operation not permitted
12/07/04 07:58:34 java.lang.UnsatisfiedLinkError: /tmp/libjamagent.so.1: /tmp/libjamagent.so.1: failed to map segment from shared object: Operation not permitted
12/07/04 07:58:34       at java.lang.ClassLoader$NativeLibrary.load(Native Method)
12/07/04 07:58:34       at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1803)
12/07/04 07:58:34       at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1699)
12/07/04 07:58:34       at java.lang.Runtime.load0(Runtime.java:770)
12/07/04 07:58:34       at java.lang.System.load(System.java:1003)
12/07/04 07:58:34       at jamagent.jamagent.loadNative(jamagent.java:688)
12/07/04 07:58:34       at jamagent.jamagent.<init>(jamagent.java:995)
12/07/04 07:58:34       at jamagent.jaminit.init(jaminit.java:52)

Possibility is that error is encountered when /tmp directory is mounted with -noexec option.

Solution: Make /tmp directory executable using following command:
mount -o remount,exec /tmp

Retry deploying jamagent.

No comments: