可以在无集群环境中运行weblogic的SingletoneService吗?我试过并得到了这个:独立服务器上的Weblogic SingletonService
<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有一些其他错误,可能导致此错误
所以事实证明,我不能在群集和独立服务器使用相同的应用程序,对不对?如果我想在群集上使用SingletonService,我需要两个不同的构建:一个使用SingletonService,另一个不使用? – mykola
是的,我很害怕。单一服务仅在集群上部署时才有意义。就像您所说的那样,使用此服务的应用程序无法部署到独立服务器上。另一个[教程](http://middlewaremagic.com/weblogic/?tag=singleton-service),详细介绍Singleton Service使用的应用程序/部署方面的步骤。 – Mani