3 Replies Latest reply on Feb 27, 2003 9:40 PM by vincent

    struts.taglib.tiles.InsertTag error during runtime

    vincent Newbie

      Hi all,
      I'm having a problem during running the struts application on JBoss server. The application deployed successfully on JBoss server, but, most of the time the error will occur when i try to call the first page of the
      application. It will only run smootly if i restart the JBoss server or perform a rebuild on the application again, or delete the temporary deploy folder in JBoss server serveral times.

      Please help!!!

      Server : jboss-3.0.4_tomcat-4.0.6 /
      jboss-3.0.4_tomcat-4.1.12 /
      jboss-3.0.4
      Struts : 1.1 rc 1
      jdk : j2sdk1.4.1
      j2ee : j2sdkee1.3.1
      O/S : window 2000

      java.lang.NullPointerException
      at org.apache.struts.taglib.tiles.InsertTag.processAttribute(InsertTag.java:593
      )
      at
      org.apache.struts.taglib.tiles.InsertTag.createTagHandler(InsertTag.java:390
      )
      at org.apache.struts.taglib.tiles.InsertTag.doStartTag(InsertTag.java:342)
      at org.apache.jsp.classicLayout$jsp._jspService(classicLayout$jsp.java:183)
      at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:107)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
      at
      org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.ja
      va:201)
      at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:381)
      at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:473)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
      at
      org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.
      java:683)
      at
      org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatch
      er.java:431)
      at
      org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher
      .java:355)
      at
      org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:10
      58)
      at
      org.apache.struts.tiles.TilesRequestProcessor.doForward(TilesRequestProcesso
      r.java:269)
      at
      org.apache.struts.tiles.TilesRequestProcessor.processTilesDefinition(TilesRe
      questProcessor.java:249)
      at
      org.apache.struts.tiles.TilesRequestProcessor.processForwardConfig(TilesRequ
      estProcessor.java:303)
      at
      org.apache.struts.action.RequestProcessor.processActionForward(RequestProces
      sor.java:401)
      at
      org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:279)
      at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1420)
      at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:502)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
      at
      org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Application
      FilterChain.java:247)
      at
      org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterCh
      ain.java:193)
      at
      com.ilium.eapps.syswar.filter.SetCharacterEncodingFilter.doFilter(SetCharact
      erEncodingFilter.java:147)
      at
      org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Application
      FilterChain.java:213)
      at
      org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterCh
      ain.java:193)
      at
      org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.ja
      va:243)
      at
      org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5
      66)
      at
      org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
      at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
      at
      org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.ja
      va:190)
      at
      org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5
      66)
      at
      org.apache.catalina.valves.CertificatesValve.invoke(CertificatesValve.java:2
      46)
      at
      org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5
      64)
      at
      org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
      at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
      at
      org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2347)
      at
      org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180
      )
      at
      org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5
      66)
      at
      org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.
      java:170)
      at
      org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5
      64)
      at
      org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:170
      )
      at
      org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5
      64)
      at
      org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:468)
      at
      org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5
      64)
      at
      org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
      at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
      at
      org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java
      :174)
      at
      org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5
      66)
      at
      org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
      at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
      at
      org.apache.catalina.connector.http.HttpProcessor.process(HttpProcessor.java:
      1027)
      at
      org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor.java:1125
      )
      at java.lang.Thread.run(Thread.java:536)
      tq, vincent

        • 1. Re: struts.taglib.tiles.InsertTag error during runtime
          Pratik Patel Newbie

          It might be helpful if you actually post where this error is occuring in your JSP/Tiles template and a copy of said JSP/Tile file.


          cheers
          prp

          • 2. Re: struts.taglib.tiles.InsertTag error during runtime
            vincent Newbie

            Attached is the source code that involved in the cycle, hope this would help...

            *************
            * index.jsp *
            *************
            <%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>



            <meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
            Front-Page
            <%if(request.getServerPort() == 80) {%>

            <%} else {%>

            <%}%>



            <h1>

            if(top.location!=self.location){top.location = self.location.href}

            </h1>









             
             



             


             
             


             
             


             



             

            <html:link href="main.do">ENTER</html:link>






             
             





             




            *********************
            * struts-config.xml *
            *********************
            <?xml version="1.0" encoding="ISO-8859-1"?>
            <!DOCTYPE struts-config PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 1.1//EN" "http://jakarta.apache.org/struts/dtds/struts-config_1_1.dtd">
            <struts-config>
            <!-- ========== Data Source Configuration =============================== -->
            <data-sources>
            <data-source>
            <set-property property="autoCommit" value="false" />
            <set-property property="description" value="Database for Application Name" />
            <set-property property="driverClass" value="org.postgresql.Driver" />
            <set-property property="maxCount" value="30" />
            <set-property property="minCount" value="5" />
            <set-property property="url" value="jdbc:postgresql://10.0.1.10/temp" />
            <set-property property="user" value="postgres" />
            <set-property property="password" value="postgres" />
            </data-source>
            <data-source key="DBTestdb">
            <set-property property="autoCommit" value="false" />
            <set-property property="description" value="Database for Application Name" />
            <set-property property="driverClass" value="org.postgresql.Driver" />
            <set-property property="maxCount" value="30" />
            <set-property property="minCount" value="5" />
            <set-property property="url" value="jdbc:postgresql://10.0.1.10/testdb" />
            <set-property property="user" value="postgres" />
            <set-property property="password" value="postgres" />
            </data-source>
            </data-sources>

            <!-- ========== Global Forward Definitions =============================== -->
            <global-forwards>

            </global-forwards>

            <!-- ========== Action Mapping Definitions =============================== -->
            <action-mappings>











            </action-mappings>

            <!--http://localhost:8080/toModule.do?prefix=moduleB&page=index.do-->

            <!-- ========== Controller Configuration ================================ -->


            <!-- ========== Message Resources Definitions ============================ -->
            <!--message-resources parameter="resources.application" /-->

            <!-- ========== Plug Ins Configuration ================================= -->
            <plug-in className="org.apache.struts.tiles.TilesPlugin">
            <set-property property="definitions-config" value="/WEB-INF/tiles-def.xml" />
            <set-property property="definitions-debug" value="2" />
            <set-property property="definitions-parser-details" value="2" />
            <set-property property="definitions-parser-validate" value="true" />
            <set-property property="moduleAware" value="true" />
            </plug-in>
            </struts-config>


            ****************
            * tile-def.xml *
            ****************
            <!DOCTYPE tiles-definitions PUBLIC
            "-//Apache Software Foundation//DTD Tiles Configuration//EN"
            "http://jakarta.apache.org/struts/dtds/tiles-config.dtd">

            <tiles-definitions>













            <!-- <<<<<<<<<<<<<< Cart >>>>>>>>>>>>>>> -->




















            </tiles-definitions>


            ***********
            * web.xml *
            ***********
            <?xml version="1.0" encoding="UTF-8"?>
            <!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/j2ee/dtds/web-app_2_3.dtd">

            <web-app>

            <filter-name>Set Character Encoding</filter-name>
            <filter-class>com.ilium.eapps.syswar.filter.SetCharacterEncodingFilter</filter-class>
            <init-param>
            <param-name>encoding</param-name>
            <param-value>UTF-8</param-value>
            </init-param>

            <filter-mapping>
            <filter-name>Set Character Encoding</filter-name>
            <servlet-name>action</servlet-name>
            </filter-mapping>

            <!-- ========== Servlet Definitions ============================ -->

            <servlet-name>action</servlet-name>
            <servlet-class>org.apache.struts.action.ActionServlet</servlet-class>
            <init-param>
            <param-name>config</param-name>
            <param-value>/WEB-INF/struts-config.xml</param-value>
            </init-param>
            <init-param>
            <param-name>config/cart</param-name>
            <param-value>/WEB-INF/struts-config-cart.xml</param-value>
            </init-param>
            <load-on-startup>2</load-on-startup>

            <servlet-mapping>
            <servlet-name>action</servlet-name>
            <url-pattern>*.do</url-pattern>
            </servlet-mapping>

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

            <!-- ========== Taglib Definitions ============================ -->

            <taglib-uri>/WEB-INF/struts-html.tld</taglib-uri>
            <taglib-location>/WEB-INF/struts-html.tld</taglib-location>


            <taglib-uri>/WEB-INF/struts-bean.tld</taglib-uri>
            <taglib-location>/WEB-INF/struts-bean.tld</taglib-location>


            <taglib-uri>/WEB-INF/struts-logic.tld</taglib-uri>
            <taglib-location>/WEB-INF/struts-logic.tld</taglib-location>


            <taglib-uri>/WEB-INF/struts-template.tld</taglib-uri>
            <taglib-location>/WEB-INF/struts-template.tld</taglib-location>


            <taglib-uri>/WEB-INF/tiles.tld</taglib-uri>
            <taglib-location>/WEB-INF/struts-tiles.tld</taglib-location>


            <taglib-uri>/WEB-INF/jstl-core.tld</taglib-uri>
            <taglib-location>/WEB-INF/c.tld</taglib-location>

            </web-app>


            **************
            * header.jsp *
            **************




            <h1 align="center">Application Name</h1>
            Version 1.0 





            ************
            * menu.jsp *
            ************
            <%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%>
            <%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%>



             


             







             
            Order Management
             


             


            <a href="<html:rewrite href="cart/CartItem/list.do"/>">Summary


             


             


            <a href="<html:rewrite href="cart/CartItem/process/add.do"/>">Add


             


             


            <a href="<html:rewrite href="cart/CartItem/query/SearchByPK.do"/>">Find


             







            **************
            * footer.jsp *
            **************


              &copy;intellium


              created by waimeng




            **************
            * main.jsp *
            **************
            <%@ page import="java.util.*"%>
            <%@ page import="org.apache.struts.action.*"%>
            <%@ page import="javax.servlet.http.*"%>
            <%@ page import="javax.servlet.*"%>

            Main page
            <%
            if (request.getParameter("pglang") != null)
            {
            System.out.println(request.getParameter("pglang"));
            session.setAttribute(Action.LOCALE_KEY, new java.util.Locale(request.getParameter("pglang")) );
            }
            %>


            • 3. Re: struts.taglib.tiles.InsertTag error during runtime
              vincent Newbie

              Oh, i forgot the classicLayout.jsp file:

              <%@ taglib uri="/WEB-INF/tiles.tld" prefix="comp"%>
              <%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%>
              <%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%>
              <%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%>
              <%@ page contentType="text/html; charset=UTF-8" %>
              <%@ page language="java" %>

              <html:html locale="true">

              <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
              <link rel="stylesheet" href="<html:rewrite page="/style/menu.css"/>" type="text/css">
              Title
              <%if(request.getServerPort() == 80) {%>

              <%} else {%>

              <%}%>





              english/chinese


              <comp:insert attribute="header"/>



              <comp:insert attribute='menu'/>


              <comp:insert attribute='body' />









              <comp:insert attribute="footer" />




              </html:html>