1 Reply Latest reply: May 1, 2013 9:19 AM by Vijaya Moderator -Oracle RSS

    Weblogic 12c cluster and EJB 3.1 timers

    895406
      Hello!

      I'm using Weblogic 12c (12.1.1.0) Cluster.
      I configured the cluster to use database for EJB timers (ACTIVE and WEBLOGIC_TIMERS tables). I created a persistence store with logical name 'timerst'.

      The timer bean:

      @Stateless
      public class TimerTestBean {
           private Logger logger = Logger.getLogger(TimerTestBean.class);

           @Resource
           TimerService timerService;

           public void settimer() {
                logger.info("settimer");
                timerService.createTimer(30000, "New timer");
           }

           @Timeout
           public void zszszszs(Timer arg0) {
                logger.info("Tick");
                settimer();
           }
      }

      weblogic-ejb-jar.xml:

      <?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">
      <!--weblogic-version:12.1.1-->
      <wls:weblogic-enterprise-bean>
      <wls:ejb-name>TimerTestBean</wls:ejb-name>
      <wls:stateless-session-descriptor>
      <wls:timer-descriptor>
      <wls:persistent-store-logical-name>timerst</wls:persistent-store-logical-name>
      </wls:timer-descriptor>
      </wls:stateless-session-descriptor>
      </wls:weblogic-enterprise-bean>

      <wls:timer-implementation>Clustered</wls:timer-implementation>
      </wls:weblogic-ejb-jar>

      It seems the timer starts normally.

      When there timer fires, I've got the following error message:
      java.lang.ClassCastException: timertest.TimerTestBean_9kqf6o_Impl cannot be cast to javax.ejb.TimedObject

      What is wrong?

      Thanks

      Balazs

      Edited by: 892403 on 2013.02.19. 10:43

      Edited by: 892403 on 2013.02.19. 10:44