2 Replies Latest reply: Jul 16, 2014 7:00 AM by user13063267 RSS

    Weblogic 12c cluster and EJB 3.1 timers

    user13063267

      Hello!

       

      I'm using Weblogic 12c (12.1.2.0) Cluster.

      I configured datasource in the cluster scheduling tab and created ACTIVE and WEBLOGIC_TIMERS tables.


      @Stateless

      public class MyTimerService {

       

          @Schedule(minute = "*/2", hour = "*")

          private void heartbeat() {

              System.out.println("heartbeat fired");

          }

       

       

      <?xml version="1.0" encoding="UTF-8"?>

      <wls:weblogic-ejb-jar

        xmlns:wls="http://xmlns.oracle.com/weblogic/weblogic-ejb-jar"

        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

        xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/ejb-jar_3_1.xsd http://xmlns.oracle.com/weblogic/weblogic-ejb-jar http://xmlns.oracle.com/weblogic/weblogic-ejb-jar/1.3/weblogic-ejb-jar.xsd">

        <wls:timer-implementation>Clustered</wls:timer-implementation>

      </wls:weblogic-ejb-jar>

       

      If I run application on stanalone weblogic without weblogic-ejb-jar.xml timer works.

      When I try run it on cluster with weblogic-ejb-jar.xml during deployment I receive error:

      <Error> <Deployer> <localhost> <MS1> <[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)'> <<WLS Kernel>> <> <> <1404812226750> <BEA-149231> <Unable to set the activation state to true for the application "test".

      weblogic.application.ModuleException: java.lang.NullPointerException

      at weblogic.application.internal.ExtensibleModuleWrapper.activate(ExtensibleModuleWrapper.java:123)

      at weblogic.application.internal.flow.ModuleListenerInvoker.activate(ModuleListenerInvoker.java:114)

      at weblogic.application.internal.flow.ModuleStateDriver$2.next(ModuleStateDriver.java:192)

      at weblogic.application.internal.flow.ModuleStateDriver$2.next(ModuleStateDriver.java:187)

      at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:42)

      at weblogic.application.internal.flow.ModuleStateDriver.activate(ModuleStateDriver.java:58)

      at weblogic.application.internal.flow.DeploymentCallbackFlow.activate(DeploymentCallbackFlow.java:145)

      at weblogic.application.internal.BaseDeployment$2.next(BaseDeployment.java:729)

      at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:42)

      at weblogic.application.internal.BaseDeployment.activate(BaseDeployment.java:258)

      at weblogic.application.internal.EarDeployment.activate(EarDeployment.java:61)

      at weblogic.application.internal.DeploymentStateChecker.activate(DeploymentStateChecker.java:165)

      at weblogic.deploy.internal.targetserver.AppContainerInvoker.activate(AppContainerInvoker.java:80)

      at weblogic.deploy.internal.targetserver.BasicDeployment.activate(BasicDeployment.java:222)

      at weblogic.deploy.internal.targetserver.BasicDeployment.activateFromServerLifecycle(BasicDeployment.java:414)

      at weblogic.management.deploy.internal.DeploymentAdapter$1.doActivate(DeploymentAdapter.java:51)

      at weblogic.management.deploy.internal.DeploymentAdapter.activate(DeploymentAdapter.java:200)

      at weblogic.management.deploy.internal.AppTransition$2.transitionApp(AppTransition.java:30)

      at weblogic.management.deploy.internal.ConfiguredDeployments.transitionApps(ConfiguredDeployments.java:240)

      at weblogic.management.deploy.internal.ConfiguredDeployments.activate(ConfiguredDeployments.java:169)

      at weblogic.management.deploy.internal.ConfiguredDeployments.deploy(ConfiguredDeployments.java:123)

      at weblogic.management.deploy.internal.DeploymentServerService.resume(DeploymentServerService.java:191)

      at weblogic.management.deploy.internal.DeploymentServerService.start(DeploymentServerService.java:99)

      at weblogic.t3.srvr.SubsystemRequest.run(SubsystemRequest.java:64)

      at weblogic.work.ExecuteThread.execute(ExecuteThread.java:295)

      at weblogic.work.ExecuteThread.run(ExecuteThread.java:254)

      Caused By: java.lang.NullPointerException

      at weblogic.ejb.container.timer.ClusteredEJBTimerManager.uninitializeTimerHandler(ClusteredEJBTimerManager.java:220)

      at weblogic.ejb.container.timer.ClusteredEJBTimerManager.undeploy(ClusteredEJBTimerManager.java:185)

      at weblogic.ejb.container.manager.BaseEJBManager.undeployTimerManager(BaseEJBManager.java:438)

      at weblogic.ejb.container.manager.BaseEJBManager.undeploy(BaseEJBManager.java:420)

      at weblogic.ejb.container.manager.StatelessManager.undeploy(StatelessManager.java:397)

      at weblogic.ejb.container.deployer.EJBDeployer.deactivate(EJBDeployer.java:1327)

      at weblogic.ejb.container.deployer.EjbModuleExtension.preDeactivate(EjbModuleExtension.java:150)

      at weblogic.ejb.container.deployer.EjbModuleExtension.postActivate(EjbModuleExtension.java:140)

      at weblogic.application.internal.ExtensibleModuleWrapper$ActivateStateChange.next(ExtensibleModuleWrapper.java:321)

      at weblogic.application.internal.ExtensibleModuleWrapper$ActivateStateChange.next(ExtensibleModuleWrapper.java:313)

      at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:42)

      at weblogic.application.internal.ExtensibleModuleWrapper.activate(ExtensibleModuleWrapper.java:121)

      at weblogic.application.internal.flow.ModuleListenerInvoker.activate(ModuleListenerInvoker.java:114)

      at weblogic.application.internal.flow.ModuleStateDriver$2.next(ModuleStateDriver.java:192)

      at weblogic.application.internal.flow.ModuleStateDriver$2.next(ModuleStateDriver.java:187)

      at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:42)

      at weblogic.application.internal.flow.ModuleStateDriver.activate(ModuleStateDriver.java:58)

      at weblogic.application.internal.flow.DeploymentCallbackFlow.activate(DeploymentCallbackFlow.java:145)

      at weblogic.application.internal.BaseDeployment$2.next(BaseDeployment.java:729)

      at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:42)

      at weblogic.application.internal.BaseDeployment.activate(BaseDeployment.java:258)

      at weblogic.application.internal.EarDeployment.activate(EarDeployment.java:61)

      at weblogic.application.internal.DeploymentStateChecker.activate(DeploymentStateChecker.java:165)

      at weblogic.deploy.internal.targetserver.AppContainerInvoker.activate(AppContainerInvoker.java:80)

      at weblogic.deploy.internal.targetserver.BasicDeployment.activate(BasicDeployment.java:222)

      at weblogic.deploy.internal.targetserver.BasicDeployment.activateFromServerLifecycle(BasicDeployment.java:414)

      at weblogic.management.deploy.internal.DeploymentAdapter$1.doActivate(DeploymentAdapter.java:51)

      at weblogic.management.deploy.internal.DeploymentAdapter.activate(DeploymentAdapter.java:200)

      at weblogic.management.deploy.internal.AppTransition$2.transitionApp(AppTransition.java:30)

      at weblogic.management.deploy.internal.ConfiguredDeployments.transitionApps(ConfiguredDeployments.java:240)

      at weblogic.management.deploy.internal.ConfiguredDeployments.activate(ConfiguredDeployments.java:169)

      at weblogic.management.deploy.internal.ConfiguredDeployments.deploy(ConfiguredDeployments.java:123)

      at weblogic.management.deploy.internal.DeploymentServerService.resume(DeploymentServerService.java:191)

      at weblogic.management.deploy.internal.DeploymentServerService.start(DeploymentServerService.java:99)

      at weblogic.t3.srvr.SubsystemRequest.run(SubsystemRequest.java:64)

      at weblogic.work.ExecuteThread.execute(ExecuteThread.java:295)

      at weblogic.work.ExecuteThread.run(ExecuteThread.java:254)

       

      Could you please suggest what I am doing worong.

       

      Above problem I have when deploy timer inside big application, I created small test application just with same timer and have anoher problem:

      <Error> <EJB> <MS1> <[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)'> <<anonymous>> <BEA1-0003F3B65D8A> <> <1404977347776> <BEA-011090> <The following error occurred while preparing to invoke the ejbTimeout(javax.ejb.Timer) method of EJB TestTimerService(Application: clusteredTimer-0.0.1-SNAPSHOT, EJBComponent: clusteredTimer-0.0.1-SNAPSHOT.jar).

      java.lang.AssertionError: No transaction policy specified!

        at weblogic.ejb.container.internal.InvocationWrapper.enforceTransactionPolicy(InvocationWrapper.java:268)

        at weblogic.ejb.container.internal.BaseLocalObject.preInvoke(BaseLocalObject.java:88)

        at weblogic.ejb.container.internal.BaseLocalObject.__WL_preInvoke(BaseLocalObject.java:70)

        at weblogic.ejb.container.internal.TimerDrivenLocalObject.preInvoke(TimerDrivenLocalObject.java:35)

        at weblogic.ejb.container.timer.TimerHandlerImpl$TimerObject.execute(TimerHandlerImpl.java:77)

        at weblogic.ejb.container.timer.TimerHandlerImpl.executeTimer(TimerHandlerImpl.java:53)

        at weblogic.ejb.container.timer.ClusteredTimerImpl.timerExpired(ClusteredTimerImpl.java:118)

        at weblogic.scheduler.ejb.internal.EJBListenerWrapper.executeTimer(EJBListenerWrapper.java:59)

        at weblogic.scheduler.ejb.internal.EJBListenerWrapper.timerExpired(EJBListenerWrapper.java:50)

        at weblogic.scheduler.TimerState$1$2.run(TimerState.java:200)

        at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:363)

        at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:146)

        at weblogic.scheduler.TimerState$1.run(TimerState.java:197)

        at weblogic.work.ExecuteThread.execute(ExecuteThread.java:295)

        at weblogic.work.ExecuteThread.run(ExecuteThread.java:254)