Wednesday, October 15, 2014

Unable to load metadata for VDB name - Jasper 5.6

When we use Virtual Data Source (VDS) in Jasper Reporting Server 5.6, we will face 'Unable to load metadata for VDB name' error. This is due to unable to handle the relation/mapping between the databases with Foreign keys. We need to specify it manually. Below are the sequence of steps for doing that.
  • Open the file applicationContext-VirtualDatasource.xml 
    • Path jasperreports-server-5.6/apache-tomcat/webapps/jasperserver-pro/WEB-INF
  • Search for translatorConfigList property in the file
  • Add property importPropertyMap after translatorConfigList (check below for property code)
  • Restart the server and it will work.

Below is the property code you need to add in the file:

<property name="importPropertyMap">
    <entry key="dw">
        <entry key="importer.importKeys" value="false"/>
        <entry key="importer.importForeignKeys" value="false"/>
        <entry key="importer.importIndexes" value="false"/>
        <entry key="importer.importStatistics" value="false"/>

In the above code, key value is 'dw' is a name of the database which we set while creating the virtual data source

P.S: In Jasper server 5.5 , you need to restart the server for the most of the cases if you face this error.


Dani said...

We migrated from 5.2 to JRS 6.2 and we get the metadata load error. How do I find the name of the database/entry key value, Is it the name we give when creating the VDS from multiple datasources?

Unknown said...

In 6.2, the file available is applicationContext-virtual-data-source-query-service.xml

For 6.2., add the importPropertyMap in the above file for the "bean id="teiidVirtualQueryService". , which should resolve the VDB issue.

Restart the jasper after above changes.

Dani said...

Let me just clarify this: I also see a file called applicationContext-virtual-data-source.xml in which I was trying to make the changes. Are you sure I dont need to add any code in it?

Could you also my first question on how to find the name of the entry key value; in the above it is mentioned as 'dw' how do I find it on my environment?

Thanks for the response!

Popular Posts