0 Replies Latest reply on Mar 14, 2009 2:05 PM by as6o

    Seam with Enunciate not injecting

    as6o

      I'm newish to Seam and am trying to create a minimal Seam runtime (no JSF) for use with web services constructed via Enunciate.  I have Seam registering components and web services are deployed and working but it doesn't appear that injection is working.


      The url for the web service is http://localhost:8080/sharecake/rest/test/name


      ServiceTest is shown as a registered component when Seam starts up as is CurrentTime.  In fact, all of the standard Seam components appear to be properly registered.


      Any help is greatly appreciated.


      My simple web service/component looks like:


      @Name("ServiceTest")
      @WebService
      @Path("/test")
      public class ServiceTest {
      
           @In Date currentTime;
           
           @GET
           @Path("/name")
           public User getName() {
                User user = new User();
                user.setFirstName("John");
                user.setLastName("Doe");
                user.setDate(currentTime);
                return user;
           }
      }
      



      but currentTime appears to always be null.  John and Doe come back in the user xml fine.


      web.xml looks like (I've been trying different combinations):


      <web-app id="sharecake" version="2.4" 
           xmlns="http://java.sun.com/xml/ns/j2ee" 
           xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
           xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
      
           <listener>
                <listener-class>org.jboss.seam.servlet.SeamListener</listener-class>
           </listener>
      <servlet>
                <servlet-name>Seam Resource Servlet</servlet-name>
                <servlet-class>org.jboss.seam.servlet.SeamResourceServlet</servlet-class>
           </servlet>
           <servlet-mapping>
                <servlet-name>Seam Resource Servlet</servlet-name>
                <url-pattern>/rest/*</url-pattern>
           </servlet-mapping>
       <filter>
                <filter-name>Seam Filter</filter-name>
                <filter-class>org.jboss.seam.servlet.SeamFilter</filter-class>
           </filter>
           <filter-mapping>
                <filter-name>Seam Filter</filter-name>
                <url-pattern>/*</url-pattern>
           </filter-mapping>
      <!--<filter>
          <filter-name>Seam Context Filter</filter-name>
          <filter-class>org.jboss.seam.web.ContextFilter</filter-class>
      </filter>
      
      <filter-mapping>
          <filter-name>Seam Context Filter</filter-name>
          <url-pattern>/*</url-pattern>
      </filter-mapping>-->
      
      </web-app>



      and components.xml looks like:



      <?xml version="1.0" encoding="UTF-8"?>
      <components xmlns="http://jboss.com/products/seam/components"
                  xmlns:core="http://jboss.com/products/seam/core"
                  xmlns:persistence="http://jboss.com/products/seam/persistence"
                  xmlns:drools="http://jboss.com/products/seam/drools"
                  xmlns:bpm="http://jboss.com/products/seam/bpm"
                  xmlns:security="http://jboss.com/products/seam/security"
                  xmlns:mail="http://jboss.com/products/seam/mail"
                  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                  xmlns:web="http://jboss.com/products/seam/web"
                  xsi:schemaLocation=
                      "http://jboss.com/products/seam/core http://jboss.com/products/seam/core-2.1.xsd
                       http://jboss.com/products/seam/persistence http://jboss.com/products/seam/persistence-2.1.xsd
                       http://jboss.com/products/seam/drools http://jboss.com/products/seam/drools-2.1.xsd
                       http://jboss.com/products/seam/bpm http://jboss.com/products/seam/bpm-2.1.xsd
                       http://jboss.com/products/seam/security http://jboss.com/products/seam/security-2.1.xsd
                       http://jboss.com/products/seam/mail http://jboss.com/products/seam/mail-2.1.xsd
                       http://jboss.com/products/seam/web http://jboss.com/products/seam/web-2.1.xsd
                       http://jboss.com/products/seam/components http://jboss.com/products/seam/components-2.1.xsd">
      
           <web:context-filter url-pattern="/rest/*"/>
      </components>