2 Replies Latest reply on Jul 28, 2011 10:57 AM by hantsy

    Seam 3 Rest module does not support Servlet Container?

    hantsy

      I tried to used Seam 3 Rest module in our project, but when I added seam modules in pom.xml.
      When Tomcat 7 starts up, an NPE exception was threw, caused by the SeamRestStartup class.


      It is a web Listener with @WebListener annotation. It seems the @Inject object can not be ready when called them.


      In before tomcat 6, I did not encountered this problem, because the @WebListener annotation was not recognized.


      In the Rest module doc, it indicates It MUST be used in a JEE6 container. It means Rest modules can not be used in servlet container(tomcat 7)?

        • 1. Re: Seam 3 Rest module does not support Servlet Container?
          jharting

          Seam REST requires a CDI implementation. Are you using Weld Servlet with your application? Weld's docs says Servlet injection is supported with Tomcat 6. I am not sure what's the situation with Tomcat 7 and Listener injection, though.


          If you open a JIRA issue I can try to make the module less EE6-dependent.

          • 2. Re: Seam 3 Rest module does not support Servlet Container?
            hantsy

            I configured the project according to the description in the doc.
            In servlet 2.5 container(tomcat 6), there is almost no configurtion, a Applcation(and registered in web.xml), but in servlet 3.0 container(tomcat 7), the SeamRestStartup(with a @WebListener annotation) was invoked automatically.
            But i noticed weld info when tocmat starts up.
            It indicated that weld can not inject object into Listener.