[Mondrian] Locale 2057 not support breaks xmla Excel 2007 / UK compatibility

Michele Rossi michele.rossi at gmail.com
Wed Aug 3 06:11:40 EDT 2011


hi Julian,
I have just started working on the XMLA task with the intention of creating
that Olap4j Servlet user guide but I found that the latest build of mondrian
(from changelist 14503) no longer works with my "locale" which I think it's
UK.

The exception I get is

2011-08-03 11:51:56,843 ERROR [mondrian.xmla.XmlaServlet] - <Errors when
handling XML/A message>
mondrian.xmla.XmlaException: Mondrian Error:XMLA SOAP Body processing error
        at
mondrian.xmla.impl.DefaultXmlaServlet.handleSoapBody(DefaultXmlaServlet.java:561)
        at mondrian.xmla.XmlaServlet.doPost(XmlaServlet.java:315)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
        at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
        at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
        at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
        at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
        at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
        at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
        at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
        at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
        at
org.apache.coyote.http11.Http11NioProcessor.process(Http11NioProcessor.java:883)
        at
org.apache.coyote.http11.Http11NioProtocol$Http11ConnectionHandler.process(Http11NioProtocol.java:721)
        at
org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:2258)
        at
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
        at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
        at java.lang.Thread.run(Thread.java:662)
Caused by: java.lang.RuntimeException: Unknown LCID 2057
        at mondrian.olap.Util.lcidToLocale(Util.java:1755)
        at mondrian.xmla.Rowset.setProperty(Rowset.java:155)
        at
mondrian.xmla.RowsetDefinition$DiscoverDatasourcesRowset.setProperty(RowsetDefinition.java:1629)
        at mondrian.xmla.Rowset.<init>(Rowset.java:119)
        at
mondrian.xmla.RowsetDefinition$DiscoverDatasourcesRowset.<init>(RowsetDefinition.java:1573)
        at
mondrian.xmla.RowsetDefinition$1.getRowset(RowsetDefinition.java:83)
        at mondrian.xmla.XmlaHandler.discover(XmlaHandler.java:2767)
        at mondrian.xmla.XmlaHandler.process(XmlaHandler.java:608)
        at
mondrian.xmla.impl.DefaultXmlaServlet.handleSoapBody(DefaultXmlaServlet.java:557)
        ... 17 more


It's caused by the method below which only supports US_EN
(open\mondrian\src\main\mondrian\olap\Util.java)

    /**
     * Converts a locale identifier (LCID) as used by Windows into a Java
     * locale.
     *
     * <p>For example, {@code lcidToLocale(1033)} returns "en_US", because
     * 1033 (hex 0409) is US english.</p>
     *
     * @param lcid Locale identifier
     * @return Locale
     * @throws RuntimeException if locale id is unkown
     */
    public static Locale lcidToLocale(short lcid) {
        switch (lcid) {
        case 0x0409: // 1033
            return Locale.US;
        // TODO: fill out this list
        default:
            throw new RuntimeException("Unknown LCID " + lcid);
        }
    }


Could we default to Locale.US instead of throwing the exception if the
specified locale is not found in that list?


This is a total blocker for me :)

thanks,
Michele
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.pentaho.org/pipermail/mondrian/attachments/20110803/23434458/attachment-0001.html 


More information about the Mondrian mailing list