Hello all. I seem to be having trouble with classes loaded via Reflection and I was wondering if anybody in the forum can provide some pointers. The problem is as follows:
I have class files RedApple.class, GreenApple.class, YellowApple.class sitting on the filesystem where JBoss 4.0 DR3 is running. For all intents and purposes lets say those 3 class files are in /tmp on a Linux machine running Java 1.4.2_03. The colored apple classes all extend Apple. Apple, in contrast with the colored apples, lives in a Jar file that has been placed along the FruitBean in the $JBOSS/server/fruits/deploy directory. A helper class to FruitBean (say, FruitHarvester, which is a custom class loader) instantiates colored apples in the following manner: 1. Reads from a properties file where the colored apple class files are located. 2. Via an input stream it loads a byte array for the appropriate colored apple we are about to harvest. 3. FruitHarvester issues a call to ClassLoader.defineClass and passes it the name of the colored apple, the bytes it read from the file, 0 and the length of the byte array. If you trace ClassLoader.defineClass you'll see that it makes a call to defineClass0() which is a native call. That is the last call in my stack trace and the exception I get is a NoClassDefFoundError on Apple. I have run out of ideas why Apple cannot be seen by JBoss, especially because Apple is in the Jar file I deployed. I have tried putting that same Jar file in the $JBOSS/server/fruits/lib directory, I have tried extracting Apple.class and putting it in that same dir, I have tried putting the Jar file in $JBOSS/lib directly, and none of these things helps JBoss find the Apple class. The properties file is read without a problem and the bytes for the class file are successfully read, the problem is when loading the class. It is as if JBoss has half of what it needs (colored apple class) but it's missing the other half (Apple), even though the later is in the lib directory in a Jar file. Please, if anybody has any pointers do let me know. I have ran out of ideas on this problem. Thanks. // David View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=3830203#3830203 Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=3830203 ------------------------------------------------------- This SF.Net email is sponsored by: IBM Linux Tutorials Free Linux tutorial presented by Daniel Robbins, President and CEO of GenToo technologies. Learn everything from fundamentals to system administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click _______________________________________________ JBoss-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-user