Atitit. 。Jna技术与 解决 java.lang.Error: Invalid memory access
Atitit. 。Jna技术与 解决 java.lang.Error: Invalid memory access
1. 原因与解决
Timeout::wait dll 或者other resource load finish...
And retry
2. jNA (这个ms sun 的)
我目前正做着一个相关的项目,说白了JNA就是JNI的替代品,以前用JNI需要编译一层中间库,现在JNA直接调用C的库
JNA的功能和P/Invoke类似,但编写方法与P/Invoke截然不同。JNA没有使用Annotation,而是通过编写一般的Java代码来实现。
P/Invoke是.NET平台的机制。而JNA是Java平台上的一个开源类库,和其他类库没有什么区别。只需要在classpath下加入jna.jar包,就可以使用JNA
JNA提供了一个动态的C语言编写的转发器,可以自动实现Java和C的数据类型映射。你不再需要编写那个烦人的C动态链接库。
当然,这也意味着,使用JNA技术比使用JNI技术调用动态链接库会有些微的性能损失。可能速度会降低几倍。但对于绝大部分项目来说,影响不大。
作者:: 老哇的爪子 Attilax 艾龙, EMAIL:1466519819@qq.com
转载请注明来源: http://www.cnblogs.com/attilax/
3. Code
public static void inix() throws IniEx {
//while(true)
{
try {
Thread.sleep(5000);
try {
ini_core();
} catch (Exception e) {
ini_core();
}
} catch (InterruptedException e2) {
// TODO Auto-generated catch block
e2.printStackTrace();
}
}
}
private static void ini_core() throws IniEx {
if(userID<=0)
{
try {
} catch (Throwable e) {
throw new RuntimeException(e);
}
if(userID<=0)
throw new IniEx();
}
}
4. 参考
paip.java 调用c++ dll so总结 - attilax的专栏 - 博客频道 - CSDN.NET.html
paip.java c# .net php python调用c++ c dll so windows api 总结 - attilax的专栏 - 博客频道 - CSDN.NET.html
Atitit. 。Jna技术与 解决 java.lang.Error: Invalid memory access的更多相关文章
- Atitit. Exception in thread "main" java.lang.Error: Unresolved compilation problem:
Atitit. Exception in thread "main" java.lang.Error: Unresolved compilation problem: 1.1. ...
- 解决java.lang.SecurityException: Invalid signature file digest for Manifest main attributes
解决java.lang.SecurityException: Invalid signature file digest for Manifest main attributes 当项目依赖其他jar ...
- org.apache.axis2.AxisFault: java.lang.Error: Unresolved compilation problem:
原创:转载请注明出处 今天遇到以下一个异常,找了好长时间,就是不知道什么原因, 在网上搜了好多,也没搜到相关的解决方法. 1.异常展示, org.apache.axis2.AxisFault: jav ...
- java.lang.Error: Unresolved compilation problems: Syntax error on token "return", delete this token Type mismatch: cannot convert from Init to String
java.lang.Error: Unresolved compilation problems: Syntax error on token "return", delete ...
- 解决springboot项目请求出现非法字符问题 java.lang.IllegalArgumentException:Invalid character found in the request target. The valid characters are defined in RFC 7230 and RFC 3986
springboot版本: 2.1.5 最近使用springboot搭建了一个App后台服务的项目,开发接口的时候在本机使用postman工具做请求测试,请求返回一直很正常,但是在前端开发使用h5请求 ...
- java.lang.Error: java.lang.NoSuchMethodError: org.objectweb.asm.ClassWriter.<init>(Z)V
有时候出现这种怪异的问题,是由于多个版本的class存在. 比如说:某个java编译成class后,放到classes下面,然后lib目录下,也有这个class所在的jar包,这样就导致classpa ...
- java.lang.IllegalAccessError: tried to access method com.google.common.base.Stopwatch.<init>()V from 解决
在用spark的yarn-cluster模式跑fpgrowth进行频繁项集挖掘的时候,报如下错误: ERROR yarn.ApplicationMaster: User class threw exc ...
- hibernate 解决 java.lang.NoClassDefFoundError: Could not initialize class org.hibernate.validator.internal.engine.xxx 这类的问题
<!-- 解决 java.lang.NoClassDefFoundError: Could not initialize class org.hibernate.validator.intern ...
- java.lang.Error: Unresolved compilation problem: 解决方案
严重: Allocate exception for servlet WX_Interfacejava.lang.Error: Unresolved compilation problem: The ...
随机推荐
- jQuery插件示例笔记
插件的种类 封装对象方法的插件 将对象方法封装起来,用于对通过选择器获取的jQuery对象进行操作. //注意,为了更好的兼容性开始前有个分号 ;(function($){ //此处将$作为匿名函数的 ...
- Linux设备文件简介
转:http://www.360doc.com/content/11/0418/00/5087210_110410837.shtml 版权声明 本 文作者是一位自由软件爱好者,所以本文虽然不是软件,但 ...
- Ubuntu下轻松安装virtualbox
转自:http://blog.csdn.net/flm2003/article/details/8168628 以下假设你的Ubuntu系统版本为11.10的64位版本,进行如下操作: 1.到http ...
- Unity-EasyTouch插件之One Finger
这节课,我们主要讲下单个手指的测试.比如单击啊,双击啊,拖动,单手滑动等. 单击: public class TouchTest : MonoBehaviour { // Subscribe to e ...
- android sdk下载SDK Platform失败记录
在使用android sdk manager下载的时候会遇到 下载完毕后,你可能会出现如下图一样的错误,就算重复尝试多次依然无法正常安装 Downloading SDK Platform Androi ...
- C#.net开发 List与DataTable相互转换 【转】
http://blog.csdn.net/shuizhaoshui/article/details/51425527 在.NET开发中,操作关系型数据库提取数据经常用到DataTable.ASP.NE ...
- TensorFlow环境搭建及安装教程
1.安装虚拟环境virtualenv相关配置(创建了python3.5的环境) 2.http://docs.nvidia.com/cuda/cuda-installation-guide-linux/ ...
- OpenStack 实现技术分解 (5) 应用开发 — 使用 OpenStackClients 进行二次开发
文件夹 文件夹 前文列表 參考阅读 前言 OpenStackClients 使用 OpenStackClients 获取 project_client object 的 demo 调用 project ...
- [Functional Programming Monad] Combine Stateful Computations Using A State Monad
The true power of the State ADT really shows when we start combining our discrete, stateful transact ...
- dubbo-monitor安装监控中心,管理控制台安装网页一直访问不到,解决bug的方式记录
问题再现 第一步,重启机器 第二步,按照dubbo-monitor需要开启的服务,顺序逐一进行启动,之前的推翻全部重新再走一遍就通了,千万不能死磕...很浪费时间.... 通过打印日志追踪问题的所在. ...