我正在尝试生成代理。我从samples文件夹复制了一个样本xml并对其进行了修改。
操作系统:Windows 8.1
Java版本:1.7.0_45(32或64位)
JNI4NET版本:0.8.6
命令行:proxygen config.xml
config.xml中:
<?xml version="1.0" encoding="utf-8" ?>
<jni4net-proxygen xmlns="http://jni4net.sf.net/0.8.7.0/toolConfig.xsd">
<!-- Location where .java files will be generated into. It's relative or absolute path. -->
<TargetDirJvm>java</TargetDirJvm>
<!-- Location where .cs files will be generated into. It's relative or absolute path. -->
<TargetDirClr>csharp</TargetDirClr>
<!-- List of class paths (.jar files or directories) which define known classes for generator-->
<ClassPath Path="scr-classicconnector-7.5.1.jar"/>
<!-- List of Java classes which should have proxy generated -->
<JavaClass TypeName="com.saperion.connector.SaClassicConnector"/>
</jni4net-proxygen>
我得到的错误:
jni4net.proxygen - Copyright (C) 2009 Pavel Savara - licensed under GPLv3
System.InvalidOperationException: There is an error in XML document (20, 2). ---> System.InvalidOperationException: <jni4net-proxygen xmlns='http://jni4net.sf.net/0.8.7.0/toolConfig.xsd'> was not expected.
at Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationReaderToolConfig.Read8_jni4netproxygen()
--- End of inner exception stack trace ---
at System.Xml.Serialization.XmlSerializer.Deserialize(XmlReader xmlReader, String encodingStyle, XmlDeserializationEvents events)
at System.Xml.Serialization.XmlSerializer.Deserialize(Stream stream)
at net.sf.jni4net.proxygen.Program.Work(String[] args)
at net.sf.jni4net.proxygen.Program.Main(String[] args)
可以请别人帮忙......
谢谢, 安德烈亚斯
答案 0 :(得分:1)
谢谢Pavel Savara: 问题是xmlns用于proxygen版本0.8.7。我使用0.8.6版本的工具。将其更改为“0.8.6.0”后,就可以了。