Home » Eclipse Projects » Rich Client Platform (RCP) » Exported project can't find resource bundle, bundle is found by Eclipse App
| |
Re: Exported project can't find resource bundle, bundle is found by Eclipse App [message #456279 is a reply to message #456207] |
Mon, 16 October 2006 14:39 |
Bill Blalock Messages: 119 Registered: July 2009 Location: Alabama |
Senior Member |
|
|
xiangqinxian wrote:
> Hi,
> Could you paste that build.properties file ?
> Regards
> qinxian.
Thanks for looking,
=====================================
source.. = src/
output.. = bin/
bin.includes = plugin.xml,\
META-INF/,\
.,\
icons/,\
build.properties,\
lib/,\
lib/jaxrpc.jar,\
lib/axis.jar,\
lib/commons-discovery-0.2.jar,\
lib/commons-logging-1.0.4.jar,\
lib/log4j-1.2.8.jar,\
lib/activation.jar,\
lib/axis-ant.jar,\
lib/mail.jar,\
lib/saaj.jar,\
lib/wsdl4j-1.5.1.jar,\
edoc.Properties
=============================
edoc.Properties is in the root of the Product jar.
This is edoc.Properties, in case it matters:
==============================================
#WebServiceURL property
webservice_address = http://stpap4gt/auwebservice/auwebservice.asmx
#Database properties
server = p102
port = 1521
database = DEV8173
================================================
|
|
|
Re: Exported project can't find resource bundle, bundle is found by Eclipse App [message #456283 is a reply to message #456207] |
Mon, 16 October 2006 15:54 |
Bill Blalock Messages: 119 Registered: July 2009 Location: Alabama |
Senior Member |
|
|
xiangqinxian wrote:
> Hi,
> Could you paste that build.properties file ?
> Regards
> qinxian.
This is the Manifest.MF file, throught it might help ---
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: Alchemy Viewer Plug-in
Bundle-SymbolicName: com.cprs.alchemyviewer; singleton:=true
Bundle-Version: 1.0.0
Bundle-Activator: com.cprs.alchemyviewer.Activator
Bundle-Vendor: CPRS
Bundle-Localization: plugin
Require-Bundle: org.eclipse.ui,
org.eclipse.core.runtime,
com.uky.imageviewer,
com.ibm.jt400,
org.apache.xerces
Eclipse-LazyStart: true
Bundle-ClassPath: .,
lib/jaxrpc.jar,
lib/axis.jar,
lib/commons-discovery-0.2.jar,
lib/commons-logging-1.0.4.jar,
lib/log4j-1.2.8.jar,
lib/activation.jar,
lib/axis-ant.jar,
lib/mail.jar,
lib/saaj.jar,
lib/wsdl4j-1.5.1.jar
|
|
| | |
Re: Exported project can't find resource bundle, bundle is found by Eclipse App [message #456336 is a reply to message #456290] |
Mon, 16 October 2006 21:54 |
Bill Blalock Messages: 119 Registered: July 2009 Location: Alabama |
Senior Member |
|
|
Alex Blewitt wrote:
> Is it a case-sensitive filing system? If so, it might be looking for
'edoc.properties' and not 'edoc.Properties'. If it's a case-insensittive
filing system (e.g. Windows) then it's quite likely that it would work from a
dev area, but fail when exported to a Jar (since the Jar is case-sensitive
regardless of what filing system it's exported to).
> You should be able to test this pretty easily (for example, change
Properties to properties). Also, if you expand the Jar out into an unpacked
version, you might find that it suddenly starts working. That's what I'd look
for.
> Alex.
Alex:
You were right. Changing the file name 'edoc.Properties' to
'edoc.pProperties' and chaning the build.properties file (refactor didn't
automatically make the change from 'edoc.Properties' to 'edoc.properties'.
How can something like 'edoc.properties' be left out of the JAR file,
exported with the project but as a file, 'edoc.properties', so that the
"soft" values can easily be edited?
Putting it in the jar file works but I might has well not use a resource
bundle if it can't be changed.
Thanks
Bill Blalock
|
|
|
Re: Exported project can't find resource bundle, bundle is found by Eclipse App [message #456342 is a reply to message #456336] |
Tue, 17 October 2006 02:53 |
Xiang Qinxian Messages: 119 Registered: July 2009 |
Senior Member |
|
|
在 2006-10-16一的 21:54 +0000,Bill Blalock写道:
> Alex Blewitt wrote:
>
> > Is it a case-sensitive filing system? If so, it might be looking for
> 'edoc.properties' and not 'edoc.Properties'. If it's a case-insensittive
> filing system (e.g. Windows) then it's quite likely that it would work from a
> dev area, but fail when exported to a Jar (since the Jar is case-sensitive
> regardless of what filing system it's exported to).
>
> > You should be able to test this pretty easily (for example, change
> Properties to properties). Also, if you expand the Jar out into an unpacked
> version, you might find that it suddenly starts working. That's what I'd look
> for.
>
> > Alex.
>
> Alex:
>
> You were right. Changing the file name 'edoc.Properties' to
> 'edoc.pProperties' and chaning the build.properties file (refactor didn't
> automatically make the change from 'edoc.Properties' to 'edoc.properties'..
>
> How can something like 'edoc.properties' be left out of the JAR file,
> exported with the project but as a file, 'edoc.properties', so that the
> "soft" values can easily be edited?
>
Maybe you could refer osgi specs and use FileLocator.find+variables.
More details code in FindSupport.class.
> Putting it in the jar file works but I might has well not use a resource
> bundle if it can't be changed.
>
> Thanks
> Bill Blalock
>
>
Regards
Qinxian
|
|
|
Re: Exported project can't find resource bundle, bundle is found by Eclipse App [message #456350 is a reply to message #456336] |
Tue, 17 October 2006 08:50 |
Alex Blewitt Messages: 946 Registered: July 2009 |
Senior Member |
|
|
> You were right. Changing the file name
> 'edoc.Properties' to
> 'edoc.pProperties' and chaning the build.properties
> file (refactor didn't
> automatically make the change from 'edoc.Properties'
> to 'edoc.properties'.
I'm not sure that there is a refactor for changing file names; I'd have assumed that you were using F2 to rename it. If there is a refactor option, then you also have the opportunity of changing occurences of the name in other resources, but you have to specify which manually (e.g. by resource name, usually *.xml and *.mf)
> How can something like 'edoc.properties' be left out
> of the JAR file,
> exported with the project but as a file,
> 'edoc.properties', so that the
> "soft" values can easily be edited?
I'd recommend that you use a system property (e.g. the kind specified by -D) to point to the location of the properties file, which you can then read directly.
Of course, this advice isn't terribly helpful for an individual plugin, but if you're exporting a product and these are product configurations, then that's the approach I'd take. You could possibly even utilise the config.ini associated with your configuration to perform the setup on your behalf.
For a general case, there's an OSGi configuration service that you can use to configure properties on a per-plugin basis. However, there's no external file-based reader for that one, and it persists configuration between restarts.
Alex.
|
|
|
Goto Forum:
Current Time: Sat Apr 27 02:45:43 GMT 2024
Powered by FUDForum. Page generated in 0.04068 seconds
|