Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
POJO ReportEngine accessing rptdesign file from WebViewer
lotusman
<p>Hi,</p><p> </p><p>We have a setup where we use the WebViewer for the majority of BIRT report viewing. We do have one instance where we have created a batch process to run longer running reports. We are upgrading our environments, so a number of things have changed. We used to have separate projects, but have now been able to reduce this down to one WAR (contained within an EAR), so I want to eliminate duplication of one of the rptdesign files. </p><p> </p><p>Our old batch process was setup such that all files were found in the classpath of the now eliminated 2nd project. Since we now have one project, I would like to only maintain a single instance of the file - the one found under the WebViewer structure (there is an abbreviated version of the report - same design file - that is run interactively from the WebViewer and why we wish to keep it there). The files for the webviewer are currently found in WebContent/report/*. So far I have been unable to find a way to have the ReportEngine access and utilize the directory structure found for the WebViewer files. It seems to expect them to be found under the classpath from everything I have been able to find and determine. </p><p> </p><p>Has anyone successfully been able to access the files from the ReportEngine where they are not found under the classpath? I did pass openReportDesign a full qualified path, but then it was unable to find out rptlibrary found in the same directory as the report (and we have internationalization properties files in another directory, though this is under the classpath). </p><p> </p><p>We are currently using BIRT 4.3.1 on JBoss 7.2.0.</p><p> </p><p>Thanks</p>
Find more posts tagged with
Comments
lotusman
<p>I have a few updates I've discovered as I've researched this issue more closely.</p><p> </p><p>1) Jboss 4.x added the root of the WAR to the classpath, and that is why our old setup worked and found all the necessary files and external resources. Jboss 7.x doesn't do this.</p><p>2) So far I have been unable to add our report/* directory to the classpath. I have tried in Manifest.mf in both the EAR and WAR, but so far it hasn't worked - it seems to be expecting a JAR file only. I could jar up the necessary files and make a module, but that defeats our purpose as it would need to be updated every time we redeployed the application.</p><p> </p><p>So far I have been unable to find a workaround for this issue. </p>
mwilliams
So, your batch process is attempting to access a file from within the EAR -> WAR? Am I understanding correctly? If so, what error are you getting?
lotusman
<p>Hi,</p><p> </p><p>Yes, all the files are included within the same WAR inside an EAR. From what I can tell, the batch process is unable to access the reports which are located outside the classpath (WEB-INF/lib and WEB-INF/classes). I have tried adding the path to the classpath, but Jboss 7 doesn't appear to allow adding the root of the WAR to the classpath (I've found an open JBoss issue around this). </p><p> </p><p>One idea I've had, but not tried implementing so far (will do so today), is to move the reports into the classpath and see if the WebViewer can still access them. Instead of trying to get the batch process to access the files, I thought I'd see if the WebViewer can access the files in the classpath.</p>
lotusman
<p>Hi,</p><p> </p><p>Ok, so I got a bit sidetracked on some other work, but have finally had time to come back to this. I was able to move all the report files into the classpath of the WAR and the WebViewer can successfully access them, so we're almost there in only having a single instance of the files.</p><p> </p><p>Back to the batch process. I am now able to access the report file, but it is not finding the resources. I have tried setting EngineConfig.setResourcePath(), but am having issues on exactly how to set this. I want this to be relative to the WAR (as the resource files are all in the WAR) and not the filesystem, but from every example I've seen, this path is always a fully qualified file system path, so I am unsure how to proceed with a relative path.</p><p> </p><p>I tested the resource path by putting in a fully qualified path on my development machine and that found all the resources - but this is with an exploded WAR. Can I use a relative path? Since I have been moving the report files around, the paths to the resources have moved as well - I don't want to have to update all the report designs. Being able to use a relative resource path is much more flexible, but I can't see how to do that. Wondering if anyone else has encountered this?</p><p> </p><p>Thanks</p>