java.io.FileInputStream -The type initializer for 'java.io.File' threw an exception

1.7k views Asked by At

I am trying to use OpenNLP.Net Nuget package. I created a sample project but running into TypeInitialization exception when java.io.FileInputStream object is created.

"The type initializer for 'java.io.File' threw an exception."

Any ideas?

My IKVM.net version number is 7.4.5196.0, VS2013, .NET 4.5

Thanks

Edit:

I am trying sample code from here but using the nuget package: https://cwiki.apache.org/confluence/display/OPENNLP/Introduction+to+using+openNLP+in+.NET+Projects

Exception ToString() is "The function evaluation was disabled because of an out of memory exception". 
_Hresult = -2146233036 
_message = The type initializer for 'java.io.File' threw an exception.

Here is the stack from IntelliTrace:

IKVM.OpenJDK.Core.dll!java.util.Hashtable.rehash()  C#
IKVM.OpenJDK.Core.dll!java.util.Hashtable.put(object key = "java.ext.dirs", object value = "")  C#
IKVM.OpenJDK.Core.dll!java.util.Properties.setProperty(string key = "java.ext.dirs", string value = "") C#
IKVM.OpenJDK.Core.dll!java.lang.VMSystemProperties.initCommonProperties(java.util.Properties  = {java.util.Properties}) C#
IKVM.OpenJDK.Core.dll!java.lang.VMSystemProperties.initProperties(java.util.Properties  = {java.util.Properties})   C#
IKVM.OpenJDK.Core.dll!java.lang.Props..cctor()  C#
IKVM.OpenJDK.Core.dll!java.lang.System.getProperty(string key = "sun.io.useCanonCaches")    C#
IKVM.OpenJDK.Core.dll!java.io.FileSystem.getBooleanProperty(string  = "sun.io.useCanonCaches", bool  = true)    C#
IKVM.OpenJDK.Core.dll!java.io.FileSystem..cctor()   C#
IKVM.OpenJDK.Core.dll!java.io.File..cctor() C#
IKVM.OpenJDK.Core.dll!java.io.FileInputStream..ctor(string name = "C:\\nlp\\en-sent.bin")   C#
>   OpenNLPTest.exe!OpenNLPTest.EntityExtractor.prepareSentenceDetector()   C#
OpenNLPTest.exe!OpenNLPTest.Program.Main(string[] args = {string[0]})   C#
OpenNLPTest.exe!OpenNLPTest.EntityExtractor.ExtractEntities(string inputData = "I am still here", EntityType targetType = Person)   C#
Microsoft.VisualStudio.HostingProcess.Utilities.dll!Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()   C#
mscorlib.dll!System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext executionContext = {unknown}, System.Threading.ContextCallback callback = {unknown}, object state = {unknown}, bool preserveSyncCtx = {unknown})   C#
mscorlib.dll!System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext executionContext = {unknown}, System.Threading.ContextCallback callback = {unknown}, object state = {unknown}, bool preserveSyncCtx = {unknown})   C#
mscorlib.dll!System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext executionContext = {unknown}, System.Threading.ContextCallback callback = {unknown}, object state = {unknown}) C#
mscorlib.dll!System.Threading.ThreadHelper.ThreadStart()    C#

Here the file c:\nlp\en-sent.bin is ~100kb

0

There are 0 answers