[Ikvm-developers] IKVM can not cast sun.awt.image.ToolkitImage to java.awt-image.BufferedImage
Brought to you by:
jfrijters
|
From: Vito S. <vit...@gm...> - 2012-02-02 10:36:05
|
Apologies first, if this is the wrong place to ask for help (redirect me pls, if this is so). I have been looking for possible causes of the problem below quite extensively, but the few cases, where "ClassCastException: *sun*.*awt*.* image*.*ToolkitImage* *cannot be cast to ..."* was mentioned, were not helpful insofar code changes have been suggested - and I have an inkling, the problem should be simpler to solve. I am trying to run ImageJ (http://rsbweb.nih.gov/ij/) using ikvm and I get the following exception and post-mortem: *D:\Data\ikVlll-7.0.4H5.0\bin>ikvm -jar ij.jar Exception in thread "main" java.lang.ClassCastException: Das Objekt des Typs sun.awt.image.ToolkitImage kann nicht 1n Typ java.awt.image.BufferedImage umgewandelt werden. at cli.system.Windows.Forms.Control.MarshaledInvoke(Unknown Source) at cli.system.Windows.Forms.Contro1.Invoke(Unknown Source) at cli.System.Windows.Forms.Control.Invoke(Unknown Source) at cli.ikvm.awt.NetToolkit.Invoke(Unknown Source) at cli.ikvm.awt.NetToolkit.createFrame(Unknown Source) at java.awt.Frame.addNotify(Frame.java:477) at java.awt.window.pack(Window.java:806) at ij.lmageJ.<init>(ImageJ.java:165) at ij.ImageJ.main(ImageJ.java:563)* The IKVM version is as follows: *IKVM.NET Launcher version 7.0.4335.0 Copyright (C) 2002-2011 Jeroen Frijters http://www.ikvm.net/ CLR version: 2.0.50727.3625 (32 bit) mscorlib: 2.0.0.0 ikvm: 7.0.4335.0 mscorlib.resources: 2.0.0.0 yst_: 2.0.0.0 IKVM.OpenJDK.Core: 7.0.4335.0 IKVM.Runtime: 7.0.4335.0 System Configuration: 2.0.0.0 System.Xml: 2.0.0.0 OpenJDK version: OpenJDK 7 b147 * ___________________ OS: windows XP 32bit .NET 4 version ____________________ I have an identical problem with another ikvm version (0.46.01) and OpenJDK version (OpenJDK 6 b22). I used ikvmc in this environment to create ij.dll. It behaves decently in my environment (.net 4, Visual Studio 2010, c#) except when it comes to creating the GUI - nothing going on. I added IKVM.OpenJDK.SwingAWT assembly to references (to silence some "unsatisfied" grumbles;) , on top of IKVM.OpenJDK.Core and IKVM.RunTime. Am I missing something evident here? Please let me know, what else you would need to know to make any suggestions. Using Eclipse on the Java side and as already mentioned Visual Studio and C# on the .NET side. Sincere regards Vito Smolej (smo) |