property files in the classpath

View: New views
20 Messages — Rating Filter:   Alert me  
< Prev | 1 - 2 | Next >

property files in the classpath

by jun_li :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,

I am just starting to use IKVM.NET.
I have some java jar files which I converted to dll as a library.
I will call the java library class in c#.

There are some property files in the classpath.
Just wondering how can I have the dll to load the property file which used to be in the java classpath.

Thanks,
Jun

Re: property files in the classpath

by Jeroen Frijters :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,

Some recommended articles to get started are these:
http://weblog.ikvm.net/PermaLink.aspx?guid=4e0b7f7c-6f5d-42a3-a4d6-5d05a99c84ff
http://weblog.ikvm.net/PermaLink.aspx?guid=8a457a80-1e5f-4182-8f78-b2cd67845553
http://weblog.ikvm.net/PermaLink.aspx?guid=375f1ff8-912a-4458-9120-f0a8cfb23b68

Regards,
Jeroen

> -----Original Message-----
> From: jun_li [mailto:jun.li@...]
> Sent: Thursday, July 23, 2009 16:19
> To: ikvm-developers@...
> Subject: [Ikvm-developers] property files in the classpath
>
>
> Hi,
>
> I am just starting to use IKVM.NET.
> I have some java jar files which I converted to dll as a library.
> I will call the java library class in c#.
>
> There are some property files in the classpath.
> Just wondering how can I have the dll to load the property file which
> used to be in the java classpath.
>
> Thanks,
> Jun
> --
> View this message in context: http://www.nabble.com/property-files-in-
> the-classpath-tp24626742p24626742.html
> Sent from the IKVM .NET - Dev mailing list archive at Nabble.com.
>
>
> -----------------------------------------------------------------------
> -------
> _______________________________________________
> Ikvm-developers mailing list
> Ikvm-developers@...
> https://lists.sourceforge.net/lists/listinfo/ikvm-developers

------------------------------------------------------------------------------
_______________________________________________
Ikvm-developers mailing list
Ikvm-developers@...
https://lists.sourceforge.net/lists/listinfo/ikvm-developers

Re: property files in the classpath

by jun_li :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi Jeroen,

I try to add the following in App.config
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
  <appSettings>
    <add key="ikvm:java.class.path" value="C:\properties"/>
  </appSettings>
</configuration>

It doesn't work.
Please advise.

Thanks,
Jun

Re: property files in the classpath

by Jeroen Frijters :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi Jun,

Setting the java.class.path system property has no effect (other than setting the system property), because the default system class loader ignores the class path completely. For this to have any effect, your main application executable assembly will need to have a ClassPathAssemblyClassLoader.

See this blog entry:
http://weblog.ikvm.net/PermaLink.aspx?guid=8a457a80-1e5f-4182-8f78-b2cd67845553

Regards,
Jeroen

> -----Original Message-----
> From: jun_li [mailto:jun.li@...]
> Sent: Thursday, July 23, 2009 21:16
> To: ikvm-developers@...
> Subject: Re: [Ikvm-developers] property files in the classpath
>
>
> Hi Jeroen,
>
> I try to add the following in App.config <?xml version="1.0"
> encoding="utf-8" ?> <configuration>
>   <appSettings>
>     <add key="ikvm:java.class.path" value="C:\properties"/>
>   </appSettings>
> </configuration>
>
> It doesn't work.
> Please advise.
>
> Thanks,
> Jun
> --
> View this message in context: http://www.nabble.com/property-files-in-
> the-classpath-tp24626742p24632512.html
> Sent from the IKVM .NET - Dev mailing list archive at Nabble.com.
>
>
> -----------------------------------------------------------------------
> -------
> _______________________________________________
> Ikvm-developers mailing list
> Ikvm-developers@...
> https://lists.sourceforge.net/lists/listinfo/ikvm-developers

------------------------------------------------------------------------------
_______________________________________________
Ikvm-developers mailing list
Ikvm-developers@...
https://lists.sourceforge.net/lists/listinfo/ikvm-developers

Re: property files in the classpath

by jun_li :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi Jeroen,

Thanks you so much for your quick response!
I was able to use the  -recurse flag to include all the properties files in the dll.
It works for some of the property files which were loaded from classpath previously.
I had some problem with the spring config properties.

And I also would like to try the ClassPathAssemblyClassLoader approach you pointed out.
The app I developed in c# is a outlook addin, not sure how can I pass the classpath args to the add-in.

Any suggestion will be great appreciated.

Jun

Re: property files in the classpath

by Jeroen Frijters :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

One option is to write a custom assembly class loader and then override findResource() and return a URL to the properties file (if the requested resource is the properties file, of course).

Regards,
Jeroen

> -----Original Message-----
> From: jun_li [mailto:jun.li@...]
> Sent: Friday, July 24, 2009 16:35
> To: ikvm-developers@...
> Subject: Re: [Ikvm-developers] property files in the classpath
>
>
> Hi Jeroen,
>
> Thanks you so much for your quick response!
> I was able to use the  -recurse flag to include all the properties
> files in the dll.
> It works for some of the property files which were loaded from
> classpath previously.
> I had some problem with the spring config properties.
>
> And I also would like to try the ClassPathAssemblyClassLoader approach
> you pointed out.
> The app I developed in c# is a outlook addin, not sure how can I pass
> the classpath args to the add-in.
>
> Any suggestion will be great appreciated.
>
> Jun
> --
> View this message in context: http://www.nabble.com/property-files-in-
> the-classpath-tp24626742p24645644.html
> Sent from the IKVM .NET - Dev mailing list archive at Nabble.com.
>
>
> -----------------------------------------------------------------------
> -------
> _______________________________________________
> Ikvm-developers mailing list
> Ikvm-developers@...
> https://lists.sourceforge.net/lists/listinfo/ikvm-developers

------------------------------------------------------------------------------
_______________________________________________
Ikvm-developers mailing list
Ikvm-developers@...
https://lists.sourceforge.net/lists/listinfo/ikvm-developers

Re: property files in the classpath

by jun_li :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi Jereon,

Ok, I will try to use a custom assembly class loader per your link
http://weblog.ikvm.net/PermaLink.aspx?guid=375f1ff8-912a-4458-9120-f0a8cfb23b68
Sorry that I need ask some stupid questions after I did some research.
It seems to me the classload is written in java.
If so, what's the jar file for compile the cli.System.Reflection.Assembly?

After I have the custom class loader, what I need to do?
Specify it in the app.config?
If so, are the following config correct since I am not sure both key and value?
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
  <appSettings>
    <add key="ikvm:ikvm.runtime.AssemblyClassLoader" value="MyCustomClassLoader" />
  </appSettings>
</configuration>


Thanks a lot,
Jun

Re: property files in the classpath

by Valeriy Pikulskyy :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

your config is wrong, look here:
http://weblog.ikvm.net/PermaLink.aspx?guid=8a457a80-1e5f-4182-8f78-b2cd67845553

"Here the key is ikvm-classloader: followed by the simple name of the
assembly. The value must be the assembly qualified type name of the
custom assembly class loader type."

E.g. if your .NET output after ikvmc is MyAssembly.dll, then its config file:

<configuration>
        <appSettings>
                <add key="ikvm-classloader:MyAssembly"
value="ikvm.runtime.MyCustomAssemblyClassLoader,
MyCustomClassLoaderAssembly, Version=1.0.0.0, Culture=neutral" />
...
Also, the same custom classloader's name should be specified while
compiling via ikvmc:

ikvmc.exe ...  -out:MyAssembly.dll -target:library
-classloader:ikvm.runtime.MyCustomAssemblyClassLoader

Jeroen, please correct me if I wrong.
Valeriy.




On Fri, Jul 24, 2009 at 6:52 PM, jun_li<jun.li@...> wrote:

>
> Hi Jereon,
>
> Ok, I will try to use a custom assembly class loader per your link
> http://weblog.ikvm.net/PermaLink.aspx?guid=375f1ff8-912a-4458-9120-f0a8cfb23b68
> http://weblog.ikvm.net/PermaLink.aspx?guid=375f1ff8-912a-4458-9120-f0a8cfb23b68
> Sorry that I need ask some stupid questions after I did some research.
> It seems to me the classload is written in java.
> If so, what's the jar file for compile the cli.System.Reflection.Assembly?
>
> After I have the custom class loader, what I need to do?
> Specify it in the app.config?
> If so, are the following config correct since I am not sure both key and
> value?
> <?xml version="1.0" encoding="utf-8" ?>
> <configuration>
>  <appSettings>
>    <add key="ikvm:ikvm.runtime.AssemblyClassLoader"
> value="MyCustomClassLoader" />
>  </appSettings>
> </configuration>
>
>
> Thanks a lot,
> Jun
> --
> View this message in context: http://www.nabble.com/property-files-in-the-classpath-tp24626742p24647050.html
> Sent from the IKVM .NET - Dev mailing list archive at Nabble.com.
>
>
> ------------------------------------------------------------------------------
> _______________________________________________
> Ikvm-developers mailing list
> Ikvm-developers@...
> https://lists.sourceforge.net/lists/listinfo/ikvm-developers
>

------------------------------------------------------------------------------
_______________________________________________
Ikvm-developers mailing list
Ikvm-developers@...
https://lists.sourceforge.net/lists/listinfo/ikvm-developers

Re: property files in the classpath

by jun_li :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Thank you so much to clarify the config and the dll build.

The last piece of the puzzle (hopefully) I had is that which file contains the cli.System.Reflection.Assembly?

Best Regards,
Jun

Re: property files in the classpath

by Valeriy Pikulskyy :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

cli.System.Reflection.Assembly is inside ikvm-0.40.0.1\classpath\mscorlib.jar
You will add it to the classpath when you build your custom class
loader on java. Then you will ikvmc it into .NET dll and then specify
it as a custom classloader.



On Fri, Jul 24, 2009 at 7:49 PM, jun_li<jun.li@...> wrote:

>
> Thank you so much to clarify the config and the dll build.
>
> The last piece of the puzzle (hopefully) I had is that which file contains
> the cli.System.Reflection.Assembly?
>
> Best Regards,
> Jun
> --
> View this message in context: http://www.nabble.com/property-files-in-the-classpath-tp24626742p24647982.html
> Sent from the IKVM .NET - Dev mailing list archive at Nabble.com.
>
>
> ------------------------------------------------------------------------------
> _______________________________________________
> Ikvm-developers mailing list
> Ikvm-developers@...
> https://lists.sourceforge.net/lists/listinfo/ikvm-developers
>

------------------------------------------------------------------------------
_______________________________________________
Ikvm-developers mailing list
Ikvm-developers@...
https://lists.sourceforge.net/lists/listinfo/ikvm-developers

Re: property files in the classpath

by jun_li :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi there,

Looks like I can not find ikvm.runtime.AssemblyClassLoader now.
However, I did see a java class in the source code distribution.
How can I build the jar file which contains AssemblyClassLoader?

Thx,
Jun

Re: property files in the classpath

by Valeriy Pikulskyy :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

http://weblog.ikvm.net/PermaLink.aspx?guid=375f1ff8-912a-4458-9120-f0a8cfb23b68
see Jeroen's comments:
"You probably need to run ikvmstub on IKVM.OpenJDK.ClassLibrary.dll
and add the resulting jar to your classpath instead of the ikvm
directory."

The creation of a custom class loader definetly lacks a step-by-step
instructions.



On Fri, Jul 24, 2009 at 9:58 PM, jun_li<jun.li@...> wrote:

>
> Hi there,
>
> Looks like I can not find ikvm.runtime.AssemblyClassLoader now.
> However, I did see a java class in the source code distribution.
> How can I build the jar file which contains AssemblyClassLoader?
>
> Thx,
> Jun
> --
> View this message in context: http://www.nabble.com/property-files-in-the-classpath-tp24626742p24650087.html
> Sent from the IKVM .NET - Dev mailing list archive at Nabble.com.
>
>
> ------------------------------------------------------------------------------
> _______________________________________________
> Ikvm-developers mailing list
> Ikvm-developers@...
> https://lists.sourceforge.net/lists/listinfo/ikvm-developers
>

------------------------------------------------------------------------------
_______________________________________________
Ikvm-developers mailing list
Ikvm-developers@...
https://lists.sourceforge.net/lists/listinfo/ikvm-developers

Re: property files in the classpath

by jun_li :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I did try that before.
I have 0.40.0.1 version downloaded.
There is no IKVM.OpenJDK.ClassLibrary.dll. When I tried IKVM.OpenJDK.Core.dll
I got the following error:

ikvmstub IKVM.OpenJDK.Core.dll
Warning: Running ikvmstub on ikvmc compiled assemblies is not supported.
cli.System.IO.FileNotFoundException: Could not load file or assembly 'System.Cor
e, Version=3.5.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' or one of
its dependencies. The system cannot find the file specified.
        at cli.System.ModuleHandle.ResolveMethod(Unknown Source)
        at cli.System.ModuleHandle.ResolveMethodHandle(Unknown Source)
        at cli.System.ModuleHandle.ResolveMethodHandle(Unknown Source)
        at cli.System.RuntimeType.GetMethodBase(Unknown Source)
        at cli.System.RuntimeType.GetMethodBase(Unknown Source)
        at cli.System.Reflection.CustomAttributeData.<init>(Unknown Source)
        at cli.System.Reflection.CustomAttributeData.GetCustomAttributes(Unknown
 Source)
        at cli.System.Reflection.CustomAttributeData.GetCustomAttributes(Unknown
 Source)
        at IKVM.Internal.AttributeHelper.GetInnerClass(Unknown Source)
        at IKVM.Internal.CompiledTypeWrapper.GetName(Unknown Source)
        at IKVM.Internal.AssemblyClassLoader+AssemblyLoader.CreateWrapperForAsse
mblyType(Unknown Source)
        at IKVM.Internal.AssemblyClassLoader.GetWrapperFromAssemblyType(Unknown
Source)
        at IKVM.Internal.ClassLoaderWrapper.GetWrapperFromType(Unknown Source)
        at IKVM.NativeCode.ikvm.runtime.Util.getFriendlyClassFromType(Unknown So
urce)
        at ikvm.runtime.Util.getFriendlyClassFromType(Native Method)
        at cli.NetExp.ProcessAssembly(Unknown Source)
        at cli.NetExp.Main(Unknown Source)
        at cli.NetExp.Main(Unknown Source)
Warning: Assembly reflection encountered an error. Resultant JAR may be incomple
te.
Error: Assembly contains no public IKVM.NET compatible types

Thanks,
Jun

Re: property files in the classpath

by Valeriy Pikulskyy :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

http://weblog.ikvm.net/PermaLink.aspx?guid=abe9dce7-ea83-4d21-851a-1f819794b445

Jeroen mentioned a "-shared" param for ikvmstub:

"ikvmstub -shared ikvm.openjdk.core"
and below:
"Added hack to ikvmstub (-shared option) to generate stubs for core
class library."


On Fri, Jul 24, 2009 at 10:19 PM, jun_li<jun.li@...> wrote:

>
> I did try that before.
> I have 0.40.0.1 version downloaded.
> There is no IKVM.OpenJDK.ClassLibrary.dll. When I tried
> IKVM.OpenJDK.Core.dll
> I got the following error:
>
> ikvmstub IKVM.OpenJDK.Core.dll
> Warning: Running ikvmstub on ikvmc compiled assemblies is not supported.
> cli.System.IO.FileNotFoundException: Could not load file or assembly
> 'System.Cor
> e, Version=3.5.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' or one
> of
> its dependencies. The system cannot find the file specified.
>        at cli.System.ModuleHandle.ResolveMethod(Unknown Source)
>        at cli.System.ModuleHandle.ResolveMethodHandle(Unknown Source)
>        at cli.System.ModuleHandle.ResolveMethodHandle(Unknown Source)
>        at cli.System.RuntimeType.GetMethodBase(Unknown Source)
>        at cli.System.RuntimeType.GetMethodBase(Unknown Source)
>        at cli.System.Reflection.CustomAttributeData.<init>(Unknown Source)
>        at
> cli.System.Reflection.CustomAttributeData.GetCustomAttributes(Unknown
>  Source)
>        at
> cli.System.Reflection.CustomAttributeData.GetCustomAttributes(Unknown
>  Source)
>        at IKVM.Internal.AttributeHelper.GetInnerClass(Unknown Source)
>        at IKVM.Internal.CompiledTypeWrapper.GetName(Unknown Source)
>        at
> IKVM.Internal.AssemblyClassLoader+AssemblyLoader.CreateWrapperForAsse
> mblyType(Unknown Source)
>        at
> IKVM.Internal.AssemblyClassLoader.GetWrapperFromAssemblyType(Unknown
> Source)
>        at IKVM.Internal.ClassLoaderWrapper.GetWrapperFromType(Unknown
> Source)
>        at
> IKVM.NativeCode.ikvm.runtime.Util.getFriendlyClassFromType(Unknown So
> urce)
>        at ikvm.runtime.Util.getFriendlyClassFromType(Native Method)
>        at cli.NetExp.ProcessAssembly(Unknown Source)
>        at cli.NetExp.Main(Unknown Source)
>        at cli.NetExp.Main(Unknown Source)
> Warning: Assembly reflection encountered an error. Resultant JAR may be
> incomple
> te.
> Error: Assembly contains no public IKVM.NET compatible types
>
> Thanks,
> Jun
> --
> View this message in context: http://www.nabble.com/property-files-in-the-classpath-tp24626742p24650384.html
> Sent from the IKVM .NET - Dev mailing list archive at Nabble.com.
>
>
> ------------------------------------------------------------------------------
> _______________________________________________
> Ikvm-developers mailing list
> Ikvm-developers@...
> https://lists.sourceforge.net/lists/listinfo/ikvm-developers
>

------------------------------------------------------------------------------
_______________________________________________
Ikvm-developers mailing list
Ikvm-developers@...
https://lists.sourceforge.net/lists/listinfo/ikvm-developers

Re: property files in the classpath

by jun_li :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi Valeriy,

Thanks again for the help.
I tried with the -shared option, I got the following error:

ikvmstub -shared IKVM.OpenJDK.Core.dll
Warning: Running ikvmstub on ikvmc compiled assemblies is not supported.
java.lang.NullPointerException
        at IKVM.Internal.CompiledTypeWrapper.GetMethodAnnotations(Unknown Source
)
        at IKVM.NativeCode.java.lang.reflect.Method.getDeclaredAnnotationsImpl(U
nknown Source)
        at java.lang.reflect.Method.getDeclaredAnnotationsImpl(Native Method)
        at java.lang.reflect.Constructor.declaredAnnotations(Constructor.java:63
1)
        at java.lang.reflect.Constructor.getDeclaredAnnotations(Constructor.java
:625)
        at ikvm.internal.stubgen.StubGenerator.run(StubGenerator.java:169)
        at ikvm.internal.stubgen.StubGenerator.run(StubGenerator.java:42)
        at java.security.AccessController.doPrivileged(AccessController.java:258
)
        at java.security.AccessController.doPrivileged(AccessController.java:303
)
        at ikvm.internal.stubgen.StubGenerator.generateStub(StubGenerator.java:5
4)
        at gnu.java.net.protocol.ikvmres.Handler.readResourceFromAssembly(Handle
r.java:155)
        at gnu.java.net.protocol.ikvmres.Handler.readResourceFromAssembly(Handle
r.java:122)
        at gnu.java.net.protocol.ikvmres.IkvmresURLConnection.connect(Handler.ja
va:53)
        at gnu.java.net.protocol.ikvmres.IkvmresURLConnection.getInputStream(Han
dler.java:77)
        at java.net.URL.openStream(URL.java:1027)
        at java.lang.ClassLoader.getResourceAsStream(ClassLoader.java:1181)
        at java.lang.Class.getResourceAsStream(Class.java:2060)
        at cli.NetExp.WriteClass(Unknown Source)
        at cli.NetExp.ProcessAssembly(Unknown Source)
        at cli.NetExp.Main(Unknown Source)
Warning: Assembly reflection encountered an error. Resultant JAR may be incomplete.

The output jar file does not contains the ikvm.runtime.AssemblyClassLoader
I am pretty ikvm.runtime.AssemblyClassLoader in the dll since I was able to get it in the Visual Studio.

Jun

Re: property files in the classpath

by Jeroen Frijters :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Valeriy Pikulskyy wrote:

> E.g. if your .NET output after ikvmc is MyAssembly.dll, then its config
> file:
>
> <configuration>
> <appSettings>
> <add key="ikvm-classloader:MyAssembly"
> value="ikvm.runtime.MyCustomAssemblyClassLoader,
> MyCustomClassLoaderAssembly, Version=1.0.0.0, Culture=neutral" />
> ...
> Also, the same custom classloader's name should be specified while
> compiling via ikvmc:
>
> ikvmc.exe ...  -out:MyAssembly.dll -target:library
> -classloader:ikvm.runtime.MyCustomAssemblyClassLoader

Actually, you only need one of these two. The App.config feature is primarily to modify the class loader of external assemblies that you don't control. For ikvmc generated assemblies, the -classloader:<class> option is the best approach and for C# (or other .NET languages) you can specify the IKVM.Attributes.CustomAssemblyClassLoaderAttribute custom attribute.

Regards,
Jeroen


------------------------------------------------------------------------------
_______________________________________________
Ikvm-developers mailing list
Ikvm-developers@...
https://lists.sourceforge.net/lists/listinfo/ikvm-developers

Re: property files in the classpath

by Jeroen Frijters :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi Jun,

Sorry, I (once again) forgot to test generated a jar from the core class libraries before releasing. Here is the jar that you need: http://www.frijters.net/IKVM.OpenJDK.Core.jar

Regards,
Jeroen

> -----Original Message-----
> From: jun_li [mailto:jun.li@...]
> Sent: Friday, July 24, 2009 22:26
> To: ikvm-developers@...
> Subject: Re: [Ikvm-developers] property files in the classpath
>
>
> Hi Valeriy,
>
> Thanks again for the help.
> I tried with the -shared option, I got the following error:
>
> ikvmstub -shared IKVM.OpenJDK.Core.dll
> Warning: Running ikvmstub on ikvmc compiled assemblies is not
> supported.
> java.lang.NullPointerException
>         at
> IKVM.Internal.CompiledTypeWrapper.GetMethodAnnotations(Unknown
> Source
> )
>         at
> IKVM.NativeCode.java.lang.reflect.Method.getDeclaredAnnotationsImpl(U
> nknown Source)
>         at java.lang.reflect.Method.getDeclaredAnnotationsImpl(Native
> Method)
>         at
> java.lang.reflect.Constructor.declaredAnnotations(Constructor.java:63
> 1)
>         at
> java.lang.reflect.Constructor.getDeclaredAnnotations(Constructor.java
> :625)
>         at
> ikvm.internal.stubgen.StubGenerator.run(StubGenerator.java:169)
>         at
> ikvm.internal.stubgen.StubGenerator.run(StubGenerator.java:42)
>         at
> java.security.AccessController.doPrivileged(AccessController.java:258
> )
>         at
> java.security.AccessController.doPrivileged(AccessController.java:303
> )
>         at
> ikvm.internal.stubgen.StubGenerator.generateStub(StubGenerator.java:5
> 4)
>         at
> gnu.java.net.protocol.ikvmres.Handler.readResourceFromAssembly(Handle
> r.java:155)
>         at
> gnu.java.net.protocol.ikvmres.Handler.readResourceFromAssembly(Handle
> r.java:122)
>         at
> gnu.java.net.protocol.ikvmres.IkvmresURLConnection.connect(Handler.ja
> va:53)
>         at
> gnu.java.net.protocol.ikvmres.IkvmresURLConnection.getInputStream(Han
> dler.java:77)
>         at java.net.URL.openStream(URL.java:1027)
>         at
> java.lang.ClassLoader.getResourceAsStream(ClassLoader.java:1181)
>         at java.lang.Class.getResourceAsStream(Class.java:2060)
>         at cli.NetExp.WriteClass(Unknown Source)
>         at cli.NetExp.ProcessAssembly(Unknown Source)
>         at cli.NetExp.Main(Unknown Source)
> Warning: Assembly reflection encountered an error. Resultant JAR may be
> incomplete.
>
> The output jar file does not contains the
> ikvm.runtime.AssemblyClassLoader I am pretty
> ikvm.runtime.AssemblyClassLoader in the dll since I was able to get it
> in the Visual Studio.
>
> Jun
> --
> View this message in context: http://www.nabble.com/property-files-in-
> the-classpath-tp24626742p24651380.html
> Sent from the IKVM .NET - Dev mailing list archive at Nabble.com.
>
>
> -----------------------------------------------------------------------
> -------
> _______________________________________________
> Ikvm-developers mailing list
> Ikvm-developers@...
> https://lists.sourceforge.net/lists/listinfo/ikvm-developers

------------------------------------------------------------------------------
_______________________________________________
Ikvm-developers mailing list
Ikvm-developers@...
https://lists.sourceforge.net/lists/listinfo/ikvm-developers

Re: property files in the classpath

by jun_li :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,

I downloaded the jar file and complied the customer class loader.
And when I tried to build the dll afte I copied MyCustomClassLoader.class into the same dir with all the jar files, I got an error:
ikvmc -output mydll.dll -target:library *.jar *.class -classloader:MyCustomClassLoader

Warning IKVMC0100: class "cli.System.Reflection.Assembly" not found
Link Error: Method "ikvm.runtime.AssemblyClassLoader.<init>(Lcli.System.Reflect
on.Assembly;)V" has a argument type "cli.System.Reflection.Assembly, mscorlib,
ersion=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" instead of ty
e "cli.System.Reflection.Assembly (unknown assembly)" as expected by "MyCustomC
assLoader"

Then, I copied the generated mscorlib.jar to the same dir, I got another error:
System.NotSupportedException: Specified method is not supported.
   at IKVM.Reflection.Emit.Impl.TypeBase.get_Assembly()
   at IKVM.Internal.CompilerClassLoader.Compile()
   at IKVM.Internal.CompilerClassLoader.Compile(List`1 optionsList)
   at IkvmcCompiler.Main(String[] args)

Any ideas?

Thanks,
Jun

Re: property files in the classpath

by Jeroen Frijters :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,

Use -r:mscorlib with ikvmc.

Regards,
Jeroen


> -----Original Message-----
> From: jun_li [mailto:jun.li@...]
> Sent: Monday, July 27, 2009 16:46
> To: ikvm-developers@...
> Subject: Re: [Ikvm-developers] property files in the classpath
>
>
> Hi,
>
> I downloaded the jar file and complied the customer class loader.
> And when I tried to build the dll afte I copied
> MyCustomClassLoader.class into the same dir with all the jar files, I
> got an error:
> ikvmc -output mydll.dll -target:library *.jar *.class -
> classloader:MyCustomClassLoader
>
> Warning IKVMC0100: class "cli.System.Reflection.Assembly" not found
> Link Error: Method
> "ikvm.runtime.AssemblyClassLoader.<init>(Lcli.System.Reflect
> on.Assembly;)V" has a argument type "cli.System.Reflection.Assembly,
> mscorlib, ersion=2.0.0.0, Culture=neutral,
> PublicKeyToken=b77a5c561934e089" instead of ty e
> "cli.System.Reflection.Assembly (unknown assembly)" as expected by
> "MyCustomC assLoader"
>
> Then, I copied the generated mscorlib.jar to the same dir, I got
> another
> error:
> System.NotSupportedException: Specified method is not supported.
>    at IKVM.Reflection.Emit.Impl.TypeBase.get_Assembly()
>    at IKVM.Internal.CompilerClassLoader.Compile()
>    at IKVM.Internal.CompilerClassLoader.Compile(List`1 optionsList)
>    at IkvmcCompiler.Main(String[] args)
>
> Any ideas?
>
> Thanks,
> Jun
> --
> View this message in context: http://www.nabble.com/property-files-in-
> the-classpath-tp24626742p24682000.html
> Sent from the IKVM .NET - Dev mailing list archive at Nabble.com.
>
>
> -----------------------------------------------------------------------
> -------
> _______________________________________________
> Ikvm-developers mailing list
> Ikvm-developers@...
> https://lists.sourceforge.net/lists/listinfo/ikvm-developers

------------------------------------------------------------------------------
_______________________________________________
Ikvm-developers mailing list
Ikvm-developers@...
https://lists.sourceforge.net/lists/listinfo/ikvm-developers

Re: property files in the classpath

by jun_li :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi Jeroen,

Thank nyou for your quick response.
I removed the mscorlib jar and tried the -r:mscorlib, I still got the folowing error:
System.NotSupportedException: Specified method is not supported.
   at IKVM.Reflection.Emit.Impl.TypeBase.get_Assembly()
   at IKVM.Internal.CompilerClassLoader.Compile()
   at IKVM.Internal.CompilerClassLoader.Compile(List`1 optionsList)
   at IkvmcCompiler.Main(String[] args)

I noticed that the jar you gave it 0.40.0.2 and my ikvm version is 0.40.0.1, not sure if it does matter.

Best Regards,
Jun

> -----Original Message-----
> From: jun_li [mailto:jun.li@credit-suisse.com]
> Sent: Monday, July 27, 2009 16:46
> To: ikvm-developers@lists.sourceforge.net
> Subject: Re: [Ikvm-developers] property files in the classpath
>
>
> Hi,
>
> I downloaded the jar file and complied the customer class loader.
> And when I tried to build the dll afte I copied
> MyCustomClassLoader.class into the same dir with all the jar files, I
> got an error:
> ikvmc -output mydll.dll -target:library *.jar *.class -
> classloader:MyCustomClassLoader
>
> Warning IKVMC0100: class "cli.System.Reflection.Assembly" not found
> Link Error: Method
> "ikvm.runtime.AssemblyClassLoader.<init>(Lcli.System.Reflect
> on.Assembly;)V" has a argument type "cli.System.Reflection.Assembly,
> mscorlib, ersion=2.0.0.0, Culture=neutral,
> PublicKeyToken=b77a5c561934e089" instead of ty e
> "cli.System.Reflection.Assembly (unknown assembly)" as expected by
> "MyCustomC assLoader"
>
> Then, I copied the generated mscorlib.jar to the same dir, I got
> another
> error:
> System.NotSupportedException: Specified method is not supported.
>    at IKVM.Reflection.Emit.Impl.TypeBase.get_Assembly()
>    at IKVM.Internal.CompilerClassLoader.Compile()
>    at IKVM.Internal.CompilerClassLoader.Compile(List`1 optionsList)
>    at IkvmcCompiler.Main(String[] args)
>
> Any ideas?
>
> Thanks,
> Jun
> --
> View this message in context: http://www.nabble.com/property-files-in-
> the-classpath-tp24626742p24682000.html
> Sent from the IKVM .NET - Dev mailing list archive at Nabble.com.
>
>
> -----------------------------------------------------------------------
> -------
> _______________________________________________
> Ikvm-developers mailing list
> Ikvm-developers@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/ikvm-developers

------------------------------------------------------------------------------
_______________________________________________
Ikvm-developers mailing list
Ikvm-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ikvm-developers


< Prev | 1 - 2 | Next >