[Bug 6454] New: Velocity unable to find templates when running from css-validator.jar

http://www.w3.org/Bugs/Public/show_bug.cgi?id=6454

           Summary: Velocity unable to find templates when running from css-
                    validator.jar
           Product: CSSValidator
           Version: CSS Validator
          Platform: PC
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Other
        AssignedTo: ot@w3.org
        ReportedBy: mroch@salesforce.com
         QAContact: www-validator-cvs@w3.org
                CC: mroch@salesforce.com


After applying the patch I attached to bug 5578 to fix that problem, Velocity
can't find the <format>.properties files (e.g. text.properties) when running
from the command line:

Unable to find resource 'text.properties'
org.apache.velocity.exception.ResourceNotFoundException: Unable to find
resource 'text.properties'
        at
org.apache.velocity.runtime.resource.ResourceManagerImpl.loadResource(ResourceManagerImpl.java:452)
        at
org.apache.velocity.runtime.resource.ResourceManagerImpl.getResource(ResourceManagerImpl.java:335)
        at
org.apache.velocity.runtime.RuntimeInstance.getTemplate(RuntimeInstance.java:1102)
        at
org.apache.velocity.runtime.RuntimeInstance.getTemplate(RuntimeInstance.java:1077)
        at
org.apache.velocity.runtime.RuntimeSingleton.getTemplate(RuntimeSingleton.java:303)
        at org.apache.velocity.app.Velocity.getTemplate(Velocity.java:503)
        at
org.w3c.css.css.StyleSheetGenerator.<init>(StyleSheetGenerator.java:160)
        at
org.w3c.css.css.StyleReportFactory.getStyleReport(StyleReportFactory.java:19)
        at org.w3c.css.css.CssValidator.handleRequest(CssValidator.java:178)
        at org.w3c.css.css.CssValidator.main(CssValidator.java:151)
java.lang.NullPointerException
        at
org.w3c.css.css.StyleSheetGenerator.print(StyleSheetGenerator.java:418)
        at org.w3c.css.css.CssValidator.handleRequest(CssValidator.java:187)
        at org.w3c.css.css.CssValidator.main(CssValidator.java:151)

Relevant lines from the log:

[info] Velocity not initialized yet. Calling init()...
[debug] Starting Apache Velocity v1.5 (compiled: 2007-02-22 08:52:29)
[trace] RuntimeInstance initializing.
[debug] Default Properties File:
org/apache/velocity/runtime/defaults/velocity.properties
[debug] Default ResourceManager initializing. (class
org.apache.velocity.runtime.resource.ResourceManagerImpl)
[debug] ResourceLoader instantiated:
org.apache.velocity.runtime.resource.loader.FileResourceLoader
[trace] FileResourceLoader : initialization starting.
[info] FileResourceLoader : adding path '.'
[trace] FileResourceLoader : initialization complete.
...
[error] ResourceManager : unable to find resource 'text.properties' in any
resource loader.

It is looking for text.properties in . (current directory) rather than inside
css-validator.jar. If you copy text.proprties to the current dir, it works.


-- 
Configure bugmail: http://www.w3.org/Bugs/Public/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.

Received on Monday, 19 January 2009 22:43:34 UTC