P***@nomura.com
2016-11-18 16:58:16 UTC
Hi folks,
I am looking for help on using IKVM with the spring framework. We are using the âone large DLLâ solution to compile a large number of our libraries. We recently added the spring framework to these.
Compiling everything together with ikvmc works but on initialization of the spring framework, the ikvm class loader behaves differently than the class loader of the standard JVM. The class loader of the standard JVM tolerates that some extensions of the spring framework are missing, whereas the ikvm class loader throws an exception:
"ClassNotFoundException: com.datastax.driver.core.Cluster$Builder\r\n at IKVM.Internal.ClassLoaderWrapper.LoadClass(String name, LoadMode mode)\r\n at IKVM.Internal.ClassLoaderWrapper.LoadClassByDottedName(String name)\r\n at IKVM.Internal.CompiledTypeWrapper.get_InnerClasses()\r\n at IKVM.StubGen.StubGenerator.WriteClass(Stream stream, TypeWrapper tw, Boolean includeNonPublicInterfaces, Boolean includeNonPublicMembers, Boolean includeSerialVersionUID, Boolean includeParameterNames)\r\n at IKVM.Internal.VirtualFileSystem.VfsAssemblyClass.Populate()\r\n at IKVM.Internal.VirtualFileSystem.VfsAssemblyClass.Open()\r\n at IKVM.Internal.VirtualFileSystem.Open(String name, FileMode fileMode, FileAccess fileAccess)\r\n at Java_java_io_FileDescriptor.open(String name, FileMode fileMode, FileAccess fileAccess)\r\n at java.io.FileDescriptor.open(String , FileMode , FileAccess )\r\n at java.io.FileDescriptor.open(String , Int32 , Int32 )\r\n at java.io.FileDescriptor.openReadOnly(String )\r\n at Ja
va_java_io_FileInputStream.open0(Object _this, String name, FileDescriptor fd)\r\n at java.io.FileInputStream.open0(String )\r\n at java.io.FileInputStream.open(String )\r\n at java.io.FileInputStream..ctor(File file)\r\n at java.util.zip.ClassStubZipEntry.getInputStream()\r\n at java.util.zip.ZipFile.getInputStream(ZipEntry entry)\r\n at java.util.jar.JarFile.getInputStream(ZipEntry ze)\r\n at sun.net.www.protocol.jar.JarURLConnection.getInputStream()\r\n at java.net.URLClassLoader.getResourceAsStream(String name)\r\n at org.springframework.core.io.ClassPathResource.getInputStream() in ClassPathResource.java:line 166\r\n at org.springframework.core.type.classreading.SimpleMetadataReader..ctor(Resource resource, ClassLoader classLoader) in SimpleMetadataReader.java:line 50\r\n at org.springframework.core.type.classreading.SimpleMetadataReaderFactory.getMetadataReader(Resource resource) in SimpleMetadataReaderFactory.java:line 98\r\n at org.springframework.boot.type.classreading.Concurre
ntReferenceCachingMetadataReaderFactory.createMetadataReader(Resource resource) in ConcurrentReferenceCachingMetadataReaderFactory.java:line 89\r\n at org.springframework.boot.type.classreading.ConcurrentReferenceCachingMetadataReaderFactory.getMetadataReader(Resource resource) in ConcurrentReferenceCachingMetadataReaderFactory.java:line 76\r\n at org.springframework.core.type.classreading.SimpleMetadataReaderFactory.getMetadataReader(String className) in SimpleMetadataReaderFactory.java:line 93\r\n at org.springframework.boot.autoconfigure.AutoConfigurationSorter.AutoConfigurationClasses..ctor(MetadataReaderFactory metadataReaderFactory, Collection classNames) in AutoConfigurationSorter.java:line 110\r\n at org.springframework.boot.autoconfigure.AutoConfigurationSorter.getInPriorityOrder(Collection classNames) in AutoConfigurationSorter.java:line 54\r\n at org.springframework.boot.autoconfigure.EnableAutoConfigurationImportSelector.sort(List configurations) in EnableAutoConfigurationImportSelector.j
ava:line 193\r\n at org.springframework.boot.autoconfigure.EnableAutoConfigurationImportSelector.selectImports(AnnotationMetadata metadata) in EnableAutoConfigurationImportSelector.java:line 89\r\n at org.springframework.context.annotation.ConfigurationClassParser.processDeferredImportSelectors() in ConfigurationClassParser.java:line 481"
Here are the detail of our setup:
IKVM 8.1
Spring 4.3.2.RELEASE
Spring boot 1.4.0.RELEASE
Target .NET 4
We are using the statement âikvm.runtime.Startup.addBootClassPathAssembly(Assembly.Load("OurLargeAssembly"));â. We are not using any âclassloader argument in the args of ikvmc.
We tried downloading the datastax driver and adding it to our large assembly. It worked, but right after we faced the same problem with âelasticsearchâ. But this time, adding this package caused an ikvmc crash:
warning IKVMC0100: Class "org.jboss.netty.bootstrap.ServerBootstrap" not found
warning IKVMC0100: Class "org.jboss.netty.channel.socket.nio.NioServerSocketChannelFactory" not found
warning IKVMC0100: Class "org.jboss.netty.channel.group.ChannelGroup" not found
warning IKVMC0100: Class "org.jboss.netty.channel.group.ChannelGroupFuture" not found
*** INTERNAL COMPILER ERROR ***
PLEASE FILE A BUG REPORT FOR IKVM.NET WHEN YOU SEE THIS MESSAGE
ikvmc, Version=8.1.5717.0, Culture=neutral, PublicKeyToken=13235d27fcbfff58
C:\Windows\Microsoft.NET\Framework64\v2.0.50727\
2.0.50727.5485 64-bit
System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
at IKVM.Reflection.Impl.ISymUnmanagedWriter2.CloseMethod()
at IKVM.Reflection.Impl.PdbWriter.Close()
at IKVM.Reflection.Writer.ModuleWriter.WriteModuleImpl(StrongNameKeyPair keyPair, Byte[] publicKey, ModuleBuilder moduleBuilder, PEFileKinds fileKind, PortableExecutableKinds portableExecutableKind, ImageFileMachine imageFileMachine, ResourceSection resources, Int32 entryPointToken, Stream stream)
at IKVM.Reflection.Writer.ModuleWriter.WriteModule(StrongNameKeyPair keyPair, Byte[] publicKey, ModuleBuilder moduleBuilder, PEFileKinds fileKind, PortableExecutableKinds portableExecutableKind, ImageFileMachine imageFileMachine, ResourceSection resources, Int32 entryPointToken, Stream stream)
at IKVM.Reflection.Emit.AssemblyBuilder.SaveImpl(String assemblyFileName, Stream streamOrNull, PortableExecutableKinds portableExecutableKind, ImageFileMachine imageFileMachine)
at IKVM.Reflection.Emit.AssemblyBuilder.Save(String assemblyFileName, PortableExecutableKinds portableExecutableKind, ImageFileMachine imageFileMachine)
at IKVM.Internal.CompilerClassLoader.Save()
at IKVM.Internal.CompilerClassLoader.Compile(String runtimeAssembly, List`1 optionsList)
at IkvmcCompiler.Compile(String[] args)
at IkvmcCompiler.Main(String[] args)
Any help would be appreciated.
_________________________________
Pascal Dufresne
Associate - Securitized Products Technology
Nomura Securities International
309 West 49th Street
New York, New York 10019-7316
Phone: +1 212 667 1381 Mobile: +1 646 920 9617
Email: ***@nomura.com<mailto:***@nomura.com>
Connecting Markets East & West
www.nomura.com<http://www.nomura.com/>
PLEASE READ: This message is for the named person's use only. It may contain confidential, proprietary or legally privileged information. No confidentiality or privilege is waived or lost by any mistransmission. If you receive this message in error, please delete it and all copies from your system, destroy any hard copies and notify the sender. You must not, directly or indirectly, use, disclose, distribute, print, or copy any part of this message if you are not the intended recipient. Nomura Holding America Inc., Nomura Securities International, Inc, and their respective subsidiaries each reserve the right to monitor all e-mail communications through its networks. Any views expressed in this message are those of the individual sender, except where the message states otherwise and the sender is authorized to state the views of such entity. Unless otherwise stated, any pricing information in this message is indicative only, is subject to change and does not constitute an offer to deal at any price quoted. Any reference to the terms of executed transactions should be treated as preliminary only and subject to our formal written confirmation.
I am looking for help on using IKVM with the spring framework. We are using the âone large DLLâ solution to compile a large number of our libraries. We recently added the spring framework to these.
Compiling everything together with ikvmc works but on initialization of the spring framework, the ikvm class loader behaves differently than the class loader of the standard JVM. The class loader of the standard JVM tolerates that some extensions of the spring framework are missing, whereas the ikvm class loader throws an exception:
"ClassNotFoundException: com.datastax.driver.core.Cluster$Builder\r\n at IKVM.Internal.ClassLoaderWrapper.LoadClass(String name, LoadMode mode)\r\n at IKVM.Internal.ClassLoaderWrapper.LoadClassByDottedName(String name)\r\n at IKVM.Internal.CompiledTypeWrapper.get_InnerClasses()\r\n at IKVM.StubGen.StubGenerator.WriteClass(Stream stream, TypeWrapper tw, Boolean includeNonPublicInterfaces, Boolean includeNonPublicMembers, Boolean includeSerialVersionUID, Boolean includeParameterNames)\r\n at IKVM.Internal.VirtualFileSystem.VfsAssemblyClass.Populate()\r\n at IKVM.Internal.VirtualFileSystem.VfsAssemblyClass.Open()\r\n at IKVM.Internal.VirtualFileSystem.Open(String name, FileMode fileMode, FileAccess fileAccess)\r\n at Java_java_io_FileDescriptor.open(String name, FileMode fileMode, FileAccess fileAccess)\r\n at java.io.FileDescriptor.open(String , FileMode , FileAccess )\r\n at java.io.FileDescriptor.open(String , Int32 , Int32 )\r\n at java.io.FileDescriptor.openReadOnly(String )\r\n at Ja
va_java_io_FileInputStream.open0(Object _this, String name, FileDescriptor fd)\r\n at java.io.FileInputStream.open0(String )\r\n at java.io.FileInputStream.open(String )\r\n at java.io.FileInputStream..ctor(File file)\r\n at java.util.zip.ClassStubZipEntry.getInputStream()\r\n at java.util.zip.ZipFile.getInputStream(ZipEntry entry)\r\n at java.util.jar.JarFile.getInputStream(ZipEntry ze)\r\n at sun.net.www.protocol.jar.JarURLConnection.getInputStream()\r\n at java.net.URLClassLoader.getResourceAsStream(String name)\r\n at org.springframework.core.io.ClassPathResource.getInputStream() in ClassPathResource.java:line 166\r\n at org.springframework.core.type.classreading.SimpleMetadataReader..ctor(Resource resource, ClassLoader classLoader) in SimpleMetadataReader.java:line 50\r\n at org.springframework.core.type.classreading.SimpleMetadataReaderFactory.getMetadataReader(Resource resource) in SimpleMetadataReaderFactory.java:line 98\r\n at org.springframework.boot.type.classreading.Concurre
ntReferenceCachingMetadataReaderFactory.createMetadataReader(Resource resource) in ConcurrentReferenceCachingMetadataReaderFactory.java:line 89\r\n at org.springframework.boot.type.classreading.ConcurrentReferenceCachingMetadataReaderFactory.getMetadataReader(Resource resource) in ConcurrentReferenceCachingMetadataReaderFactory.java:line 76\r\n at org.springframework.core.type.classreading.SimpleMetadataReaderFactory.getMetadataReader(String className) in SimpleMetadataReaderFactory.java:line 93\r\n at org.springframework.boot.autoconfigure.AutoConfigurationSorter.AutoConfigurationClasses..ctor(MetadataReaderFactory metadataReaderFactory, Collection classNames) in AutoConfigurationSorter.java:line 110\r\n at org.springframework.boot.autoconfigure.AutoConfigurationSorter.getInPriorityOrder(Collection classNames) in AutoConfigurationSorter.java:line 54\r\n at org.springframework.boot.autoconfigure.EnableAutoConfigurationImportSelector.sort(List configurations) in EnableAutoConfigurationImportSelector.j
ava:line 193\r\n at org.springframework.boot.autoconfigure.EnableAutoConfigurationImportSelector.selectImports(AnnotationMetadata metadata) in EnableAutoConfigurationImportSelector.java:line 89\r\n at org.springframework.context.annotation.ConfigurationClassParser.processDeferredImportSelectors() in ConfigurationClassParser.java:line 481"
Here are the detail of our setup:
IKVM 8.1
Spring 4.3.2.RELEASE
Spring boot 1.4.0.RELEASE
Target .NET 4
We are using the statement âikvm.runtime.Startup.addBootClassPathAssembly(Assembly.Load("OurLargeAssembly"));â. We are not using any âclassloader argument in the args of ikvmc.
We tried downloading the datastax driver and adding it to our large assembly. It worked, but right after we faced the same problem with âelasticsearchâ. But this time, adding this package caused an ikvmc crash:
warning IKVMC0100: Class "org.jboss.netty.bootstrap.ServerBootstrap" not found
warning IKVMC0100: Class "org.jboss.netty.channel.socket.nio.NioServerSocketChannelFactory" not found
warning IKVMC0100: Class "org.jboss.netty.channel.group.ChannelGroup" not found
warning IKVMC0100: Class "org.jboss.netty.channel.group.ChannelGroupFuture" not found
*** INTERNAL COMPILER ERROR ***
PLEASE FILE A BUG REPORT FOR IKVM.NET WHEN YOU SEE THIS MESSAGE
ikvmc, Version=8.1.5717.0, Culture=neutral, PublicKeyToken=13235d27fcbfff58
C:\Windows\Microsoft.NET\Framework64\v2.0.50727\
2.0.50727.5485 64-bit
System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
at IKVM.Reflection.Impl.ISymUnmanagedWriter2.CloseMethod()
at IKVM.Reflection.Impl.PdbWriter.Close()
at IKVM.Reflection.Writer.ModuleWriter.WriteModuleImpl(StrongNameKeyPair keyPair, Byte[] publicKey, ModuleBuilder moduleBuilder, PEFileKinds fileKind, PortableExecutableKinds portableExecutableKind, ImageFileMachine imageFileMachine, ResourceSection resources, Int32 entryPointToken, Stream stream)
at IKVM.Reflection.Writer.ModuleWriter.WriteModule(StrongNameKeyPair keyPair, Byte[] publicKey, ModuleBuilder moduleBuilder, PEFileKinds fileKind, PortableExecutableKinds portableExecutableKind, ImageFileMachine imageFileMachine, ResourceSection resources, Int32 entryPointToken, Stream stream)
at IKVM.Reflection.Emit.AssemblyBuilder.SaveImpl(String assemblyFileName, Stream streamOrNull, PortableExecutableKinds portableExecutableKind, ImageFileMachine imageFileMachine)
at IKVM.Reflection.Emit.AssemblyBuilder.Save(String assemblyFileName, PortableExecutableKinds portableExecutableKind, ImageFileMachine imageFileMachine)
at IKVM.Internal.CompilerClassLoader.Save()
at IKVM.Internal.CompilerClassLoader.Compile(String runtimeAssembly, List`1 optionsList)
at IkvmcCompiler.Compile(String[] args)
at IkvmcCompiler.Main(String[] args)
Any help would be appreciated.
_________________________________
Pascal Dufresne
Associate - Securitized Products Technology
Nomura Securities International
309 West 49th Street
New York, New York 10019-7316
Phone: +1 212 667 1381 Mobile: +1 646 920 9617
Email: ***@nomura.com<mailto:***@nomura.com>
Connecting Markets East & West
www.nomura.com<http://www.nomura.com/>
PLEASE READ: This message is for the named person's use only. It may contain confidential, proprietary or legally privileged information. No confidentiality or privilege is waived or lost by any mistransmission. If you receive this message in error, please delete it and all copies from your system, destroy any hard copies and notify the sender. You must not, directly or indirectly, use, disclose, distribute, print, or copy any part of this message if you are not the intended recipient. Nomura Holding America Inc., Nomura Securities International, Inc, and their respective subsidiaries each reserve the right to monitor all e-mail communications through its networks. Any views expressed in this message are those of the individual sender, except where the message states otherwise and the sender is authorized to state the views of such entity. Unless otherwise stated, any pricing information in this message is indicative only, is subject to change and does not constitute an offer to deal at any price quoted. Any reference to the terms of executed transactions should be treated as preliminary only and subject to our formal written confirmation.