Home
Analytics
Java properties file in initialize script of template
b2tech
Hello:
I am using these two initial lines of code in a template initialize script:
propertiesFileIn = new Packages.java.util.Properties();
propertiesFileIn.load(new Packages.java.io.FileInputStream(params["init_name"]));
....
propertiesFileIn.close();
used to load in "dynamic" file names that populate a report's
report parameters.
All works just fine in the BIRT Report Designer for testing purposes. When I move this template to the deployment environment under Tomcat, the first iteration of the report will work fine, then the second but after that, everything crashes out with many java errors (memory related ?).
The first line of code
propertiesFileIn = new Packages.java.util.Properties();
IS definitely causing the problem. Is there some configuration in the web.xml file that I have to do or am I missing something else here?
Any help greatly appreciated.
BillH
Find more posts tagged with
Comments
JasonW
Bill
Have you tried this in the beforeFactory script? The initialize script gets called many times.
Jason
b2tech
Jason:
Yes, exactly the same behavior from the beforeFactory script location. It is as if
propertiesFileIn = new Packages.xxxxxxxxxx(); causes the issue.
It does not really matter what I type in for (xxxx), the memory issue will always come up. If I remove this line the template works fine. BTW I am running an existing template on disk. It is being called through the wget program that calls Tomcat passing in the template name.
Before I was using command line parameters but this got unworkable when the number of parameters got into the hundreds. It was suggested to me to try this approach. Seems great when working from the BIRT Report Designer.
- Bill
JasonW
Bill,
Any chance you could open a bug for this? I am not certain what is happening.
Jason
b2tech
Jason:
This (my) problem sounds very similar to this:
http://www.eclipse.org/forums/index.php?t=rview&goto=659483&th=204947
ie:
"Yes, the problem also occurs when I use the "View Report in Web Viewer" button in the toolbar. The first time is ok, and the exception occurs at the second try.
And when I'm trying to preview the dataset, it's the same problem : the first time is ok, the second try raises the exception.
I've installed the version 2.6.2 of Birt, but the problem remains."
and
"Yes, the Java class relies on other jars. But these jars are only once in the classpath. It's the same classpath which is used in debug mode, and I don't have the problem in Debug mode."
There is something about using jars in scripting that seems to be causing BOTH problems.
-- Bill
JasonW
Bill,
I do not believe the user opened a bug for this. Can you?
Jason
b2tech
Jason:
[Solved... by something you guys did under the hood
]
On a hunch, I upgraded to 3.7 today of the BIRT runtime and I also upgraded my Tomcat 5.5 to version 6 (I can't use Tomcat 7 since one off my other integrated systems needs java 5) and now, ---all--- works fine.
Only one tweak was needed to the web.xml file for the path to our report designs.
Everything came together with the vanilla installs of BIRT 3.7 and Tomcat. I copied over the WebViewerExample folder from BIRT-runtime-3_7_0 to Tomcat and then started it up. Reports that took 5 seconds (and are actually pretty complex with many charts, tables, logos, external CSV's, etc.) to run before now only take 2 seconds.
Great improvement with 3.7.
-- Bill
JasonW
Glad to hear!
Jason
johnw
Jason,
Interestingly enough (I was helping them offline with this), I didn't experience this issue. I am not sure if it is a Java related issue (the Properties object not being thread safe in 1.5 vs 1.6) or what. Regardless, if its working for them with the 3.7 release, great