DO NOT REPLY [Bug 38377] - BCEL cannot be used as java.system.class.loader
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG· RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT http://issues.apache.org/bugzilla/show_bug.cgi?id=38377. ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND· INSERTED IN THE BUG DATABASE. http://issues.apache.org/bugzilla/show_bug.cgi?id=38377 --- Additional Comments From [EMAIL PROTECTED] 2006-09-28 11:23 --- Created an attachment (id=18930) -- (http://issues.apache.org/bugzilla/attachment.cgi?id=18930action=view) Patch for ClassLoader constructor I created a subclass of org..ClassLoader (lets call is SLoader) and tried to use it as the system class loader, but it gave me the same error as described in the initial comment. The class looks like this: public class SLoader extends ClassLoader{ [...] public SLoader(java.lang.ClassLoader deferTo) { super(deferTo, new String[]{ java., javax., com.sun., sun.} ); } [...] } The JVM calls the above constructor when the class is passed with the -Djava.system.class.loader VM argument. This constructor then calls the constructor of the org..ClassLoader public class ClassLoader extends java.lang.ClassLoader { [...] public ClassLoader(java.lang.ClassLoader deferTo, String[] ignored_packages) { this(ignored_packages); this.repository = new ClassLoaderRepository(deferTo); } [...] } As you can see, there is no explicit call the any constructor of the java..ClassLoader class. This causes its default constructor to be invoked, which tries to resolv the parent class loader by calling java..ClassLoader.getSystemClassLoader() which causes the loop in the class loader hierarchy. The appended patch fixes this by explicitly invoking the java.lang.ClassLoader.ClassLoader(ClassLoader parent) constructor which does not use the getSystemClassLoader() method. A question about the bug reporting process: Should I REOPEN the bug and then set it RESOLVED/FIXED again? -- Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email --- You are receiving this mail because: --- You are the assignee for the bug, or are watching the assignee. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
DO NOT REPLY [Bug 38377] - BCEL cannot be used as java.system.class.loader
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG· RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT http://issues.apache.org/bugzilla/show_bug.cgi?id=38377. ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND· INSERTED IN THE BUG DATABASE. http://issues.apache.org/bugzilla/show_bug.cgi?id=38377 --- Additional Comments From [EMAIL PROTECTED] 2006-01-25 14:59 --- Created an attachment (id=17501) -- (http://issues.apache.org/bugzilla/attachment.cgi?id=17501action=view) Tentative patch. This is a tentative patch. It may not well be the solution to the problem, but it does remove the IllegalStateException error. I think the problem is that, once initSystemClassLoader is called (it's in java.lang.ClassLoader), no class should depend load java.lang.ClassLoader or you get a indirectly recursive call of initSystemClassLoader. -- Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email --- You are receiving this mail because: --- You are the assignee for the bug, or are watching the assignee. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
DO NOT REPLY [Bug 38377] - BCEL cannot be used as java.system.class.loader
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG· RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT http://issues.apache.org/bugzilla/show_bug.cgi?id=38377. ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND· INSERTED IN THE BUG DATABASE. http://issues.apache.org/bugzilla/show_bug.cgi?id=38377 --- Additional Comments From [EMAIL PROTECTED] 2006-01-25 15:05 --- Now that I think of it, my idea of the source of the problem is probably wrong so disregard the explanation after the patch. The patch, though, still solves the problem. -- Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email --- You are receiving this mail because: --- You are the assignee for the bug, or are watching the assignee. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
DO NOT REPLY [Bug 38377] - BCEL cannot be used as java.system.class.loader
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG· RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT http://issues.apache.org/bugzilla/show_bug.cgi?id=38377. ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND· INSERTED IN THE BUG DATABASE. http://issues.apache.org/bugzilla/show_bug.cgi?id=38377 --- Additional Comments From [EMAIL PROTECTED] 2006-01-25 07:50 --- hmmm. I attempted to do as you suggest, but can't seem to shake the java.lang.Error: java.lang.IllegalStateException: recursive invocation error. could getParent() be returning org.apache.bcel.util.ClassLoader, in this case? Unfortunately the error occurs before debugging begins. Any ideas? -- Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email --- You are receiving this mail because: --- You are the assignee for the bug, or are watching the assignee. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]