2012-10-30 99 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