#276 Error while playing around with JDBC

closed-works-for-me
nobody
None
5
2013-03-25
2013-03-12
Matthias Fuchs
No

I was playing around with jOOQ and the postgres JDBC driver and got this error message:

****** Critical Failure: Exception during finishing of: $Proxy1 ******

PLEASE FILE A BUG REPORT FOR IKVM.NET WHEN YOU SEE THIS MESSAGE

System.Threading.ThreadAbortException: Thread was being aborted
at LocalVarInfo.FindLocalVariablesImpl (CodeInfo codeInfo, IKVM.Internal.ClassFile classFile, IKVM.Internal.Method method, FindLocalVarState[] state) [0x00000] in <filename unknown>:0
at LocalVarInfo.FindLocalVariables (CodeInfo codeInfo, IKVM.Internal.MethodWrapper mw, IKVM.Internal.ClassFile classFile, IKVM.Internal.Method method) [0x00000] in <filename unknown>:0
at LocalVarInfo..ctor (CodeInfo ma, IKVM.Internal.ClassFile classFile, IKVM.Internal.Method method, UntangledExceptionTable exceptions, IKVM.Internal.MethodWrapper mw, IKVM.Internal.ClassLoaderWrapper classLoader) [0x00000] in <filename unknown>:0
at Compiler..ctor (IKVM.Internal.FinishContext context, IKVM.Internal.DynamicTypeWrapper clazz, IKVM.Internal.MethodWrapper mw, IKVM.Internal.ClassFile classFile, IKVM.Internal.Method m, IKVM.Internal.CodeEmitter ilGenerator, IKVM.Internal.ClassLoaderWrapper classLoader, System.Collections.Generic.Dictionary`2 invokespecialstubcache) [0x00000] in <filename unknown>:0
at Compiler.Compile (IKVM.Internal.FinishContext context, IKVM.Internal.DynamicTypeWrapper clazz, IKVM.Internal.MethodWrapper mw, IKVM.Internal.ClassFile classFile, IKVM.Internal.Method m, IKVM.Internal.CodeEmitter ilGenerator, System.Boolean& nonleaf, System.Collections.Generic.Dictionary`2 invokespecialstubcache) [0x00000] in <filename unknown>:0
at IKVM.Internal.DynamicTypeWrapper+FinishContext.FinishImpl () [0x00000] in <filename unknown>:0
at IKVM.Internal.DynamicTypeWrapper+JavaTypeImpl.FinishCore () [0x00000] in <filename unknown>:0
at LocalVarInfo.FindLocalVariablesImpl(CodeInfo codeInfo, IKVM.Internal.ClassFile classFile, IKVM.Internal.Method method, .FindLocalVarState[] state)
at LocalVarInfo.FindLocalVariables(CodeInfo codeInfo, IKVM.Internal.MethodWrapper mw, IKVM.Internal.ClassFile classFile, IKVM.Internal.Method method)
at LocalVarInfo..ctor(CodeInfo ma, IKVM.Internal.ClassFile classFile, IKVM.Internal.Method method, UntangledExceptionTable exceptions, IKVM.Internal.MethodWrapper mw, IKVM.Internal.ClassLoaderWrapper classLoader)
at Compiler..ctor(IKVM.Internal.FinishContext context, IKVM.Internal.DynamicTypeWrapper clazz, IKVM.Internal.MethodWrapper mw, IKVM.Internal.ClassFile classFile, IKVM.Internal.Method m, IKVM.Internal.CodeEmitter ilGenerator, IKVM.Internal.ClassLoaderWrapper classLoader, System.Collections.Generic.Dictionary`2 invokespecialstubcache)
at Compiler.Compile(IKVM.Internal.FinishContext context, IKVM.Internal.DynamicTypeWrapper clazz, IKVM.Internal.MethodWrapper mw, IKVM.Internal.ClassFile classFile, IKVM.Internal.Method m, IKVM.Internal.CodeEmitter ilGenerator, Boolean ByRef nonleaf, System.Collections.Generic.Dictionary`2 invokespecialstubcache)
at IKVM.Internal.DynamicTypeWrapper+FinishContext.FinishImpl()
at IKVM.Internal.DynamicTypeWrapper+JavaTypeImpl.FinishCore()
at IKVM.Internal.JVM.CriticalFailure(System.String message, System.Exception x)
at IKVM.Internal.DynamicTypeWrapper+JavaTypeImpl.FinishCore()
at IKVM.Internal.DynamicTypeWrapper+JavaTypeImpl.Finish()
at IKVM.Internal.DynamicTypeWrapper.Finish()
at IKVM.NativeCode.java.lang.Class.getDeclaredConstructors0(java.lang.Class thisClass, Boolean publicOnly)
at java.lang.Class.getDeclaredConstructors0(Boolean )
at java.lang.Class.privateGetDeclaredConstructors(Boolean )
at java.lang.Class.getConstructor0(java.lang.Class[] , Int32 )
at java.lang.Class.getConstructor(java.lang.Class[] parameterTypes, ikvm.internal.CallerID )
at java.lang.reflect.Proxy.newProxyInstance(java.lang.ClassLoader loader, java.lang.Class[] interfaces, InvocationHandler h)
at sun.reflect.annotation.AnnotationParser.annotationForMap(java.lang.Class type, Map memberValues)
at IKVM.NativeCode.java.lang.Class.FreezeOrWrapAttribute(Annotation ann)
at IKVM.NativeCode.java.lang.Class.AnnotationsToMap(System.Object[] objAnn)
at IKVM.NativeCode.java.lang.Class.getDeclaredAnnotationsImpl(java.lang.Class thisClass)
at java.lang.Class.getDeclaredAnnotationsImpl()
at java.lang.Class.initAnnotationsIfNecessary()
at java.lang.Class.getAnnotation(java.lang.Class annotationClass)
at javax.xml.bind.JAXB._marshal(System.Object , System.Object )
at javax.xml.bind.JAXB.marshal(System.Object jaxbObject, java.io.Writer xml)
at org.jooq.impl.DefaultConfiguration.toString()
at java.lang.Object.instancehelper_toString(System.Object this)
at org.jooq.impl.Executor.toString()
at java.lang.Object.ToString()
at JooqTest.MainClass.Main(System.String[] args) in /Users/matthias/Projekte/MonoDevelop/JooqTest/JooqTest/Main.cs:line 32
Shutting down finalizer thread timed out.

##################
This is the code that cause the error:
DriverManager.registerDriver(new org.postgresql.Driver());

Connection con = null;
Executor exe = null;
Result ret;

try {
con = DriverManager.getConnection("jdbc:postgresql://192.168.201.16:5433/shop_test_ditech", "postgres", "postgres");
exe = new Executor(con, org.jooq.SQLDialect.POSTGRES);

ret = exe.fetch("select * from shop.ip_security;");
ResultSet rs = ret.intoResultSet();

while (rs.next()) {
System.Console.WriteLine(rs.getInt(0));
}

System.Console.WriteLine(ret.formatCSV()); //line 32

} catch (Exception ex) {
System.Console.WriteLine(ex.Message);
}

Discussion

  • This looks like a Mono bug (or actually combination of multiple bugs).

    Do you have any idea why the thread is being aborted? Another thread is aborting the "main" thread and the Mono runtime (incorrectly) injects the ThreadAbortException while the IKVM runtime is inside a finally block and that causes the "critical failure".

     
    • status: open --> closed-works-for-me