You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@velocity.apache.org by bu...@apache.org on 2002/10/24 14:27:33 UTC

DO NOT REPLY [Bug 13926] New: - Exception while running the Velocity code

DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=13926>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=13926

Exception while running the Velocity code

           Summary: Exception while running the Velocity code
           Product: Velocity
           Version: 1.3-rc1
          Platform: PC
        OS/Version: Windows NT/2K
            Status: NEW
          Severity: Blocker
          Priority: Other
         Component: Source
        AssignedTo: velocity-dev@jakarta.apache.org
        ReportedBy: sameer.karkhanis@seepz.tcs.co.in


I downloaded the build source for Velocity version 1.3-rc1. Imported and ran 
the sorce in IBM Visual age for Java 

Here is the sample code i tried to run............

try{
		VelocityEngine ve = new VelocityEngine();
	 	ve.init(); 

		/*  next, get the Template  */

		Template t = ve.getTemplate("C:\\helloworld.vm");

		/*  create a context and add data */

		VelocityContext context = new VelocityContext();

		context.put("name", "World");

		/* now render the template into a StringWriter */

		StringWriter writer = new StringWriter();

		t.merge( context, writer );
		/* show the World */
		return ( writer.toString() );
	}
	catch (Exception e){
		System.out.println("Got a error" + e.toString());
		return ("the error was found");
	}



It returned a "org.apache.velocity.ResourceNotFoundException". 

Can u tell me  way to get around the problem.

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>