Bug 588375 - CA Setup Wizard cannot create new Security Domain if locale not en_US
Summary: CA Setup Wizard cannot create new Security Domain if locale not en_US
Keywords:
Status: CLOSED WORKSFORME
Alias: None
Product: Dogtag Certificate System
Classification: Retired
Component: Installation Wizard
Version: 1.3
Hardware: All
OS: Linux
high
medium
Target Milestone: ---
Assignee: John Dennis
QA Contact: Ben Levenson
URL:
Whiteboard:
Depends On: 441974
Blocks: dogtagIPAv2
TreeView+ depends on / blocked
 
Reported: 2010-05-03 15:34 UTC by Rob Crittenden
Modified: 2015-09-28 17:49 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of: 441974
Environment:
Last Closed: 2015-09-28 17:29:27 UTC


Attachments (Terms of Use)
patch if rename in svn (646 bytes, patch)
2010-06-18 21:34 UTC, John Dennis
no flags Details | Diff
patch if ant installs copy (869 bytes, patch)
2010-06-18 21:35 UTC, John Dennis
no flags Details | Diff
rename LogMessages & UserMessages property files (223.78 KB, patch)
2010-06-25 15:18 UTC, John Dennis
no flags Details | Diff

Comment 2 John Dennis 2010-06-18 21:28:34 UTC
Adding the contents of an email I sent to the developer list describing the issues so that the information is captured in the bug report.

---------------------------------------------------

Unfortunately the bug and the one it was cloned from contain a number of 
extraneous issues unrelated to the actual problem so let me summarize 
the actual issue.

Summary
-------

If the locale is not en_US then a java.util.MissingResourceException is 
thrown with the message "Can't find bundle for base name LogMessages". 
Although the error is reported against the LogMessages property file the 
same problem exists for the UserMessages property file.

The error occurs because the messages are part of a ResourceBundle 
*family*. Resource bundles belong to families whose members share a 
common base name, but whose names also have additional components that 
identify their locales. If the locale specific bundle cannot be located 
then the family name is used (e.g. a name *without* a locale suffix).

For the example cited in the bug the following would happen:

1. Locale is set to de_DE

2. ResourceBundle.getBundle("LogMessages") tries to locate 
"LogMessages_de_DE" which fails.

3. ResourceBundle.getBundle("LogMessages") then tries to locate the 
default bundle "LogMessages" which also fails because only the locale 
specific "LogMessages_en" is available. It then throws an exception.

Solution
--------

The message bundles need to be installed without their locale suffix.

Issues
------

1) The message bundle can either be renamed in the source tree or via 
Ant during the build.

2) We might want to consider installing both the base bundle and the _en 
locale specific file even though they would have the same contents for 
clarity purposes. This would best be done via symlink but symlinks are 
only available on Unix platforms.

Recommendation
--------------

I would prefer to rename LogMessages_en and UserMessages_en in the 
source tree without the _en locale suffix because then it is clear this 
is the default base of the family. This is also consistent with how 
translations are typically handled in GNU Gettext (the most common i18n 
support package). In Gettext the "master" file is called a .pot file and 
it typically has the messages in english, it is then used to derive the 
locale specific .po files which have their locale embedded in their 
filename.

Would renaming the files in the source tree cause heartburn or problems 
elsewhere?

Since we probably don't want to depend on symlinks and it isn't really 
necessary to also install a _en or _en_US bundle (because if those 
aren't found it will default to the base bundle which is english) we can 
punt on installing the extra bundle.

Comment 3 John Dennis 2010-06-18 21:33:27 UTC
I have implemented and tested both solutions (either renaming the files in the source tree or renaming them via ant.

If we want to rename in the source tree then:

% svn move LogMessages_en.properties LogMessages.properties 
% svn move UserMessages_en.properties UserMessages.properties 

Index: base/common/build.xml
===================================================================
--- base/common/build.xml	(revision 1111)
+++ base/common/build.xml	(working copy)
@@ -130,8 +130,8 @@
         </jar>
         <jar jarfile="${build.jars}/cmsbundle.jar">
             <fileset dir="${src.dir}">
-                <include name="LogMessages_en.properties"/>
-                <include name="UserMessages_en.properties"/>
+                <include name="LogMessages.properties"/>
+                <include name="UserMessages.properties"/>
             </fileset>
         </jar>
         <echo message="${end.build.jars.log.message}"/>


If we want to retain the existing file names but have ant install both the base family and the locale specfic files, then:

Index: base/common/build.xml
===================================================================
--- base/common/build.xml	(revision 1111)
+++ base/common/build.xml	(working copy)
@@ -128,9 +128,13 @@
                 <include name="com/netscape/cmscore/**"/>
             </fileset>
         </jar>
+	<copy file="${src.dir}/LogMessages.properties" tofile="${src.dir}/LogMessages_en.properties"/>
+	<copy file="${src.dir}/UserMessages.properties" tofile="${src.dir}/UserMessages_en.properties"/>
         <jar jarfile="${build.jars}/cmsbundle.jar">
             <fileset dir="${src.dir}">
+                <include name="LogMessages.properties"/>
                 <include name="LogMessages_en.properties"/>
+                <include name="UserMessages.properties"/>
                 <include name="UserMessages_en.properties"/>
             </fileset>
         </jar>

Comment 4 John Dennis 2010-06-18 21:34:34 UTC
Created attachment 425257 [details]
patch if rename in svn

Comment 5 John Dennis 2010-06-18 21:35:10 UTC
Created attachment 425258 [details]
patch if ant installs copy

Comment 6 Oliver Burtchen 2010-06-19 12:37:17 UTC
I agree with changing the filenames will solve the problem. But as I described in Bug 583177 there is one more to rename.

Package: dogtag-pki-console-ui

File: build.xml
-pki-console-theme-${version}_en.jar
+pki-console-theme-${version}.jar


File: dogtag-pki-console-ui.spec

-ln -s pki-console-theme-%{version}_en.jar pki-console-theme_en.jar
+ln -s pki-console-theme-%{version}.jar pki-console-theme.jar

-ln -s ../pki-console-theme_en.jar cms-theme_en.jar
+ln -s ../pki-console-theme.jar cms-theme.jar



Package: pki-console

File: templates/pki_console_wrapper

-pki-console-theme_en.jar
+pki-console-theme.jar

-cms-theme_en.jar
+cms-theme.jar



Best regards,
Oli

Comment 7 John Dennis 2010-06-25 14:37:59 UTC
Hi Oli:

Could you please describe why the jar files need to be renamed as well? Specifically what problems did you see because of the jar file names?

I have not been able to reproduce any failures when the locale is not en_US related to the jar names.

Comment 8 John Dennis 2010-06-25 15:18:12 UTC
Created attachment 426908 [details]
rename LogMessages & UserMessages property files

This patch fixes the resource bundle names by renaming the files in SVN and updating the ant build.xml file to use the new names.

Oli has commented on the bug and asserted that is not sufficient and that some of the jar files also need to be renamed. I have not been able to find a logical reason for why a jar file with _en in it's base name would be a problem. Nor have I been able to reproduce any failures during installation, runtime, and with pkiconsole when both the system locale and user locale are de_DE (other than the problem with the resource bundle names).

My suggestion at the moment is to just fix the resource bundle names with this patch. Later if we identify and understand why the jar names would produce a failure when can produce a new patch to address that issue.

Comment 9 Matthew Harmsen 2010-06-25 17:09:13 UTC
attachment (id=426908) +mharmsen

Comment 10 Rob Crittenden 2010-08-25 17:47:05 UTC
Installation successful with IPA v2 HEAD against pki-common-1.3.8-1.fc12.noarch after using system-config-language to set the locale to fr_FR.


Note You need to log in before you can comment on or make changes to this bug.