Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8046020

WARNING: Could not open/create prefs root node Software\JavaSoft\Prefs

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P4 P4
    • None
    • 7u60
    • core-libs
    • x86
    • windows_7

      FULL PRODUCT VERSION :
      java version "1.7.0_60"
      Java(TM) SE Runtime Environment (build 1.7.0_60-b19)
      Java HotSpot(TM) Client VM (build 24.60-b09, mixed mode, sharing)


      ADDITIONAL OS VERSION INFORMATION :
      Microsoft Windows [Version 6.1.7601]


      A DESCRIPTION OF THE PROBLEM :
      Request to re-open JDK-8038489 there the solution was cannot reproduce.

      A standard user cannot create keys below HKEY_LOCAL_MACHINE which is tried when creating the attribute systemRoot of java.util.prefs.WindowsPreferences

      ADDITIONAL REGRESSION INFORMATION:
      See JDK-8038489 for a survey of JRE installers that are not affected.

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      - on a fresh installation of Windows 7 install JRE 7u60
      - change to standard user, i.e. not member of Aministrators group
      - check both registry keys (HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\Prefs and HKEY_CURRENT_USER\Software\JavaSoft\Prefs) they do not exist
      - run Bugs
      - check again HKEY_CURRENT_USER\Software\JavaSoft\Prefs has been created

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      no warning
      ACTUAL -
      java.util.prefs.WindowsPreferences <init>
      WARNING: Could not open/create prefs root node Software\JavaSoft\Prefs at root 0x80000002. Windows RegCreateKeyEx(...) returned error code 5.

      5 means ERROR_ACCESS_DENIED

      REPRODUCIBILITY :
      This bug can be reproduced always.

      ---------- BEGIN SOURCE ----------
      package Bugs;

      import java.util.prefs.Preferences;

      public class PrefsWarning {

        void findPrefs() {
          Preferences prefs = Preferences.userNodeForPackage(this.getClass());
        }

        public static void main(String[] args) {
          PrefsWarning pw = new PrefsWarning();
          pw.findPrefs();
        }

      }
      ---------- END SOURCE ----------

      CUSTOMER SUBMITTED WORKAROUND :
      see JDK-8038489

            coffeys Sean Coffey
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: