Tapestry
  1. Tapestry
  2. TAPESTRY-560

Poor reporting of missing specification file

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 4.0
    • Fix Version/s: 4.0
    • Component/s: Framework
    • Labels:
      None
    • Environment:
      winxp, Java5, Jboss 4.0.2/Tomcat

      Description

      stacktrace

      • org.apache.tapestry.util.xml.DocumentParseException.<init>(DocumentParseException.java:45)
      • org.apache.tapestry.parse.SpecificationParser.parseDocument(SpecificationParser.java:1676)
      • org.apache.tapestry.parse.SpecificationParser.parsePageSpecification(SpecificationParser.java:1736

      Looking at the code (and running it through the debugger), I found out that the url was null even though the resouce is not.

      URL resourceURL = resource.getResourceURL();
      if (resourceURL == null)
      throw new DocumentParseException(ParseMessages.missingResource(resource), resource,null);

      I'm using Tap 4.0, my application file contains the following :
      <page name="Home" specification-path="/test/web/pages/Home.page"/>

      and the Home.page looks like

      <?xml version="1.0"?>

      <page-specification class="org.apache.tapestry.html.BasePage"/>

      the problem is .

      according to the DTD the specification-path attribute in the page element is the "resource classpath". So this should be something like /my/package/name, alas the ContextResource class of Hivemind obtains the URL of the Resource via the ServletContext, which is NOT by classpath but by path in the servletcontext so like /WEB-INF/classes/my/package/name. Prefixing it with classpath or context don't seem to work.

      <!-- =======================================================
      Element: page
      Contained by: application, library-specification

      Defines a single page within the application. Each application will contain
      at least one of these, to define the Home page.

      Attributes:
      name: A unique name for the application.
      specification-path: The resource classpath of the component specification for the page.
      -->

        Issue Links

          Activity

            People

            • Assignee:
              Howard M. Lewis Ship
              Reporter:
              Koen Serry
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development