I'm putting together a tomcat (4.0 latest beta), turbine (2.1) and
velocity (whatever ships with the tdk) HelloWorld application and I've
run into a problem and since I'm a little new to Turbine/Velocity I was
wondering if you guys could smack me upside the head and point out my
silly little error. :-) 

So a little background

Downloaded and extracted the tdk
Downloaded and extracted tomcat 4.0 (latest beta)

creates the following directories/files in the tomcat webapps directory

I'm calling the app userman for now ... just ignore that ...

All of the *jar files are from the tdk (2.1)

userman/WEB-INF/lib/turbine-2.1.jar
userman/WEB-INF/lib/velocity-1.2-dev.jar
userman/WEB-INF/lib/xmlrpc.jar
userman/WEB-INF/lib/ecs-1.4.1.jar
userman/WEB-INF/lib/activation-1.0.1.jar
userman/WEB-INF/lib/hsql.jar
userman/WEB-INF/lib/httpunit.jar
userman/WEB-INF/lib/idb.jar
userman/WEB-INF/lib/jakarta-regexp-1.3-dev.jar
userman/WEB-INF/lib/jdbc2_0-stdext.jar
userman/WEB-INF/lib/jdbc-se2.0.jar
userman/WEB-INF/lib/jndi-1.2.1.jar
userman/WEB-INF/lib/jta1.0.1.jar
userman/WEB-INF/lib/junit-3.2.jar
userman/WEB-INF/lib/log4j-1.1.jar
userman/WEB-INF/lib/mail-1.2.jar
userman/WEB-INF/lib/mm.mysql-2.0.4.jar
userman/WEB-INF/lib/oro.jar
userman/WEB-INF/lib/postgresql.jar
userman/WEB-INF/lib/sapdbc.jar
userman/WEB-INF/lib/village-1.5.1.jar
userman/WEB-INF/lib/xalan-1.2.1.jar
userman/WEB-INF/lib/xerces-1.3.0.jar


My Index.java class ... Copied from the HelloWorld example at
http://jakarta.apache.org/turbine/howto/velocity-site-howto.html
but the class name was changed to Index instead of HelloWorld. I think
this is the right way .... 

The class file is compiled with:

javac -classpath ../lib/velocity-1.2-dev.jar:../lib/turbine-2.1.jar
Index.java

userman/WEB-INF/classes
userman/WEB-INF/classes/Index.java
userman/WEB-INF/classes/Index.class


web.xml copied from tdk ... checked for differences and modified approp.
userman/WEB-INF/web.xml

also copied from the tdk. changes the screen/layout paths to reflect the
applications directory structure...See below

userman/WEB-INF/conf/TurbineResources.properties

Templates ... Index.vm just says 

<p>
$hello
</p>

Default.vm just says:

$screen_placeholder

GlobalMacros.vm is copied from the tdk ...

userman/templates/screens
userman/templates/screens/Index.vm
userman/templates/layouts/Default.vm
userman/templates/navigations
userman/templates/GlobalMacros.vm

The log files ...
userman/logs/turbine.log
userman/logs/velocity.log

Okay ... So when I pull up the url:
http://localhost:8080/userman/servlet/userman

I get ...

$hello

So I looked in my logs and this is what I get...
velocity.log
Fri Jul 13 16:15:23 EDT 2001 AvalonLogSystem initialized using logfile
/home/edwardam/java/jakarta-tomcat-4.0-b5/webapps/userman/logs/velocity.log
Fri Jul 13 16:15:23 EDT 2001   [info]   [info] Default Properties File:
org/apache/velocity/runtime/defaults/velocity.properties
Fri Jul 13 16:15:23 EDT 2001   [info] Resource Loader Instantiated:
org.apache.velocity.runtime.resource.loader.FileResourceLoader
Fri Jul 13 16:15:23 EDT 2001   [info] FileResourceLoader :
initialization starting.
Fri Jul 13 16:15:23 EDT 2001   [info] FileResourceLoader : adding path
'/home/edwardam/java/jakarta-tomcat-4.0-b5/webapps/userman/templates'
Fri Jul 13 16:15:23 EDT 2001   [info] FileResourceLoader :
initialization complete.
Fri Jul 13 16:15:23 EDT 2001   [info] Resource Loader Instantiated:
org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader
Fri Jul 13 16:15:23 EDT 2001   [info] ClasspathResourceLoader :
initialization starting.
Fri Jul 13 16:15:23 EDT 2001   [info] ClasspathResourceLoader :
initialization complete.
Fri Jul 13 16:15:23 EDT 2001   [info] Loaded Pluggable Directive:
org.apache.velocity.runtime.directive.Literal
Fri Jul 13 16:15:24 EDT 2001   [info] Loaded Pluggable Directive:
org.apache.velocity.runtime.directive.Macro
Fri Jul 13 16:15:24 EDT 2001   [info] Loaded Pluggable Directive:
org.apache.velocity.runtime.directive.Parse
Fri Jul 13 16:15:24 EDT 2001   [info] Loaded Pluggable Directive:
org.apache.velocity.runtime.directive.Include
Fri Jul 13 16:15:24 EDT 2001   [info] Loaded Pluggable Directive:
org.apache.velocity.runtime.directive.Foreach
Fri Jul 13 16:15:24 EDT 2001   [info] Created: 20 parsers.
Fri Jul 13 16:15:24 EDT 2001   [info] Velocimacro : initialization
starting.
Fri Jul 13 16:15:24 EDT 2001   [info] Velocimacro : adding VMs from VM
library template : GlobalMacros.vm
Fri Jul 13 16:15:25 EDT 2001   [info] Velocimacro : added new VM :
#text( text ) : source = GlobalMacros.vm
Fri Jul 13 16:15:25 EDT 2001   [info] Velocimacro : added new VM :
#formLabel( label ) : source = GlobalMacros.vm
Fri Jul 13 16:15:25 EDT 2001   [info] Velocimacro : added new VM :
#formTextField( name value ) : source = GlobalMacros.vm
Fri Jul 13 16:15:25 EDT 2001   [info] Velocimacro : added new VM :
#textField( name value size ) : source = GlobalMacros.vm
Fri Jul 13 16:15:25 EDT 2001   [info] Velocimacro : added new VM :
#listBox( list ) : source = GlobalMacros.vm
Fri Jul 13 16:15:25 EDT 2001   [info] Velocimacro : added new VM :
#formPasswordCell( label name value ) : source = GlobalMacros.vm
Fri Jul 13 16:15:25 EDT 2001   [info] Velocimacro : added new VM :
#formCell( label name value ) : source = GlobalMacros.vm
Fri Jul 13 16:15:25 EDT 2001   [info] Velocimacro : added new VM :
#fileUploadField( name ) : source = GlobalMacros.vm
Fri Jul 13 16:15:25 EDT 2001   [info] Velocimacro : added new VM :
#fileUpload( label name ) : source = GlobalMacros.vm
Fri Jul 13 16:15:25 EDT 2001   [info] Velocimacro : added new VM :
#formCheckBox( label name checked ) : source = GlobalMacros.vm
Fri Jul 13 16:15:25 EDT 2001   [info] Velocimacro : added new VM :
#formListBox( label list ) : source = GlobalMacros.vm
Fri Jul 13 16:15:25 EDT 2001   [info] Velocimacro : added new VM :
#headerCell( body ) : source = GlobalMacros.vm
Fri Jul 13 16:15:25 EDT 2001   [info] Velocimacro : added new VM :
#entryCell( body ) : source = GlobalMacros.vm
Fri Jul 13 16:15:25 EDT 2001   [info] ResourceManager : found
GlobalMacros.vm with loader
org.apache.velocity.runtime.resource.loader.FileResourceLoader
Fri Jul 13 16:15:25 EDT 2001   [info] Velocimacro :  VM library template
macro registration complete.
Fri Jul 13 16:15:25 EDT 2001   [info] Velocimacro : allowInline = true :
VMs can be defined inline in templates
Fri Jul 13 16:15:25 EDT 2001   [info] Velocimacro :
allowInlineToOverride = false : VMs defined inline may NOT replace
previous VM definitions
Fri Jul 13 16:15:25 EDT 2001   [info] Velocimacro : allowInlineLocal =
false : VMs defined inline will be  global in scope if allowed.
Fri Jul 13 16:15:25 EDT 2001   [info] Velocimacro : messages on  : VM
system will output logging messages
Fri Jul 13 16:15:25 EDT 2001   [info] Velocimacro : initialization
complete.
Fri Jul 13 16:15:25 EDT 2001   [info] Velocity successfully started.
Fri Jul 13 16:15:28 EDT 2001   [info] ResourceManager : found
screens/Index.vm with loader
org.apache.velocity.runtime.resource.loader.FileResourceLoader
Fri Jul 13 16:15:28 EDT 2001   [warn]
org.apache.velocity.runtime.exception.ReferenceException: reference :
template = screens/Index.vm [line 3,column 1] : $hello is not a valid
reference.
Fri Jul 13 16:15:28 EDT 2001   [info] ResourceManager : found
layouts/Default.vm with loader
org.apache.velocity.runtime.resource.loader.FileResourceLoader


And the only ERROR I get in turbine.log is...

[Fri Jul 13 16:15:28 EDT 2001] -- ERROR -- Cannot load skin: default
[Fri Jul 13 16:15:28 EDT 2001] -- ERROR -- Cannot load skin: default

Can anyone tell me why I don't get the $hello rendered  ... becuase it
is put in the contextby the class....My only guess is the class isn't
getting loaded ... But why then?



--
Edward Muller
Director of Information Services
LearningPatterns.com Inc.

Direct: 212-487-9064 x 115
Fax: 212-202-3822
Email: [EMAIL PROTECTED]

http://www.learningpatterns.com


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to