2 Replies Latest reply: Aug 27, 2009 2:11 PM by 465506 RSS

    @SipListener instantiated at deployment time?

    465506
      Summary
      I have annotated some classes with @SipListener (they implement session activation listeners). When I try to deploy an application that contains these classes, it appears that the container is trying to instantiate these classes at deployment time.

      Evidence
      In server log, I see a stack trace that starts with:

      User defined listener com.bea.wcp.sip.engine.SipContainerServletContextListener failed: java.lang.RuntimeException: com.bea.wcp.sip.engine.server.SetupException: Failed to load listener: "com.xxx.MyClass.
      java.lang.RuntimeException: com.bea.wcp.sip.engine.server.SetupException: Failed to load listener: "com.xxx.MyClass
      at com.bea.wcp.sip.engine.server.CanaryContext.activate(CanaryContext.java:493)
      ...
      java.lang.InstantiationException: com.xxx.MyClass
      at java.lang.Class.newInstance0(Class.java:340)
      at java.lang.Class.newInstance(Class.java:308)
      at com.bea.wcp.sip.engine.server.SipComponentContributor.getNewInstance(SipComponentContributor.java:154)

      Experimentation
      I tried defining a zero-args constructor for com.xxx.MyClass, and that seemed to satisfy the container - for that class. But it bombed on the next class that was annotated as a @SipListener.

      Question
      Must I implement zero-args constructors for every class that is a @SipListener? This is laborious, and instances created in such a way have no meaning to the application.

      Thanks,
      Tom.

      Subject edited by: yotommy on Aug 27, 2009 12:50 PM