4

I have a webapp that I'm trying to use Mondrian within. And I'm getting the following exception when I try to open a connection:

Caused by: mondrian.olap.MondrianException: Mondrian Error:Internal error: Virtual file is not readable: /WEB-INF/olap/mycube.xml

I have tested this cube using a plain J2SE program from the command line, and it works fine. However, when I tried to execute the same cube in my web application I get the error above. My connect string is the following:

jdbc:mondrian:Jdbc=jdbc:mysql://${server.db.host}/HRWarehouse?user=${server.db.username}&password=${server.db.password};Catalog=/WEB-INF/olap/mycube.xml;

This is very similar to what I've found in the Mondrian web application. However, somehow that application has installed the ServletContext in the VFS, but there is exactly zero documentation out there that I can find through google about any sort of special configuration for mondrian in a web application.

I have worked around the issue by setting the path to the schema to be absolute reference instead of relative to webapp context. While this has allowed me to continue testing it is not a suitable solution to the problem. I'm looking for a answer on how to that fix the exception that allows a webapp context relative URL.

chubbsondubs
  • 37,646
  • 24
  • 106
  • 138

1 Answers1

1

I think you need to specify the work file in the Catalog,

 `jdbc:mondrian:Jdbc=jdbc:mysql://${server.db.host}/HRWarehouse?user=${server.db.username}&password=${server.db.password};Catalog=file:/path/to/schema.xml;`

I cant recall if it was absolute path or not, try both again.

I would also double check the connection string just to make sure it's written properly. Also, here is a link that might end up helpful if you don't have it already.

Update Try to add jndi:/ at the beggining of your path: jndi:/localhost/path/to/file.xml

KoU_warch
  • 2,160
  • 1
  • 25
  • 46
  • This is exactly what I'm already doing. I have an absolute URL specified in the Catalog. I want to convert it to web app context relative URL so it's not hard coded. In the Mondrian example web application they define their catalog file relative to the servlet context path, but I can't tell what they did to make that work. And why mine isn't working. Do you understand how VFS is implemented in Mondrian enough to help me? – chubbsondubs Nov 07 '12 at 18:54
  • I have never mess with a Mondrian Adhoc solution, i have only used Pentaho BI, however i can give it a try to help you tomorrow, while that can you tell me if you are using tomcat? – KoU_warch Nov 07 '12 at 22:11
  • Man I'm sorry I missed this comment because this update was exactly correct. – chubbsondubs Feb 23 '14 at 17:09