2012-10-30 98 views
3

可以在無集羣環境中運行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有一些其他錯誤,可能導致此錯誤

回答

3

Singleton Service只能在WebLogic羣集的上下文中使用。對於獨立服務器@Singleton EJB註釋就足夠了。

實現SingletonService的應用程序僅適用於羣集內的受管服務器。此應用程序不能部署到獨立的受管服務器(即不屬於任何羣集的受管服務器)。

+0

所以事實證明,我不能在羣集和獨立服務器使用相同的應用程序,對不對?如果我想在羣集上使用SingletonService,我需要兩個不同的構建:一個使用SingletonService,另一個不使用? – mykola

+0

是的,我很害怕。單一服務僅在集羣上部署時纔有意義。就像您所說的那樣,使用此服務的應用程序無法部署到獨立服務器上。另一個[教程](http://middlewaremagic.com/weblogic/?tag=singleton-service),詳細介紹Singleton Service使用的應用程序/部署方面的步驟。 – Mani

1

一個簡單的解決方案是通過配置遷移策略來修復'檢查是否配置了集羣MigrationBasis'消息。之後,單身人士也可以部署在單個節點(單節點羣集)上。在環境 - >羣集,你會發現以下設置:

Environment -> Clusters