You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@velocity.apache.org by Edward Muller <ed...@akira.learningpatterns.com> on 2001/06/20 17:35:32 UTC

Problem getting SampleServelet2 to work...

I've gotten SampleServlet to work, but I am trying to SampleServlet2 to
work. I followed the directions in the README.txt file to setup the
ClasspathResourceLoader version, but this is what I get them I go to the
servlet..

velocity.log

Wed Jun 20 11:28:11 EDT 2001 AvalonLogSystem initialized using logfile
/var/tomcat/webapps/vexample/velocity.log
Wed Jun 20 11:28:11 EDT 2001   [info]   [info] Default Properties File:
org/apache/velocity/runtime/defaults/velocity.properties
Wed Jun 20 11:28:11 EDT 2001   [info] Resource Loader Instantiated:
org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader
Wed Jun 20 11:28:11 EDT 2001   [info] ClasspathResourceLoader :
initialization starting.
Wed Jun 20 11:28:11 EDT 2001   [info] ClasspathResourceLoader :
initialization complete.
Wed Jun 20 11:28:11 EDT 2001   [info] Loaded Pluggable Directive:
org.apache.velocity.runtime.directive.Literal
Wed Jun 20 11:28:11 EDT 2001   [info] Loaded Pluggable Directive:
org.apache.velocity.runtime.directive.Macro
Wed Jun 20 11:28:11 EDT 2001   [info] Loaded Pluggable Directive:
org.apache.velocity.runtime.directive.Parse
Wed Jun 20 11:28:11 EDT 2001   [info] Loaded Pluggable Directive:
org.apache.velocity.runtime.directive.Include
Wed Jun 20 11:28:11 EDT 2001   [info] Loaded Pluggable Directive:
org.apache.velocity.runtime.directive.Foreach
Wed Jun 20 11:28:11 EDT 2001   [info] Created: 20 parsers.
Wed Jun 20 11:28:11 EDT 2001   [info] Velocimacro : initialization
starting.
Wed Jun 20 11:28:11 EDT 2001   [info] Velocimacro : adding VMs from VM
library template : VM_global_library.vm
Wed Jun 20 11:28:11 EDT 2001  [error] ResourceManager : unable to find
resource 'VM_global_library.vm' in any resource loader.
Wed Jun 20 11:28:11 EDT 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'
Wed Jun 20 11:28:11 EDT 2001   [info] Velocimacro : allowInline = true :
VMs can be defined inline in templates
Wed Jun 20 11:28:11 EDT 2001   [info] Velocimacro :
allowInlineToOverride = false : VMs defined inline may NOT replace
previous VM definitions
Wed Jun 20 11:28:11 EDT 2001   [info] Velocimacro : allowInlineLocal =
false : VMs defined inline will be  global in scope if allowed.
Wed Jun 20 11:28:11 EDT 2001   [info] Velocimacro : messages on  : VM
system will output logging messages
Wed Jun 20 11:28:11 EDT 2001   [info] Velocimacro : initialization
complete.
Wed Jun 20 11:28:11 EDT 2001   [info] Velocity successfully started.
Wed Jun 20 11:28:11 EDT 2001  [error] ResourceManager : unable to find
resource 'sample.vm' in any resource loader.


And here is what I get in the web browser:
VelocityServlet : Error processing the templatejava.lang.Exception:
handleRequest(Context) returned null - no template selected!
java.lang.Exception: handleRequest(Context) returned null - no template
selected! at java.lang.Throwable.(Throwable.java:96) at
java.lang.Exception.(Exception.java:44) at
org.apache.velocity.servlet.VelocityServlet.handleRequest(VelocityServlet.java:561) at org.apache.velocity.servlet.VelocityServlet.doRequest(VelocityServlet.java:333) at org.apache.velocity.servlet.VelocityServlet.doGet(VelocityServlet.java:294) at javax.servlet.http.HttpServlet.service(HttpServlet.java) at javax.servlet.http.HttpServlet.service(HttpServlet.java) at org.apache.tomcat.core.ServletWrapper.doService(ServletWrapper.java) at org.apache.tomcat.core.Handler.service(Handler.java) at org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java) at org.apache.tomcat.core.ContextManager.internalService(ContextManager.java) at org.apache.tomcat.core.ContextManager.service(ContextManager.java) at org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(HttpConnectionHandler.java) at org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java) at org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java) at java.lang.Thread.run(Thread!
.java:498)

I'm still new to TomCat/Velocity/Servlets so there may be something I've
done wrong. I've checked the settings files, but they all look okay.

Can anyone help me?



Re: Problem getting SampleServelet2 to work...

Posted by "Geir Magnusson Jr." <ge...@optonline.net>.
Edward Muller wrote:
> 
> I've gotten SampleServlet to work, but I am trying to SampleServlet2 to
> work. I followed the directions in the README.txt file to setup the
> ClasspathResourceLoader version, but this is what I get them I go to the
> servlet..
> 
> velocity.log

[SNIP]

Looks fine.

> 
> And here is what I get in the web browser:
> VelocityServlet : Error processing the templatejava.lang.Exception:
> handleRequest(Context) returned null - no template selected!
> java.lang.Exception: handleRequest(Context) returned null - no template
> selected! at java.lang.Throwable.(Throwable.java:96) at
> java.lang.Exception.(Exception.java:44) at
> org.apache.velocity.servlet.VelocityServlet.handleRequest(VelocityServlet.java:561) at org.apache.velocity.servlet.VelocityServlet.doRequest(VelocityServlet.java:333) at ]

[SNIP]

> I'm still new to TomCat/Velocity/Servlets so there may be something I've
> done wrong. I've checked the settings files, but they all look okay.
> 
> Can anyone help me?

Did you put template.jar into

<yourwebapp>/WEB-INF/lib

And what version of tomcat?

geir

-- 
Geir Magnusson Jr.                           geirm@optonline.net
System and Software Consulting
Developing for the web?  See http://jakarta.apache.org/velocity/
You have a genius for suggesting things I've come a cropper with!