Java proxygen抛出System.NullReferenceException
我想在我们的java应用程序中使用一个dll文件,我正在使用jni4net,当我试图为它抛出的dll创建代理时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
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
类中),并将这些非泛型类放在不同的项目中