[Ikvm-developers] NoClassDefFoundError occurred
Brought to you by:
jfrijters
|
From: Frank B. <fbergman@u.washington.edu> - 2009-11-03 19:14:41
|
Hello, First of all let me say how much I appreciate all the hard work you do with ikvm it is simply amazing and has changed the way we will deploy our software from now on. However, I am facing problems and it would be great if you could help me out. I'm using ikvmc generated assemblies that allow me to access the qtjambi framework: http://code.google.com/p/qt4dotnet/ and mostly things work just fine, at least as long as I confine myself to never use .Net objects in a class used by qtjambi. However for my current project I'm stumped. I need to define my own object inherited from QGraphicsScene, which works great up to the point where qtjambi is using it (here in a custom QGraphicsItem::itemChange method). So I was hoping you could tell me what I could do to make it work. I think I saw on the IKVM website that it should be possible to refer to CLI objects. Here the error I get: public class MyItem: QGraphicsItemGroup { public override object itemChange(QGraphicsItem.GraphicsItemChange change, object value) { if (change == QGraphicsItem.GraphicsItemChange.ItemPositionChange) { UpdateTheItem(); return value; } return base.itemChange(change, value); //<---- BOOOOM } .... } The Exception: Java.lang.NoClassDefFoundError {"cli/MyGraphicsScene"} at IKVM.Runtime.JNI.Frame.Leave() at com.trolltech.qt.gui.QGraphicsItemGroup.__qt_itemChange_GraphicsItemChange_O bject(Int64 , Int32 , Object ) at com.trolltech.qt.gui.QGraphicsItemGroup.itemChange(GraphicsItemChange change, Object value) at BenZaiTenQt.GraphicItems.QSpeciesItem.itemChange(GraphicsItemChange change, Object value) in MyItem.cs:line 167 and here the definition of the scene: public class MyGraphicsScene : QGraphicsScene { public MyGraphicsScene(QObject parent) : base(parent) { Initialize(); } public MyGraphicsScene(QRectF sceneRect, QObject parent) : base(sceneRect, parent) { Initialize(); } public MyGraphicsScene(double x, double y, double width, double height, QObject parent) : base(x, y, width, height, parent) { Initialize(); } public MyGraphicsScene(QRectF sceneRect) : base(sceneRect) { Initialize(); } public MyGraphicsScene(double x, double y, double width, double height) : base(x, y, width, height) { Initialize(); } protected internal MyGraphicsScene(QtJambiObject.QPrivateConstructor p) : base(p) { Initialize(); } private void Initialize() { } } Also things like the following seem to fail, I wonder why: public class MyVeryImportantClass { public MyVeryImportantClass () {} } public class MyDialog : QDialog { public MyDialog(MyVeryImportantClass var1) { _var1 = var1; } public MyVeryImportantClass Helper { get { return _var1; } set { _var1 = value;} } } where a CLI class is referenced will just fail with a NullReferenceException: *** exception in native code *** System.NullReferenceException: Object reference not set to an instance of an object. at __<Getter>(Object ) at IKVM.NativeCode.sun.reflect.ReflectionFactory.FieldAccessorImplBase.FastObje ctFieldAccessor.get(Object obj) at IKVM.Runtime.JNIEnv.GetObjectField(JNIEnv* pEnv, IntPtr obj, IntPtr fieldID) at com.trolltech.qt.gui.QDialog.__qt_QDialog_QWidget_WindowFlags(Int64 , Int32 ) *** exception in native code *** System.NullReferenceException: Object reference not set to an instance of an object. at __<Getter>(Object ) at IKVM.NativeCode.sun.reflect.ReflectionFactory.FieldAccessorImplBase.FastObje ctFieldAccessor.get(Object obj) at IKVM.Runtime.JNIEnv.GetObjectField(JNIEnv* pEnv, IntPtr obj, IntPtr fieldID) at com.trolltech.qt.core.QObject.__qt_toString(Int64 ) Thank you so much Best frank |