@vensw said: I tried the below approaches.. Approach 1: resourceFilePath = reportContext.getDesignHandle().resourceFolder; file = new File(resourceFilePath + "/" + "watermark.properties"); Observed: 1) View Report As PDF : Worked Fine. 2) When ran Integration Test : null is being appended in the path and the path Is:C:\devl\ws-svn\MR\null\watermark.properties 3) When ran the job on Server : null is being appended in the path and the path Is:C:\Program Files\IBM\SDP\runtimes\base_v7\profiles\was70profile1\bin\null\watermark.properties Approach 2: resourceFilePath = reportContext.getResource("watermark.properties"); file = new File(resourceFilePath.toString().substring(6)); // reportContext.getResource("watermark.properties") is returning file:/C:\devl\ws-svn\MR\null\watermark.properties Observed: 1) View Report As PDF : Worked Fine. 2) When ran Integration Test : Worked Fine. 3) When ran the job on Server : toString() is being called on null and an error is thrown. Approach 3: importPackage(com.mr.marketing.birt.watermark) waterMarkReader = new WaterMarkPropertyReader(); // WaterMarkPropertyReader is a class in the package com.mr.marketing.birt.watermark. propertyValue = waterMarkReader.getWaterMarkKeyValue("hasWaterMark"); getWaterMarkKeyValue("hasWaterMark") will return the property value of the key that was passed to it. (In this case, it is hasWaterMark). Observed: 1) View Report As PDF : path is:C:\Program Files\ibm\SDP\watermark.properties 2) When ran Integration Test : path is:C:\devl\ws-svn\MR\watermark.properties 3) When ran the job on Server : path is:C:\Program Files\IBM\SDP\runtimes\base_v7\profiles\was70profile1\bin\watermark.properties Birt is expecting the watermark.properties file from three different places this time..
@vensw said: I tried the below approaches..
Approach 1:
resourceFilePath = reportContext.getDesignHandle().resourceFolder;
file = new File(resourceFilePath + "/" + "watermark.properties");
Observed:
1) View Report As PDF : Worked Fine.
2) When ran Integration Test : null is being appended in the path and
the path Is:C:\devl\ws-svn\MR\null\watermark.properties
3) When ran the job on Server : null is being appended in the path and
the path Is:C:\Program Files\IBM\SDP\runtimes\base_v7\profiles\was70profile1\bin\null\watermark.properties
Approach 2:
resourceFilePath = reportContext.getResource("watermark.properties");
file = new File(resourceFilePath.toString().substring(6));
// reportContext.getResource("watermark.properties") is returning
file:/C:\devl\ws-svn\MR\null\watermark.properties
2) When ran Integration Test : Worked Fine.
3) When ran the job on Server : toString() is being called on null and an error is thrown.
Approach 3:
importPackage(com.mr.marketing.birt.watermark)
waterMarkReader = new WaterMarkPropertyReader();
// WaterMarkPropertyReader is a class in the package com.mr.marketing.birt.watermark.
propertyValue = waterMarkReader.getWaterMarkKeyValue("hasWaterMark");
getWaterMarkKeyValue("hasWaterMark") will return the property value of the key that was passed to it. (In this case, it is hasWaterMark).
1) View Report As PDF : path is:C:\Program Files\ibm\SDP\watermark.properties
2) When ran Integration Test : path is:C:\devl\ws-svn\MR\watermark.properties
3) When ran the job on Server : path is:C:\Program Files\IBM\SDP\runtimes\base_v7\profiles\was70profile1\bin\watermark.properties
Birt is expecting the watermark.properties file from three different places this time..
Did you find any solution for the relative path??