[jboss-user] [Tomcat, HTTPD, Servlets & JSP] - JSF 1.1 RI + JSTL + JBoss doesn't work

pjsa do-not-reply at jboss.com
Tue Jun 5 20:37:34 EDT 2007


Hi JBoss Community!

I developed an application (using Netbeans 5.5 with Sun AS 9.0) that uses following technologies:

- Database

MySQL 5.0

- Persistence

JPA

- Business Layer

EJB 3.0

- Web

Servlet
JSP with JSTL 1.1
JSF 1.1

Everything work fine in my development environment, but the production environment uses JBoss 4.05 GA. I confess: I'm newbie with JBoss and I am having many problems to deploy my application in this server. Lets go to the issues:

1- JSF doesn't work

When I used My Faces (already installed in the server), JSF page worked, but layout was corrupted. So, I tried use JSF RI 1.1 (as in my development environment). For it:

- I deleted jsf-lib directory
- I upload jsf-api.jar and jsf-impl (and dependencies) to 
<jboss home>/server/default/deploy/jbossweb-tomcat55.sar/ (because I want the .ear be small)
- I modified <jboss home>/server/default/deploy/jbossweb-tomcat55.sar/conf/web.xml, commenting the part below:

      <init-param>
         <param-name>engineOptionsClass</param-name>
         <param-value>
org.jboss.web.tomcat.tc5.jasper.JspServletOptions
</param-value>
      </init-param>
        Specify the jars relative to the jbossweb-tomcat55.sar that should
        be scanned for common tag lib descriptors to include in every war
        deployment.

      <init-param>
         MyFaces tlds
         <param-name>tagLibJar0</param-name>
         <param-value>jsf-libs/myfaces-impl.jar</param-value>
      </init-param>

And finally, I cleaned work and tmp directories. After it, I restart JBoss, but when I test the application, I get the following error:

java.lang.NoClassDefFoundError: org.apache.myfaces.taglib.core.ViewTag
	at org.apache.jsp.views.apps.artigos.listarArtigos_jsp._jspx_meth_f_view_0(listarArtigos_jsp.java:115)
	at org.apache.jsp.views.apps.artigos.listarArtigos_jsp._jspService(listarArtigos_jsp.java:91)
	at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
	at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:334)
	at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
	at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
	at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:672)
	at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:463)
	at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:398)
	at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:301)
	at com.sun.faces.context.ExternalContextImpl.dispatch(ExternalContextImpl.java:322)
	at com.sun.faces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:147)
	at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:87)
	at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:200)
	at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:117)
	at javax.faces.webapp.FacesServlet.service(FacesServlet.java:198)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
	at com.sivople.web.site.filters.LoadNewsControllerFilter.doFilter(LoadNewsControllerFilter.java:58)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
	at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
	at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:175)
	at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:74)
	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
	at org.jboss.web.tomcat.tc5.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:156)
	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
	at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
	at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
	at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
	at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
	at java.lang.Thread.run(Thread.java:595)

2- JSTL Expression Language are not been interpreted

Code like this:

<c:forEach items="${sessionScope.news}" var="item">
            
	<a href="/sivople/views/apps/noticias/lerNoticia.jsp?noticia=<c:out value='${item.contentUrl}' />">               		<c:out value="${item.title}" />   
	
                            
</c:forEach>

is rendering as below:

               			${item.title}   


In this case, there isn't errors in the log.

Any sugestions?

*** My web.xml: ***

<?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">
    
        <listener-class>com.sun.faces.config.ConfigureListener</listener-class>
    
    <context-param>
        <param-name>com.sun.faces.verifyObjects</param-name>
        <param-value>false</param-value>
    </context-param>
    <context-param>
        <param-name>com.sun.faces.validateXml</param-name>
        <param-value>true</param-value>
    </context-param>
    <context-param>
        <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
        <param-value>client</param-value>
    </context-param>
    
        <servlet-name>Faces Servlet</servlet-name>
        <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
        <load-on-startup>1</load-on-startup>
    
    
        <servlet-name>ViewGalleryControllerServlet</servlet-name>
        <servlet-class>com.sivople.web.site.servlets.ViewGalleryControllerServlet</servlet-class>
        <init-param>
            <param-name>forwardUrl</param-name>
            <param-value>/views/apps/verGaleria.jsp</param-value>
        </init-param>
           
    
        <filter-name>LoadNewsControllerFilter</filter-name>
        <filter-class>com.sivople.web.site.filters.LoadNewsControllerFilter</filter-class>
        
    <servlet-mapping>
        <servlet-name>Faces Servlet</servlet-name>
        <url-pattern>*.jsf</url-pattern>
    </servlet-mapping>
    <servlet-mapping>
        <servlet-name>ViewGalleryControllerServlet</servlet-name>
        <url-pattern>/servlet/galerias/ViewGalleryControllerServlet</url-pattern>
    </servlet-mapping>  
    <filter-mapping>
        <filter-name>LoadNewsControllerFilter</filter-name>
        <url-pattern>/*</url-pattern>
    </filter-mapping>    
    <session-config>
        <session-timeout>
            30
        </session-timeout>
    </session-config>
    <welcome-file-list>
        <welcome-file>
            index.jsp
        </welcome-file>
    </welcome-file-list>
    <jsp-config>
        
            <taglib-uri>
                http://java.sun.com/jstl/core
            </taglib-uri>
            <taglib-location>
                /WEB-INF/c.tld
            </taglib-location>
        
    </jsp-config>
</web-app>



View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4051560#4051560

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4051560



More information about the jboss-user mailing list