[ 
https://issues.apache.org/jira/browse/DERBY-6696?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16747847#comment-16747847
 ] 

Liam Sharp commented on DERBY-6696:
-----------------------------------

Just hit this in production. As this has been open since 2014 I assume it's not 
going to be fixed soon - what workarounds are people using to avoid this?


> ERROR XBM0X: Supplied territory description 'es_419' is invalid, expecting 
> ln[_CO[_variant]]
> --------------------------------------------------------------------------------------------
>
>                 Key: DERBY-6696
>                 URL: https://issues.apache.org/jira/browse/DERBY-6696
>             Project: Derby
>          Issue Type: Bug
>          Components: Services
>            Reporter: David Sitsky
>            Priority: Major
>
> We have a customer in the South American Spanish locale, which in effect are 
> using these settings: -Duser.language=es -Duser.country=419.  I have seen 
> DERBY-4854 and this comment:
> {quote}
> The problem seems to be that Locale.getDefault().getCountry() returns 
> "8859_1" in this locale, and that value confuses Derby. The javadoc for 
> Locale.getCountry() says that it should return an empty string or a 
> two-letter uppercase country code, so I think it's a bug that getCountry() 
> returns "8859_1".
> {quote}
> However the Javadoc in fact states that 3 digit codes are permitted:
> {quote}
> Returns the country/region code for this locale, which should either be the 
> empty string, an uppercase ISO 3166 2-letter code, or a UN M.49 3-digit code.
> {quote}
> So it seems Derby requires adding support for the three digit country codes.
> As a workaround, I can apply territory=en_US to the connection parameters, 
> but this is not ideal.
> For the record, here is the stacktrace seen:
> {noformat}
> Thu Aug 07 12:13:27 CDT 2014 
> Thread[DefaultExecutorService-4,4,DefaultExecutorService] Cleanup action 
> starting
> ERROR XBM0X: Supplied territory description 'es_419' is invalid, expecting 
> ln[_CO[_variant]]
> ln=lower-case two-letter ISO-639 language code, CO=upper-case two-letter 
> ISO-3166 country codes, see java.util.Locale.
>       at 
> org.apache.derby.iapi.error.StandardException.newException(StandardException.java:278)
>       at 
> org.apache.derby.impl.services.monitor.BaseMonitor.staticGetLocaleFromString(BaseMonitor.java:2020)
>       at 
> org.apache.derby.impl.services.monitor.BaseMonitor.setLocale(BaseMonitor.java:505)
>       at org.apache.derby.impl.db.BasicDatabase.boot(BasicDatabase.java:156)
>       at 
> org.apache.derby.impl.services.monitor.BaseMonitor.boot(BaseMonitor.java:1993)
>       at 
> org.apache.derby.impl.services.monitor.TopService.bootModule(TopService.java:334)
>       at 
> org.apache.derby.impl.services.monitor.BaseMonitor.bootService(BaseMonitor.java:1827)
>       at 
> org.apache.derby.impl.services.monitor.BaseMonitor.createPersistentService(BaseMonitor.java:1013)
>       at 
> org.apache.derby.iapi.services.monitor.Monitor.createPersistentService(Monitor.java:596)
>       at 
> org.apache.derby.impl.jdbc.EmbedConnection.createDatabase(EmbedConnection.java:2604)
>       at 
> org.apache.derby.impl.jdbc.EmbedConnection.<init>(EmbedConnection.java:407)
>       at 
> org.apache.derby.impl.jdbc.EmbedConnection30.<init>(EmbedConnection30.java:73)
>       at 
> org.apache.derby.impl.jdbc.EmbedConnection40.<init>(EmbedConnection40.java:53)
>       at 
> org.apache.derby.jdbc.Driver40.getNewEmbedConnection(Driver40.java:70)
>       at org.apache.derby.jdbc.InternalDriver.connect(InternalDriver.java:255)
>       at 
> org.apache.derby.jdbc.EmbeddedDataSource.getConnection(EmbeddedDataSource.java:480)
>       at 
> org.apache.derby.jdbc.EmbedPooledConnection.openRealConnection(EmbedPooledConnection.java:178)
>       at 
> org.apache.derby.jdbc.EmbedPooledConnection.<init>(EmbedPooledConnection.java:119)
>       at 
> org.apache.derby.jdbc.EmbedPooledConnection40.<init>(EmbedPooledConnection40.java:54)
>       at 
> org.apache.derby.jdbc.Driver40.getNewPooledConnection(Driver40.java:179)
>       at 
> org.apache.derby.jdbc.EmbeddedConnectionPoolDataSource.createPooledConnection(EmbeddedConnectionPoolDataSource.java:129)
>       at 
> org.apache.derby.jdbc.EmbeddedConnectionPoolDataSource.getPooledConnection(EmbeddedConnectionPoolDataSource.java:75)
> {noformat}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to