1

I have a similar problem to: Using external properties files in weblogic and note that the accepted answer there is mainly working for me.

However, I have a follow-up (sorry, cannot work out how to just add comments to re-open the original question)

Does anyone know what the actual cause of this is and the "correct" (if there is such a thing) solution, or do people take copying files to the domain as a common practise in weblogic (10.3.3)

What I am using is: Spring config has this:

<bean id="messages" class="java.util.ResourceBundle" factory-method="getBundle">
     <constructor-arg index="0" value="config/messages"/>
</bean>

the messages bean is then referenced in other beans The error is

<code>
<11-Apr-2011 11:47:23 o'clock BST> <Error> <Deployer> <BEA-149265> <Failure occurred in the execution of deployment request with ID '1302518829904' for task '4'. Error is: 'weblogic.application.ModuleException: '
weblogic.application.ModuleException:
        at weblogic.servlet.internal.WebAppModule.startContexts(WebAppModule.java:1514)
        at weblogic.servlet.internal.WebAppModule.start(WebAppModule.java:486)
        at weblogic.application.internal.flow.ModuleStateDriver$3.next(ModuleStateDriver.java:425)
        at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:41)
        at weblogic.application.internal.flow.ModuleStateDriver.start(ModuleStateDriver.java:119)
        Truncated. see log file for complete stacktrace

Caused By: java.util.MissingResourceException: Can't find bundle for base name config/messages, locale en_GB
        at java.util.ResourceBundle.throwMissingResourceException(ResourceBundle.java:1521)
        at java.util.ResourceBundle.getBundleImpl(ResourceBundle.java:1260)
        at java.util.ResourceBundle.getBundle(ResourceBundle.java:715)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        Truncated. see log file for complete stacktrace
</code>

I have tried removing the config/ at the start (and copying the messages.properties to WEB-INF and also WEB-INF/classes, to no avail. Should also point out that all of messages, messages _en_GB and messages _en_US exist

Community
  • 1
  • 1
Gary McWilliams
  • 335
  • 3
  • 4
  • 9

1 Answers1

1

Your path reference doesn't have a 'classpath' in it. Have you tried putting the config directory in the root of the war?

Jeff West
  • 1,563
  • 9
  • 11
  • Thanks for the help, but none of those suggestions have worked. Still stuck. – Gary McWilliams Apr 14 '11 at 08:03
  • for reference, I have gotten the classloader path and it does not include WEB-INF/classes from either the expanded war file, nor from the "stage" area at deployment time (comment box is too short to allow me to add the complete classpath, but all it adds to the default CLASSPATH is: /opt/bea/Oracle/Middleware/user_projects/domains/base_domain/:/opt/bea/Oracle/Middleware/ – Gary McWilliams Apr 14 '11 at 14:43
  • What version of WLS are you using? – Jeff West Apr 14 '11 at 22:33
  • version 10.3.3. I have resolved this as follows. I added a new class which has a static getBundle method that does: InputStream propertiesStream = Thread.currentThread().getContextClassLoader().getResourceAsStream(aBundleName+".properties"); bundle = new PropertyResourceBundle(propertiesStream); and returns that bundle. Then changed the spring config to use that class. All seems to be working fine now – Gary McWilliams Apr 15 '11 at 08:06