5 Replies Latest reply on Jun 22, 2007 10:47 AM by hattifnat

    http://java.sun.com/jsf/html cannot be resolved

    hattifnat

      Hi!

      I'm using JBoss AS 4.2.0 and deploying a WAR file consisting of JSP and JSF pages. I use Apache MyFaces Tomahawk 1.1.6, which is in my WAR's WEB-INF/lib directory. I do not use MyFaces Core - i want to use the JBoss's bundled JSF libraries. The problem is: deployment of the WAR goes fine, the main index.jsp page works fine, but when I want to enter a JSF page, a following exception is thrown on the JBoss console and the page is blank.

      org.apache.jasper.JasperException: The absolute uri: http://java.sun.com/jsf/html cannot be resolved in either web.xml or the jar files deployed with this application
       at org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:51)
       at org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:409)
       at org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:116)
       at org.apache.jasper.compiler.TagLibraryInfoImpl.generateTLDLocation(TagLibraryInfoImpl.java:315)
       at org.apache.jasper.compiler.TagLibraryInfoImpl.<init>(TagLibraryInfoImpl.java:148)
       at org.apache.jasper.compiler.Parser.parseTaglibDirective(Parser.java:420)
       at org.apache.jasper.compiler.Parser.parseDirective(Parser.java:476)
       at org.apache.jasper.compiler.Parser.parseElements(Parser.java:1426)
       at org.apache.jasper.compiler.Parser.parse(Parser.java:133)
       at org.apache.jasper.compiler.ParserController.doParse(ParserController.java:216)
       at org.apache.jasper.compiler.ParserController.parse(ParserController.java:103)
       at org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:167)
       at org.apache.jasper.compiler.Compiler.compile(Compiler.java:306)
       at org.apache.jasper.compiler.Compiler.compile(Compiler.java:286)
       at org.apache.jasper.compiler.Compiler.compile(Compiler.java:273)
       at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:566)
       at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:311)
       at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320)
       at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
       at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
       at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:687)
       at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:469)
       at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:403)
       at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:301)
       at com.sun.faces.context.ExternalContextImpl.dispatch(ExternalContextImpl.java:408)
       at com.sun.faces.application.ViewHandlerImpl.executePageToBuildView(ViewHandlerImpl.java:439)
       at com.sun.faces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:114)
       at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:106)
       at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:251)
       at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:144)
       at javax.faces.webapp.FacesServlet.service(FacesServlet.java:245)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
       at org.apache.myfaces.webapp.filter.ExtensionsFilter.doFilter(ExtensionsFilter.java:147)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
       at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
       at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
       at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
       at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:179)
       at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
       at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
       at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)
       at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:156)
       at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
       at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:241)
       at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
       at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:580)
       at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
       at java.lang.Thread.run(Thread.java:595)


      My web.xml file is such:

      <?xml version="1.0" encoding="UTF-8"?>
      <web-app 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" version="2.4">
      
       <servlet>
       <servlet-name>jsp</servlet-name>
       <servlet-class>org.apache.jasper.servlet.JspServlet</servlet-class>
       <init-param>
       <param-name>compilerTargetVM</param-name>
       <param-value>1.5</param-value>
       </init-param>
       <init-param>
       <param-name>compilerSourceVM</param-name>
       <param-value>1.5</param-value>
       </init-param>
       </servlet>
      
       <filter>
       <filter-name>extensionsFilter</filter-name>
       <filter-class>org.apache.myfaces.webapp.filter.ExtensionsFilter</filter-class>
       <init-param>
       <description>Set the size limit for uploaded files.
       Format: 10 - 10 bytes
       10k - 10 KB
       10m - 10 MB
       1g - 1 GB</description>
       <param-name>uploadMaxFileSize</param-name>
       <param-value>2m</param-value>
       </init-param>
       <init-param>
       <description>Set the threshold size - files
       below this limit are stored in memory, files above
       this limit are stored on disk.
      
       Format: 10 - 10 bytes
       10k - 10 KB
       10m - 10 MB
       1g - 1 GB</description>
       <param-name>uploadThresholdSize</param-name>
       <param-value>100k</param-value>
       </init-param>
       </filter>
       <filter-mapping>
       <filter-name>extensionsFilter</filter-name>
       <url-pattern>*.jsf</url-pattern>
       </filter-mapping>
       <filter-mapping>
       <filter-name>extensionsFilter</filter-name>
       <url-pattern>/faces/*</url-pattern>
       </filter-mapping>
      
       <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>*.jsf</url-pattern>
       </servlet-mapping>
      
       <welcome-file-list>
       <welcome-file>index.jsp</welcome-file>
       </welcome-file-list>
      </web-app>


      My JSF page (called "page.jsp" but accessed as "page.jsf")
      <%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
      <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
      <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
      <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
      <%@ taglib uri="http://myfaces.apache.org/tomahawk" prefix="t" %>
      
      <html>
      <head>
      <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
      <link rel="stylesheet" href="styles.css" type="text/css">
      <title></title>
      </head>
      <body>
      <table>
       <tr>
       <td id="menu">
       <%@include file="menu.html" %>
       </td>
       <td id="main">
       <f:view>
      
       <h:form id="some_id">
       HELLO
       </h:form>
       </f:view>
       </td>
       </tr>
      </table>
      </body>
      </html>"


      The same WAR, but with MyFaces included in WEB-INF/lib (MyFaces API and Impl) works fine on Tomcat 5.5.23. Can anybody help me?

        • 1. Re: http://java.sun.com/jsf/html cannot be resolved
          peterj

          This error means that the server was not able to find the *.tld file for the tag library. I located the *.tld file: html_basic.tld file in server/xxx/deploy/jboss-web.deployer/jsf-libs/jsf-impl.jar. Apparently the server is not picking it up. You might want to open a JIRA issue, I agree with you that if the app server supplies the JSF libraries that they should automatically apply to all web applications.

          • 2. Re: http://java.sun.com/jsf/html cannot be resolved
            hattifnat

            Thanks a lot for the reply. I will try with extracting the TLDs, though meanwhile I found this post:
            http://jboss.com/index.html?module=bb&op=viewtopic&t=101802
            It doesn't explain much in my situation - I deleted both tmp/ and work/ there are no signs of MyFaces in my app (aparts from pure Tomahawk), but it gave me new paths to follow. Tomorrow I'll try to expand the simplest example from http://wiki.jboss.org/wiki/Wiki.jsp?page=HelloJSF which executes successfully. I'll try to locate the cause of the crash and if nothing helps, I'll use the "copy TLDs" solution.

            • 3. Re: http://java.sun.com/jsf/html cannot be resolved
              hattifnat

              Okaaaaay... After long debugging (the constant caching in the work/ directory was very misleading ;/) I found the reason of the error. The following part of web.xml was causing it:

              <servlet>
               <servlet-name>jsp</servlet-name>
               <servlet-class>org.apache.jasper.servlet.JspServlet</servlet-class>
               <init-param>
               <param-name>compilerTargetVM</param-name>
               <param-value>1.5</param-value>
               </init-param>
               <init-param>
               <param-name>compilerSourceVM</param-name>
               <param-value>1.5</param-value>
               </init-param>
               </servlet>

              I found at the Tomcat forum that such configuration would allow to run JSP pages with Java 5 style (I wanted to use generic collections...). It successfully worked on Tomcat, but here I see it causes problems. The solution for that was to put the two init-params in the main server/xxx/deploy/jboss-web.deployer/conf/web.xml under the JSP servlet configuration (line 253). Phew... I hope it helps somebody in the future...

              • 4. Re: http://java.sun.com/jsf/html cannot be resolved
                peterj

                If this entry goes into the global web.xml file, perhaps this fix should be made in subversion so that it can be included as part of the next release. Should a JIRA be filed?

                • 5. Re: http://java.sun.com/jsf/html cannot be resolved
                  hattifnat

                  Sorry for not responding - my JSF work absorbed me ;) Well, as much as I tested, the JSP servlet snippet works fine on pure Tomcat 5.5 - it overrides the global web.xml allowing project specific configuration. Thus, I can have Java 5 style code without disturbing the whole server. I think it should be possible to do so in JBoss, too. But certainly it should *not* be so, that putting such configuration in the project web.xml crashes the JSF page. So I would say, it should be filed as a JIRA issue.
                  And now the funny part - I have never used JIRA ;) Should I file the issue myself? Create some test case (test configuration)? Sorry for the newbie questions ;) I will be helpful with pleasure.