United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
JDK-7070619 : locale issue for keytool with pt_BR

Details
Type:
Bug
Submit Date:
2011-07-25
Status:
Closed
Updated Date:
2012-07-12
Project Name:
JDK
Resolved Date:
2012-07-12
Component:
globalization
OS:
linux
Sub-Component:
translation
CPU:
x86
Priority:
P4
Resolution:
Fixed
Affected Versions:
6u26
Fixed Versions:
6u34 (b01)

Related Reports
Relates:

Sub Tasks

Description
FULL PRODUCT VERSION :
modolo@modolo:~/bin/apache-tomcat-7.0.16/bin$ java -version
java version "1.6.0_26"
Java(TM) SE Runtime Environment (build 1.6.0_26-b03)
Java HotSpot(TM) 64-Bit Server VM (build 20.1-b02, mixed mode)


ADDITIONAL OS VERSION INFORMATION :
modolo@modolo:~/bin/apache-tomcat-7.0.16/bin$ uname -a
Linux modolo 2.6.35-30-generic #56-Ubuntu SMP Mon Jul 11 20:01:08 UTC 2011 x86_64 GNU/Linux


EXTRA RELEVANT SYSTEM CONFIGURATION :
modolo@modolo:~/bin/apache-tomcat-7.0.16/bin$ env | grep -i lang
LANG=pt_BR.UTF-8
GDM_LANG=pt_BR
LANGUAGE=pt_BR:en


A DESCRIPTION OF THE PROBLEM :
When I try to list the contents of a keystore in my language (pt_BR) I received a error. If I use -v (verbose) the comple exception was:

erro de keytool: java.lang.IllegalArgumentException: unknown format type at
java.lang.IllegalArgumentException: unknown format type at
	at java.text.MessageFormat.makeFormat(MessageFormat.java:1442)
	at java.text.MessageFormat.applyPattern(MessageFormat.java:458)
	at java.text.MessageFormat.<init>(MessageFormat.java:350)
	at sun.security.tools.KeyTool.doPrintEntries(KeyTool.java:1649)
	at sun.security.tools.KeyTool.doCommands(KeyTool.java:871)
	at sun.security.tools.KeyTool.run(KeyTool.java:172)
	at sun.security.tools.KeyTool.main(KeyTool.java:166)


STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
  To reproduce the error, change the LANG to pt_BR and try to list the contents of a keystore with the command:
keytool -v -list

EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
I am expecting the result:

Keystore type: JKS
Keystore provider: SUN

Your keystore contains 1 entry

Alias name: tomcat
Creation date: Jul 24, 2011
Entry type: PrivateKeyEntry
Certificate chain length: 1
Certificate[1]:
Owner: CN=localhost, OU=localhost, O=Localhost, L=Niter??i, ST=Rio de Janeiro, C=BR
Issuer: CN=localhost, OU=localhost, O=Localhost, L=Niter??i, ST=Rio de Janeiro, C=BR
Serial number: 4e2c3b0d
Valid from: Sun Jul 24 12:32:29 BRT 2011 until: Mon Jul 23 12:32:29 BRT 2012
Certificate fingerprints:
	 MD5:  96:D6:7D:9B:FB:CC:15:F9:AE:94:48:E9:F5:BD:93:65
	 SHA1: 29:22:74:B4:96:0C:5E:9D:03:30:8F:20:8D:30:0D:02:5D:FC:03:1B
	 Signature algorithm name: SHA1withRSA
	 Version: 3

ACTUAL -
modolo@modolo:~/bin/apache-tomcat-7.0.16/bin$ keytool -v -list -keystore /etc/.keystore-tomcat
Insira a senha do armazenamento de chaves:

Tipo de armazenamento de chaves: JKS
Fornecedor de armazenamento de chaves: SUN

erro de keytool: java.lang.IllegalArgumentException: unknown format type at
java.lang.IllegalArgumentException: unknown format type at
	at java.text.MessageFormat.makeFormat(MessageFormat.java:1442)
	at java.text.MessageFormat.applyPattern(MessageFormat.java:458)
	at java.text.MessageFormat.<init>(MessageFormat.java:350)
	at sun.security.tools.KeyTool.doPrintEntries(KeyTool.java:1649)
	at sun.security.tools.KeyTool.doCommands(KeyTool.java:871)
	at sun.security.tools.KeyTool.run(KeyTool.java:172)
	at sun.security.tools.KeyTool.main(KeyTool.java:166)


ERROR MESSAGES/STACK TRACES THAT OCCUR :
modolo@modolo:~/bin/apache-tomcat-7.0.16/bin$ keytool -v -list -keystore /etc/.keystore-tomcat
Insira a senha do armazenamento de chaves:

Tipo de armazenamento de chaves: JKS
Fornecedor de armazenamento de chaves: SUN

erro de keytool: java.lang.IllegalArgumentException: unknown format type at
java.lang.IllegalArgumentException: unknown format type at
	at java.text.MessageFormat.makeFormat(MessageFormat.java:1442)
	at java.text.MessageFormat.applyPattern(MessageFormat.java:458)
	at java.text.MessageFormat.<init>(MessageFormat.java:350)
	at sun.security.tools.KeyTool.doPrintEntries(KeyTool.java:1649)
	at sun.security.tools.KeyTool.doCommands(KeyTool.java:871)
	at sun.security.tools.KeyTool.run(KeyTool.java:172)
	at sun.security.tools.KeyTool.main(KeyTool.java:166)


REPRODUCIBILITY :
This bug can be reproduced always.

CUSTOMER SUBMITTED WORKAROUND :
  To bypass this bug I use to pass the user.language with a value off us like the line bellow:

keytool -v -list -keystore /etc/.keystore-tomcat -J"-Duser.language=en"

Enter keystore password:

Keystore type: JKS
Keystore provider: SUN

Your keystore contains 1 entry

Alias name: tomcat
Creation date: Jul 24, 2011
Entry type: PrivateKeyEntry
Certificate chain length: 1
Certificate[1]:
Owner: CN=localhost, OU=localhost, O=Localhost, L=Niter??i, ST=Rio de Janeiro, C=BR
Issuer: CN=localhost, OU=localhost, O=Localhost, L=Niter??i, ST=Rio de Janeiro, C=BR
Serial number: 4e2c3b0d
Valid from: Sun Jul 24 12:32:29 BRT 2011 until: Mon Jul 23 12:32:29 BRT 2012
Certificate fingerprints:
	 MD5:  96:D6:7D:9B:FB:CC:15:F9:AE:94:48:E9:F5:BD:93:65
	 SHA1: 29:22:74:B4:96:0C:5E:9D:03:30:8F:20:8D:30:0D:02:5D:FC:03:1B
	 Signature algorithm name: SHA1withRSA
	 Version: 3

                                    

Comments
EVALUATION

The localization strings for pt_BR have a problem:

	{"Your keystore contains keyStore.size() entry",
		"Seu armazenamento de chaves cont\u00e9m {0,n\u00famero,inteiro} entrada"},
	{"Your keystore contains keyStore.size() entries",
		"Seu armazenamento de chaves cont\u00e9m {0,n\u00famero,inteiro} entradas"},

Here, {0,number,integer} should not be localized.
                                     
2012-04-11
EVALUATION

The issue is reproducible in 6ux, but not in jdk7 and 8.
                                     
2012-04-11



Hardware and Software, Engineered to Work Together