[Ginp-developers] java.util.Preferences again..
Brought to you by:
burchbri,
dougculnane
|
From: Justin <ju...@sq...> - 2005-01-27 07:57:01
|
Doug,
I'm getting that java.util.prefs failure again where it forgets how it
was configured. I loaded up the JDK in the eclipse debugger and found
the problem deep in the guts of the preferences API. In
java.util.prefs.XmlSupport the last line of the code snippet below is
throwing a NullPointerException. This is the code it's executing while
trying to read the user's java preferences file. Interestingly enough
this happens in Resin but not in Tomcat. This is due to an XML library
that is not compatible with the preferences API that is included in
Resin 2.1 series. So since java preferences is seems to be fundametally
broken on the 2.1 resin series I think we should put in the install
notes that we recommend you don't use Resin 2.1. I am sure you get it
to work with some serious classpath hacking but that's to difficult for
most people.
static void importMap(InputStream is, Map m)
throws IOException, InvalidPreferencesFormatException
{
try {
Document doc = load(is);
Element xmlMap = (Element) doc.getChildNodes().item(1);
// check version
String mapVersion = xmlMap.getAttribute("MAP_XML_VERSION");
I am almost thinking that maybe for the next version we should just dump
the preferences api on Unix and just write a file named .ginp into the
user's home directory with simple java properties syntax. There seems
to be a lot of grumbling about the Preferences API around the net:
http://www.google.com/search?hl=en&q=syncWorld+preferences&btnG=Google+Search
Justin
|