Re: [Ikvm-developers] NoClassDefFoundError occurred
Brought to you by:
jfrijters
|
From: Frank B. <fbergman@u.washington.edu> - 2009-11-03 21:29:59
|
I'm currently using ikvm: 0.38.0.4, but I could upgrade to: 0.40.0.1 if you think that would make a difference. As for the class loaders I'm actually not sure. As said before I was just reusing the from trolltech compiled qtjambi binaries. At first glance I cannot find out whether they use custom classloaders in their code. Also since I was using the binaries from the qt4dotnet I'm not sure whether any classloader was specified through the command line. But I'd be fine with regenerating the library ... so if you tell me which one to use that would be great. Since 1) I have a single jar file which was translated into a single library, 2) I don't write any java code, I should compile the library with: -classloader:ikvm.runtime.AppDomainAssemblyClassLoader? Thanks Frank > -----Original Message----- > From: Volker Berlin [mailto:vol...@go...] > Sent: Tuesday, November 03, 2009 12:23 PM > To: 'Frank Bergmann'; ikv...@li... > Subject: AW: [Ikvm-developers] NoClassDefFoundError occurred > > Hi, > > First the general questions: > Which IKVM version do you use? > Which classloader do you use? See also the wiki at > http://sourceforge.net/apps/mediawiki/ikvm/index.php?title=ClassLoader > > Volker > > > > -----Ursprungliche Nachricht----- > > Von: Frank Bergmann [mailto:fbergman@u.washington.edu] > > Gesendet: Dienstag, 3. November 2009 20:14 > > An: ikv...@li... > > Betreff: [Ikvm-developers] NoClassDefFoundError occurred > > > > 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_Graphi > > csItemChange_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.FieldAccessorImp > > lBase.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.FieldAccessorImp > > lBase.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 > > > > > > -------------------------------------------------------------- > > ---------------- > > Come build with us! The BlackBerry(R) Developer Conference in SF, CA > > is the only developer event you need to attend this year. > > Jumpstart your > > developing skills, take BlackBerry mobile applications to > > market and stay > > ahead of the curve. Join us from November 9 - 12, 2009. Register now! > > http://p.sf.net/sfu/devconference > > _______________________________________________ > > Ikvm-developers mailing list > > Ikv...@li... > > https://lists.sourceforge.net/lists/listinfo/ikvm-developers > > |