facebook

[Struts & Tiles] XML parsing problems

  1. MyEclipse IDE > Off Topic
Viewing 15 posts - 1 through 15 (of 22 total)
  • Author
    Posts
  • #220978 Reply

    RUFFIE
    Member

    Hi, I’m implementing Tiles in a struts application of mine, but it won’t work. Seems like some problem with the definition xml, but I’ve copieed it right from other examples.

    Here’s my tiles-defs.xml:

    
    <!DOCTYPE tiles-definitions PUBLIC "-//Apache Software Foundation//DTD Tiles Configuration//EN" "http://jakarta.apache.org/struts/dtds/tiles-config_1_1.dtd">
     
    <tiles-definitions>
        <definition name="MslDefault" path="../layouts/mslDefaultLayout.jsp">
        <put name="title" type="string" value="Centrale Hypotheekbank Curacao" />
        <put name="header" value="../jsp/header.jsp" />
        <put name="menu" value="../jsp/officeMenu.jsp" />
        <put name="body" value="" />
        <put name="footer" value="../jsp/copyright.jsp" />
        </definition>
    </tiles-definitions>
    

    I get no DTD or DOCTYPE validation error or such. Struts Console is showing a valid xml.

    Then my web.xml:

    
    <?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" version="2.4" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee   [URL=http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">]http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">[/URL]
       <servlet>
          <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>debug</param-name>
             <param-value>3</param-value>
          </init-param>
          <init-param>
             <param-name>detail</param-name>
             <param-value>3</param-value>
          </init-param>
          <load-on-startup>0</load-on-startup>
       </servlet>
       <servlet-mapping>
          <servlet-name>action</servlet-name>
          <url-pattern>*.do</url-pattern>
       </servlet-mapping>
       <jsp-config>
      <taglib>
          <taglib-uri>/WEB-INF/struts-tiles.tld</taglib-uri>
          <taglib-location>/WEB-INF/struts-tiles.tld</taglib-location>
      </taglib>
      <taglib>
        <taglib-uri>http://jakarta.apache.org/taglibs/i18n-1.0</taglib-uri>
        <taglib-location>/WEB-INF/i18n.tld</taglib-location>
      </taglib>
      <taglib>
        <taglib-uri>/dbtags</taglib-uri>
        <taglib-location>/WEB-INF/lib/dbtags.jar</taglib-location>
      </taglib>
      <taglib>
        <taglib-uri>/i18n</taglib-uri>
        <taglib-location>/WEB-INF/lib/i18n.jar</taglib-location>
      </taglib>
      <taglib>
        <taglib-uri>http://jakarta.apache.org/taglibs/page-1.0</taglib-uri>
        <taglib-location>/WEB-INF/page.tld</taglib-location>
      </taglib>
      <taglib>
        <taglib-uri>/page</taglib-uri>
        <taglib-location>/WEB-INF/lib/page.jar</taglib-location>
      </taglib>
      </jsp-config>
       <welcome-file-list>
       <welcome-file>../html/index2.html</welcome-file>
       </welcome-file-list>
    </web-app>
    

    Design view in Eclipse also showing a valid XML file.
    In my Struts-config.xml i got the following Tiles plugin:

    
    <plug-in className="org.apache.sruts.tiles.TilesPlugin">
           <set-property property="definitions-config" value="/WEB-INF/tiles-defs.xml" />
           <set-property property="moduleAware" value="true" />
           <set-property property="definitions-debug" value="2" />
           <set-property property="definitions-parser-details" value="2" />
           <set-property property="definitions-parser-validate" value="true" />
       </plug-in>

    When I try to look up the page that uses Tiles
    (indexhuis.jsp:

    
    <%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles" %>
    <tiles:insert definition="MslDefault" flush="true">
    <tiles :p ut name="body" value="../jsp/huiskopen.jsp" />
    </tiles:insert>
    

    )

    I get the following error:

    
    exception 
     
    javax.servlet.ServletException: Can't get definitions factory from context.
        org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:845)
        org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:778)
        org.apache.jsp.jsp.indexhuis_jsp._jspService(org.apache.jsp.jsp.indexhuis_jsp:77)
        org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:99)
        javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
        org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:325)
        org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295)
        org.apache.jasper.servlet.JspServlet.service(JspServlet.java:245)
        javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
     
    
    root cause 
     
    javax.servlet.jsp.JspException: Can't get definitions factory from context.
        org.apache.struts.taglib.tiles.InsertTag.processDefinitionName(InsertTag.java:583)
        org.apache.struts.taglib.tiles.InsertTag.createTagHandler(InsertTag.java:487)
        org.apache.struts.taglib.tiles.InsertTag.doStartTag(InsertTag.java:451)
        org.apache.jsp.jsp.indexhuis_jsp._jspx_meth_tiles_insert_0(org.apache.jsp.jsp.indexhuis_jsp:94)
        org.apache.jsp.jsp.indexhuis_jsp._jspService(org.apache.jsp.jsp.indexhuis_jsp:70)
        org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:99)
        javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
        org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:325)
        org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295)
        org.apache.jasper.servlet.JspServlet.service(JspServlet.java:245)
        javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
    

    The only log that’s full is stdout.log:

    
    Dec 14, 2004 9:38:42 AM org.apache.commons.digester.Digester error
    SEVERE: Parse Error at line 1 column 19: Document is invalid: no grammar found.
    org.xml.sax.SAXParseException: Document is invalid: no grammar found.
        at org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Unknown Source)
        at org.apache.xerces.util.ErrorHandlerWrapper.error(Unknown Source)
        at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
        at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
        at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown Source)
        at org.apache.xerces.impl.XMLNSDocumentScannerImpl$NSContentDispatcher.scanRootElementHook(Unknown Source)
        at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
        at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
        at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
        at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
        at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
        at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
        at org.apache.commons.digester.Digester.parse(Digester.java:1567)
        at org.apache.struts.tiles.xmlDefinition.XmlParser.parse(XmlParser.java:279)
        at org.apache.struts.tiles.xmlDefinition.I18nFactorySet.parseXmlFile(I18nFactorySet.java:526)
        at org.apache.struts.tiles.xmlDefinition.I18nFactorySet.parseXmlFiles(I18nFactorySet.java:467)
        at org.apache.struts.tiles.xmlDefinition.I18nFactorySet.createDefaultFactory(I18nFactorySet.java:271)
        at org.apache.struts.tiles.xmlDefinition.I18nFactorySet.initFactory(I18nFactorySet.java:246)
        at org.apache.struts.tiles.xmlDefinition.I18nFactorySet.initFactory(I18nFactorySet.java:196)
        at org.apache.struts.tiles.definition.ComponentDefinitionsFactoryWrapper.init(ComponentDefinitionsFactoryWrapper.java:104)
        at org.apache.struts.tiles.TilesUtilImpl.createDefinitionsFactory(TilesUtilImpl.java:138)
        at org.apache.struts.tiles.TilesUtil.createDefinitionsFactory(TilesUtil.java:167)
        at org.apache.struts.tiles.TilesPlugin.initDefinitionsFactory(TilesPlugin.java:224)
        at org.apache.struts.tiles.TilesPlugin.init(TilesPlugin.java:139)
        at org.apache.struts.action.ActionServlet.initModulePlugIns(ActionServlet.java:839)
        at org.apache.struts.action.ActionServlet.init(ActionServlet.java:332)
        at javax.servlet.GenericServlet.init(GenericServlet.java:211)
        at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1053)
        at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:886)
        at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:3817)
        at org.apache.catalina.core.StandardContext.start(StandardContext.java:4079)
        at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:755)
        at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:739)
        at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:525)
        at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:886)
        at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:849)
        at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:474)
        at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1079)
        at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:310)
        at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
        at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1011)
        at org.apache.catalina.core.StandardHost.start(StandardHost.java:718)
        at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1003)
        at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:437)
        at org.apache.catalina.core.StandardService.start(StandardService.java:450)
        at org.apache.catalina.core.StandardServer.start(StandardServer.java:2010)
        at org.apache.catalina.startup.Catalina.start(Catalina.java:537)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.lang.reflect.Method.invoke(Unknown Source)
        at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:271)
        at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:409)
    Dec 14, 2004 9:38:42 AM org.apache.commons.digester.Digester error
    SEVERE: Parse Error at line 1 column 19: Document root element "tiles-definitions", must match DOCTYPE root "null".
    org.xml.sax.SAXParseException: Document root element "tiles-definitions", must match DOCTYPE root "null".
        at org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Unknown Source)
        at org.apache.xerces.util.ErrorHandlerWrapper.error(Unknown Source)
        at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
        at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
        at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown Source)
        at org.apache.xerces.impl.XMLNSDocumentScannerImpl$NSContentDispatcher.scanRootElementHook(Unknown Source)
        at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
        at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
        at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
        at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
        at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
        at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
        at org.apache.commons.digester.Digester.parse(Digester.java:1567)
        at org.apache.struts.tiles.xmlDefinition.XmlParser.parse(XmlParser.java:279)
        at org.apache.struts.tiles.xmlDefinition.I18nFactorySet.parseXmlFile(I18nFactorySet.java:526)
        at org.apache.struts.tiles.xmlDefinition.I18nFactorySet.parseXmlFiles(I18nFactorySet.java:467)
        at org.apache.struts.tiles.xmlDefinition.I18nFactorySet.createDefaultFactory(I18nFactorySet.java:271)
        at org.apache.struts.tiles.xmlDefinition.I18nFactorySet.initFactory(I18nFactorySet.java:246)
        at org.apache.struts.tiles.xmlDefinition.I18nFactorySet.initFactory(I18nFactorySet.java:196)
        at org.apache.struts.tiles.definition.ComponentDefinitionsFactoryWrapper.init(ComponentDefinitionsFactoryWrapper.java:104)
        at org.apache.struts.tiles.TilesUtilImpl.createDefinitionsFactory(TilesUtilImpl.java:138)
        at org.apache.struts.tiles.TilesUtil.createDefinitionsFactory(TilesUtil.java:167)
        at org.apache.struts.tiles.TilesPlugin.initDefinitionsFactory(TilesPlugin.java:224)
        at org.apache.struts.tiles.TilesPlugin.init(TilesPlugin.java:139)
        at org.apache.struts.action.ActionServlet.initModulePlugIns(ActionServlet.java:839)
        at org.apache.struts.action.ActionServlet.init(ActionServlet.java:332)
        at javax.servlet.GenericServlet.init(GenericServlet.java:211)
        at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1053)
        at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:886)
        at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:3817)
        at org.apache.catalina.core.StandardContext.start(StandardContext.java:4079)
        at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:755)
        at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:739)
        at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:525)
        at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:886)
        at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:849)
        at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:474)
        at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1079)
        at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:310)
        at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
        at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1011)
        at org.apache.catalina.core.StandardHost.start(StandardHost.java:718)
        at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1003)
        at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:437)
        at org.apache.catalina.core.StandardService.start(StandardService.java:450)
        at org.apache.catalina.core.StandardServer.start(StandardServer.java:2010)
        at org.apache.catalina.startup.Catalina.start(Catalina.java:537)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.lang.reflect.Method.invoke(Unknown Source)
        at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:271)
        at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:409)
    Dec 14, 2004 9:38:42 AM org.apache.commons.digester.Digester fatalError
    SEVERE: Parse Fatal Error at line 13 column 1: XML document structures must start and end within the same entity.
    org.xml.sax.SAXParseException: XML document structures must start and end within the same entity.
        at org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Unknown Source)
        at org.apache.xerces.util.ErrorHandlerWrapper.fatalError(Unknown Source)
        at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
        at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
        at org.apache.xerces.impl.XMLScanner.reportFatalError(Unknown Source)
        at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.endEntity(Unknown Source)
        at org.apache.xerces.impl.XMLDocumentScannerImpl.endEntity(Unknown Source)
        at org.apache.xerces.impl.XMLEntityManager.endEntity(Unknown Source)
        at org.apache.xerces.impl.XMLEntityScanner.load(Unknown Source)
        at org.apache.xerces.impl.XMLEntityScanner.scanContent(Unknown Source)
        at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanContent(Unknown Source)
        at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
        at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
        at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
        at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
        at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
        at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
        at org.apache.commons.digester.Digester.parse(Digester.java:1567)
        at org.apache.struts.tiles.xmlDefinition.XmlParser.parse(XmlParser.java:279)
        at org.apache.struts.tiles.xmlDefinition.I18nFactorySet.parseXmlFile(I18nFactorySet.java:526)
        at org.apache.struts.tiles.xmlDefinition.I18nFactorySet.parseXmlFiles(I18nFactorySet.java:467)
        at org.apache.struts.tiles.xmlDefinition.I18nFactorySet.createDefaultFactory(I18nFactorySet.java:271)
        at org.apache.struts.tiles.xmlDefinition.I18nFactorySet.initFactory(I18nFactorySet.java:246)
        at org.apache.struts.tiles.xmlDefinition.I18nFactorySet.initFactory(I18nFactorySet.java:196)
        at org.apache.struts.tiles.definition.ComponentDefinitionsFactoryWrapper.init(ComponentDefinitionsFactoryWrapper.java:104)
        at org.apache.struts.tiles.TilesUtilImpl.createDefinitionsFactory(TilesUtilImpl.java:138)
        at org.apache.struts.tiles.TilesUtil.createDefinitionsFactory(TilesUtil.java:167)
        at org.apache.struts.tiles.TilesPlugin.initDefinitionsFactory(TilesPlugin.java:224)
        at org.apache.struts.tiles.TilesPlugin.init(TilesPlugin.java:139)
        at org.apache.struts.action.ActionServlet.initModulePlugIns(ActionServlet.java:839)
        at org.apache.struts.action.ActionServlet.init(ActionServlet.java:332)
        at javax.servlet.GenericServlet.init(GenericServlet.java:211)
        at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1053)
        at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:886)
        at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:3817)
        at org.apache.catalina.core.StandardContext.start(StandardContext.java:4079)
        at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:755)
        at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:739)
        at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:525)
        at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:886)
        at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:849)
        at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:474)
        at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1079)
        at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:310)
        at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
        at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1011)
        at org.apache.catalina.core.StandardHost.start(StandardHost.java:718)
        at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1003)
        at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:437)
        at org.apache.catalina.core.StandardService.start(StandardService.java:450)
        at org.apache.catalina.core.StandardServer.start(StandardServer.java:2010)
        at org.apache.catalina.startup.Catalina.start(Catalina.java:537)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.lang.reflect.Method.invoke(Unknown Source)
        at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:271)
        at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:409)
    Dec 14, 2004 9:38:42 AM org.apache.struts.tiles.TilesPlugin initDefinitionsFactory
    SEVERE: Can't create Tiles definition factory for module ''.
    Dec 14, 2004 9:38:42 AM org.apache.catalina.core.ApplicationContext log
    SEVERE: Servlet /layout threw load() exception
    javax.servlet.ServletException: Error while parsing file '/WEB-INF/tiles-defs.xml'. XML document structures must start and end within the same entity.
        at org.apache.struts.tiles.TilesPlugin.initDefinitionsFactory(TilesPlugin.java:235)
        at org.apache.struts.tiles.TilesPlugin.init(TilesPlugin.java:139)
        at org.apache.struts.action.ActionServlet.initModulePlugIns(ActionServlet.java:839)
        at org.apache.struts.action.ActionServlet.init(ActionServlet.java:332)
        at javax.servlet.GenericServlet.init(GenericServlet.java:211)
        at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1053)
        at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:886)
        at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:3817)
        at org.apache.catalina.core.StandardContext.start(StandardContext.java:4079)
        at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:755)
        at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:739)
        at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:525)
        at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:886)
        at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:849)
        at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:474)
        at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1079)
        at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:310)
        at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
        at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1011)
        at org.apache.catalina.core.StandardHost.start(StandardHost.java:718)
        at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1003)
        at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:437)
        at org.apache.catalina.core.StandardService.start(StandardService.java:450)
        at org.apache.catalina.core.StandardServer.start(StandardServer.java:2010)
        at org.apache.catalina.startup.Catalina.start(Catalina.java:537)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.lang.reflect.Method.invoke(Unknown Source)
        at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:271)
        at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:409)
    Dec 14, 2004 9:38:43 AM org.apache.catalina.loader.WebappClassLoader validateJarFile
    INFO: validateJarFile(C:\Program Files\Apache Software Foundation\Tomcat 5.5\webapps\msl\WEB-INF\lib\servlet.jar) - jar not loaded. See Servlet Spec 2.3, section 9.7.2. Offending class: javax/servlet/Servlet.class
    Dec 14, 2004 9:38:44 AM org.apache.catalina.loader.WebappClassLoader validateJarFile
    INFO: validateJarFile(C:\Program Files\Apache Software Foundation\Tomcat 5.5\webapps\msl2\WEB-INF\lib\servlet.jar) - jar not loaded. See Servlet Spec 2.3, section 9.7.2. Offending class: javax/servlet/Servlet.class
    log4j:WARN No appenders could be found for logger (org.apache.catalina.session.ManagerBase).
    log4j:WARN Please initialize the log4j system properly.
    Dec 14, 2004 9:38:46 AM org.apache.catalina.loader.WebappClassLoader validateJarFile
    INFO: validateJarFile(C:\Program Files\Apache Software Foundation\Tomcat 5.5\webapps\secure\WEB-INF\lib\servlet.jar) - jar not loaded. See Servlet Spec 2.3, section 9.7.2. Offending class: javax/servlet/Servlet.class
    Dec 14, 2004 9:38:47 AM org.apache.catalina.core.ApplicationContext log
    INFO: ContextListener: contextInitialized()
    Dec 14, 2004 9:38:47 AM org.apache.catalina.core.ApplicationContext log
    INFO: SessionListener: contextInitialized()
    Dec 14, 2004 9:38:47 AM org.apache.coyote.http11.Http11Protocol start
    INFO: Starting Coyote HTTP/1.1 on http-80
    Dec 14, 2004 9:38:49 AM org.apache.jk.common.ChannelSocket init
    INFO: JK2: ajp13 listening on /0.0.0.0:8009
    Dec 14, 2004 9:38:49 AM org.apache.jk.server.JkMain start
    INFO: Jk running ID=0 time=0/731  config=null
    Dec 14, 2004 9:38:49 AM org.apache.catalina.startup.Catalina start
    INFO: Server startup in 65474 ms
    

    I don’t understand what is wrong or which xml is wrong! Done everything like in tutorials and stuff. Can someone help me?
    Sorry for the long post, but it’s all the necessary info!
    I’m using myEclipse 3.8.2 with Tomcat 5.5.4
    I should mention that in my system enviroment variabele I have Java JDK 1.5.0 as my Java Home, but I use 1.4 for Tomcat (with the compatibility plugin, cuz of another app that doesn’t work with 1.5)

    #220991 Reply

    Riyad Kalla
    Member

    Moving to OT > Dev, this is a tiles issue not ME.

    On a side note, I just duplicated all your posted info (thank you for doing that) into a test project and received no errors… I wonder what is going on here. I wonder if it’s either a newline issue (Linux/Mac/Windows) or if its an encoding issue OR more basically, if a different tiles-def.xml file is being parsed then the one you think that is being parsed… try and use Source > Convert Newlines feature to convert all the newlines to your platform’s newline, then save the file. Try and search in your Tomcat install for all tiles-def.xml files to see if there are other invalid tiles files that could be mucking up your app… do some investigative work, I think that’s the best thing to do at this point (since the files technically look fine).

    #221023 Reply

    RUFFIE
    Member

    tnx rkalla!, See i was just thinking the exact same thing about Tomcat loading a different or old tiles-defs.xml.
    Cuz i deleted this from my eclipse project, restarted tomcat and in the log i saw it was still complaining about tiles-defs.xml.

    I’m gonna take a look at, but one problem, there is no Convert New Lines option in my Source menu??

    Using Eclipse 3.01 with myEclipse 3.8.2

    #221040 Reply

    Riyad Kalla
    Member

    Its the 2nd to last item “Convert Line Delimiters to >”

    #221103 Reply

    RUFFIE
    Member

    It’s getting a bit too frustrating. Here’s what I’ve tried:
    – Only using Java SDK 1.4.2_06 now
    – Made sure there I’ve got only one tomcat installation
    – Made sure Eclipse is deploying to the right directory, but that was already good (set in workspace).
    – Double checked above, by looking in my windows explorer at the files that had just been deployed and had the most recent changes.
    – There is no other tiles-defs.xml before or after deployment except the one that is the same as I have in my Eclipse workspace.
    – Validated all xml files
    – Double checked all paths that have to do with tiles (rkalla said it just worked for him, just the way I have it)
    – Newlines options was already set to default on Windows

    So I’m just plain out of ideas. Can it be that this has to do with my parser (Xerces) and I find it strange that eventhough I delete the tiles-defs.xml the log still is complaining about a start and end thing of tiles-defs.xml
    I wanna avoid having to start a new project again, so if anyone has any more idead, please!

    #221116 Reply

    john
    Member

    This isn’t going to help you identify the issue, but have you tried (in struts-config.xml) setting the plugin property for validating the tiles config to false?

    <set-property property=”definitions-parser-validate” value=”false” />

    That SAX parse exception sounds like a problem with validating, since it seems to think that the expected document root element is “null” which is certainly wrong. Just a guess.

    -john.

    #221123 Reply

    Riyad Kalla
    Member

    RUFFIE,
    If you navigate to your JDK/jre/lib/ext directory, do you have custom XML parsing libs in there that you have dropped in? How about Tomcat? Did you drop custom libs in there?

    Its possible that the XML parser installed on your system being used to parse this isn’t fully compliant (old version of crimoson + JBoss has this exactly same problem, it fails on startup).

    #221148 Reply

    RUFFIE
    Member

    I don’t think so. The libs in each one of my Eclipse projects are automatically added to it (you can set that in the options e.g. the mysql connector lib that is on a different drive).
    And to be honest, I don’t know anymore xml parsers than Xerces and JAXP.
    I do have the following update:
    There WAS indeed another tiles-defs.xml in a layout folder inside my webapps, dunno how I missed that, but I removed it and the stdout.log gave no errors anymore.
    But I still get the same error page when going to indexhuis.jsp (as above). The one about not getting definitions from factory or something.
    So I googled around a little and found some more people with this problem and most of them were indeed related to XML parsing issues. Unfortunately most of them were using an old tomcat and some other versions I don’t use, but still I went on investigating those solutions.

    Some were saying to replace JAXP.jar and/or parser,jar & crimson.jar in my tomcat/lib folder (I’ve got Tomcat/Commons/Lib). I can’t exactly find any of those jars on the sun site.
    Anyways, I’ll summon up the jars I got in my Eclipse project maybe someone can help me out with the xml parsers:

    
    xml-apis.jar
    xercesImpl.jarxerces-2.4.0.jar
    xalan.jarxalan-2.4.0.jar
    swarmcache-1.0rc2.jar
    struts.jar
    standard.jar
    struts-legacy.jar
    servlet.jar
    sax.jar
    saxpath.jar
    proxool-0.8.3.jar
    page.jar
    oscache-2.0.jar
    ojdbc14.zip
    mysql-connector-java-3.0.15-ga-bin.jar
    odmg-3.0.jar
    mail.jar
    log4j-1.2.8.jar
    junit-3.8.1.jar
    jta.jarjgroups-2.2.1.jar
    jstl.jarjdbc2_0-stdext.jar
    jcs-1.0-dev.jar
    jboss-system.jar
    jboss-jmx.jar
    jboss-common.jar
    jboss-cache.jar
    jaxp-api.jar
    jaxen-full.jar
    jakarta-oro.jar
    jaas.jari18n.jar
    hibernate2.jar
    ehcache-0.7.jar
    dom4j-1.4.jar
    dbtags.jar
    dom.jar
    connector.jar
    concurrent-1.3.2.jar
    commons-pool-1.1.jar
    commons-validator.jar
    commons-logging.jar
    commons-lang.jar
    commons-logging-1.0.3.jar
    commons-lang-1.0.1.jar
    commons-fileupload.jar
    commons-digester.jar
    commons-dbcp-1.1.jar
    commons-collections.jar
    commons-collections-2.1.jar
    commons-beanutils.jar
    cglib-full-2.0.1.jar
    c3p0-0.8.4.5.jar
    ant-optional-1.5.3.jar
    ant-1.5.3.jar
    

    My JDK1.4.2_6 is a fresh install so no custom libs in there.
    My tomcat/commons/lib contains:

    
    commons-el.jar
    jasper-compiler.jar
    jasper-compiler-jdt.jar
    jasper-runtime.jar
    jsp-api.jar
    naming-factory.jar
    naming-factory-dbcp.jar
    naming-resources.jar
    servlet-api.jar
    

    Another strange thing, although I get the error page stated as in my 1st post, I don’t get a jakarta service log, only the stdout

    #221152 Reply

    Riyad Kalla
    Member

    Here’s what we should do:
    1) Redownload a fresh Tomcat 5.0.28 zip file (yes zip)
    2) Unzip it to C:\tomcat-test
    3) Setup it up in MyEclipse
    4) Remove your deployment for your app and re-add it to the new server
    5) Deploy
    6) Run the app
    7) Try and connect to it

    #221153 Reply

    RUFFIE
    Member

    Hmm I can’t edit my post. Forgot to put my log now, as I said I don’t get the errors as in my 1st post anymore:

    
    Created MBeanServer with ID: fd54d6:100d752b267:-8000:Ritchie:1
    Dec 15, 2004 12:22:32 PM org.apache.coyote.http11.Http11Protocol init
    INFO: Initializing Coyote HTTP/1.1 on http-80
    Dec 15, 2004 12:22:32 PM org.apache.catalina.startup.Catalina load
    INFO: Initialization processed in 2985 ms
    Dec 15, 2004 12:22:33 PM org.apache.catalina.core.StandardService start
    INFO: Starting service Catalina
    Dec 15, 2004 12:22:33 PM org.apache.catalina.core.StandardEngine start
    INFO: Starting Servlet Engine: Apache Tomcat/5.5.4
    Dec 15, 2004 12:22:33 PM org.apache.catalina.core.StandardHost start
    INFO: XML validation disabled
    Dec 15, 2004 12:22:36 PM org.apache.catalina.startup.HostConfig deployWAR
    INFO: Deploying web application archive opencms.war
    log4j:WARN No appenders could be found for logger (org.apache.catalina.session.ManagerBase).
    log4j:WARN Please initialize the log4j system properly.
    Dec 15, 2004 12:22:47 PM org.apache.catalina.startup.HostConfig deployWAR
    INFO: Deploying web application archive opencms5.war
    Dec 15, 2004 12:22:52 PM org.apache.catalina.startup.HostConfig deployWAR
    INFO: Deploying web application archive pager-taglib-2.0.war
    Dec 15, 2004 12:22:52 PM org.apache.catalina.startup.HostConfig deployWAR
    INFO: Deploying web application archive struts-mailreader.war
    Dec 15, 2004 12:22:55 PM org.apache.catalina.core.ApplicationContext log
    INFO: action: []: Verifying ModuleConfig for this module
    Dec 15, 2004 12:22:55 PM org.apache.catalina.core.ApplicationContext log
    INFO: action: []: Verification of ModuleConfig has been completed
    Dec 15, 2004 12:22:55 PM org.apache.struts.webapp.example.memory.MemoryDatabasePlugIn init
    INFO: Initializing memory database plug in from '/WEB-INF/database.xml'
    Dec 15, 2004 12:22:55 PM org.apache.struts.validator.ValidatorPlugIn initResources
    INFO: Loading validation rules file from '/WEB-INF/validator-rules.xml'
    Dec 15, 2004 12:22:55 PM org.apache.struts.validator.ValidatorPlugIn initResources
    INFO: Loading validation rules file from '/WEB-INF/validation.xml'
    Dec 15, 2004 12:22:56 PM org.apache.catalina.core.ApplicationContext log
    INFO: org.apache.webapp.balancer.BalancerFilter: init(): ruleChain: [org.apache.webapp.balancer.RuleChain: [org.apache.webapp.balancer.rules.URLStringMatchRule: Target string: News / Redirect URL: http://www.cnn.com], [org.apache.webapp.balancer.rules.RequestParameterRule: Target param name: paramName / Target param value: paramValue / Redirect URL: http://www.yahoo.com], [org.apache.webapp.balancer.rules.AcceptEverythingRule: Redirect URL: http://jakarta.apache.org]]
    log4j:WARN No appenders could be found for logger (org.apache.catalina.session.ManagerBase).
    log4j:WARN Please initialize the log4j system properly.
    log4j:WARN No appenders could be found for logger (org.apache.catalina.session.ManagerBase).
    log4j:WARN Please initialize the log4j system properly.
    Dec 15, 2004 12:23:05 PM org.apache.catalina.core.ApplicationContext log
    INFO: ContextListener: contextInitialized()
    Dec 15, 2004 12:23:05 PM org.apache.catalina.core.ApplicationContext log
    INFO: SessionListener: contextInitialized()
    Dec 15, 2004 12:23:05 PM org.apache.catalina.loader.WebappClassLoader validateJarFile
    INFO: validateJarFile(C:\Program Files\Apache Software Foundation\Tomcat 5.5\webapps\msl\WEB-INF\lib\servlet.jar) - jar not loaded. See Servlet Spec 2.3, section 9.7.2. Offending class: javax/servlet/Servlet.class
    Dec 15, 2004 12:23:06 PM org.apache.catalina.loader.WebappClassLoader validateJarFile
    INFO: validateJarFile(C:\Program Files\Apache Software Foundation\Tomcat 5.5\webapps\msl2\WEB-INF\lib\servlet.jar) - jar not loaded. See Servlet Spec 2.3, section 9.7.2. Offending class: javax/servlet/Servlet.class
    log4j:WARN No appenders could be found for logger (org.apache.commons.digester.Digester).
    log4j:WARN Please initialize the log4j system properly.
    Dec 15, 2004 12:23:12 PM org.apache.catalina.loader.WebappClassLoader validateJarFile
    INFO: validateJarFile(C:\Program Files\Apache Software Foundation\Tomcat 5.5\webapps\secure\WEB-INF\lib\servlet.jar) - jar not loaded. See Servlet Spec 2.3, section 9.7.2. Offending class: javax/servlet/Servlet.class
    Dec 15, 2004 12:23:13 PM org.apache.catalina.core.ApplicationContext log
    INFO: ContextListener: contextInitialized()
    Dec 15, 2004 12:23:13 PM org.apache.catalina.core.ApplicationContext log
    INFO: SessionListener: contextInitialized()
    Dec 15, 2004 12:23:14 PM org.apache.coyote.http11.Http11Protocol start
    INFO: Starting Coyote HTTP/1.1 on http-80
    Dec 15, 2004 12:23:15 PM org.apache.jk.common.ChannelSocket init
    INFO: JK2: ajp13 listening on /0.0.0.0:8009
    Dec 15, 2004 12:23:15 PM org.apache.jk.server.JkMain start
    INFO: Jk running ID=0 time=0/210  config=null
    Dec 15, 2004 12:23:16 PM org.apache.catalina.startup.Catalina start
    INFO: Server startup in 43432 ms
    

    I tried the suggestion about doing the definitions-validate to false, but the same error-page comes up

    #221154 Reply

    Riyad Kalla
    Member

    check my post right above yours

    #221155 Reply

    Riyad Kalla
    Member

    INFO: validateJarFile(C:\Program Files\Apache Software Foundation\Tomcat 5.5\webapps\msl\WEB-INF\lib\servlet.jar) – jar not loaded. See Servlet Spec 2.3, section 9.7.2. Offending class: javax/servlet/Servlet.class
    Dec 15, 2004 12:23:06 PM org.apache.catalina.loader.WebappClassLoader validateJarFile
    INFO: validateJarFile(C:\Program Files\Apache Software Foundation\Tomcat 5.5\webapps\msl2\WEB-INF\lib\servlet.jar) – jar not loaded. See Servlet Spec 2.3, section 9.7.2. Offending class: javax/servlet/Servlet.class
    log4j:WARN No appenders could be found for logger (org.apache.commons.digester.Digester).
    log4j:WARN Please initialize the log4j system properly.
    Dec 15, 2004 12:23:12 PM org.apache.catalina.loader.WebappClassLoader validateJarFile
    INFO: validateJarFile(C:\Program Files\Apache Software Foundation\Tomcat 5.5\webapps\secure\WEB-INF\lib\servlet.jar) – jar not loaded. See Servlet Spec 2.3, section 9.7.2. Offending class: javax/servlet/Servlet.class

    You should get rid of those JARs from your project that are provided by the app server.

    #221174 Reply

    RUFFIE
    Member

    Update:
    Ok I haven’t downloaded the 5.0.28 zip yet, but I had the 5.5.4 zip on my pc, so I used that to follow rkalla’s step.
    Extracted it to c:\tomcat5.
    In Eclipse I changed the tomcat 5 application server settings in the myEclipse are to the new path as above.
    Before that I had my project undeployed ofcourse.
    Added & Deployed to new server and tried to connect (localhost was working).

    While connecting, Eclipse asks me to switch to Debug perspective, cause some thread was suspended.
    This was something about the TilesUtil.class and I could attach the source with a button. It was looking for struts.jar
    That jar file was already in my project lib, but still I attached it again, but it doesn’t go away, the debug message.
    Still saying “Source not found.. The source attachment does not contain the source for the file TilesUtil.class blabla”

    Anyways I just choose to resume that specific thread that was suspended, the page went on loading, but gave me the same error page as in my 1st post! 🙁 🙁

    #221176 Reply

    RUFFIE
    Member

    EDIT:
    This is the stack of the thread where it’s halted.
    This occurs while looking up the page indexhuis.jsp
    I can choose to resume it, but it will only get me the error page.

    
    Thread [http-8080-Processor24] (Suspended (exception NullPointerException))
        TilesUtil.getDefinition(String, ServletRequest, ServletContext) line: 224
        InsertTag.processDefinitionName(String) line: 566
        InsertTag.createTagHandler() line: 487
        InsertTag.doStartTag() line: 451
        indexhuis_jsp._jspx_meth_tiles_insert_0(PageContext) line: 10
        indexhuis_jsp._jspService(HttpServletRequest, HttpServletResponse) line: 10
        indexhuis_jsp(HttpJspBase).service(HttpServletRequest, HttpServletResponse) line: 99
        indexhuis_jsp(HttpServlet).service(ServletRequest, ServletResponse) line: 802
        JspServletWrapper.service(HttpServletRequest, HttpServletResponse, boolean) line: 325
        JspServlet.serviceJspFile(HttpServletRequest, HttpServletResponse, String, Throwable, boolean) line: 295
        JspServlet.service(HttpServletRequest, HttpServletResponse) line: 245
        JspServlet(HttpServlet).service(ServletRequest, ServletResponse) line: 802
        ApplicationFilterChain.internalDoFilter(ServletRequest, ServletResponse) line: 237
        ApplicationFilterChain.doFilter(ServletRequest, ServletResponse) line: 157
        StandardWrapperValve.invoke(Request, Response) line: 214
        StandardContextValve.invoke(Request, Response) line: 178
        StandardHostValve.invoke(Request, Response) line: 126
        ErrorReportValve.invoke(Request, Response) line: 105
        StandardEngineValve.invoke(Request, Response) line: 107
        CoyoteAdapter.service(Request, Response) line: 148
        Http11Processor.process(InputStream, OutputStream) line: 825
        Http11Protocol$Http11ConnectionHandler.processConnection(TcpConnection, Object[]) line: 731
        PoolTcpEndpoint.processSocket(Socket, TcpConnection, Object[]) line: 526
        LeaderFollowerWorkerThread.runIt(Object[]) line: 80
        ThreadPool$ControlRunnable.run() line: 684
        ThreadWithAttributes(Thread).run() line: 595
    
    #221180 Reply

    Riyad Kalla
    Member

    RUFFIE,
    I haven’t played with Tomcat 5.5 yet, can you try using 5.0.28 like I mentioned just so we can rule out EVER possible problem? Additionally please find your project in eclipse, right click > Export > To Zip and email it to support@genuitec.com ATTN Riyad so I can work with it over here and see if it just works “out of the box” or if its something easy we can fix together.

Viewing 15 posts - 1 through 15 (of 22 total)
Reply To: [Struts & Tiles] XML parsing problems

You must be logged in to post in the forum log in