Java Solaris Communities Sun Store Join SDN My Profile Why Join?
 
Bug Database
Bug Detail
Quick Lists
Top 25 Bugs
Top 25 RFE's
Recently Closed Bugs
Printable Page Printable Page


Bug Database
Bug ID: 6396599
Votes 1
Synopsis (prefs) Preferences sync fails if jaxp transform provider doesn't support indent-number
Category java:classes_util
Reported Against b102
Release Fixed 7(b05), 6u10(b23) (Bug ID:2154807)
State 10-Fix Delivered, bug
Priority: 4-Low
Related Bugs 6486887 , 6519088 , 6568540
Submit Date 10-MAR-2006
Description
FULL PRODUCT VERSION :
java version "1.6.0-beta"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.6.0-beta-b59g)
Java HotSpot(TM) Client VM (build 1.6.0-beta-b59g, mixed mode, sharing)


ADDITIONAL OS VERSION INFORMATION :
Linux 2.6.15-1.1830_FC4 #1 Thu Feb 2 17:23:41 EST 2006 i686 i686 i386 GNU/Linux

EXTRA RELEVANT SYSTEM CONFIGURATION :
classpath contains  customer  xalan 2.6.0 - overriding default javax.xml.transform.TransformerFactory via META-INF/services

A DESCRIPTION OF THE PROBLEM :
Attempts to trigger a preferenece store (using the default provider ie FileSystemPreferences) fail with a java.util.prefs.BackingStoreException caused by java.lang.IllegalArgumentException due to XmlSupport.writeDoc attempting to set the "indent-number" attribute on the TransformerFactory (stack trace at end).

Since IllegalArgumentException is the proper response for an unrecognised attribute, and the indent is not essential to prefences operation it is reasonable to expect prefences to catch and ignore the exception. (1.5.0 works bacuase it does not set this attribute)



STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
To reproduce:
  1) compile test case
  2) run test case under jdk 1.6.0 beta with xalan as jaxp transform 
provider:
java -cp .:/home/clive/lib/xalan-j_2_6_0/bin/xalan.jar testing.PrefTest

Test code follows:
/*
 * PrefTest.java
 *
 * Created on 1 March 2006, 10:44
 * $Id: $
 */

package testing;

/**
 * Test for preferences sync
 * nb to reproduce issue must run with xalan as jaxp transform provider 
on a platform that uses FileSystemPreferences
 *
 * @author Clive Brettingham-Moore
 */


public class PrefTest {
   
    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        // do pref sync
        try {
            java.util.prefs.Preferences prefs = 
java.util.prefs.Preferences.userRoot();
            prefs.put("test", String.valueOf(Math.random()));
            prefs.sync();
        } catch (java.util.prefs.BackingStoreException e) {
            // Exception due to issue
            e.printStackTrace();
        }
    }
   
}


EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
sucessful store of preferences
ACTUAL -
BackingStoreException as described

ERROR MESSAGES/STACK TRACES THAT OCCUR :
Stack trace:
java.util.prefs.BackingStoreException: java.lang.IllegalArgumentException: Not supported: indent-number
        at java.util.prefs.FileSystemPreferences$8.run(FileSystemPreferences.java:615)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.util.prefs.FileSystemPreferences.writeBackCache(FileSystemPreferences.java:600)
        at java.util.prefs.FileSystemPreferences.syncSpiPrivileged(FileSystemPreferences.java:784)
        at java.util.prefs.FileSystemPreferences.access$2300(FileSystemPreferences.java:33)
        at java.util.prefs.FileSystemPreferences$13.run(FileSystemPreferences.java:754)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.util.prefs.FileSystemPreferences.syncSpi(FileSystemPreferences.java:752)
        at java.util.prefs.AbstractPreferences.sync2(AbstractPreferences.java:1317)
        at java.util.prefs.AbstractPreferences.sync(AbstractPreferences.java:1308)
        at java.util.prefs.FileSystemPreferences.sync(FileSystemPreferences.java:731)
(deep application trace removed)
Caused by: java.lang.IllegalArgumentException: Not supported: indent-number
        at org. customer .xalan.processor.TransformerFactoryImpl.setAttribute(TransformerFactoryImpl.java:485)
        at java.util.prefs.XmlSupport.writeDoc(XmlSupport.java:247)
        at java.util.prefs.XmlSupport.exportMap(XmlSupport.java:333)
        at java.util.prefs.FileSystemPreferences$8.run(FileSystemPreferences.java:607)
        ... 36 more

REPRODUCIBILITY :
This bug can be reproduced always.

CUSTOMER SUBMITTED WORKAROUND :
For applications that use xalan directly can remove MRTA-INF/services from the xalan jar to prevent xalan being picked up as the default provider for jaxp transform.
Posted Date : 2006-03-10 04:55:08.0
Work Around
N/A
Evaluation
as suggested by the synopsis, seems like not everyone supports "indent-number"
Posted Date : 2006-03-13 21:53:49.0
Comments
  
  Include a link with my name & email   

Submitted On 11-APR-2007
bhamail
This bug is still an issue in the final release of JDK 6. Yikes! No prefs support in JDK 6 on non-windows machines.



Submitted On 16-JUL-2007
bhamail
Any word on a backport to 6.0u?


Submitted On 26-JUL-2007
I am affected by this bug, with java -version saying:

Java(TM) SE Runtime Environment (build 1.6.0-b105)
Java HotSpot(TM) 64-Bit Server VM (build 1.6.0-b105, mixed mode)

How come this bug is marked fixed if it's not fixed on all platforms?


Submitted On 31-JUL-2007
owenrees
This is a showstopper for me. It looks as if I am going to have to stay on Java 5 until Java 7 is released.


Submitted On 21-DEC-2007
I am still seeing this in Java(TM) SE Runtime Environment (build 1.6.0_03-b05)


Submitted On 29-DEC-2007
Translation for people (like me) not intimately familiar with Java code-names: "Dolphin" means Java 7. So it is claimed this bug is solved in Java 7 and I guess no attempt will be made at backporting the correction to Java 6. Too bad for those wanting to use java.util.prefs.Preferences and a proper XSLT engine at the same time.


Submitted On 27-APR-2008
> Priority:   	 4-Low
It's a showstopper because the complete Preferences API is not usable at all as long as this bug is not fixed.


Submitted On 18-AUG-2008
michael_n
The issue is still there... (this is Ubuntu 8.0.4, 1.6.0_07).  For example, in order to set preferences in NetBeans 6.1 on Linux, I run netbeans once with Jdk1.5, change the prefs, then exit. (Otherwise, preferences do not get set when edited through the GUI w/ jdk1.6)

$ java -version
java version "1.6.0_07"
Java(TM) SE Runtime Environment (build 1.6.0_07-b06)
Java HotSpot(TM) Server VM (build 10.0-b23, mixed mode)

This bug is becoming well known... and, yes, makes Preferences unusable (and therefore, desktop applications unusable) on Linux.  Other products' release notes mention this bug by ID: http://www.oracle.com/technology/products/ias/toplink/doc/10131/relnotes/rel_notes.htm#BABDFBAJ

...Does the "modify xalan jar" workaround mean modifying netbeans' jars?  All of them?
$ find ~/.netbeans -name \*xalan\*
~/.netbeans/6.1/modules/jmeter/lib/xalan.jar
~/.netbeans/6.1/modules/ext/xalan.jar
~/.netbeans/6.1/libs/xalan.jar




Submitted On 20-AUG-2008
michael_n
> Any word on a backport to 6.0u?

This bug is listed as fixed in Java 6u10 RC (as of b23); http://www.java.net/download/jdk6/6u10/promoted/b28/changes/JDK6u10.list.html

I just ran this "RC" jdk 1.6u10 against nb6.1 and the preferences problem DOES appear to be resolved...!  (Note: this is still a release candidate, but it does mean that jdk1.6 will eventually work on Linux. :-)

Verify: 
  On jdk1.6 pre-update10, launch nb6.1, tail the messages.log, and update properties (I update "advanced" properties of the jvi key bindings); restart netbeans and the property settings will be lost. There is an error in messages.log,

$ tail -f  ~/.netbeans/6.1/var/log/messages.log
...
WARNING [java.util.prefs]: Couldn't flush user prefs: java.util.prefs.BackingStoreException: java.lang.IllegalArgumentException: Not supported: indent-number

Then, use jdk1.6u10 RC, ... and, either use JAVA_HOME, put this jdk1.6u10 first in your PATH, or use  netbeans --jdkhome ( see http://wiki.netbeans.org/FaqJdkHome ).  Start netbeans, and messages.log no longer includes the error message, and updating properties works as expected.





PLEASE NOTE: JDK6 is formerly known as Project Mustang