Problems running JNI4NET proxygen with xml config

1.2k Views Asked by At

I am trying to generate proxies. I copied a sample xml from the samples folder and modified it.


OS: Windows 8.1

Java Version: 1.7.0_45 (32 or 64 bit)

JNI4NET Version: 0.8.6


The command line: 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>

The error I get:

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)

Can please someone help out...

Thanks, Andreas

1

There are 1 best solutions below

1
On BEST ANSWER

Thank you Pavel Savara: The problem was the xmlns which was for proxygen version 0.8.7. I was using it with a 0.8.6 version of the tool. After changing it to '0.8.6.0', it worked.