opensubscriber
   Find in this group all groups
 
Unknown more information…

v : velocity-user@jakarta.apache.org 24 October 2006 • 5:27AM -0400

bizarre ClassNotFoundException when running in Eclipse
by Robby Walker

REPLY TO AUTHOR
 
REPLY TO GROUP




Hi,

I have a project using Velocity 1.4 that I'm working on from Eclipse
3.2.1.  In my project path I have a directory called 'lib' which
contains velocity-dep-1.4.jar.  I have velocity-dep-1.4.jar added as
an external jar to my project (I've also tried as a non-external jar).
I'm using the following velocity.properties:

resource.loader = classpath

classpath.resource.loader.description = Velocity Classpath Resource Loader
classpath.resource.loader.class =
org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader

When I run init(...) from org.apache.velocity.app.Velocity I get the
following error:

java.lang.Exception: Problem initializing template loader:
org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader
Error is: java.lang.ClassNotFoundException:
org/apache/velocity/runtime/resource/loader/ClasspathResourceLoader
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Unknown Source)
at org.apache.velocity.runtime.resource.loader.ResourceLoaderFactory.getLoader(ResourceLoaderFactory.java:41)
at org.apache.velocity.runtime.resource.ResourceManagerImpl.initialize(ResourceManagerImpl.java:142)
at org.apache.velocity.runtime.RuntimeInstance.initializeResourceManager(RuntimeInstance.java:522)
at org.apache.velocity.runtime.RuntimeInstance.init(RuntimeInstance.java:227)
at org.apache.velocity.runtime.RuntimeInstance.init(RuntimeInstance.java:461)
at org.apache.velocity.runtime.RuntimeSingleton.init(RuntimeSingleton.java:208)
at org.apache.velocity.app.Velocity.init(Velocity.java:106)
at com.ctk.index.AirsIndexer.<init>(AirsIndexer.java:75)
at com.ctk.index.AirsParser.main(AirsParser.java:62)

at org.apache.velocity.runtime.resource.loader.ResourceLoaderFactory.getLoader(ResourceLoaderFactory.java:56)
at org.apache.velocity.runtime.resource.ResourceManagerImpl.initialize(ResourceManagerImpl.java:142)
at org.apache.velocity.runtime.RuntimeInstance.initializeResourceManager(RuntimeInstance.java:522)
at org.apache.velocity.runtime.RuntimeInstance.init(RuntimeInstance.java:227)
at org.apache.velocity.runtime.RuntimeInstance.init(RuntimeInstance.java:461)
at org.apache.velocity.runtime.RuntimeSingleton.init(RuntimeSingleton.java:208)
at org.apache.velocity.app.Velocity.init(Velocity.java:106)
at com.ctk.index.AirsIndexer.<init>(AirsIndexer.java:75)
at com.ctk.index.AirsParser.main(AirsParser.java:62)

But here is the strange part.  In my main function if I call
Class.forName("org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader")
it works and loads the class.  Even if I call Class.forName before
Velocity.init, I still get the error.

I know this could be something pretty simple or fundamental I'm
missing.  Any help is greatly appreciated.

Additional info:
Windows XP
JRE 1.5_09

Thank you,
Robby Walker

---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-user-unsubscribe@jaka...
For additional commands, e-mail: velocity-user-help@jaka...

Bookmark with:

Delicious   Digg   reddit   Facebook   StumbleUpon

Related Messages

opensubscriber is not affiliated with the authors of this message nor responsible for its content.