Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Newcomers » Newcomers » Stuck in ClassLoader.defineClass
Stuck in ClassLoader.defineClass [message #213554] Mon, 04 June 2007 00:39 Go to next message
Eclipse UserFriend
Originally posted by: mire.darkwind-guild.org

Hi,

now that my custom classLoader for JAR (or ZIP) files seemed to work
flawlessly.. on the last few meters I might have ran against another wall :(
It loads all of my test classes well.. and I can invoke methods of them,
however, it won't let me load any classes that I haven't made myself
(i.E. those that this would have a purpose for). After some heavy
debugging, I found out that it all gets stuck in the defineClass Method
of ClassLoader.
So basically what happens is
1.) I get the path to the jar in a standard dialog and get a new
jclassloader object from it
2.) I check what the contents are (called), format the wanted class
accordingly and then
3.) I call a loadClass on it, which involves getting the byte array and
all with no problems.. but for some reason it won't pass this following
line where it gets the class from the bytes:
result = defineClass(classBytes, 0, classBytes.length);
It just get stuck there, no exception, no nothing. Could it be custom
imports or anything? I have had some brief testing and imported an
emf.EObject into my helloworld class and it worked too. I'm way clueless
at this point and even google won't help me! So I'd be grateful for any
hints on stuff that I could recheck for.

-M.
Re: Stuck in ClassLoader.defineClass [message #213639 is a reply to message #213554] Mon, 04 June 2007 10:59 Go to previous message
Eclipse UserFriend
Originally posted by: mire.darkwind-guild.org

Hrm, this might actually be inner classes .. I'm going to check that out!

> Hi,
>
> now that my custom classLoader for JAR (or ZIP) files seemed to work
> flawlessly.. on the last few meters I might have ran against another
> wall :(
> It loads all of my test classes well.. and I can invoke methods of them,
> however, it won't let me load any classes that I haven't made myself
> (i.E. those that this would have a purpose for). After some heavy
> debugging, I found out that it all gets stuck in the defineClass Method
> of ClassLoader.
> So basically what happens is
> 1.) I get the path to the jar in a standard dialog and get a new
> jclassloader object from it
> 2.) I check what the contents are (called), format the wanted class
> accordingly and then
> 3.) I call a loadClass on it, which involves getting the byte array and
> all with no problems.. but for some reason it won't pass this following
> line where it gets the class from the bytes:
> result = defineClass(classBytes, 0, classBytes.length);
> It just get stuck there, no exception, no nothing. Could it be custom
> imports or anything? I have had some brief testing and imported an
> emf.EObject into my helloworld class and it worked too. I'm way clueless
> at this point and even google won't help me! So I'd be grateful for any
> hints on stuff that I could recheck for.
>
> -M.
Previous Topic:Using xjc Command in Eclipse
Next Topic:Syntax coloring
Goto Forum:
  


Current Time: Fri Apr 19 22:34:38 GMT 2024

Powered by FUDForum. Page generated in 0.05580 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top