Skip to main content



      Home
Home » Archived » BIRT » ResourceBundle not found during runtime
ResourceBundle not found during runtime [message #70654] Thu, 01 September 2005 07:29 Go to next message
Eclipse UserFriend
Originally posted by: christian.rueedi.globus.ch

Hi there,

First of all, BIRT rocks!

I made a report which needs some internationalization now. I added a
resourceBundle mylabes.properties in the same dir as the
myreport.rptdesign file. During design time anything works fine including
preview. But not at runtime in my own webapp. I create the reports with
the Engine API. But no labels are printed anymore.

Where exactly does my .properties file has to lay?
In the same directory as the .rptdesign file or in the engine base path
(where the plugins dir is)

Thanks for any help...
Re: ResourceBundle not found during runtime [message #70748 is a reply to message #70654] Thu, 01 September 2005 14:56 Go to previous messageGo to next message
Eclipse UserFriend
Chris,

I think the problem is that you need to have the mylabes.properties in
the class-path of the viewer web app. To do this, while running in
Eclipse, you need to have a copy of your mylabes.properties in the
following directory:

${ECLIPSE_HOME}\plugins\org.eclipse.birt.report.viewer_1.0.1 \birt\WEB-INF\classes

Scott Rosenbaum
BIRT PMC

Chris wrote:

> Hi there,
>
> First of all, BIRT rocks!
>
> I made a report which needs some internationalization now. I added a
> resourceBundle mylabes.properties in the same dir as the
> myreport.rptdesign file. During design time anything works fine
> including preview. But not at runtime in my own webapp. I create the
> reports with the Engine API. But no labels are printed anymore.
>
> Where exactly does my .properties file has to lay? In the same
> directory as the .rptdesign file or in the engine base path (where the
> plugins dir is)
>
> Thanks for any help...
Re: ResourceBundle not found during runtime [message #71009 is a reply to message #70748] Fri, 02 September 2005 00:10 Go to previous messageGo to next message
Eclipse UserFriend
I am having the same problem.

Scott, your solution does not work. I have put my property file in just
about every directory and it still does not work. I'm at a loss as to how
to get this to work. When I deploy the web viewer using the war file
supplised in the BIRT runtime download, I am able to get everything to work
by simply putting the property file in the same dir as the report file.
However, I have no idea why I cannot replicate this in my own application,
even when my application can access the property file just fine using the
ResourceBundle class.

Thanks for any help,

Andrew

"Scott Rosenbaum" <scottr@innoventsolutions.com> wrote in message
news:43174ECF.9000408@innoventsolutions.com...
> Chris,
>
> I think the problem is that you need to have the mylabes.properties in the
> class-path of the viewer web app. To do this, while running in Eclipse,
> you need to have a copy of your mylabes.properties in the following
> directory:
>
> ${ECLIPSE_HOME}\plugins\org.eclipse.birt.report.viewer_1.0.1 \birt\WEB-INF\classes
>
> Scott Rosenbaum
> BIRT PMC
>
> Chris wrote:
>
>> Hi there,
>>
>> First of all, BIRT rocks!
>>
>> I made a report which needs some internationalization now. I added a
>> resourceBundle mylabes.properties in the same dir as the
>> myreport.rptdesign file. During design time anything works fine including
>> preview. But not at runtime in my own webapp. I create the reports with
>> the Engine API. But no labels are printed anymore.
>>
>> Where exactly does my .properties file has to lay? In the same directory
>> as the .rptdesign file or in the engine base path (where the plugins dir
>> is)
>>
>> Thanks for any help...
Re: ResourceBundle not found during runtime [message #71251 is a reply to message #71009] Fri, 02 September 2005 07:47 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: christian.rueedi.globus.ch

Scott,

Thanks for your answer. I create my reports just plain via Engine API like
the SampleClass on the birt homepage with the main class. Not via the birt
viewer webapp.
So actually I don't have the "org.eclipse.birt.report.view_1.0.1" in my
classpath at all. I think I don't need it or?

I have the following plugins in my classpath from the
birt-runtime_1.0.1\Report-Engine package:

org.eclipse.birt.chart.device.extension_1.0.1
org.eclipse.birt.chart.engine.extension_1.0.1
org.eclipse.birt.chart.reportitem_1.0.1
org.eclipse.birt.report.data.oda.flatfile.ui_1.0.1
org.eclipse.birt.report.data.oda.flatfile_1.0.1
org.eclipse.birt.report.data.oda.jdbc.ui_1.0.1
org.eclipse.birt.report.data.oda.jdbc_1.0.1
org.eclipse.birt.report.data.oda.sampledb.ui_1.0.1
org.eclipse.birt.report.data.oda.sampledb_1.0.1
org.eclipse.birt.report.engine.emitter.fo_1.0.1
org.eclipse.birt.report.engine.emitter.html_1.0.1

and all common, tidy, oda , chart-engine jars


How is the Resource bundle access by the report-engine? Because in the
rptdesign there's only:

<property name="includeResource">TSLabels</property>

so the Engine should do something like this: ResourceBundle myResources =
ResourceBundle.getBundle("mylabels", currentLocale);

When I do this from my Pojo in the webapp... I am able to access it. Does
the Engine creates it's own classpath? do I have to put it somewhere?

Any hints? ;-)

greets

Chris
Re: ResourceBundle not found during runtime [message #72189 is a reply to message #71251] Tue, 06 September 2005 03:07 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: christian.rueedi.globus.ch

Hi there,

I don't want to be annoying... but has anybody a working example report
with an included resourcebundle which can be created via the Engine API
(like the sample app RunReport.java)?

greets

Chris
Re: ResourceBundle not found during runtime [message #72315 is a reply to message #72189] Tue, 06 September 2005 10:27 Go to previous messageGo to next message
Eclipse UserFriend
I've given up on trying to get it to work. I put my property file in just
about every directory on my computer and it is just not working. There is
something that the RunReport.java file must be missing and I'm just not sure
what in the world it can be. If I eventually get it to work, I'll make sure
to email you and/or post here.

--Andrew


"Chris" <christian.rueedi@globus.ch> wrote in message
news:461f529ca48459f631da832d65efb4b0$1@www.eclipse.org...
> Hi there,
>
> I don't want to be annoying... but has anybody a working example report
> with an included resourcebundle which can be created via the Engine API
> (like the sample app RunReport.java)?
>
> greets
>
> Chris
>
Re: ResourceBundle not found during runtime [message #72457 is a reply to message #72315] Wed, 07 September 2005 10:54 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: christian.rueedi.globus.ch

Ok thanks!

I'll do the same if I get further...


Chris
Re: ResourceBundle not found during runtime [message #72563 is a reply to message #72457] Wed, 07 September 2005 14:31 Go to previous messageGo to next message
Eclipse UserFriend
Ok,

I found the problem. They are not looking in the classpath for the
resource file. Look in org.eclipse.birt.report.model.core.BundleHelper and
org.eclipse.birt.report.model.core.Module. It is looking only in the file
location of the report file. Ok, so it should work if you put it in the
same directory as the report file, but it doesn't. What's weird is that I
noticed that when I remove the resource file from my report but keep the
keys in the report file, I get a bunch of SEVERE logging messages that say:

Sep 7, 2005 1:56:29 PM
org.eclipse.birt.report.engine.executor.ReportItemExecutor
getLocalizedString
SEVERE: get resource error, resource key: label.grand.total Locale: en_US

The weird thing is that when I readd the resource file, I do not get the
errors, which I suppose tells me that it can find the resource file, but it
doesn't seem to find the keys. I'll keep investigating when I find the
time, but at least I got a start on it.....

Andrew


"Chris" <christian.rueedi@globus.ch> wrote in message
news:42f4c7653a93f7f69fa56d1e913d30f2$1@www.eclipse.org...
> Ok thanks!
>
> I'll do the same if I get further...
>
>
> Chris
>
Re: ResourceBundle not found during runtime [message #86600 is a reply to message #72563] Wed, 02 November 2005 09:39 Go to previous message
Eclipse UserFriend
Hi
I had the same problem and for me the following simple (simple doesn't
mean quickly found) solution works:

Use an absolute path for the .rptdesign file and put the resource files
in the same place.

I used to create my reports like this : RunReport myreport.rptdesign -p
This worked well until I started using localization.

With the following command I can create localized reports with the
birt engine: RunReport c:\templates\myreport.rptdesign -p

Cheers, michael

P.S. The RunReport class is the one from the birt homepage
(http://www.eclipse.org/birt/deploy/RunReport.java)


Andrew Berman schrieb:
> Ok,
>
> I found the problem. They are not looking in the classpath for the
> resource file. Look in org.eclipse.birt.report.model.core.BundleHelper and
> org.eclipse.birt.report.model.core.Module. It is looking only in the file
> location of the report file. Ok, so it should work if you put it in the
> same directory as the report file, but it doesn't. What's weird is that I
> noticed that when I remove the resource file from my report but keep the
> keys in the report file, I get a bunch of SEVERE logging messages that say:
>
> Sep 7, 2005 1:56:29 PM
> org.eclipse.birt.report.engine.executor.ReportItemExecutor
> getLocalizedString
> SEVERE: get resource error, resource key: label.grand.total Locale: en_US
>
> The weird thing is that when I readd the resource file, I do not get the
> errors, which I suppose tells me that it can find the resource file, but it
> doesn't seem to find the keys. I'll keep investigating when I find the
> time, but at least I got a start on it.....
>
> Andrew
>
>
> "Chris" <christian.rueedi@globus.ch> wrote in message
> news:42f4c7653a93f7f69fa56d1e913d30f2$1@www.eclipse.org...
>
>>Ok thanks!
>>
>>I'll do the same if I get further...
>>
>>
>>Chris
>>
>
>
>
Previous Topic:Chart listeners / SWT
Next Topic:Cascading Parameters
Goto Forum:
  


Current Time: Wed Jul 23 13:23:26 EDT 2025

Powered by FUDForum. Page generated in 0.53954 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top