DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=7104>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=7104

Preferences will fail





------- Additional Comments From [EMAIL PROTECTED]  2002-04-29 15:20 -------
Hm. I have installed the JDK 1.4.0. I'm not using the DTD at all, if anything is
using the DTD, it's the JDK/JRE. On the matter of the testcase, simply compile
and run it (maybe run it twice):

// the package I'm using:
import java.util.prefs.*;

public class Test{

    public static void main( String[] args ){
// this one get's me a preferences node where I can store, well, Preferences
        Preferences prefs=Preferences.userNodeForPackage(Test.class);
// this stores the "testvalue" under the "testkey"
        prefs.put("testkey","testvalue");
// the next ones stores the preferences, anything goes fine here
        try{
            prefs.flush();
        }catch(Exception e){
            e.printStackTrace();
        }
// here occurs the exception/error whatever, the preferences API tries to open
// the existing preferences. Under Linux, there are FileSystemPreferences,
// which open a XML file under ~/.java. I suspect the error occurs while 
// parsing the file (at least in the first case).
        System.out.println(prefs.get("testkey","standard"));
    }

}


On the matter of the exception: Yes, in that case I am using a xerces 2.0.1 and
the xmlParserAPIs.jar. I skipped the xercesSamples.jar (as the third and last
.jar which is packaged in the 2.0.1 distribution).

To clarify the different cases:

1. Using a standalone JDK/JRE 1.4 works fine while compiling and running the
testcase. My command line:

/usr/lib/j2sdk1.4.0/bin/java Test

Output:
testvalue

2. Putting a xerces 1.4.x in the classpath works also fine. Command line:

/usr/lib/j2sdk1.4.0/bin/java -cp xerces-1_4_4/xerces.jar:. Test

Output:
testvalue

3. Putting a xerces 2.0.1 jar in the classpath gives the exception. Command line:

/usr/lib/j2sdk1.4.0/bin/java -cp xerces-2_0_1/xercesImpl.jar:. Test

Output (first line):

Exception in thread "main" java.lang.NoClassDefFoundError:
org/w3c/dom/ranges/DocumentRange

4. Putting a xerces from the xalan 2.3.1 distribution into the classpath gives
the IncorrectFormatPrefs error messages. Command line:

/usr/lib/j2sdk1.4.0/bin/java -cp
xalan-j_2_3_1/bin/xercesImpl.jar:xalan-j_2_3_1/bin/xml-apis.jar:. Test

Output:

29.04.2002 17:18:05 java.util.prefs.FileSystemPreferences$11 run
WARNUNG: Invalid preferences format in
/home/stranger/.java/.userPrefs/<unnamed>/prefs.xml
29.04.2002 17:18:05 java.util.prefs.FileSystemPreferences$11 run
WARNUNG:  Prefs file removed in background
/home/stranger/.java/.userPrefs/<unnamed>/prefs.xml

On the matter of the .dtd file: I did not download it or store it in any way. I
also couldn't find any .dtd file in the jdk1.4.0 directory, so if there is any,
it must be stored in a .jar or something?

Maybe that finally helps, Andreas

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to