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">
<map>
<entry key="dw">
<map>
<entry key="importer.importKeys" value="false"/>
<entry key="importer.importForeignKeys" value="false"/>
<entry key="importer.importIndexes" value="false"/>
<entry key="importer.importStatistics" value="false"/>
</map>
</entry>
</map>
</property>
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.