Jpivot + mondrian +xmla配置

来源:互联网 发布:淘宝开网店的保证金 编辑:程序博客网 时间:2024/06/10 06:08

实验环境:

Tomcat 7.0.27

JDK 1.6.0_18

mondrian 3.5.0

前提是根据mondrian  doc目录下的install.html安装好mondrian

1> web.xml中设置

<servlet>    <servlet-name>MondrianXmlaServlet</servlet-name><servlet-class>mondrian.xmla.impl.DefaultXmlaServlet</servlet-class></servlet>

注意要把下面的配置禁掉

<!--init-param>      <param-name>DataSourcesConfig</param-name>      <param-value>/WEB-INF/datasources.xml</param-value></init-param-->

2> 由于是JDK1.6,需要做如下配置:

编辑tomcat   bin目录下的startup.bat,在set "EXECUTABLE=%CATALINA_HOME%\bin\catalina.bat" 之前添加:

set JAVA_OPTS=%JAVA_OPTS% -Djavax.xml.soap.MessageFactory=org.apache.axis.soap.MessageFactoryImpl -Djavax.xml.soap.SOAPConnectionFactory=org.apache.axis.soap.SOAPConnectionFactoryImpl -Djavax.xml.soap.SOAPFactory=org.apache.axis.soap.SOAPFactoryImplset JAVA_OPTS=%JAVA_OPTS% -Djavax.xml.transform.TransformerFactory=org.apache.xalan.processor.TransformerFactoryImpl

3> 将以下几个jar放到webapps\mondrian\WEB-INF\lib

- commons-discovery-0.2.jar
- jaxrpc.jar
- axis.jar
- wsdl4j-1.5.1.jar

这几个jar可以在http://download.csdn.net/detail/sundongsdu/5288549 中找到


4> 修改webapps\mondrian\WEB-INF\datasources.xml

5> 启动tomcat

我的tomcat端口是7080,访问http://127.0.0.1:7080/mondrian/testpage.jsp?query=xmla 可以看到如下结果:




==================================================

datasources.xml:

<?xml version="1.0"?><!--  == This software is subject to the terms of the Eclipse Public License v1.0  == Agreement, available at the following URL:  == http://www.eclipse.org/legal/epl-v10.html.  == You must accept the terms of that agreement to use this software.  ==  == Copyright (C) 2005-2006 Pentaho and others  == All Rights Reserved.  --><DataSources>    <!--          A data source is a collection of logically related Mondrian         catalogs.         The XMLA specification allows an XMLA provider to have         multiple data sources, but some clients, particularly ones         based on ADOMD.NET such as Simba's O2X client and Pentaho         Spreadsheet Services, can only connect to the first declared         data source. Therefore, we recommend that you use a single         data source, containing multiple catalogs if necessary.     -->    <DataSource>        <!--             Name of the data source.        -->        <DataSourceName>Provider=Mondrian;DataSource=MondrianFoodMart;</DataSourceName>        <!--             Description of the data source.        -->        <DataSourceDescription>Mondrian FoodMart Data Warehouse</DataSourceDescription>        <!--              The URL of the servlet.        -->        <URL>http://localhost:7080/mondrian/xmla</URL>        <!--             Mondrian connect string for the data source. If this data             source contains multiple catalogs, omit the 'Catalog'             property, and specify the URI of the schema.xml file in             the catalog's <Definition> element.             Catalogs can override the connect string with their own             <DataSourceInfo> element.          -->        <DataSourceInfo>Provider=mondrian;Jdbc=jdbc:mysql://localhost/foodmart?user=foodmart&password=foodmart;Catalog=/WEB-INF/queries/FoodMart.xml;JdbcDrivers=com.mysql.jdbc.Driver</DataSourceInfo>        <!--              Provider name must be 'Mondrian'.        -->        <ProviderName>Mondrian</ProviderName>        <!--              Provider type must be 'MDP'.        -->        <ProviderType>MDP</ProviderType>        <!--              Authentication mode. Allowable values are             'Unauthenticated', 'Authenticated', 'Integrated'.         -->        <AuthenticationMode>Unauthenticated</AuthenticationMode>        <!--              A data source contains one or more catalogs.        -->        <Catalogs>            <!--                 Catalog names must match the name inside the                schema.xml file, and must be unique across all data                sources defined in this datasources.xml file.            -->            <Catalog name="FoodMart">                <!--                     Mondrian connect string for the data source. This                     element is optional; if specified, it overrides the                     data source's <DataSourceInfo> element. Typically,                     you would use this element if the catalogs have                     different JDBC data sources.                 -->                <!--                <DataSourceInfo>Provider=mondrian;Jdbc=jdbc:odbc:MondrianFoodMart;JdbcDrivers=sun.jdbc.odbc.JdbcOdbcDriver</DataSourceInfo>                 -->                <!--                     URI of the schema definition file.                -->                <Definition>/WEB-INF/queries/FoodMart.xml</Definition>            </Catalog>        </Catalogs>    </DataSource></DataSources>



原创粉丝点击