2 Replies Latest reply on Nov 9, 2006 9:10 AM by Tim Lam

    JBoss 4.0.5 servlet filter problem in web.xml

    ray lai Newbie

      I write a simple JSF hello world page index.jsp and deploy to JBoss 4.0.5. it seems that JBoss can only accept .faces extension, despite I define the Faces servlet filter with *.jsp.

      1. My simple JSF apps has only one page index.jsp,
      which is a simple hello world app, e.g.

      Hello world, hi there.

      2. I have a simple web.xml that defines the servlet filter with *.jsp (instead of .faces).
      <?xml version="1.0" encoding="UTF-8"?>

      <web-app version="2.4"


      <servlet-name>Faces Servlet</servlet-name>

      <servlet-name>Faces Servlet</servlet-name>

      <!-- Welcome File List -->


      3. A simple, vanilla faces-config.xml
      <?xml version="1.0" encoding="UTF-8"?>




      1. upon successful deployment to JBoss, if I type

      JBoss will generate "non-stoppable" exceptions in the server console for a few minutes, and ends up with an exception on the Web browser:


      javax.servlet.ServletException: javax.servlet.ServletException

      root cause

      javax.faces.FacesException: javax.servlet.ServletException

      2. if I type

      the system will work and show hello world message.

      Note: if I put *.faces in the faces servlet filter in the web.xml, the system will work as well.

      3. JBoss does not seem to accept the faces servlet with a non-*.faces entry. I understand that *.faces is a recommended practice from the JSF spec, but in reality, many people use *.jsf or even *.jsp in the servlet filter.

      Implication - I can only use *.faces in the URL for JSF apps.

      Could anyone tell me whether I miss anything, or whether this is a specific JBoss implementation?


        • 1. Re: JBoss 4.0.5 servlet filter problem in web.xml
          ray lai Newbie

          This setup will work:

          1. web.xml :

          <!-- Faces Servlet Mapping -->
          <servlet-name>Faces Servlet</servlet-name>

          <!-- Welcome File List -->

          2. In the browser, enter

          or http://localhost:8080/xxx/index.faces
          or http://localhost:8080/xxx/index.jsp

          However, if you specify
          *.jsp in the url-pattern of the web.xml,
          JBoss will spin a few minutes when generating exceptions

          I deploy the same JSF app in BEA Weblogic or Sun Java, and I don't have the same problem.


          Any pointer to why?
          Is this a bug in JBoss's implementation of the servlet filter?

          • 2. Re: JBoss 4.0.5 servlet filter problem in web.xml
            Tim Lam Newbie

            I've got a different problem. I am trying to build a document literal web service in JBoss 4.0.5 and can't get around this exception:

            org.jboss.ws.WSException: Cannot obtain java/xml type mapping for: {http://www.w3.org/2001/XMLSchema}base64Binary

            Here's what my wsdl looks like:

            <SOAP:binding style="document" transport="http://schemas.xmlsoap.org/soap/http">

            <SOAP:operation style="document" soapAction="Ping">
            < input>
            <SOAP:body use="literal"/>
            <mime:content part="data" type="gzip"/>
            </ input>
            < output>
            <SOAP:body use="literal"/>
            </ output>


            In my mapping.xml file that wscompile generated, this mapping was generated for the data mime:content:


            My ultimate goal is to allow a web service request containing parameters passed via a normal web service request and allow an attachment of a base64 encoded binary file. Is this a bug in JBoss 4.0.5?