weblogic,部署不从 WEB-INF/类读取属性,使用 Spring 配置

发布于 2024-11-01 04:44:23 字数 2068 浏览 2 评论 0原文

我有一个类似的问题:在 weblogic 中使用外部属性文件并注意那里接受的答案主要对我有用。

但是,我有一个后续行动(抱歉,无法弄清楚如何添加评论来重新打开原始问题)

有谁知道这的实际原因是什么以及“正确”(如果有这样的事情)解决方案,或者人们将复制文件到域作为 weblogic 中的常见做法(10.3.3)

我使用的是: Spring 配置是这样的:

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

消息 bean 然后在其他 bean 中引用 错误是

<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>

我尝试在开始时删除 config/ (并将 messages.properties 复制到 WEB-INF 以及 WEB-INF/classes,但无济于事。还应该指出所有消息、消息 _en_GB 和消息 _en_US存在

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

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

地狱即天堂 2024-11-08 04:44:23

您的路径引用中没有“类路径”。您是否尝试过将 config 目录放在 war 的根目录中?

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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文