Re: [Ikvm-developers] What is the recommended strategy to deal with ikvmc0105 warnings?
Brought to you by:
jfrijters
From: Seref A. <ser...@ku...> - 2012-06-27 16:11:26
|
Thanks Jeroen, This is really beginning to look a little bit too good. Kind regards Seref On Wed, Jun 27, 2012 at 4:50 PM, Jeroen Frijters <je...@su...> wrote: > A library generated by ikvmc is treated like any other .NET library by > ASP.NET, so as long as the AppDomain is not unloaded by ASP.NET all > requests will use the same "instantiation" of the IKVM runtime. > > Regards, > Jeroen > > > -----Original Message----- > > From: Seref Arikan [mailto:ser...@ku...] > > Sent: Wednesday, June 27, 2012 17:44 > > To: Jeroen Frijters > > Cc: ikv...@li... > > Subject: Re: [Ikvm-developers] What is the recommended strategy to deal > > with ikvmc0105 warnings? > > > > Thanks Jeroen, > > In theory, I should not have an issue, because if Eclipse Modelling > > Framework project claims that all I need is 3 jars to use EMF in a > > standalone Java executable, then even though there are references to > > other EMF jars (as ikvmc discovers), they should not be required in the > > standalone Java executable scenario, or the claim from EMF would not be > > correct. > > > > I wanted to make sure that I was getting the inner workings of ikvmc > > right. I think unit tests in Java would help in making sure that EMF > > related code is working just fine, but that means I'll also have to > > include junit in the conversion process :) Worth trying though. > > > > A key question here is: if I use ikvm in an asp.net application, would > > different requests (say to a web service) lead to reloading of ikvm > > implementation of jvm over and over again? That would be very expensive > > I guess. In short, what would be the right way of using ikvm in an > > asp.net web service? > > > > Best regards > > Seref > > > > > > > > On Wed, Jun 27, 2012 at 4:26 PM, Jeroen Frijters <je...@su...> > > wrote: > > > > > > Hi, > > > > You're on the right track. If the code works in Java without the > > dependencies then you can also use the ikvmc generated assembly without > > the dependencies. If you want to get rid of the warnings, you can use > > the ikvmc -writeSuppressWarningsFile:<file> option to generate a > > response file that suppresses all the warnings (so you only have to go > > through them once to see if they are all harmless). > > > > The alternative is indeed to figure out all the dependencies. A > > helpful tools is jar2ikvmc available at > > http://code.google.com/p/jar2ikvmc/ but this isn't strictly necessary as > > modern versions of ikvmc can also compile everything at once using the { > > } syntax. For example: ikvmc -target:library { lib-a.jar } { lib-b.jar } > > This will generate lib-a.dll and lib-b.dll and they will reference each > > other only if this is needed (so you can then use a .NET assembly > > inspection tool to look at the dependencies, if you want). > > > > Dynamic class loading is trickier. There you're mainly conconcerned > > with class loader issues. See > > https://sourceforge.net/apps/mediawiki/ikvm/index.php?title=ClassLoader > > for more on this. > > > > Regards, > > Jeroen > > > > > > > -----Original Message----- > > > From: Seref Arikan [mailto:ser...@ku...] > > > Sent: Wednesday, June 27, 2012 16:38 > > > To: ikv...@li... > > > Subject: [Ikvm-developers] What is the recommended strategy to > > deal with > > > ikvmc0105 warnings? > > > > > > Greetings, > > > First of all, hats off to excellent work for IKVM! My specific > > goal is > > > to move some work I've done with Eclipse Modeling Framework (EMF) > > to > > > .NET, via IKVM. I am using Java 1.6, under Windows 7, with latest > > > version of IKVM, and both Java and Windows are 64 bits, > > > > > > EMF jars can be used standalone (they're also osgi bundles), out > > of an > > > OSGI container, so I thought it would be OK for me to give > > ikvmc.exe a > > > try. I've given ikvmc.exe a jar that uses EMF models and emf > > jars, to > > > generate one fat dll. I end up with a long list of warnings, with > > > references to non-EMF jars. I guess this is normal, since IKVM > > seems to > > > go through all types and mark the ones it can't find in the given > > jars. > > > > > > Despite the warnings, simple test code written in C# seems to > > work, > > > which is very encouraging. However, I'd like to know if there is > > a > > > method I can follow to perform a perfect transformation. My gut > > feeling > > > is, I'd need to perform a dependency analysis on the EMF jars, > > finding > > > all the jars with all types that are ever referenced, and feed it > > all to > > > IKVM. Is this correct? If it is, then are there any known tools > > that may > > > make the process easier for me? OSGI class loading is especially > > tricky > > > in the context of creating a dependency graph, but even tools > > that help > > > with normal jars would be nice. > > > > > > I am attaching only a few lines of the output below (the total > > output is > > > 23kbs), and warning #1 is a perfect example of the situation I'm > > in (a > > > non-EMF type missing). So, am I in the right path here? > > > > > > Thanks again for this fantastic piece of work, and here comes the > > > beginning of my output from ikvmc.exe: > > > > > > c:\work\data\tmp\ikvm-tests>ikvmc -out:emf.dll *.jar 2> > > results.txt > > > > > > Warning IKVMC0105: unable to compile class > > > "org.eclipse.emf.common.EMFPlugin$EclipsePlugin" > > > (missing class "org.eclipse.core.runtime.Plugin") > > > Warning IKVMC0105: unable to compile class > > > "org.eclipse.emf.common.CommonPlugin$Implementation" > > > (missing class > > "org.eclipse.emf.common.EMFPlugin$EclipsePlugin") > > > Warning IKVMC0100: class "org.eclipse.core.runtime.Platform" not > > found > > > Warning IKVMC0100: class > > > "org.eclipse.emf.common.EMFPlugin$EclipsePlugin" not found > > Warning > > > IKVMC0100: class "org.osgi.framework.Bundle" not found Warning > > > IKVMC0111: emitted java.lang.NoClassDefFoundError in > > > "org.eclipse.emf.common.EMFPlugin.<clinit>()V" > > > ("org.eclipse.core.runtime.Platform") > > > Warning IKVMC0100: class > > > "org.eclipse.emf.common.CommonPlugin$Implementation" not found > > Warning > > > IKVMC0111: emitted java.lang.NoClassDefFoundError in > > > > > "org.eclipse.emf.common.CommonPlugin.asLocalURI(Lorg.eclipse.emf.common. > > > util.URI;)Lorg.eclipse.emf.common.util.URI;" > > > ("org.eclipse.emf.common.CommonPlugin$Implementation") > > > Warning IKVMC0111: emitted java.lang.NoClassDefFoundError in > > > > > "org.eclipse.emf.common.CommonPlugin.resolve(Lorg.eclipse.emf.common.uti > > > l.URI;)Lorg.eclipse.emf.common.util.URI;" > > > ("org.eclipse.emf.common.CommonPlugin$Implementation") > > > Warning IKVMC0111: emitted java.lang.NoClassDefFoundError in > > > > > "org.eclipse.emf.common.CommonPlugin.loadClass(Ljava.lang.String;Ljava.l > > > ang.String;)Ljava.lang.Class;" > > > ("org.eclipse.emf.common.CommonPlugin$Implementation") > > > Warning IKVMC0100: class "org.eclipse.core.runtime.ILog" not > > found > > > Warning IKVMC0100: class "org.eclipse.core.runtime.IStatus" not > > found > > > Warning IKVMC0100: class "org.eclipse.core.runtime.Plugin" not > > found > > > Warning IKVMC0100: class "org.eclipse.core.runtime.Status" not > > found > > > Warning IKVMC0111: emitted java.lang.NoClassDefFoundError in > > > > > "org.eclipse.emf.common.EMFPlugin$InternalHelper.getBundle()Lorg.osgi.fr > > > amework.Bundle;" > > > ("org.eclipse.core.runtime.Plugin") > > > Warning IKVMC0111: emitted java.lang.NoClassDefFoundError in > > > > > "org.eclipse.emf.common.EMFPlugin$InternalHelper.getLog()Lorg.eclipse.co > > > re.runtime.ILog;" > > > ("org.eclipse.core.runtime.Plugin") > > > Warning IKVMC0111: emitted java.lang.NoClassDefFoundError in > > > > > > > "org.eclipse.emf.common.EMFPlugin$InternalHelper.getSymbolicName()Ljava. > > > > > lang.String;" > > > ("org.osgi.framework.Bundle") > > > Warning IKVMC0111: emitted java.lang.NoClassDefFoundError in > > > > > "org.eclipse.emf.common.EMFPlugin$InternalHelper.getBaseURL()Ljava.net.U > > > RL;" > > > ("org.osgi.framework.Bundle") > > > Warning IKVMC0111: emitted java.lang.NoClassDefFoundError in > > > > > > > "org.eclipse.emf.common.EMFPlugin$InternalHelper.getString(Ljava.lang.St > > > > > ring;Z)Ljava.lang.String;" > > > ("org.eclipse.core.runtime.Platform") > > > Warning IKVMC0111: emitted java.lang.NoClassDefFoundError in > > > > > "org.eclipse.emf.common.EMFPlugin$InternalHelper.log(Ljava.lang.Object;) > > > V" > > > ("org.eclipse.core.runtime.ILog") > > > Warning IKVMC0105: unable to compile class > > > "org.eclipse.emf.common.util.BasicDiagnostic$StatusWrapper" > > > ... > > > ... > > > > > > > > > > > |