velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tom Schindl <tomatli...@gmx.at>
Subject Problems with classpathloader
Date Mon, 11 Jul 2005 09:50:59 GMT
Hi,

somehow I'm running into problems with classpathloader which doesn't 
seem to work. This is the relevant config-section:

-----------------------8<-----------------------
resource.loader=class
class.resource.loader.description=Velocity Classpath Resource Loader
class.resource.loader.class=org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader
-----------------------8<-----------------------

and the lines of code:
-----------------------8<-----------------------
Properties p = new Properties();
p.load(getClass().getClassLoader().getResourceAsStream("velocity.properties"));

Velocity.init(p);

Template template = null;

template=Velocity.getTemplate("at/bestsolution/ojb/builder/templates/dao.vm");
-----------------------8<-----------------------

Although all at/**/* is in my classpath I always get an exception.

Using file-loader with the following entries everything is working as 
expected:
-----------------------8<-----------------------
resource.loader=file
file.resource.loader.description = Velocity File Resource Loader
file.resource.loader.class = 
org.apache.velocity.runtime.resource.loader.FileResourceLoader
file.resource.loader.path = E:/eclipse-workspaces/beso-devel/clay2ojb/src/
file.resource.loader.cache = false
file.resource.loader.modificationCheckInterval = 0
-----------------------8<-----------------------

Have I missed something? Any ideas?

Tom

---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-user-help@jakarta.apache.org


Mime
View raw message