1 Reply Latest reply on Apr 20, 2010 12:14 AM by Arbi Sookazian

    java.lang.ClassCastException: org.jboss.seam.remoting.Remoting cannot be cast to javax.servlet.Servlet

    Philip Murphy Newbie

      Trying to use Seam Remoting with the following configuration, however, I get a ClassCastException on deployment.


      java.lang.ClassCastException: org.jboss.seam.remoting.Remoting cannot be cast to javax.servlet.Servlet


           <servlet>
                <servlet-name>Seam Remoting Servlet</servlet-name>
                <servlet-class>org.jboss.seam.remoting.Remoting</servlet-class>
                <load-on-startup>1</load-on-startup>
           </servlet>
           <servlet-mapping>
                <servlet-name>Seam Remoting Servlet</servlet-name>
                <url-pattern>/seam/resource/remoting/*</url-pattern>
           </servlet-mapping>
      



      I am using JBoss 5.1.0 GA with Seam Seam 2.2.0 CR1.


      Any ideas?


      Thanks,


      Philip

        • 1. Re: java.lang.ClassCastException: org.jboss.seam.remoting.Remoting cannot be cast to javax.servlet.Servlet
          Arbi Sookazian Master

          I would recommend trying Seam 2.2.0.GA with JBoss 5.x or JBoss 4.2.x.


          Compare your web.xml with the ones in the remoting examples of the distro.


          Here's the web.xml for the chatroom example:


          <?xml version="1.0" encoding="UTF-8"?>
          
          <web-app version="2.5"
              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">
          
              <!-- Seam -->
             
              <listener>
                  <listener-class>org.jboss.seam.servlet.SeamListener</listener-class>
              </listener>
          
              <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> 
              
              <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>/seam/resource/*</url-pattern>
              </servlet-mapping>      
          
              <context-param>
                  <param-name>facelets.DEVELOPMENT</param-name>
                  <param-value>true</param-value>
              </context-param>
          
              <context-param>
                  <param-name>javax.faces.DEFAULT_SUFFIX</param-name>
                  <param-value>.xhtml</param-value>
              </context-param>
          
              <!-- Faces Servlet -->
              
              <servlet>
                  <servlet-name>Faces Servlet</servlet-name>
                  <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
                  <load-on-startup>1</load-on-startup>
              </servlet>
          
              <servlet-mapping>
                  <servlet-name>Faces Servlet</servlet-name>
                  <url-pattern>*.seam</url-pattern>
              </servlet-mapping>
          
          </web-app>