From: Christoph F. <cf...@fo...> - 2004-10-11 11:31:51
|
Hi Kal when executing ant -f batch.xml -Dtopicmap=tmworld.xtm topicmap I'm getting the following null pointer [copy] Copying 1 file to /opt/java/tm4web/build/batch/temp [java] 0 [main] WARN org.tm4j.vtl.factory.BaseFactory - Could not locate properties file: factory.props [java] Cannot find CatalogManager.properties [java] Processing explicit mergeMap directives... [java] Merging referenced topic maps... [java] All external maps merged! [java] Making merged map consistent... [java] Consistency processing complete! [java] java.lang.NullPointerException [java] at org.tm4j.vtl.TM4JVelocityApp.pushContext(TM4JVelocityApp.java:429) [java] at org.tm4j.vtl.TM4JVelocityApp.startTopicMap(TM4JVelocityApp.java:401) [java] at org.tm4j.topicmap.utils.TopicMapWalker.walk(TopicMapWalker.java:73) [java] at org.tm4j.vtl.TM4JVelocityApp.processMap(TM4JVelocityApp.java:281) [java] at org.tm4j.vtl.TM4JVelocityApp.main(TM4JVelocityApp.java:223) This happens with both, tm4web/velocity0.2rc1 and the current cvs-checkout. I'm using tm4j 0.9.7 Tracing the source it seems obvious that m_toolboxManager is not initialized because batch.xml does not specify the toolbox option on the command line. do I miss something? Thanks c -- Christoph Froehlich <cf...@fo...> |
From: Kal A. <ka...@te...> - 2004-10-11 13:59:08
|
Hi Cristoph, Thanks for the bug report. The only problem is the missing -t option on the command line. I've updated batch.xml and added a toolbox.xml that is safe for batch HTML generation into CVS. Cheers, Kal On Mon, 2004-10-11 at 12:29, Christoph Froehlich wrote: > Hi Kal > > when executing > > ant -f batch.xml -Dtopicmap=tmworld.xtm topicmap > > I'm getting the following null pointer > > [copy] Copying 1 file to /opt/java/tm4web/build/batch/temp > [java] 0 [main] WARN org.tm4j.vtl.factory.BaseFactory - Could not locate properties file: factory.props > [java] Cannot find CatalogManager.properties > [java] Processing explicit mergeMap directives... > [java] Merging referenced topic maps... > [java] All external maps merged! > [java] Making merged map consistent... > [java] Consistency processing complete! > [java] java.lang.NullPointerException > [java] at org.tm4j.vtl.TM4JVelocityApp.pushContext(TM4JVelocityApp.java:429) > [java] at org.tm4j.vtl.TM4JVelocityApp.startTopicMap(TM4JVelocityApp.java:401) > [java] at org.tm4j.topicmap.utils.TopicMapWalker.walk(TopicMapWalker.java:73) > [java] at org.tm4j.vtl.TM4JVelocityApp.processMap(TM4JVelocityApp.java:281) > [java] at org.tm4j.vtl.TM4JVelocityApp.main(TM4JVelocityApp.java:223) > > > This happens with both, tm4web/velocity0.2rc1 and the current cvs-checkout. > I'm using tm4j 0.9.7 > > Tracing the source it seems obvious that m_toolboxManager is not initialized > because batch.xml does not specify the toolbox option on the command line. > > do I miss something? > > Thanks > > c > > -- Kal Ahmed <ka...@te...> techquila |
From: Christoph F. <cf...@fo...> - 2004-10-11 18:00:24
|
Hi Kal thanks for the quick fix. It works now... until I reach org.tm4j.topicmap.utils.extractors.AssociationGroupsExtractor$DefaultAssociationGroupComparator.compare(AssociationGroupsExtractor.java:149) where another NullPointer waits. I fixed this one myself and could either commit the fix or send you a patch, just as you prefer. Beside of this last NPE, batch.xml now runs successfully and produces a lot of html files. Unfortunately there is one more problem with the default skin. The "topicref"-macro in "utils.vm" constantly produces the following loglines: Mon Oct 11 19:39:11 CEST 2004 [warn] org.apache.velocity.runtime.exception.ReferenceException: reference : template = associations.vm [line 2,column 29] : ${filename.fn($topic)} is not a valid reference. Therefor all links from index.html to any topic detail page refer to the unresolved string "$filename.fn($topic).html". I haven't got deep enough into tm4Web to know where I should start to look for the missing reference. Do you have a hint for me? Thanks c Am Mo, den 11.10.2004 schrieb Kal Ahmed um 16:08: > Hi Cristoph, > > Thanks for the bug report. > > The only problem is the missing -t option on the command line. I've > updated batch.xml and added a toolbox.xml that is safe for batch HTML > generation into CVS. > > Cheers, > > Kal > > On Mon, 2004-10-11 at 12:29, Christoph Froehlich wrote: > > Hi Kal > > > > when executing > > > > ant -f batch.xml -Dtopicmap=tmworld.xtm topicmap > > > > I'm getting the following null pointer > > > > [copy] Copying 1 file to /opt/java/tm4web/build/batch/temp > > [java] 0 [main] WARN org.tm4j.vtl.factory.BaseFactory - Could not locate properties file: factory.props > > [java] Cannot find CatalogManager.properties > > [java] Processing explicit mergeMap directives... > > [java] Merging referenced topic maps... > > [java] All external maps merged! > > [java] Making merged map consistent... > > [java] Consistency processing complete! > > [java] java.lang.NullPointerException > > [java] at org.tm4j.vtl.TM4JVelocityApp.pushContext(TM4JVelocityApp.java:429) > > [java] at org.tm4j.vtl.TM4JVelocityApp.startTopicMap(TM4JVelocityApp.java:401) > > [java] at org.tm4j.topicmap.utils.TopicMapWalker.walk(TopicMapWalker.java:73) > > [java] at org.tm4j.vtl.TM4JVelocityApp.processMap(TM4JVelocityApp.java:281) > > [java] at org.tm4j.vtl.TM4JVelocityApp.main(TM4JVelocityApp.java:223) > > > > > > This happens with both, tm4web/velocity0.2rc1 and the current cvs-checkout. > > I'm using tm4j 0.9.7 > > > > Tracing the source it seems obvious that m_toolboxManager is not initialized > > because batch.xml does not specify the toolbox option on the command line. > > > > do I miss something? > > > > Thanks > > > > c > > > > -- Christoph Froehlich <cf...@fo...> |
From: Kal A. <ka...@te...> - 2004-10-11 18:30:08
|
On Mon, 2004-10-11 at 18:57, Christoph Froehlich wrote: > Hi Kal > > thanks for the quick fix. It works now... until I reach > > org.tm4j.topicmap.utils.extractors.AssociationGroupsExtractor$DefaultAssociationGroupComparator.compare(AssociationGroupsExtractor.java:149) > > where another NullPointer waits. I fixed this one myself and could > either commit the fix or send you a patch, just as you prefer. > Feel free to commit the fix - I guess that it is probably an untyped association or untyped role case that I didn't catch in the code. > Beside of this last NPE, batch.xml now runs successfully and produces a > lot of html files. > > Unfortunately there is one more problem with the default skin. > The "topicref"-macro in "utils.vm" constantly produces the following > loglines: > Mon Oct 11 19:39:11 CEST 2004 [warn] > org.apache.velocity.runtime.exception.ReferenceException: reference : > template = associations.vm [line 2,column 29] : ${filename.fn($topic)} > is not a valid reference. > > Therefor all links from index.html to any topic detail page refer to the > unresolved string "$filename.fn($topic).html". > You need to create the filename object. You can do this by adding the following line to topicmap.vm: #set ($filename = $factory.create("org.tm4j.vtl.extractors.FileNameExtractor")) The factory variable should be initialised by the toolbox.xml. Actually it probably makes sense for FileNameExtractor to implement the Velocity ViewTool interface so that you can load it in the toolbox.xml. But for now, add that line to topicmap.vm as a workaround. > I haven't got deep enough into tm4Web to know where I should start to > look for the missing reference. Do you have a hint for me? > In general, any variables set by #set in topicmap.vm or setup.vm are available when processing the whole topic map. Any variables set in topic.vm or any of the templates it calls are available only for the processing of that topic. The toolbox.xml allows you to choose the scope of a variable. If the <scope> element content is "request" then the tool is initialised once for each page generated. If the <scope> element content is application then the tool is initialised once at the start of processing and the same instance is available to every page. Hope this helps! Cheers, Kal -- Kal Ahmed <ka...@te...> techquila |
From: Christoph F. <cf...@fo...> - 2004-10-11 18:46:04
|
Am Mo, den 11.10.2004 schrieb Kal Ahmed um 20:40: > On Mon, 2004-10-11 at 18:57, Christoph Froehlich wrote: > > Hi Kal > > > > thanks for the quick fix. It works now... until I reach > > > > org.tm4j.topicmap.utils.extractors.AssociationGroupsExtractor$DefaultAssociationGroupComparator.compare(AssociationGroupsExtractor.java:149) > > > > where another NullPointer waits. I fixed this one myself and could > > either commit the fix or send you a patch, just as you prefer. > > > Feel free to commit the fix - I guess that it is probably an untyped > association or untyped role case that I didn't catch in the code. > committed. > > Beside of this last NPE, batch.xml now runs successfully and produces a > > lot of html files. > > > > Unfortunately there is one more problem with the default skin. > > The "topicref"-macro in "utils.vm" constantly produces the following > > loglines: > > Mon Oct 11 19:39:11 CEST 2004 [warn] > > org.apache.velocity.runtime.exception.ReferenceException: reference : > > template = associations.vm [line 2,column 29] : ${filename.fn($topic)} > > is not a valid reference. > > > > Therefor all links from index.html to any topic detail page refer to the > > unresolved string "$filename.fn($topic).html". > > > You need to create the filename object. You can do this by adding the > following line to topicmap.vm: > > #set ($filename = > $factory.create("org.tm4j.vtl.extractors.FileNameExtractor")) > > The factory variable should be initialised by the toolbox.xml. Actually > it probably makes sense for FileNameExtractor to implement the Velocity > ViewTool interface so that you can load it in the toolbox.xml. But for > now, add that line to topicmap.vm as a workaround. > aah, it works. > > I haven't got deep enough into tm4Web to know where I should start to > > look for the missing reference. Do you have a hint for me? > > > In general, any variables set by #set in topicmap.vm or setup.vm are > available when processing the whole topic map. Any variables set in > topic.vm or any of the templates it calls are available only for the > processing of that topic. > > The toolbox.xml allows you to choose the scope of a variable. If the > <scope> element content is "request" then the tool is initialised once > for each page generated. If the <scope> element content is application > then the tool is initialised once at the start of processing and the > same instance is available to every page. > Hope this helps! > oh yes, it does. Thank you, bye c > Cheers, > > Kal -- Christoph Froehlich <cf...@fo...> |