Showing posts with label jasper server. Show all posts
Showing posts with label jasper server. Show all posts

Wednesday, October 15, 2014

tree load error - jasperserver


When you are working with Jasper reporting server, you often face tree load error for the jasper server. I faced this error lot of times and I could not find the root cause for this. But we can fix this problem by clearing the cookies in the browser. 
Below are the steps to clear the cookies for the jasper server in the firefox browser.

  • Go to setttings/Preferences in the firefox browser
  • Go to Privacy tab
  • Click on 'remove individual cookies'
  • Search for localhost or jasper server ip address. See sample image below (for me its local host)
  • Click on 'Remove cookie' button (remove until all localhost cookies are removed)



I have specified for FireFox browser, if you are using other browsers like Chrome, IE you need to follow similar process to clear the individual cookies.

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">
  <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.

Tuesday, March 25, 2014

How to configure JDNI in Japser Reporting Server on Mac!!!


Recently when I try to generate a report from Jasper server, I got the below error and it took me lot of time to solve. So posting here to help others.

org.postgresql.util.PSQLException: ERROR: transaction is read-only Detail

One of the reason for getting this error is setting wrong Data source. Initially I set the data source as JDBC Driver. After doing all the possibilities , tried to change the data source from JDBC to JDNI, and it was worked successfully. Below are the steps to set JDNI drive on Jasper reporting server.
  1. Open context.xml file (path is given below in Mac OS X)
  2. Copy and paste existing resource and edit (given below how to do this) 
  3. Login to the server
  4. Goto view->repository->public->data source
  5. Right click Data Sources -> add resource -> Data Source
  6. Check Type as JNDI data source
  7. Give appropriate Name, ID and description 
  8. Give service name which specified in context.xml file
  9. Save the settings by specifying particular location for later use
  10. Test Connection to check success/failure


in Mac path for context.xml:
/Applications/jasperreports-server-5.5/apache-tomcat/webapps/jasperserver-pro/META-INF/context.xml

Changing resource in context.xml file:

    <Resource name="jdbc/jasperserver" auth="Container" type="javax.sql.DataSource"
        maxActive="100" maxIdle="30" maxWait="10000"
        username="jasperdb" password="password" 
        driverClassName="org.postgresql.Driver"
        validationQuery="SELECT 1"
        testOnBorrow="true"
        url="jdbc:postgresql://127.0.0.1:5432/jasperserver?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&autoReconnectForPools=true"
        factory="com.jaspersoft.jasperserver.tomcat.jndi.JSBasicDataSourceFactory"/>

we need to modify name, username, password and url fields in the resource.
name: This will be used while configuring Dat Source
username: user name of your data base
password: Password of your data base
url: url of your data base.

Happy Reading!!!


Popular Posts