By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,032 Members | 825 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,032 IT Pros & Developers. It's quick & easy.

Bug in childrenNames() api for Preference class?

P: n/a
Hi,

The following code trhrows an Illegal Argument Exception.

import java.uitl.prefs.*;

try{
String xyz[] = (Preferences.userRoot()).childrenNames();
} catch (Exception e) {
e.printStackTrace();
}

The exception caught is :
java.lang.IllegalArgumentException: String length must be a multiple
of four.
at java.util.prefs.Base64.base64ToByteArray(Base64.ja va:134)
at java.util.prefs.Base64.altBase64ToByteArray(Base64 .java:126)
at java.util.prefs.FileSystemPreferences.nodeName(Fil eSystemPreferences.java:859)
at java.util.prefs.FileSystemPreferences.access$1900( FileSystemPreferences.java:33)
at java.util.prefs.FileSystemPreferences$10.run(FileS ystemPreferences.java:640)
at java.security.AccessController.doPrivileged(Native Method)
at java.util.prefs.FileSystemPreferences.childrenName sSpi(FileSystemPreferences.java:632)
at java.util.prefs.AbstractPreferences.childrenNames( AbstractPreferences.java:699)
at test.main(test.java:9)

Is this a BUG in java?
My requirement is that I have many NODES under the root node of user
preferences(userRoot).I want the list of nodes, for futher
processing.How do i retrieve them?

Please help.
(Also send a cc to my email:up******@npd.hcltech.com)
Thanks,
Prakash.
Jul 17 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Liz

"Prakash" <up******@npd.hcltech.com> wrote in message
news:a1**************************@posting.google.c om...
Hi,

The following code trhrows an Illegal Argument Exception.
My guess is that you do not have Windows ;-)
and that it is trying to read a file and there
is something wrong with the file.

import java.uitl.prefs.*;

try{
String xyz[] = (Preferences.userRoot()).childrenNames();
} catch (Exception e) {
e.printStackTrace();
}

The exception caught is :
java.lang.IllegalArgumentException: String length must be a multiple
of four.
at java.util.prefs.Base64.base64ToByteArray(Base64.ja va:134)
at java.util.prefs.Base64.altBase64ToByteArray(Base64 .java:126)
at java.util.prefs.FileSystemPreferences.nodeName(Fil eSystemPreferences.java:85
9) at java.util.prefs.FileSystemPreferences.access$1900( FileSystemPreferences.java
:33) at java.util.prefs.FileSystemPreferences$10.run(FileS ystemPreferences.java:640) at java.security.AccessController.doPrivileged(Native Method)
at java.util.prefs.FileSystemPreferences.childrenName sSpi(FileSystemPreferences
..java:632) at java.util.prefs.AbstractPreferences.childrenNames( AbstractPreferences.java:6
99) at test.main(test.java:9)

Is this a BUG in java?
My requirement is that I have many NODES under the root node of user
preferences(userRoot).I want the list of nodes, for futher
processing.How do i retrieve them?

Please help.
(Also send a cc to my email:up******@npd.hcltech.com)
Thanks,
Prakash.

Jul 17 '05 #2

P: n/a
Hi Liz,

Java is platform independent.So it should work in Linux as well.
Any other pointers in this regard would be helpful.

Thanks,
Prakash.
"Liz" <Li*@nospam.com> wrote in message news:<QcKxc.1321$eu.299@attbi_s02>...
"Prakash" <up******@npd.hcltech.com> wrote in message
news:a1**************************@posting.google.c om...
Hi,

The following code trhrows an Illegal Argument Exception.


My guess is that you do not have Windows ;-)
and that it is trying to read a file and there
is something wrong with the file.

import java.uitl.prefs.*;

try{
String xyz[] = (Preferences.userRoot()).childrenNames();
} catch (Exception e) {

e.printStackTrace();
}

The exception caught is :
java.lang.IllegalArgumentException: String length must be a multiple
of four.
at java.util.prefs.Base64.base64ToByteArray(Base64.ja va:134)
at java.util.prefs.Base64.altBase64ToByteArray(Base64 .java:126)
at

java.util.prefs.FileSystemPreferences.nodeName(Fil eSystemPreferences.java:85
9)
at

java.util.prefs.FileSystemPreferences.access$1900( FileSystemPreferences.java
:33)
at

java.util.prefs.FileSystemPreferences$10.run(FileS ystemPreferences.java:640)
at java.security.AccessController.doPrivileged(Native Method)
at

java.util.prefs.FileSystemPreferences.childrenName sSpi(FileSystemPreferences
.java:632)
at

java.util.prefs.AbstractPreferences.childrenNames( AbstractPreferences.java:6
99)
at test.main(test.java:9)

Is this a BUG in java?
My requirement is that I have many NODES under the root node of user
preferences(userRoot).I want the list of nodes, for futher
processing.How do i retrieve them?

Please help.
(Also send a cc to my email:up******@npd.hcltech.com)
Thanks,
Prakash.

Jul 17 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.