Native library(terminalio) to read password

startManagedWeblogic.sh soa_server fails in 11g SOA
Error "Native library(terminalio) to read password securely from commandline on Linux x86_64
2010-05-12 9:39

metalink:ID 955853.1

解决办法:

1. Create a boot.properties file in $MIDDLEWARE_HOME/user_projects/domains//servers//security/ that contains: username=weblogic password=

2. Then run startManagedWeblogic.sh and it will not ask for the username/password on startup

OR:

1. Edit the /user_projects/domains//bin/setDomainEnv.sh and change: /wlserver_10.3/server/native/linux/i686 to: /wlserver_10.3/server/native/linux/x86_64

OR:

1.Run the startManagedWeblogic.sh script with: startManagedWeblogic.sh -Dweblogic.management.allowPasswordEcho=true.

 

//

本人是在solaris11G上出现此问题,使用第1种方法已经解决问题。

import com.jacob.activeX.ActiveXComponent; import com.jacob.com.Dispatch; import java.lang.reflect.Field; public class ZKTecoConnectionExample { static { // 设置java.library.path System.setProperty("java.library.path", "D:\\jacob-1.19"); // 重新加载java.library.path(因为System.setProperty不会立即生效) try { Field fieldSysPath = ClassLoader.class.getDeclaredField("sys_paths"); fieldSysPath.setAccessible(true); fieldSysPath.set(null, null); } catch (Exception e) { e.printStackTrace(); } // 加载jacob库 System.load("D:/jacob-1.19/jacob-1.19-x64.dll"); // 确保文件名与实际文件名一致 } public static void main(String[] args) { try { // 创建 ActiveX 组件 ActiveXComponent zkem = new ActiveXComponent("zkemkeeper.ZKEM"); // 考勤机的 IP 地址和端口 String ip = "192.168.13.14"; // 替换为考勤机的实际 IP 地址 int port = 4370; // 默认端口 // 尝试连接考勤机 boolean isConnected = Dispatch.call(zkem, "Connect_Net", ip, port).getBoolean(); if (isConnected) { System.out.println("Connected to device."); // 尝试使用默认密码 int[] defaultPasswords = {0, 0, 0, 0, 0, 0}; // 默认密码 boolean isAuth = false; for (int password : defaultPasswords) { isAuth = Dispatch.call(zkem, "SetCommPassword", password).getBoolean(); if (isAuth) { System.out.println("Authentication successful with password: " + password); break; } } if (isAuth) { // 读取用户信息 boolean isRead = Dispatch.call(zkem, "ReadAllUserID", 1).getBoolean(); // 1 表示从设备读取 if (isRead) { System.out.println("User data read successfully."); } else { System.out.println("Failed to read user data."); } } else { System.out.println("Authentication failed. Please check the password."); } // 断开连接 Dispatch.call(zkem, "Disconnect"); } else { System.out.println("Failed to connect to device."); } } catch (Exception e) { e.printStackTrace(); } } }运行结果com.jacob.com.ComFailException: Can't co-create object at com.jacob.com.Dispatch.createInstanceNative(Native Method) at com.jacob.com.Dispatch.<init>(Dispatch.java:99) at com.jacob.activeX.ActiveXComponent.<init>(ActiveXComponent.java:58) at ZKTecoConnectionExample.main(ZKTecoConnectionExample.java:27)
最新发布
03-20
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值