可以在無集羣環境中運行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