1 Reply Latest reply on Feb 22, 2011 4:56 PM by Jusang Lee

    weld-servlet.1.1.0.Beta2 and cdi-api sp4

    Jusang Lee Newbie
      we used to use weld-servlet 1.1.0.Beta1 version with cdi-api SP2 but we found that it has memory leak issue so we changed to use weld-servlet 1.1.0 Beta2 version but beta2 version only works with cdi-api SP4. It starts up ok but for some reason, it does not observes the event correctly.
      It fired even like following, event is for Quartz scheduler.

      @Override
      public void execute(JobExecutionContext context) throws JobExecutionException {

      final Object event = context.getJobDetail().getJobDataMap().get("event");

      LOGGER.info("event {}", event);

      eventProducer.fire(event);

      LOGGER.info("manual event fired {}      ", event);


      And observes the event and do extract if it catches the event like this

              public void manualExtract(@Observes  ExtractManualEvent event) {
                      logger.info("got extract event");
                      extract(event.getStartDate(), event.getEndDate(), event.getUser());
              }

      this used to work with weld-servlet.1.1.0.Beta1 along with cdi-api SP2 but it does not pick up the event
      with weld-servelt.1.1.0.Beta2 and cdi-api SP4....but it fires the event ok though.

      Any help will be much appreciated

      Thanks

        • 1. Re: weld-servlet.1.1.0.Beta2 and cdi-api sp4
          Jusang Lee Newbie
          update...

          it seems like an issue between Quartz and api-cdi SP4 @observes  annotation

          it observes event fired from beanmanager

               beanManager.fireEvent(new ApplicationStartupEvent());

          and this observes correctly

          public void applicationStartup(@Observes final ApplicationStartupEvent event) {
                    logger.info("got event");



          but event fired from javax.enterprise.event.Event like below could not be recognized by @Observes

          private Event<Object> eventProducer;

          final Object event = context.getJobDetail().getJobDataMap().get("event");

          eventProducer.fire(event);


          Any helps will be appreciated