3

是否可以在非集群环境中运行 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 可能存在其他可能导致此错误的错误

4

2 回答 2

3

单例服务只能在 WebLogic 集群的上下文中使用。对于独立服务器, @Singleton EJB 注释就足够了。

实现 SingletonService 的应用程序只能在集群中的托管服务器上运行。此应用程序不能部署到独立的托管服务器(即不属于任何集群的托管服务器)。

于 2012-10-30T17:03:56.003 回答
1

一个简单的解决方案是通过配置迁移策略来修复“检查集群的 MigrationBasis 是否已配置”消息。之后单例也可以部署在单节点(单节点集群)上。在Environment -> Clusters下,您将找到以下设置:

环境 -> 集群

于 2013-10-09T07:08:25.353 回答