Olap4j 与 SSAS 2012 的断言错误

AssertionError on Olap4j with SSAS 2012

我们正在尝试 运行 使用 olap4j 针对 SSAS 进行 OLAP 查询。我已经成功设置了 XML/A 端点,SSMS 正确连接到端点并且工作正常。

但是每次我尝试 运行 来自 JAVA 的查询都会失败。

Class.forName("org.olap4j.driver.xmla.XmlaOlap4jDriver");

Connection connection = DriverManager.getConnection(
          "jdbc:xmla:Server=http://servername/msmdpump.dll;Catalog=DatabaseName");
OlapWrapper wrapper = (OlapWrapper) connection;
OlapConnection olapConnection = wrapper.unwrap(OlapConnection.class);

CellSet set = olapConnection.createStatement().executeOlapQuery(
        "SELECT [Measures].[Foo] ON COLUMNS, " +
        "[Dimension].[Id].[All].children ON ROWS FROM [Cube]");

exception/stacktrace:

java.lang.AssertionError
    at org.olap4j.driver.xmla.XmlaOlap4jElement.<init>(XmlaOlap4jElement.java:43)
    at org.olap4j.driver.xmla.XmlaOlap4jProperty.<init>(XmlaOlap4jProperty.java:54)
    at org.olap4j.driver.xmla.XmlaOlap4jConnection$PropertyHandler.handle(XmlaOlap4jConnection.java:1890)
    at org.olap4j.driver.xmla.XmlaOlap4jConnection.populateList(XmlaOlap4jConnection.java:854)
    at org.olap4j.driver.xmla.DeferredNamedListImpl.populateList(DeferredNamedListImpl.java:136)
    at org.olap4j.driver.xmla.DeferredNamedListImpl.getList(DeferredNamedListImpl.java:90)
    at org.olap4j.driver.xmla.DeferredNamedListImpl.size(DeferredNamedListImpl.java:116)
    at java.util.AbstractCollection.toArray(Unknown Source)
    at java.util.ArrayList.addAll(Unknown Source)
    at org.olap4j.driver.xmla.XmlaOlap4jLevel.getProperties(XmlaOlap4jLevel.java:189)
    at org.olap4j.driver.xmla.XmlaOlap4jConnection$MemberHandler.addUserDefinedDimensionProperties(XmlaOlap4jConnection.java:1739)
    at org.olap4j.driver.xmla.XmlaOlap4jConnection$MemberHandler.handle(XmlaOlap4jConnection.java:1698)
    at org.olap4j.driver.xmla.XmlaOlap4jConnection.populateList(XmlaOlap4jConnection.java:854)
    at org.olap4j.driver.xmla.XmlaOlap4jCube$RawMetadataReader.lookupMemberRelatives(XmlaOlap4jCube.java:547)
    at org.olap4j.driver.xmla.XmlaOlap4jCube$RawMetadataReader.lookupMemberByUniqueName(XmlaOlap4jCube.java:438)
    at org.olap4j.driver.xmla.XmlaOlap4jCube$DelegatingMetadataReader.lookupMemberByUniqueName(XmlaOlap4jCube.java:252)
    at org.olap4j.driver.xmla.XmlaOlap4jCube$CachingMetadataReader.lookupMemberByUniqueName(XmlaOlap4jCube.java:338)
    at org.olap4j.driver.xmla.XmlaOlap4jConnection$MeasureHandler.handle(XmlaOlap4jConnection.java:1555)
    at org.olap4j.driver.xmla.XmlaOlap4jConnection.populateList(XmlaOlap4jConnection.java:854)
    at org.olap4j.driver.xmla.XmlaOlap4jCube.<init>(XmlaOlap4jCube.java:110)
    at org.olap4j.driver.xmla.XmlaOlap4jConnection$CubeHandler.handle(XmlaOlap4jConnection.java:1284)
    at org.olap4j.driver.xmla.XmlaOlap4jConnection.populateList(XmlaOlap4jConnection.java:854)
    at org.olap4j.driver.xmla.DeferredNamedListImpl.populateList(DeferredNamedListImpl.java:136)
    at org.olap4j.driver.xmla.DeferredNamedListImpl.getList(DeferredNamedListImpl.java:90)
    at org.olap4j.driver.xmla.DeferredNamedListImpl.size(DeferredNamedListImpl.java:116)
    at java.util.AbstractList$Itr.hasNext(Unknown Source)
    at org.olap4j.driver.xmla.XmlaOlap4jCellSet.lookupCube(XmlaOlap4jCellSet.java:520)
    at org.olap4j.driver.xmla.XmlaOlap4jCellSet.createMetaData(XmlaOlap4jCellSet.java:403)
    at org.olap4j.driver.xmla.XmlaOlap4jCellSet.populate(XmlaOlap4jCellSet.java:181)
    at org.olap4j.driver.xmla.XmlaOlap4jStatement.executeOlapQuery(XmlaOlap4jStatement.java:372)
    at com.socgen.moma.services.pricingassetscope.DefaultPricingAssetScopeManagerTest.testOlap4j(DefaultPricingAssetScopeManagerTest.java:184)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at org.junit.runners.model.FrameworkMethod.runReflectiveCall(FrameworkMethod.java:47)
    at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
    at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)
    at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
    at org.springframework.test.context.junit4.statements.RunBeforeTestMethodCallbacks.evaluate(RunBeforeTestMethodCallbacks.java:74)
    at org.springframework.test.context.junit4.statements.RunAfterTestMethodCallbacks.evaluate(RunAfterTestMethodCallbacks.java:83)
    at org.springframework.test.context.junit4.statements.SpringRepeat.evaluate(SpringRepeat.java:72)
    at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:231)
    at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:88)
    at org.junit.runners.ParentRunner.run(ParentRunner.java:238)
    at org.junit.runners.ParentRunner.schedule(ParentRunner.java:63)
    at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
    at org.junit.runners.ParentRunner.access[=11=]0(ParentRunner.java:53)
    at org.junit.runners.ParentRunner.evaluate(ParentRunner.java:229)
    at org.springframework.test.context.junit4.statements.RunBeforeTestClassCallbacks.evaluate(RunBeforeTestClassCallbacks.java:61)
    at org.springframework.test.context.junit4.statements.RunAfterTestClassCallbacks.evaluate(RunAfterTestClassCallbacks.java:71)
    at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
    at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run(SpringJUnit4ClassRunner.java:174)
    at org.junit.runner.JUnitCore.run(JUnitCore.java:160)
    at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:78)
    at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:212)
    at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:68)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at com.intellij.rt.execution.application.AppMain.main(AppMain.java:140)
    14:17

出于某种原因,代码尝试构建一个 XML具有空唯一名称的元素。

XmlaOlap4jElement(
    String uniqueName,
    String name,
    String caption,
    String description)
{
    assert uniqueName != null;

尝试嗅探来自 SSAS 的消息。 XML 它 returns.

可能有一些奇怪的东西

或者,您可以采取更高级的方式并关闭断言,但此错误表明发生了严重错误,我建议不要使用这种方法。