1 Reply Latest reply on Feb 10, 2014 1:44 PM by Jonathan Fuerth

    Can someone define a working  UberFire Errai JAXRS web.xml?

    Tim McClure Apprentice

      I am trying to get ERRAI JAXRS working with UberFire - I want my UberFire MVP communication to be JAXRS - I have a working ERRAI JAXRS project and a working UberFire but when I try to combine them I get numerous errors based on the approach I take.  I feel the issue is probably with my web.xml

       

      Here is my Errai JAXRS web.xml:

      <?xml version="1.0" encoding="UTF-8"?>

       

       

      <web-app xmlns="http://java.sun.com/xml/ns/javaee" 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/web-app_2_5.xsd"

        version="2.5">

       

       

        <servlet-mapping>

        <servlet-name>javax.ws.rs.core.Application</servlet-name>

        <url-pattern>/</url-pattern>

        </servlet-mapping>

       

       

        <servlet-mapping>

        <servlet-name>default</servlet-name>

        <url-pattern>*.html</url-pattern>

        </servlet-mapping>

       

       

        <servlet-mapping>

        <servlet-name>default</servlet-name>

        <url-pattern>*.css</url-pattern>

        </servlet-mapping>

       

       

        <servlet-mapping>

        <servlet-name>default</servlet-name>

        <url-pattern>*.js</url-pattern>

        </servlet-mapping>

       

       

        <servlet-mapping>

        <servlet-name>default</servlet-name>

        <url-pattern>*.png</url-pattern>

        </servlet-mapping>

       

       

        <servlet-mapping>

        <servlet-name>default</servlet-name>

        <url-pattern>*.gif</url-pattern>

        </servlet-mapping>

       

       

        <servlet-mapping>

        <servlet-name>default</servlet-name>

        <url-pattern>*.jpg</url-pattern>

        </servlet-mapping>

       

        <welcome-file-list>

        <welcome-file>RestDemo.html</welcome-file>

        </welcome-file-list>

      </web-app>

       

      My UberFire web.xml:

      <?xml version="1.0" encoding="UTF-8"?>

      <web-app xmlns="http://java.sun.com/xml/ns/javaee"

               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/web-app_2_5.xsd"

               version="2.5">

       

       

        <distributable/>

       

       

        <filter>

          <filter-name>UberFire Security Filter</filter-name>

          <filter-class>

            org.uberfire.security.server.UberFireSecurityFilter

          </filter-class>

          <init-param>

            <param-name>org.uberfire.cookie.id</param-name>

            <param-value>harness.showcase</param-value>

          </init-param>

        </filter>

       

       

       

       

        <filter-mapping>

          <filter-name>UberFire Security Filter</filter-name>

            <url-pattern>/*</url-pattern>

        </filter-mapping>

       

        <servlet>

          <servlet-name>UberFireServlet</servlet-name>

          <servlet-class>org.uberfire.server.UberfireServlet</servlet-class>

          <load-on-startup>1</load-on-startup>

        </servlet>

       

       

        <servlet-mapping>

          <servlet-name>UberFireServlet</servlet-name>

          <url-pattern>/com.apimg.Harness/Harness.html</url-pattern>

        </servlet-mapping>

       

       

        <servlet-mapping>

        <servlet-name>javax.ws.rs.core.Application</servlet-name>

        <url-pattern>/com.apimg.Harness/dbconnections/*</url-pattern>

        </servlet-mapping>

        <servlet>

          <servlet-name>UberFireImageServlet</servlet-name>

          <servlet-class>org.uberfire.server.UberfireImageServlet</servlet-class>

          <init-param>

            <param-name>org.uberfire.images.paths</param-name>

            <param-value>/com.apimg.Harness</param-value>

          </init-param>

          <load-on-startup>1</load-on-startup>

        </servlet>

        <servlet-mapping>

          <servlet-name>UberFireImageServlet</servlet-name>

          <url-pattern>/com.apimg.Harness/uberFireImages/*</url-pattern>

        </servlet-mapping>

       

       

        <servlet>

          <!-- NOTE: the integration-test profile uses this web.xml. Integration tests only work properly

      with the DefaultBlockingServlet. If you change this setting, make a backup of this web.xml

      (perhaps under src/integration-test-settings/web.xml and alter the integration-test

      profile in pom.xml to use that. -->

          <servlet-name>ErraiServlet</servlet-name>

          <servlet-class>org.jboss.errai.bus.server.servlet.DefaultBlockingServlet</servlet-class>

      <init-param>

          <param-name>auto-discover-services</param-name>

          <param-value>true</param-value>

          </init-param>

          <!--

          <init-param>

            <param-name>service-locator</param-name>

            <param-value>org.jboss.errai.cdi.server.CDIServiceLocator</param-value>

          </init-param>

           -->

          <load-on-startup>1</load-on-startup>

        </servlet>

       

       

        <servlet-mapping>

          <servlet-name>ErraiServlet</servlet-name>

          <url-pattern>*.erraiBus</url-pattern>

        </servlet-mapping>

       

       

       

       

        <servlet>

          <servlet-name>FileUploadServlet</servlet-name>

          <servlet-class>org.uberfire.server.FileUploadServlet</servlet-class>

        </servlet>

        <servlet-mapping>

          <servlet-name>FileUploadServlet</servlet-name>

          <url-pattern>/com.apimg.Harness/defaulteditor/upload/*</url-pattern>

        </servlet-mapping>

       

       

        <servlet>

          <servlet-name>FileDownloadServlet</servlet-name>

          <servlet-class>org.uberfire.server.FileDownloadServlet</servlet-class>

        </servlet>

        <servlet-mapping>

          <servlet-name>FileDownloadServlet</servlet-name>

          <url-pattern>/com.apimg.Harness/defaulteditor/download/*</url-pattern>

        </servlet-mapping>

       

       

        <listener>

          <listener-class>org.jboss.weld.environment.servlet.Listener</listener-class>

        </listener>

       

       

        <resource-env-ref>

       

       

      How do I combine them?

       

      Tim

          <description>Object factory for the CDI Bean Manager</description>

          <resource-env-ref-name>BeanManager</resource-env-ref-name>

          <resource-env-ref-type>javax.enterprise.inject.spi.BeanManager</resource-env-ref-type>

        </resource-env-ref>

       

       

        <resource-env-ref>

          <description>Object factory for the Errai Service</description>

          <resource-env-ref-name>ErraiService</resource-env-ref-name>

          <resource-env-ref-type>org.jboss.errai.bus.server.service.ErraiService</resource-env-ref-type>

        </resource-env-ref>

       

       

        <context-param>

          <param-name>errai.properties</param-name>

          <param-value>/WEB-INF/errai.properties</param-value>

        </context-param>

       

       

        <context-param>

          <param-name>login.config</param-name>

          <param-value>/WEB-INF/login.config</param-value>

        </context-param>

       

       

        <context-param>

          <param-name>users.properties</param-name>

          <param-value>/WEB-INF/users.properties</param-value>

        </context-param>

       

       

        <welcome-file-list>

          <welcome-file>index.jsp</welcome-file>

        </welcome-file-list>

      How do I combine them?

       

      Tim