0

I'm trying to get Jasper Reports working from my app in VB.Net. So, after considering many options, I decided to create a small program in java to launch it, and reference it in my .Net project, using JNI4NET.

I don't know if I'm doing something wrong, but, when I launch the proxygen tool, it gives me a "OK/Completed" message, it creates two directories, java and csharp, with two files that I think are the two proxies.

The problem comes when I follow the Wiki instructions(https://github.com/jni4net/jni4net/wiki/Generating-Proxies) and there says that it should be a "build.cmd" file that creates the dll that will be included later in my project. I don't have that file. What am I missing?

I launched the proxy with the command line .\proxygen.exe ProxyGenJasperTest.xml, being the xml:

<?xml version="1.0" encoding="utf-8" ?>
<jni4net-proxygen xmlns="http://jni4net.sf.net/0.8.8.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="lib/com.springsource.com.informix.jdbc-3.0.0.JC3.jar"/>
<ClassPath Path="lib/commons-beanutils-1.9.2.jar"/>
<ClassPath Path="lib/commons-collections-3.2.2.jar"/>
<ClassPath Path="lib/commons-digester-2.1.jar"/>
<ClassPath Path="lib/commons-logging-1.2.jar"/>
<ClassPath Path="lib/ecj-4.3.1.jar"/>
<ClassPath Path="lib/groovy-all-2.4.5.jar"/>
<ClassPath Path="lib/itext-2.1.7.jar"/>
<ClassPath Path="lib/jasperreports-6.2.2.jar"/>
<ClassPath Path="lib/jasperreports-fonts-6.2.2.jar"/>
<ClassPath Path="lib/jasperreports-functions-6.2.2.jar"/>
<ClassPath Path="lib/jasperreports-javaflow-6.2.2"/>
<ClassPath Path="lib/joda-time-2.4.jar"/>
<ClassPath Path="lib/ojdbc6.jar"/>
<ClassPath Path="JasperTest.jar"/>

<!-- List of Java classes which should have proxy generated -->
<JavaClass TypeName="jaspertest.JasperTest"/>

</jni4net-proxygen>

XML vilely stolen from samples and changed.

Any help? Thanks.

xecollons
  • 536
  • 6
  • 22
  • I don't think the build.xml is generated by proxygen. At any rate, It would contain something like msbuild project.sln, where the project references the generated .net source files. Mind you you'll have to have another proxygen pass to go from the .net code back to java native interfaces (if I understand your intentions). – ferry Jun 21 '16 at 12:27
  • @ferry It compiles great if I don't use the xml with the proxygen, and generates the necessary files. But without the xml I can't inject all libraries in one command line because of char limit. What I ended doing was to generate the build.xml without the proxygen.xml, and changing it manually to add the new classes. – xecollons Jun 21 '16 at 16:18

0 Answers0