Salve a tutti,

ho la necessità di eseguire una query MDX tramite codice, inviarla dunque a Mondrian per poi visualizzare il risultato tramite JPivot.

Qualcuno di voi sa quali metodi usare?

L'idea iniziale era di eseguire la query su Mondrian con il seguente frammento di codice:

Code:
mondrian.olap.Connection connection = mondrian.olap.DriverManager.getConnection("Provider=mondrian;"
                    + "Jdbc=jdbc:postgresql://127.0.0.1/dw_interval_test?user=postgres&password=password;"
                    + "Catalog=../webapps/web/WEB-INF/queries/cuboprogetti.xml;", null);
             


             Query query = connection.parseQuery("select NON EMPTY {[Measures].[ore_sett]} ON COLUMNS, " +
                "NON EMPTY Crossjoin([progetto].[tutti_progetti].Children, " +
                "Crossjoin([data inizio.data].[date_inizio].Children, " +
                "[data fine.data].[date_fine].Children)) ON ROWS " +
                "from [cubo_progetti] " +
                "where [impiegato].[tutti_impiegati].[Ann]");
            Result result = connection.execute(query);

result.print(new PrintWriter(System.out));
purtroppo ricevo il seguente errore:

Code:
log4j:WARN No appenders could be found for logger (mondrian.olap.MondrianProperties).
log4j:WARN Please initialize the log4j system properly.
Exception in thread "main" java.lang.ExceptionInInitializerError
        at mondrian.rolap.RolapSchema.<init>(RolapSchema.java:183)
        at mondrian.rolap.RolapSchema.<init>(RolapSchema.java:219)
        at mondrian.rolap.RolapSchema.<init>(RolapSchema.java:54)
        at mondrian.rolap.RolapSchema$Pool.get(RolapSchema.java:959)
        at mondrian.rolap.RolapSchema$Pool.get(RolapSchema.java:756)
        at mondrian.rolap.RolapConnection.<init>(RolapConnection.java:166)
        at mondrian.rolap.RolapConnection.<init>(RolapConnection.java:95)
        at mondrian.olap.DriverManager.getConnection(DriverManager.java:110)
        at mondrian.olap.DriverManager.getConnection(DriverManager.java:74)
        at mondrian.olap.DriverManager.getConnection(DriverManager.java:55)
        at mondrian.time.TestConnection.main(TestConnection.java:40)
Caused by: java.util.MissingResourceException: Can't find bundle for base name mondrian.resource.MondrianResource, locale it_IT
        at java.util.ResourceBundle.throwMissingResourceException(ResourceBundle.java:1427)
        at java.util.ResourceBundle.getBundleImpl(ResourceBundle.java:1250)
        at java.util.ResourceBundle.getBundle(ResourceBundle.java:777)
        at mondrian.resource.MondrianResource.instance(MondrianResource.java:29)
        at mondrian.rolap.aggmatcher.AggTableManager.<clinit>(AggTableManager.java:50)
        ... 11 more
Caused by: java.io.IOException: could not open properties file for class mondrian.resource.MondrianResource
        at org.eigenbase.resgen.ShadowResourceBundle.<init>(Unknown Source)
        at mondrian.resource.MondrianResource.<init>(MondrianResource.java:20)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
        at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
        at java.lang.Class.newInstance0(Class.java:355)
        at java.lang.Class.newInstance(Class.java:308)
        at java.util.ResourceBundle$Control.newBundle(ResourceBundle.java:2295)
        at java.util.ResourceBundle.loadBundle(ResourceBundle.java:1364)
        at java.util.ResourceBundle.findBundle(ResourceBundle.java:1328)
        at java.util.ResourceBundle.findBundle(ResourceBundle.java:1282)
        at java.util.ResourceBundle.findBundle(ResourceBundle.java:1282)
        at java.util.ResourceBundle.getBundleImpl(ResourceBundle.java:1224)
        ... 14 more
Java Result: 1
E ovviamente mi rimane il problema, una volta ottenuto il result set multidimensionale, di come visualizzarlo.

Grazie,
Elena