Gary McWilliams
Gary McWilliams

Reputation: 355

weblogic, deployments are not reading properties from WEB-INF/classes, configured using Spring

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

Upvotes: 1

Views: 14481

Answers (1)

Jeff West
Jeff West

Reputation: 1563

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

Upvotes: 1

Related Questions