Exception from System.loadLibrary(smjavaagentapi) java.lang.UnsatisfiedLinkError: no smjavaagentapi in java.library.path
可能原因:
缺少smjavaagentapi.jar文件或者libsjavaagentapi.so缺少相关的依赖包。
解决方法:
1. 检查sso的lib下面是否有smjavaagentapi.jar
2.使用ldd命令检查sso的bin下面的ligsmjavaagentapi.so是否缺少依赖包,如果缺少,添加到/usr/lib目录下。
补充知识1:
Implementation differences between smjavaagentapi and smagentapi
http://www.siteminderconsulting.com/smjavaagentapi-vs-smagentapi/
Another interesting piece of information for those who work closely with SM SDK for Agent APIs. Siteminder SDK provides an array of agent APIs which one can leverage to write a custom agent from scratch ( we will talk about siteminder custom agents in detail in coming articles , contact me if you need more information on this ). Lot many enterprises use these agent APIs to write there custom solutions around agent area.
Applications can use these agent APIs in 2 ways .. they can use either the pure java agent APIs or JNI java agent APIs. smagentapi.jar is the library which is used for pure java implementation while smjavaagentapi.jar is used in case of JNI java agent api implementation. Applications have the liberty to use either of them based on there architecture. From SM SDK perspective both libraries have same functionality but built with different technologies. So there is a difference the way applications can use them in there environments.
smagentapi.jar does not need any shared objects or dll to do its functionality , it is a pure java api and can be used standalone. smjavaagentapi needs the underlying shared object or dll to run , it calls the native functions contained in shared objects/DLLs to achieve its tasks. In case you dont have the shared objects/dll in your environment or the path is not set properly then it is very much common to get following “unsatisfied link” errors while loading these libraries.
Sample error.
“EXCEPTION OCCURED WHILE INITIALIZING SESSION MANAGER – SESSION MANAGER FAILED TO INITIALIZE
: java.lang.UnsatisfiedLinkError: netegrity/siteminder/javaagent/AgentAPI.javaagent_api_getConfig ”
So if you are using JNI Java agent api , dont forget to take care of native shared object/dll( libsmjavaagentapi.so/dll)
补充知识2:
http://tony007.com/netegrity.htm
Netegrity Siteminder (now Computer Associates) provides the foundation for policy-based authentication and authorization across the Enterprise. The 2 major components in Siteminder are the Policy Server and the Remote Agents. The agents intercept the request for an electronic resource and enforce the access policy located in the Policy Server, basically, the agents are like security guards that verify the persons identity and open the secure door.
Netegrity provides agents for many web and application servers, however,
currently (as far as I know) there is no agent available for tomcat or
jboss/jetty.
I developed a custom agent using the Siteminder sdk that supports most
Servlet 2.3 compliant containers including tomcat and jboss (with embedded
tomcat or jetty). This is a basic agent that is meant to be used in a
development environment. It allows a developer using standalone jboss/tomcat
to test authentication/authorization against the Netegrity policy server.
I'm making this available to the Netegrity Siteminder
community in the traditional open source agreement, which basically means
- use it at your own risk. Having said that, you may
contact me with any questions/problems related to this agent and I will
be glad to answer your questions and provide bug fixes (in my spare time).
After you read the application strategy and installation instructions
below, you may request the runtime (.jar) file and/or source code by
contacting me.
Application
Strategy
This siteminder agent only
supports basic authentication and at this time does not use policy server
administration functions, this means it does not handle user timeouts
or cache flushing. It will however, cache unprotected resources to avoid
policy server call overhead and handle SSO tokens (SMSESSION) to provide
session re-establishment.
The most common options to intercept a request
in tomcat are valves and servlet filters. I decided to implement my siteminder
agent as a Servlet filter because it's a portable, 100% Sun specifications
compliant solution.
Installation
Step 1 - Confirm that the Netegrity
Siteminder client support is installed, this may be available if you 1)
installed one of the Netegrity agents or 2) installed the Siteminder SDK.
Basically, the 2 files you need are the smjavaagentapi.jar which is a
java wrapper (JNI) to the actual C api implementation shared library (in
windows is called smjavaagentapi.dll). The DLL file must be located somewhere
in the system path and must be of the same version as the JAR file.
Step 2 - Create a configuration file as shown
below and call it smfilter.cfg (adjust it for you application)
| PS_IP = 127.0.0.1 PS_CONMIN = 1 PS_CONMAX = 3 PS_CONSTEP = 1 PS_TIMEOUT = 75 PS_AUPORT = 44442 PS_AZPORT = 44443 PS_ACPORT = 44441 AGENT_NAME = mylaptop AGENT_IP = 127.0.0.1 |
- The AGENT_NAME parameter must contain the name
of an agent defined in the policy server, it must support 4.x clients.
- The PS_IP parameter above should point to your policy server
- Execute the following command to update the configuration file with
an encrypted shared secret word - note the parameter '-c' specifies the
location of the configuration file.
#java -classpath smfilter.jar com.tony007.FilterUtil
-c c:\config\smfilter.cfg
This will add the following line to the configuration
file (containing your shared secret encrypted)
AGENT_SECRET_ENC = bWFzdGVy
Step 3 - Update your server web.xml definition
to include this filter.
In tomcat
this file located in the /conf directory (ie., C:\jakarta-tomcat-4.1.30\conf).
In jboss with tomcat
it is located in the jbossweb-tomcat directory (i.e., C:\jboss-3.2.3\server\default\deploy\jbossweb-tomcat41.sar)
In jboss with jetty
(Identity Minder default) it's called webdefault.xml and located in the
jbossweb.sar directory (i.e., D:\IdentityMinder\jboss-3.0.6\server\default\deploy\jbossweb.sar\webdefault.xml).
Insert the lines below immediately after the <web-app>
tag
|
<!-- start - Netegrity Agent Filter --> |
NOTE: You must change the config parameter above
to reflect the location of your smfilter.cfg file.
Step 4 - Restart your web container.
Test this agent by creating a test policy for this agent
Exception from System.loadLibrary(smjavaagentapi) java.lang.UnsatisfiedLinkError: no smjavaagentapi in java.library.path的更多相关文章
- Exception in thread "main" java.lang.UnsatisfiedLinkError: no awt in java.library.path:
Exception in thread "main" java.lang.UnsatisfiedLinkError: no awt in java.library.path: 这是 ...
- "AWT-EventQueue-0" java.lang.UnsatisfiedLinkError: no freetype in java.library.path
Exception in thread "AWT-EventQueue-0" java.lang.UnsatisfiedLinkError: no freetype in java ...
- Error: java.lang.UnsatisfiedLinkError: no ntvinv in java.library.path
Error Message When compiling or executing a Java application that uses the ArcObjects Java API, the ...
- java.lang.UnsatisfiedLinkError: no XXX in java.library.path
其中涉及的测试源码如下: For those who didn't install Javawith default settings, a systematic way for solving JN ...
- ubuntu 12.04 x86_64:java.lang.UnsatisfiedLinkError: Could not load SWT library. Reasons
sy@sy-Aspire-:~$ .0_155965261/configuration/.log !SESSION -- ::39.595 ------------------------------ ...
- 异常:没有找到本地方法库,java.lang.UnsatisfiedLinkError: no trsbean in java.library.path
1.问题描述 迁移环境中遇到这个问题 : Fri Apr 20 15:22:31 CST 2018, Exception:500004___-500004,没有找到本地方法库,java.lang.Un ...
- java.lang.NoClassDefFoundError: com.sap.conn.jco.JCo (initialization failure) java.lang.UnsatisfiedLinkError: no sapjco3 in java.library.path
java.lang.NoClassDefFoundError: com.sap.conn.jco.JCo (initialization failure) at java.lang.J9VMInter ...
- jni调用 java.lang.UnsatisfiedLinkError: no segmentor_jni in java.library.path
改过 LD_LIBRARY_PATH 改过 /etc/ld.so.conf 参考这篇文章 http://blog.csdn.net/zjuylok/article/details/4152559 最后 ...
- 解决Exception in thread "AWT-EventQueue-0" java.lang.UnsatisfiedLinkError: no jogl in java.library.path问题
首先要把jonl.jar和gluegen.jar导入到eclipse中,然后把解压后的4个.dll文件也导入到eclipse中 具体操作: jonl文件下载地址 链接:https://pan.baid ...
随机推荐
- 关于.net和java des加密
在.net和java环境中对于des加密,有几点要协同的地方: 密钥和密钥向量Key IV 加密模式CipherMode 填充模式PaddingMode 密文编码方式 下面一段.net的des加密方式 ...
- hadoop ncdc数据下载方法
我在看<Hadoop权威指南>时,里面提供了NCDC天气数据样本,提供的下载链接是:点击打开链接,但是里面只提供了1901和1902这两年的数据,这未免也太少了点!完全称不上“BIG DA ...
- 如何轻松学习C语言编程!
C语言是面向过程的,而C++是面向对象的 C和C++的区别: C是一个结构化语言,它的重点在于算法和数据结构.C程序的设计首要考虑的是如何通过一个过程,对输入(或环境条件)进行运算处理得到输出(或实现 ...
- 2、ASP .NETCore 2.0之视图
一.Razor基础 声明:Razor不是编程语言,是服务器端标记语言.Razor是一种允许开发者在网页中嵌入服务器端代码的标记语法(主要是针对VB和C#). 1.C#中Razor基本语法 (1).Ra ...
- 教你制作高逼格的技术分享Keynote(PPT)
本文来自 网易云社区 . 作为一个程序猿/媛,想必大家都参与过大大小小各式各样的技术分享,异或在不同的场合分享自己的技术心得.抛开分享内容的质量不谈,笔者发现通常这些分享者的演示文稿(Keynot或P ...
- Java 访问修饰符使用规则
作用域 当前类 同一package 子孙类 其他package public √ √ √ √ protected √ √ √ × friendly √ √ × × private √ × × × 1. ...
- Rabbitmq消息服务器通讯异常: name must not be blank
前人挖坑,后人填! 倒霉的遇到一个破项目,该 项目使用了 RabbitMQ 消息队列向服务器发送消息, 但在发送中老是报 RabbitMQ 服务器异常! 呃,查看了服务器,服务器好好的,日志中却是这样 ...
- 6.iptables常用规则
开启ip段192.168.1.0/24端的80口 开启ip段211.123.16.123/24端ip段的80口 # iptables -I INPUT -p tcp --dport 80 -j DRO ...
- 使用 Git 进行版本控制
使用 Git 进行版本控制 版本控制软件让你能够拍摄处于可行状态的项目的快照.修改项目(如实现新功能)后,如果项目不能正常运行,可恢复到前一个可行状态. 通过使用版本控制软件,你可以无忧无虑地改进项目 ...
- 编译的 Ruby 2.3.0 缺少 openssl 支持的解决方法 (已解决)
我的系统是centos 7.5,已离线安装ruby-2.3.0,openssl-1.0.2l,rubygems-2.7.4 如下图: 但是在 gem sources -a http://gems.r ...