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

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


Marshall Roch <mroch@salesforce.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
         Resolution|FIXED                       |




--- Comment #3 from Marshall Roch <mroch@salesforce.com>  2009-01-21 08:39:00 ---
Actually it doesn't... it works if you do "ant jar; java -jar css-validator.jar
..." because `org/w3c/css/css` is in the same directory. Try moving the jar
elsewhere and it fails:

{output=text, medium=all, warning=2, profile=css21, lang=en}
Jan 21, 2009 12:33:44 AM org.apache.velocity.runtime.log.JdkLogChute log
INFO: Velocity not initialized yet. Calling init()...
Jan 21, 2009 12:33:44 AM org.apache.velocity.runtime.log.JdkLogChute log
INFO: FileResourceLoader : adding path '.'
Jan 21, 2009 12:33:44 AM org.apache.velocity.runtime.log.JdkLogChute log
SEVERE: ResourceManager : unable to find resource
'org/w3c/css/css/text.properties' in any resource loader.
Unable to find resource 'org/w3c/css/css/text.properties'
org.apache.velocity.exception.ResourceNotFoundException: Unable to find
resource 'org/w3c/css/css/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)

Is it possible for IndexGenerator.java to tell whether it's inside a jar and
use Velocity's JarResourceLoader instead? Or, if it was possible to specify the
template path as an argument, then we could either store our own templates
outside the jar, or pass
"jar:file:/path/to/css-validator.jar!/org/w3c/css/css/" to use the templates
inside the jar.


-- 
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 Wednesday, 21 January 2009 08:39:10 UTC