This is the mail archive of the
java@gcc.gnu.org
mailing list for the Java project.
Re: Fwd: Status of gcj/java on PPC Linux?
- To: Tom Tromey <tromey at redhat dot com>,khendricks at ivey dot uwo dot ca
- Subject: Re: Fwd: Status of gcj/java on PPC Linux?
- From: Kevin B. Hendricks <khendricks at ivey dot uwo dot ca>
- Date: Fri, 9 Feb 2001 13:36:33 -0500
- Cc: Mark Wielaard <mark at klomp dot org>,java at gcc dot gnu dot org
- References: <200102081755.f18Htq923345@ashley.ivey.uwo.ca> <01020820140000.14554@localhost> <87wvb07iy6.fsf@creche.redhat.com>
- Reply-To: khendricks at ivey dot uwo dot ca
Hi,
I used gdb to track back the cause of gij not being able to find the class.
The problem seems to come in gcc/libjava/java/net/URLClassLoader.java in line
250.
The file was found correctly, the io stream was opened and read but just but
just as we are about to return an object:
Line 250 return defineClass (name, data, 0, len);
The code goes to create and object and then to the dl-linker and seems to die
out there someplace.
Anyway, I can't continue to debug the closure interface without being able to
at least load a class.
Any help you might have here would be greatly appreciated.
Thanks,
Kevin
// and finally, we can implement our class loader functionality.
protected Class findClass (String name)
throws ClassNotFoundException
{
if (name == null)
throw new ClassNotFoundException ("null");
try
{
URL u = getResource (name.replace ('.', '/') + ".class");
if (u == null)
throw new ClassNotFoundException (name);
URLConnection connection = u.openConnection ();
InputStream is = connection.getInputStream ();
int len = connection.getContentLength ();
byte[] data = new byte[len];
int left = len;
int off = 0;
while (left > 0)
{
int c = is.read (data, off, len-off);
if (c == -1 || c == 0)
throw new InternalError ("premature end of file");
left -= c;
off += c;
}
return defineClass (name, data, 0, len);
}