Alin Simionoiu wrote: > > I put the template in velexample directory. > Velocity Log file say : > Tue May 08 11:12:36 PDT 2001 AvalonLogSystem initialized using logfile > C:\Apache\Tomcat\bin\velocity.log > Tue May 08 11:12:36 PDT 2001 [info] [info] Default Properties File: > org\apache\velocity\runtime\defaults\velocity.properties > Tue May 08 11:12:36 PDT 2001 [info] Resource Loader Instantiated: > org.apache.velocity.runtime.resource.loader.FileResourceLoader > Tue May 08 11:12:36 PDT 2001 [info] FileResourceLoader : initialization > starting. > Tue May 08 11:12:36 PDT 2001 [info] FileResourceLoader : adding path '.' > Tue May 08 11:12:36 PDT 2001 [info] FileResourceLoader : initialization > complete. > Tue May 08 11:12:36 PDT 2001 [info] Loaded Pluggable Directive: > org.apache.velocity.runtime.directive.Literal > Tue May 08 11:12:36 PDT 2001 [info] Loaded Pluggable Directive: > org.apache.velocity.runtime.directive.Macro > Tue May 08 11:12:36 PDT 2001 > info] Loaded Pluggable Directive: > org.apache.velocity.runtime.directive.Parse > Tue May 08 11:12:36 PDT 2001 [info] Loaded Pluggable Directive: > org.apache.velocity.runtime.directive.Include > Tue May 08 11:12:36 PDT 2001 [info] Loaded Pluggable Directive: > org.apache.velocity.runtime.directive.Foreach > Tue May 08 11:12:36 PDT 2001 [info] Created: 20 parsers. > Tue May 08 11:12:36 PDT 2001 [info] Velocimacro : initialization starting. > Tue May 08 11:12:36 PDT 2001 [info] Velocimacro : adding VMs from VM > library template : VM_global_library.vm > Tue May 08 11:12:36 PDT 2001 [error] ResourceManager : unable to find > resource 'VM_global_library.vm' in any resource loader. > Tue May 08 11:12:36 PDT 2001 [info] Velocimacro : error using VM library > template VM_global_library.vm : > org.apache.velocity.exception.ResourceNotFoundException: Unable to find > resource 'VM_global_library.vm' > Tue May 08 11:12:36 PDT 2001 [info] Velocimacro : allowInline = true : VMs > can be defined inline in templates > Tue May 08 11:12:36 PDT 2001 [info] Velocimacro : allowInlineToOverride = > false : VMs defined inline may NOT replace previous VM definitions > Tue May 08 11:12:36 PDT 2001 [info] Velocimacro : allowInlineLocal = false > : VMs defined inline will be global in scope if allowed. > Tue May 08 11:12:36 PDT 2001 [info] Velocimacro : messages on : VM system > will output logging messages > Tue May 08 11:12:36 PDT 2001 [info] Velocimacro : initialization complete. > Tue May 08 11:12:36 PDT 2001 [info] Velocity successfully started. > Tue May 08 11:12:36 PDT 2001 [error] ResourceManager : unable to find > resource 'sample.vm' in any resource loader. > Tue May 08 11:12:57 PDT 2001 [error] ResourceManager : unable to find > resource 'sample.vm' in any resource loader. > Tue May 08 11:30:18 PDT 2001 [error] ResourceManager : unable to find > resource 'sample.vm' in any resource loader. > > I find very interesting this line: > Tue May 08 11:12:36 PDT 2001 [info] FileResourceLoader : adding path '.' > It's seems that the current directory for velocity is tomcat/bin ...wright? > More corect to say : is the directory from where tomcat is started. > > It is possible to specify a path to FileResourceLoader?... Yes - the servlet example was changed about 2 weeks ago to automatically configure the FileResourceLoader to use the webapp root as the path for finding templates. This is confirmed to work in Tomcat. Please update your servlet example examples/servlet_example/SampleServlet.java and then rebuild the examples, move the .class file to the WEB-INF/classes directory of your webapp, and try again. > I found that Velocity parameter file in wright in the jar file. Corect ? Yes, but you don't want to modify that. Those are defaults for Velocity to use. geir -- Geir Magnusson Jr. [EMAIL PROTECTED] System and Software Consulting Developing for the web? See http://jakarta.apache.org/velocity/ "still climbing up to the shoulders..."
