Re: [kaffe] Eclipse and strange ClassCastException

2003-07-08 Thread Dalibor Topic
Hi Mark, hallo Helmer,

Jim, I think this is front page material ;)

Helmer, is there a simple way to send you a crate of Tannenzaepfle beer?

cheers,
dalibor topic

--- Mark Wielaard <[EMAIL PROTECTED]> wrote:
> Hi Helmer,
> 
> On Mon, 2003-07-07 at 19:32, Helmer Krämer wrote:
> > > Next problem is a failure in System.arraycopy() 
> > 
> > I've just commited a fix for this one.
> > 
> > If I start eclipse with this command line:
> > 
> > LD_LIBRARY_PATH=plugins/org.eclipse.swt.gtk_2.1.0/os/linux/x86 ./eclipse
> -debug -vm /usr/local/kaffe/bin/java
> > 
> > it's running for some time, then complains
> > that the workspace layout could not be restored
> > and finally quits with an OutOfMemoryError
> 
> But, but, but,... If you do have enough memory you get
> >http://www.klomp.org/mark/kaffe-eclipse.html>
> As you can see I wasn't actually able to create a real Hello World
> application but that it actually starts up and let me try these things
> out is really, really nice.
> 
> Helmer, I think you actually did it!
> 
> Cheers,
> 
> Mark
> 
> 
> ___
> kaffe mailing list
> [EMAIL PROTECTED]
> http://kaffe.org/cgi-bin/mailman/listinfo/kaffe


__
Do you Yahoo!?
SBC Yahoo! DSL - Now only $29.95 per month!
http://sbc.yahoo.com

___
kaffe mailing list
[EMAIL PROTECTED]
http://kaffe.org/cgi-bin/mailman/listinfo/kaffe


Re: [kaffe] Eclipse and strange ClassCastException

2003-07-07 Thread Mark Wielaard
Hi Helmer,

On Mon, 2003-07-07 at 19:32, Helmer Krämer wrote:
> > Next problem is a failure in System.arraycopy() 
> 
> I've just commited a fix for this one.
> 
> If I start eclipse with this command line:
> 
> LD_LIBRARY_PATH=plugins/org.eclipse.swt.gtk_2.1.0/os/linux/x86 ./eclipse -debug -vm 
> /usr/local/kaffe/bin/java
> 
> it's running for some time, then complains
> that the workspace layout could not be restored
> and finally quits with an OutOfMemoryError

But, but, but,... If you do have enough memory you get
>http://www.klomp.org/mark/kaffe-eclipse.html>
As you can see I wasn't actually able to create a real Hello World
application but that it actually starts up and let me try these things
out is really, really nice.

Helmer, I think you actually did it!

Cheers,

Mark


___
kaffe mailing list
[EMAIL PROTECTED]
http://kaffe.org/cgi-bin/mailman/listinfo/kaffe


Re: [kaffe] Eclipse and strange ClassCastException

2003-07-07 Thread Helmer Krämer
On Mon, 7 Jul 2003 15:51:08 +0200
Helmer Krämer <[EMAIL PROTECTED]> wrote:

Hi again,

> Next problem is a failure in System.arraycopy() 

I've just commited a fix for this one.

If I start eclipse with this command line:

LD_LIBRARY_PATH=plugins/org.eclipse.swt.gtk_2.1.0/os/linux/x86 ./eclipse -debug -vm 
/usr/local/kaffe/bin/java

it's running for some time, then complains
that the workspace layout could not be restored
and finally quits with an OutOfMemoryError


Greetings,
Helmer

___
kaffe mailing list
[EMAIL PROTECTED]
http://kaffe.org/cgi-bin/mailman/listinfo/kaffe


Re: [kaffe] Eclipse and strange ClassCastException

2003-07-07 Thread Helmer Krämer
On 07 Jul 2003 12:39:04 +0200
Mark Wielaard <[EMAIL PROTECTED]> wrote:

Hi,

> > From what I know about eclipse, I would assume that the
> > PlatformClassLoader should not be able to find that class,
> > should it? 
> 
> Actually it should but it does so in a tricky way and then removes (!)
> those classes again from the classloader.
> This looks like it might be the same problem that IKVM.NET had:
> http://weblog.ikvm.net/PermaLink.aspx/66

hmm. That sure looks a little bit weird, but I think it's ok.
And it definitely worked before we implemented the AppClassLoader
stuff

It finally turned out to be a bug in java.net.URLClassLoader:
java.net.URLClassLoader.findClass() tries to find the .class
file using findResource(). PlatformClassLoader.findResource()
however delegates the call to findResource() to the xmlClassLoader
which succeeds in loading that resource, which in turn causes
the PlatformClassLoader to succeed in loading that class :( 
Fix is in CVS.

Next problem is a failure in System.arraycopy() 

Thanks,
Helmer

___
kaffe mailing list
[EMAIL PROTECTED]
http://kaffe.org/cgi-bin/mailman/listinfo/kaffe


Re: [kaffe] Eclipse and strange ClassCastException

2003-07-07 Thread Mark Wielaard
Hi,

On Mon, 2003-07-07 at 12:39, Mark Wielaard wrote:
> The workaround for IKVM.NET was to add the xmlParserAPIs.jar and
> xercesImpl.jar to the bootclasspath but that doesn't work for kaffe.

O, spoke to soon... It does work. I can see BOTH the Eclipse splash
screens now! Admittedly it crashes soon after that, but this means that
it actually finishes the installation process and tries to actually
start the real application now. Joy!

Attached is the small patch that I made to the source.
And the workspace/.metadata/.log file which shows the errors while
running.

The following is my command line and the console output:

$ 
BOOTCLASSPATH=plugins/org.apache.xerces_4.0.7/xmlParserAPIs.jar:plugins/org.apache.xerces_4.0.7/xercesImpl.jar
 ./eclipse -debug
Start VM: /usr/local/kaffe/bin/java
-cp /tmp/eclipse/./startup.jar org.eclipse.core.launcher.Main
-os linux
-ws gtk
-arch x86
-showsplash /tmp/eclipse/./eclipse -showsplash 600
-debug
Startup: unable to load configuration
java.io.FileNotFoundException: /tmp/eclipse/.config/platform.cfg: No such file or 
directory
Boot URL:
file:/tmp/eclipse/plugins/org.eclipse.core.boot_2.1.0/boot.jar
Startup: splash path = /tmp/eclipse/plugins/org.eclipse.core.boot_2.1.0/splash.bmp
Workspace location:
   /tmp/eclipse/workspace
Debug-Options:
file:/tmp/eclipse/.options
Install URL:
file:/tmp/eclipse/
Start VM: /usr/local/kaffe/bin/java
-cp /tmp/eclipse/./startup.jar org.eclipse.core.launcher.Main
-os linux
-ws gtk
-arch x86
-showsplash /tmp/eclipse/./eclipse -showsplash 600
-debug
Startup: using configuration file:/tmp/eclipse/workspace/.metadata/.config/platform.cfg
Boot URL: file:/tmp/eclipse/plugins/org.eclipse.core.boot_2.1.0/boot.jar
Startup: splash path = /tmp/eclipse/plugins/org.eclipse.platform_2.1.0/splash.bmp
Workspace location:
   /tmp/eclipse/workspace
Debug-Options:
file:/tmp/eclipse/.options
Install URL:
file:/tmp/eclipse/


Cheers,

Mark
Index: libraries/clib/native/System.c
===
RCS file: /cvs/kaffe/kaffe/libraries/clib/native/System.c,v
retrieving revision 1.35
diff -u -r1.35 System.c
--- libraries/clib/native/System.c	11 Jun 2003 16:08:56 -	1.35
+++ libraries/clib/native/System.c	7 Jul 2003 11:02:21 -
@@ -234,7 +234,7 @@
 	 *
 	 */
 
-	setProperty(p, "java.version", kaffe_version);
+	setProperty(p, "java.version", "1.3");
 	setProperty(p, "java.vendor", kaffe_vendor);
 	setProperty(p, "java.vendor.url", kaffe_vendor_url);
 	setProperty(p, "java.vendor.url.bug", kaffe_vendor_url_bug);
Index: libraries/javalib/java/net/URL.java
===
RCS file: /cvs/kaffe/kaffe/libraries/javalib/java/net/URL.java,v
retrieving revision 1.30
diff -u -r1.30 URL.java
--- libraries/javalib/java/net/URL.java	11 May 2003 16:26:23 -	1.30
+++ libraries/javalib/java/net/URL.java	7 Jul 2003 11:02:21 -
@@ -205,6 +205,16 @@
 	return (file);
 }
 
+public String getPath() {
+	int query = file.indexOf('?');
+	return query == -1 ? file : file.substring(0, query);
+}
+
+public String getQuery() {
+	int query = file.indexOf('?');
+	return query == -1 ? null : file.substring(query + 1);
+}
+
 public String getHost() {
 	return (host);
 }
!SESSION Jul 07, 2003 11:01:50.387 -
java.version=1.3
java.vendor=Kaffe.org project
BootLoader constants: OS=linux, ARCH=x86, WS=gtk, NL=en_US
Command-line arguments: -os linux -ws gtk -arch x86 -debug -install file:/tmp/eclipse/
!ENTRY org.eclipse.core.runtime 4 4 Jul 07, 2003 11:01:50.395
!MESSAGE Unable to read authorization database: 
/tmp/eclipse/workspace/.metadata/.keyring.
!STACK 0
java.io.StreamCorruptedException: bad magic in stream header (-14967, expected -21267)
at java.lang.Throwable.fillInStackTrace(Throwable.java:native)
at java.lang.Throwable.(Throwable.java:44)
at java.lang.Exception.(Exception.java:24)
at java.io.IOException.(IOException.java:24)
at java.io.ObjectStreamException.(ObjectStreamException.java:23)
at java.io.StreamCorruptedException.(StreamCorruptedException.java:21)
at java.io.ObjectInputStream.readStreamHeader(ObjectInputStream.java:298)
at java.io.ObjectInputStream.(ObjectInputStream.java:185)
at 
org.eclipse.core.internal.runtime.AuthorizationDatabase.load(AuthorizationDatabase.java:268)
at 
org.eclipse.core.internal.runtime.AuthorizationDatabase.load(AuthorizationDatabase.java:252)
at 
org.eclipse.core.internal.runtime.AuthorizationDatabase.(AuthorizationDatabase.java:77)
at 
org.eclipse.core.internal.runtime.InternalPlatform.loadKeyring(InternalPlatform.java:618)
at 
org.eclipse.core.internal.runtime.InternalPlatform.loaderStartup(InternalPlatform.java:591)
at java.lang.reflect.Method.invoke0(Method.java:native)
at java.lang.reflect.Method.invoke(Method.java:255)
at 
org.eclipse.core.internal.boot.In

Re: [kaffe] Eclipse and strange ClassCastException

2003-07-07 Thread Mark Wielaard
Hi,

On Mon, 2003-07-07 at 11:25, Helmer Krämer wrote:
> the problem is that 'StandardParserConfiguration' is loaded by a
> PluginClassLoader and 'XMLParserConfiguration' is loaded by the
> PlatformClassLoader (the attached patch includes this info in the
> message of the ClassCastException).

Nice patch. Useful info when you are playing with complex classloader
hierarchies. (If you include it then I would only add the additional
information if the classloaders are actaully different.)

> From what I know about eclipse, I would assume that the
> PlatformClassLoader should not be able to find that class,
> should it? 

Actually it should but it does so in a tricky way and then removes (!)
those classes again from the classloader.
This looks like it might be the same problem that IKVM.NET had:
http://weblog.ikvm.net/PermaLink.aspx/66
The workaround for IKVM.NET was to add the xmlParserAPIs.jar and
xercesImpl.jar to the bootclasspath but that doesn't work for kaffe.

Cheers,

Mark


___
kaffe mailing list
[EMAIL PROTECTED]
http://kaffe.org/cgi-bin/mailman/listinfo/kaffe


Re: [kaffe] Eclipse and strange ClassCastException

2003-07-07 Thread Helmer Krämer
On 07 Jul 2003 10:11:56 +0200
Mark Wielaard <[EMAIL PROTECTED]> wrote:

Hi,

> When trying to run the eclipse-SDK-2.1-linux-gtk release (make sure that
> your java.version in System.csays "1.3" otherwise it won't try to run at
> all) I get a strange ClassCastException (workspace/.metainfo/.log file):
> 
> java.lang.ExceptionInInitializerError: [exception was java.lang.ClassCastException: 
> can't cast `org/apache/xerces/parsers/StandardParserConfiguration' to 
> `org/apache/xerces/xni/parser/XMLParserConfiguration']
> at 
> org.eclipse.core.internal.plugins.RegistryLoader.processManifestFile(RegistryLoader.java:89)
> [ ... ]
> The StandardParserConfiguration class implements the
> XMLPullParserConfiguration interface which extends the
> XMLParserConfiguration interface.

the problem is that 'StandardParserConfiguration' is loaded by a
PluginClassLoader and 'XMLParserConfiguration' is loaded by the
PlatformClassLoader (the attached patch includes this info in the
message of the ClassCastException).

>From what I know about eclipse, I would assume that the
PlatformClassLoader should not be able to find that class,
should it? 

HTH,
Helmer

checkcast-patch
Description: Binary data