Discussion:
[Ikvm-developers] WARNING messages while compiling dll from jar using saxon fro class not found
Tilak Raj Singh
2017-06-08 11:34:24 UTC
Permalink
Hi All,

I have a Java Application for xslt transformation which was compiling
correctly using ikvmc and the dll generated was working fine in my app.

Now when I added a few lines of code to my java app as follows

if(tClassName.equalsIgnoreCase("net.sf.saxon.TransformerFactoryImpl"))
((net.sf.saxon.Controller)transformer).setMessageEmitter(new
net.sf.saxon.serialize.MessageWarner());

and generating dll using the command

call ikvmc -debug -target:library -nostdlib
-lib:C:\Windows\Microsoft.NET\Framework\v4.0.30319 FMXSLTJava.jar
-out:FMXSLTJava.dll

following warning messages are being thrown

IKVM.NET Compiler version 7.2.4630.5
Copyright (C) 2002-2012 Jeroen Frijters
http://www.ikvm.net/

warning IKVMC0123: Assuming assembly reference "System, Version=4.0.0.0,
Culture=neutral, PublicKeyToken=b77a5c561934e089" matches "System,
Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089", you may
need to supply runtime policy
warning IKVMC0100: Class "net.sf.saxon.Controller" not found
warning IKVMC0100: Class "net.sf.saxon.serialize.MessageWarner" not found
warning IKVMC0111: Emitted java.lang.NoClassDefFoundError in
"FMJAXPInvoker.transform(Ljavax.xml.transform.Source;Ljavax.xml.transform.Source;Ljavax.xml.transform.Result;[Ljava.lang.String;)Z"
("net.sf.saxon.serialize.MessageWarner")

ignoring these messages as given on several other forums and proceeding to
use this generated dll in my app causes it to crash on this particular line
of code which I have inserted.

saxon9he.jar is embedded in this jar file I am using here. Also the eclipse
project classpath contains the path to the jar file correctly. Jar is also
being generated without any error.

Can anyone provide some pointers on how do I procedd to resolve this?

Thanks and Regards,
Tilak Raj Singh
Volker Berlin
2017-06-08 22:02:03 UTC
Permalink
Hi,

What you do to try? You speek ever over Eclipse. I expect that you
compile your program with Visual Studio or MSBuild.
ikvm_dynamic_assembly__769101500
This sounds also that you try to run with IKVM.exe and not with Visual
Studio.

In general you can work with 2 modi:

* ikvm.exe as replacment of java.exe. Then you work with jar files
* Or you compile an exe with Visual Studio. Then you work only with dlls.
THe project classpath is included in FMXSLT.jar
IKVMC can like Visual Studio only compile with dll references that you
set. Of course you can not link to a jar file. You can only link to
another dll. For cyclic dependency you can compile multiple dlls in one
step. All other needed dependecies must you set in the command line
My eclipse project contains other jar file too like (xercesImpl.jar
and xalan.jar)
If you need this at runtime then you must also compile this jar files to
dlls and add the resulting dlls as reference to the next compiler call.

Volker
Hi Volker,
I am new to ikvmc and hence not sure if I am firing the correct
command. THe project classpath is included in FMXSLT.jar and hence I
was hoping ikvmc would resolve the classes automatically by reading
that file from the jar.
I even tried providing -classpath to saxon9he.jar with this command
which created FMXSLTJava.dll without any warnings but when running it
from my application I got a error as below
[A]net.sf.saxon.Controller cannot be cast to
[B]net.sf.saxon.Controller. Type A originates from
'ikvm_dynamic_assembly__769101500, Version=2017.608.1608.6942,
Culture=neutral, PublicKeyToken=null' in the context 'LoadNeither' in
a byte array. Type B originates from 'FMXSLTJava, Version=0.0.0.0,
Culture=neutral, PublicKeyToken=null' in the context 'Default' at
location 'base-path\FMXSLTJava.dll'.
I also tried call ikvmc -debug -target:library -nostdlib
-lib:C:\Windows\Microsoft.NET\Framework\v4.0.30319 { saxon9he.jar } {
FMXSLTJava.jar } which created two dlls (saxon9he.dll and
FMXSLTJava.dll), but again on running with my app I got a similar
error as below
[A]net.sf.saxon.Controller cannot be cast to
[B]net.sf.saxon.Controller. Type A originates from
'ikvm_dynamic_assembly__769101500, Version=2017.608.1608.6942,
Culture=neutral, PublicKeyToken=null' in the context 'LoadNeither' in
a byte array. Type B originates from 'FMXSLTJava, Version=0.0.0.0,
Culture=neutral, PublicKeyToken=null' in the context 'Default' at
location 'base-path\saxon9he.dll'.
My eclipse project contains other jar file too like (xercesImpl.jar
and xalan.jar) and it all used to work fine before....only after
introducing this particular code into my project I am facing this error.
Thanks and Regards,
Tilak Raj Singh
On Fri, Jun 9, 2017 at 12:55 AM, Volker Berlin
I can not see that you give ikvmc any reference saxon9he.dll that
the error is expected.
And what you expected with the eclipse project classpath?
Volker
Post by Tilak Raj Singh
Hi All,
I have a Java Application for xslt transformation which was
compiling correctly using ikvmc and the dll generated was working
fine in my app.
Now when I added a few lines of code to my java app as follows
if(tClassName.equalsIgnoreCase("net.sf.saxon.TransformerFactoryImpl"))
((net.sf.saxon.Controller)transformer).setMessageEmitter(new
net.sf.saxon.serialize.MessageWarner());
and generating dll using the command
call ikvmc -debug -target:library -nostdlib
-lib:C:\Windows\Microsoft.NET\Framework\v4.0.30319 FMXSLTJava.jar
-out:FMXSLTJava.dll
following warning messages are being thrown
IKVM.NET <http://IKVM.NET> Compiler version 7.2.4630.5
Copyright (C) 2002-2012 Jeroen Frijters
http://www.ikvm.net/
warning IKVMC0123: Assuming assembly reference "System,
Version=4.0.0.0, Culture=neutral,
PublicKeyToken=b77a5c561934e089" matches "System,
Version=2.0.0.0, Culture=neutral,
PublicKeyToken=b77a5c561934e089", you may need to supply runtime
policy
warning IKVMC0100: Class "net.sf.saxon.Controller" not found
warning IKVMC0100: Class "net.sf.saxon.serialize.MessageWarner" not found
warning IKVMC0111: Emitted java.lang.NoClassDefFoundError in
"FMJAXPInvoker.transform(Ljavax.xml.transform.Source;Ljavax.xml.transform.Source;Ljavax.xml.transform.Result;[Ljava.lang.String;)Z"
("net.sf.saxon.serialize.MessageWarner")
ignoring these messages as given on several other forums and
proceeding to use this generated dll in my app causes it to crash
on this particular line of code which I have inserted.
saxon9he.jar is embedded in this jar file I am using here. Also
the eclipse project classpath contains the path to the jar file
correctly. Jar is also being generated without any error.
Can anyone provide some pointers on how do I procedd to resolve this?
Thanks and Regards,
Tilak Raj Singh
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org!http://sdm.link/slashdot
_______________________________________________
Ikvm-developers mailing list
https://lists.sourceforge.net/lists/listinfo/ikvm-developers
<https://lists.sourceforge.net/lists/listinfo/ikvm-developers>
Loading...