This post is not about a particular schema file. What I'm trying to find out is how to find errors in any of my schema files. The problem is, if anything is wrong with my schema, even if it is wel-formed XML, the only error message I can get is this :

avax.servlet.ServletException: javax.servlet.jsp.JspException: javax.servlet.jsp.JspException: Mondrian Error:MDX cube 'Resultats collectifs' not found or not processed

javax.servlet.ServletException: javax.servlet.jsp.JspException: javax.servlet.jsp.JspException: Mondrian Error:MDX cube 'Resultats collectifs' not found or not processed
at org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:821)
at org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:758)
at org.apache.jsp.testpage_jsp._jspService(testpage_jsp.java:258)
(etc.)

I'm using Mondrian 2.1 on Linux/Tomcat 5.0 (not the PCI or Pentaho demo). I made a copy of a working mondrian.jsp script in the webapps/mondrian/WEB-INF/queries directory, in which I changed the path given by catalogUri="/WEB-INF/queries/FoodMart.xml" to "file:///my-directory/my-schema.mondrian.xml". I also changed the actual MDX to a simple query on my cube.

I also added this line to flush the cache each time the page is refreshed :

< % mondrian.rolap.cache.CachePool.instance().flush(); % >

(BTW : the path given in the Mondrian FAQ is incorrect, the "cache" part is missing)

I then run my JSP script by passing its name as argument to testpage.jsp, as in :
http://my-tomcat-server:8080/mondria...uery=my-script

The results are OK as long as the schema can be compiled, meaning I have significant error messages such as "Table 'my_db.MY_TABLE' doesn't exist" if the table tag refers to a non-existant table. In case the XML is malformed, there is a "Internal error: while parsing catalog ..." error. This doesn't help much, but fortunately the logs/localhost_log.current-date.txt file gives a clue, if you read past the method call stack, for example : The element type "XXX"
must be terminated by the matching end-tag "</XXX>. And of course, I can always run my XML in any XML editor (I use the XMLBuddy plugin in Eclipse).

But if any tag has the wrong label or property, or if some required tag is missing or invalid, all I have is "Mondrian Error:MDX cube 'MyCubeName' not found or not processed" with absolutely no indication of what is wrong or where.

Does anyone have a clue of how to get more helpful error messages?