[jira] [Updated] (COCOON3-45) Support input types than java.net.URL in the StringTemplateGenerator
[ https://issues.apache.org/jira/browse/COCOON3-45?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Francesco Chicchiriccò updated COCOON3-45: -- Fix Version/s: 3.0.0-beta-1 Support input types than java.net.URL in the StringTemplateGenerator Key: COCOON3-45 URL: https://issues.apache.org/jira/browse/COCOON3-45 Project: Cocoon 3 Issue Type: New Feature Components: cocoon-stringtemplate Reporter: Reinhard Poetz Assignee: Francesco Chicchiriccò Fix For: 3.0.0-beta-1 Possible types are: File, String, InputStream -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira
Re: StringTemplateGenerator
Jos Snellings schrieb: Dear, Just a small question, testing: When I get: java.lang.NullPointerException at org.apache.cocoon.stringtemplate.StringTemplateGenerator.constructCacheKey(StringTemplateGenerator.java:75) I notice that StringTemplateGenerator has two constructors: one with a 'source' argument, and one without. The one without source argument is called. Does this make sense? Am I making a mistake in the sitemap? Here's the code: map:match pattern=testcases/{name}.st map:generate src=testcases/{map:name}.st type=string-template/ map:serialize type=xhtml/ /map:match Hi, the two constructors serve two different purposes: * the default contructor is used by the sitemap to assemble pipelines in the way described by the sitemap definition (so that one being called is expected in your case) * the constructor with the source parameter is intended for the programmatic use (pure convenience) Looking at the code in the StringTemplateGenerator suggests that the source you're passing testcases/{map:name}.st cannot be resolved for the name you are using, thus resolving in the URL being null and causing a NPE. URL resolution in your case (using a sitemap) is performed by the GenerateNode, which delegates back to the Invocation(Impl). No logging in that area *sigh* so you will either need to double check your name parameter and resources and/or go debugging... The sitemap fragment you posted is perfectly fine BTW. hth, Steven Thanks, Jos
StringTemplateGenerator
Dear, Just a small question, testing: When I get: java.lang.NullPointerException at org.apache.cocoon.stringtemplate.StringTemplateGenerator.constructCacheKey(StringTemplateGenerator.java:75) I notice that StringTemplateGenerator has two constructors: one with a 'source' argument, and one without. The one without source argument is called. Does this make sense? Am I making a mistake in the sitemap? Here's the code: map:match pattern=testcases/{name}.st map:generate src=testcases/{map:name}.st type=string-template/ map:serialize type=xhtml/ /map:match Thanks, Jos
[jira] Created: (COCOON3-45) Support input types than java.net.URL in the StringTemplateGenerator
Support input types than java.net.URL in the StringTemplateGenerator Key: COCOON3-45 URL: https://issues.apache.org/jira/browse/COCOON3-45 Project: Cocoon 3 Issue Type: New Feature Components: cocoon-stringtemplate Reporter: Reinhard Poetz Assignee: Cocoon Developers Team Fix For: 3.0.0-alpha-3 Possible types are: File, String, InputStream -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.