View Full Version : Error in v1.0.1 ad hoc query

10-22-2003, 10:29 PM
I did the following:
(i) dropped mondrian.war into webapps/,
(ii) loaded FoodMart to an Oracle database under the user id "foodmart",
(iii) changed MDXQueryServlet entry in web.xml, WEB-INF/queries/mondrian.jsp and others to use the parameters: jdbcDriver="oracle.jdbc.OracleDriver" and jdbcUrl="jdbc:oracle:thin:foodmart/foodmart@localhost:1521:<sid>"
(iv) tested adhoc.jsp.
Query 0 and 1 work fine after fixing up some missing schema issues in mondrian-data-oracle.zip and mondrian-data.zip , but Query 2 failed with the following error:
Results: Error:
java.lang.RuntimeException: Internal error: Failed to parse query [select
{ [Measures].[Units Shipped], [Measures].[Units Ordered] } on columns,
[Store].[Store Name].members on rows
from Warehouse
at mondrian.olap.MondrianResource.newInternal(MondrianResource.java:45)
at mondrian.olap.Util.newError(Util.java:445)
at mondrian.olap.ConnectionBase.parseQuery(ConnectionBase.java:46)
... 33 more
Caused by: java.lang.RuntimeException: MDX object '[Measures].[Units Shipped]' not found in cube 'Warehouse'
at mondrian.olap.MondrianResource.newMdxChildObjectNotFound(MondrianResource.java:64)
at mondrian.olap.Util.lookup(Util.java:300)
at mondrian.olap.Id.resolve(Id.java:99)
at mondrian.olap.Query$StackResolver.resolveChild(Query.java:1442)
I checked FoodMart.xml in WEB-INF and found "Units Shipped" defined in the Warehouse cube (inventory_fact_1997). Could someone kindly point out my mistake(s) ? Thanks in advance !

10-23-2003, 04:15 AM
It works fine for me. Try some other queries, and see if you can find a pattern; and make sure that Mondrian isn't looking at another copy of FoodMart.xml somewhere; but I can't think of a cause.

10-23-2003, 05:13 AM
Hi Julian,
I'm using the distributed mondrian.war file.
I also checked /webapps/mondrian/WEB-INF/web.xml and saw:
in MDXQueryServelet. This is where my FoodMart.xml lies too.
I looked into the app server log and could find nothing interesting. Is there any debugging flag I can turn on to see what's going on ?
Also, I'd made some changes to the import script (The import files are "wrong" because for example, the "salary" table insertion statements all have 1 more column than the "salary" table defined schema).

10-23-2003, 06:43 AM
Hi all,
I have run through all 20 queries successfully except for query #9 and #13 which I'll get to later.
It turns out that the errors were due to the security policy for "California manager". To fix the reported errors for other queries, I changed the policy in FoodMart.xml to "grant all". Incidentally, only query #8 reported the error correctly (Illegal access). The other queries complained that Mondrian could not parse the MDX statement properly.
Now for query #9 and 13, both has similar error:
No matching signature for <function>.
I tried to turn on
in mondrian.properties but it doesn't make a difference. Does the standard war distribution include special functions used in query #9 and 13 ?
For your convenience, I have included more details about the queries below:
Any ideas ?
P.S. Do you want me to upload the updated Oracle import scripts anywhere so that new comers won't encounter the data issues I had earlier on ? I'd leave FoodMart.xml alone, but also update adhoc.jsp to describe the queries better (e.g., where to change the security policies). These little changes may help to bring more support to Mondrian.
For query #9:
member [Product].[Non dairy] as '[Product].[All Products] - [Product].[Food].[Dairy]'
member [Measures].[Dairy ever] as 'sum([Time].members, ([Measures].[Unit Sales],[Product].[Food].[Dairy]))'
set [Customers who never bought dairy] as 'filter([Customers].members, [Measures].[Dairy ever] = 0)'
{[Measures].[Unit Sales], [Measures].[Dairy ever]} on columns,
[Customers who never bought dairy] on rows
from Sales
Error message is:
Caused by: java.lang.RuntimeException: Internal error: no function matches signature 'filter(<Set>, <Logical Expression>)'
and query #13:
MEMBER [Measures].[ProfitPct] AS
'Val((Measures.[Store Sales] - Measures.[Store Cost]) / Measures.[Store Sales])',
MEMBER [Measures].[ProfitValue] AS
'[Measures].[Store Sales] * [Measures].[ProfitPct]',
{ [Store].[Store Name].Members} ON COLUMNS,
{ [Measures].[Store Sales], [Measures].[Store Cost], [Measures].[ProfitValue],
[Measures].[ProfitPct] } ON ROWS
FROM Sales
Error message is:
Caused by: java.lang.RuntimeException: Internal error: no function matches signature 'Val(<Numeric Expression>)'

10-23-2003, 08:49 AM
I am able to replicate the issues for queries 9 & 13 after making the changes as specified to my FoodMart.xml file ( giving grant all privilelges to all objects down the role )
The error for 9 for me comes back as : MDX object '[Product].[Food].[Dairy]' not found in cube 'Sales' , and I am unable to locate a reference to this in the foodmart.xml file.
The error for 13 is exactly the same as described above.
I am on a RH Linux 9 box running Sun JDK 1.4.1_03 and Blackdown JDK 1.4.1_01 against a Postgres 7.3.2 database
Hope this helps,

10-23-2003, 09:44 AM
I looked around the installation directory and noticed that I have an empty /webapps/mondrian/filter/ directory. Is that where custom filters are supposed to go (still looking for my "no function matches signature" error ? If so, where are they ?
Can I assume that the standard mondrian.war was not compiled with those functions that query 9 and 13 need ?

10-23-2003, 09:52 AM
Those queries never worked. I think I introduced them a while ago, in order to test some experimental features, and forgot to remove them. Your system is working fine.

10-23-2003, 10:35 AM
Hi Julian,
Thanks for filling in. Greatly appreciate it. Does the same thing apply to taglib.jsp query/example 6 (0 dimension test) ? Is this a bug ?

04-16-2004, 10:07 PM
Hi Jin,
you could write the modifications to the file "Foodmart.xml" in detail for resolve the problem of the security policy for "California manager."
Thank you in advance.