PDA

View Full Version : encoding problem in MDX query



boolgo
11-21-2006, 08:35 AM
Hi all,

I have a problem regarding some characters in an MDX query because the default encoding used in the pentaho BI platform is UTF-8.

So running the following MDX query failed:
<query><![CDATA[select NON EMPTY {[Measures].[Nombre de PS]} ON columns, NON EMPTY {([libellé_discipline].[toutes les disciplines], [région_département].[toutes les régions], [Statut].[Tous les Statuts])} ON rows from [PS] ]]></query>

the corresponding log:

com.tonbeller.jpivot.olap.model.OlapException: Mondrian Error:MDX object '[libell?_discipline].[toutes les disciplines]' not found in cube 'PS'
at com.tonbeller.jpivot.mondrian.MondrianModel.initialize(MondrianModel.java:394)
at com.tonbeller.jpivot.olap.model.OlapModelDecorator.initialize(OlapModelDecorator.java:129)
at com.tonbeller.jpivot.tags.OlapModelProxy$MyState.initialize(OlapModelProxy.java:76)
at com.tonbeller.jpivot.tags.PageStateManager.initializeAndShow(PageStateManager.java:37)
at com.tonbeller.jpivot.tags.OlapModelProxy.initializeAndShow(OlapModelProxy.java:161)
at com.tonbeller.jpivot.tags.OlapModelTag.doEndTag(OlapModelTag.java:76)
at org.apache.jsp.jsp.Pivot_jsp._jspService(org.apache.jsp.jsp.Pivot_jsp:306)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)


is there any configuration for the encoding?

Any help would be appreciated...

boolgo
11-23-2006, 12:31 AM
Well I solved the problem in this way:
I changed the encoding type in the xml files from 'UTF-8' to 'ISO-8859-1' in the j2ee deployment module.

Then I changed the constant:
private static String ENCODING = "UTF-8";
to
private static String ENCODING = "ISO-8859-1";
in the class LocaleHelper.java in the source code.

Now it is working...

jdixon
11-27-2006, 10:36 AM
I'm glad you solved your problem.

We have a way to do this that does not invovle changing the source code.

If you look in web.xml (pentaho-demo/jboss/server/default/deploy/pentaho.war/WEB-INF/web.xml) you will see a section near the top of the file that is commented out.


<!-- this defaults to UTF-8, uncomment this section and change the value for other encodings
<context-param>
<param-name>encoding</param-name>
<param-value>windows-1256</param-value>
</context-param>
-->

If you uncomment this code and specify the encoding that you want it will be picked up automatically.

e.g.


<!-- this defaults to UTF-8, uncomment this section and change the value for other encodings -->
<context-param>
<param-name>encoding</param-name>
<param-value>ISO-8859-1</param-value>
</context-param>


James