是否可以在非集群环境中运行weblogic的SingletoneService?我试过这个:
<30.10.2012 18:25:57> <Error> <Deployer> <BEA-149202> <Encountered an exception while attempting to commit the 1 task for the application 'myApplication'.>
<30.10.2012 18:25:57> <Warning> <Deployer> <BEA-149004> <Failures were detected while initiating deploy task for application 'myApplication'.>
<30.10.2012 18:25:57> <Warning> <Deployer> <BEA-149078> <Stack trace for message 149004
weblogic.management.DeploymentException:
at weblogic.application.internal.flow.SingletonServicesFlow.activate(SingletonServicesFlow.java:67)
at weblogic.application.internal.BaseDeployment$2.next(BaseDeployment.java:635)
at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:37)
at weblogic.application.internal.BaseDeployment.activate(BaseDeployment.java:212)
at weblogic.application.internal.EarDeployment.activate(EarDeployment.java:16)
Truncated. see log file for complete stacktrace
java.lang.IllegalArgumentException: Cannot add Singleton Service DemoSingleton as SingletonServicesManager not started. Check if MigrationBasis for cluster is configured.
at weblogic.cluster.singleton.SingletonServicesManager.addConfiguredService(SingletonServicesManager.java:280)
at weblogic.cluster.singleton.SingletonServicesManager.addConfiguredService(SingletonServicesManager.java:297)
at weblogic.application.internal.flow.SingletonServicesFlow.activate(SingletonServicesFlow.java:65)
at weblogic.application.internal.BaseDeployment$2.next(BaseDeployment.java:635)
at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:37)
Truncated. see log file for complete stacktrace
>
当然我没有为集群配置MigrationBasis,因为我没有集群。但我认为可以在集群和独立服务器上运行它。我错了,或者SingletoneService可能存在其他一些可能导致此错误的错误
答案 0 :(得分:3)
Singleton Service只能在WebLogic群集的上下文中使用。对于独立服务器@Singleton,EJB注释就足够了。
实现SingletonService的应用程序仅适用于群集中的受管服务器。此应用程序无法部署到独立的受管服务器(即不属于任何群集的受管服务器)。
答案 1 :(得分:1)
一个简单的解决方案是通过配置迁移策略来修复“检查是否已配置集群的MigrationBasis”消息。之后,单例也可以部署在单个节点(单节点集群)上。在环境 - &gt;下群集您将找到以下设置: