Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/http/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java proxygen抛出System.NullReferenceException_Java_Jni4net_Java Interop - Fatal编程技术网

Java proxygen抛出System.NullReferenceException

Java proxygen抛出System.NullReferenceException,java,jni4net,java-interop,Java,Jni4net,Java Interop,我想在我们的java应用程序中使用一个dll文件,我正在使用jni4net,当我试图为它抛出的dll创建代理时 System.NullReferenceException: Object reference not set to an instance of an object. at net.sf.jni4net.proxygen.model.Repository.RegisterType(Type type, TypeRegistration registration) at n

我想在我们的java应用程序中使用一个dll文件,我正在使用jni4net,当我试图为它抛出的dll创建代理时

System.NullReferenceException: Object reference not set to an instance of an object.
   at net.sf.jni4net.proxygen.model.Repository.RegisterType(Type type, TypeRegistration registration)
   at net.sf.jni4net.proxygen.model.Repository.RegisterType(Type type)
   at net.sf.jni4net.proxygen.model.Repository.RegisterType(Type type, TypeRegistration registration)
   at net.sf.jni4net.proxygen.model.Repository.Register()
   at net.sf.jni4net.proxygen.Program.Work(String[] args)
   at net.sf.jni4net.proxygen.Program.Main(String[] args)

你的代码使用泛型吗?根据Proxygen文档,该工具无法为包含泛型类型的方法签名生成桥接包装

我遇到了相同的错误消息,在公共方法签名中使用泛型就是问题所在。我使用引用的Proxygen分支解决了这个问题

编辑:到分支

或者,您可以尝试改用非泛型数据结构,或者将泛型数据结构包装在非泛型类中(例如,将
List
包装在
MyObjList
类中),并将这些非泛型类放在不同的项目中