|
View:
New views
5 Messages
—
Rating Filter:
Alert me
|
|
|
NoClassDefFoundError occurredHello,
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 ------------------------------------------------------------------------------ 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 Ikvm-developers@... https://lists.sourceforge.net/lists/listinfo/ikvm-developers |
|
|
Re: NoClassDefFoundError occurredHi,
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@...] > Gesendet: Dienstag, 3. November 2009 20:14 > An: ikvm-developers@... > 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 > Ikvm-developers@... > https://lists.sourceforge.net/lists/listinfo/ikvm-developers > ------------------------------------------------------------------------------ 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 Ikvm-developers@... https://lists.sourceforge.net/lists/listinfo/ikvm-developers |
|
|
Re: NoClassDefFoundError occurredI'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:volker.berlin@...] > Sent: Tuesday, November 03, 2009 12:23 PM > To: 'Frank Bergmann'; ikvm-developers@... > 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@...] > > Gesendet: Dienstag, 3. November 2009 20:14 > > An: ikvm-developers@... > > 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 > > Ikvm-developers@... > > https://lists.sourceforge.net/lists/listinfo/ikvm-developers > > ------------------------------------------------------------------------------ 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 Ikvm-developers@... https://lists.sourceforge.net/lists/listinfo/ikvm-developers |
|
|
Re: NoClassDefFoundError occurredHi,
You should contact the autor of the binary. I does not know the internal of this library. I am suspect to the JNI facts. There should be also a second dll with the JNI part. I think AppDomainAssemblyClassLoader is a good idea. Volker > -----Ursprungliche Nachricht----- > Von: Frank Bergmann [mailto:fbergman@...] > Gesendet: Dienstag, 3. November 2009 22:30 > An: ikvm-developers@... > Betreff: Re: [Ikvm-developers] NoClassDefFoundError occurred > > 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:volker.berlin@...] > > Sent: Tuesday, November 03, 2009 12:23 PM > > To: 'Frank Bergmann'; ikvm-developers@... > > 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@...] > > > Gesendet: Dienstag, 3. November 2009 20:14 > > > An: ikvm-developers@... > > > 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 > > > Ikvm-developers@... > > > https://lists.sourceforge.net/lists/listinfo/ikvm-developers > > > > > > > -------------------------------------------------------------- > ---------------- > 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 > Ikvm-developers@... > https://lists.sourceforge.net/lists/listinfo/ikvm-developers > ------------------------------------------------------------------------------ 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 Ikvm-developers@... https://lists.sourceforge.net/lists/listinfo/ikvm-developers |
|
|
[solved] RE: NoClassDefFoundError occurredI just wanted to follow up on this one. I of course meant there was only one
jar file which was converted into one managed library, of course there are many native libraries to go along with that one. Anyway ... I regenerated the managed library using the -classloader argument and everything works great now. Thank you again for your help, Cheers Frank > -----Original Message----- > From: Volker Berlin [mailto:volker.berlin@...] > Sent: Tuesday, November 03, 2009 2:19 PM > To: 'Frank Bergmann'; ikvm-developers@... > Subject: AW: [Ikvm-developers] NoClassDefFoundError occurred > > Hi, > > You should contact the autor of the binary. I does not know the > internal of this library. I am suspect to the JNI facts. > There should be also a second dll with the JNI part. > > I think AppDomainAssemblyClassLoader is a good idea. > > Volker > > > -----Ursprungliche Nachricht----- > > Von: Frank Bergmann [mailto:fbergman@...] > > Gesendet: Dienstag, 3. November 2009 22:30 > > An: ikvm-developers@... > > Betreff: Re: [Ikvm-developers] NoClassDefFoundError occurred > > > > 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:volker.berlin@...] > > > Sent: Tuesday, November 03, 2009 12:23 PM > > > To: 'Frank Bergmann'; ikvm-developers@... > > > 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@...] > > > > Gesendet: Dienstag, 3. November 2009 20:14 > > > > An: ikvm-developers@... > > > > 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 > > > > Ikvm-developers@... > > > > https://lists.sourceforge.net/lists/listinfo/ikvm-developers > > > > > > > > > > > > -------------------------------------------------------------- > > ---------------- > > 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 > > Ikvm-developers@... > > https://lists.sourceforge.net/lists/listinfo/ikvm-developers > > ------------------------------------------------------------------------------ Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july _______________________________________________ Ikvm-developers mailing list Ikvm-developers@... https://lists.sourceforge.net/lists/listinfo/ikvm-developers |
| Free embeddable forum powered by Nabble | Forum Help |