|
| [Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] |
|
It took me weeks to discover what the fix for this problem was since there were many complaints about it but no one posted a solution. I found this in a thread about class path problems in other areas. It appears that the thread context class loader is not initialized correctly in all cases in the java environment shipped with Leopard. When it is not, the JDOM code does not get the benefit of your classpath and fails when loading the parser. (startOnFirstThread is a part of it) If you add the following incantation to your main (before the first thread is launched) it will fix most cases. ClassLoader scl = ClassLoader.getSystemClassLoader(); Thread t = Thread.currentThread(); ClassLoader cl = t.getContextClassLoader(); if (cl == null) { t.setContextClassLoader(scl); } In addition, if you load any XML in static class initializations, you will need to insert the snippet prior to doing so. It may be sufficient to do that exclusively (in a static initialization) since they should run before main but I have not tried it. Once set in a given thread, the class loader is inherited by any children of the one so modified. I hope I don't hear anyone saying "works as intended", but I am not holding my breath. John Brisbin Nathan Moon wrote:
|
_______________________________________________ Do not post admin requests to the list. They will be ignored. Java-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
| References: | |
| >Re: Eclipse, Ant and Leopard Problem (From: Nathan Moon <email@hidden>) |
| Home | Archives | Terms/Conditions | Contact | RSS | Lists | About |
Visit the Apple Store online or at retail locations.
1-800-MY-APPLE
Contact Apple | Terms of Use | Privacy Policy
Copyright © 2011 Apple Inc. All rights reserved.