473,326 Members | 2,114 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

Bug in childrenNames() api for Preference class?

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
2 2348
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

25
by: Chet | last post by:
I know that id's should only be used for a unique element on a page, but what is the difference of using class or id otherwise? I've been making a few sample tableless pages to learn css, but...
48
by: dr. zoidberg | last post by:
hello, can anyone tell me or direct me where can I find explanation about difference between <div id=..> and <div class=..> TNX
7
by: Chuck Bowling | last post by:
Is there some way to determine what base class an instance of a object was derived from?
10
by: Joe | last post by:
My question is more an OOD question. I know *how* to implement both abstract classes and interfaces. Here's my question - under what circumstacnes does one use an abstract class and under what...
28
by: kfrost | last post by:
I know this is probably simple but I have a C# form and the class for the form is called sbaSynch. I have a textbox name txtServerName. I'm creating a class to manipulate XML functions so I...
9
by: craigkenisston | last post by:
Hi, I'm starting my first asp.net application and I decided to put the users preferences in a static class. I thought, the static class would be just seen by current session, but it seems it...
1
by: Harold Hsu | last post by:
Hi, Originally, I have defined the following Enum within a namespace (outside a class): Public Enum UserRole Admin Manager User End Enum
3
by: Mark Fisher | last post by:
I have created a class that records the number of games won by two players playing a match. The class has the following properties: MatchLength PlayerAGamesWon PlayerBGamesWon I also need...
37
by: JohnGoogle | last post by:
Hi, Newbie question... After a recent article in VSJ I had a go at implementing a Fraction class to aid my understanding of operator overloading. After a previous message someone suggested...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.