Thank you. It is working. But I have a similar problem when I try to use Velocity Mail
with this standalone application.
My code is:
VelocityEmail ve = new VelocityEmail();
ve.setTo("Aravinda", "[EMAIL PROTECTED]");
ve.setFrom("Me", "[EMAIL PROTECTED]").setSubject("test");
ve.setContext(ve.getContext());
ve.setTemplate("/test.vm");
ve.send();
It is unable to parse /test.vm file. I have just hello world typed in that file. The
file is in templates directory.
I hope you would solve this...
Error is:
Exception in thread "main" java.lang.NullPointerException
at
org.apache.turbine.services.velocity.TurbineVelocityService.decodeRequest(TurbineVelocityService.java:319)
rethrown as org.apache.turbine.util.TurbineException: Error rendering Velocity
template: /test.vm
at
org.apache.turbine.services.velocity.TurbineVelocityService.renderingError(TurbineVelocityService.java:392)
at
org.apache.turbine.services.velocity.TurbineVelocityService.handleRequest(TurbineVelocityService.java:252)
at
org.apache.turbine.services.velocity.TurbineVelocity.handleRequest(TurbineVelocity.java:109)
at org.apache.turbine.util.velocity.VelocityEmail.send(VelocityEmail.java:278)
at com.rightmove.rmsites.util.mail.MailExample2.main(MailExample2.java:42)
Thanks,
Aravinda.
---------- Original Message ----------------------------------
From: Daniel Rall <[EMAIL PROTECTED]>
Reply-To: [EMAIL PROTECTED]
Date: 11 Jun 2001 14:21:11 -0700
>"Aravinda Addala" <[EMAIL PROTECTED]> writes:
>
>> I have been trying to use Turbine as a standalone application with Velocity
>service. When I tried to use this code, get an error:
>>
>> TurbineConfig tc = new
>TurbineConfig("/export/home/aravinda/myapplication/WEB-INF/conf","Standalone.properties");
>> tc.init();
>>
>> I have just copied TurbineResources.properties to Standalone.properties
>>
>> The error is:
>>
>> Turbine: init
>> Exception in thread "main" java.lang.Error: VelocityService runtime log file is
>misconfigured: 'null' is not a valid log file: TurbineConfig users must use a path
>relative to web application root
>
>As the error states, you don't have the path to your Velocity log file
>configured properly in your TurbineResources.properties file.
>
>Because TurbineVelocityService uses TurbineConfig's getRealPath(), the
>log file *must exist before Turbine is initialized* (as per the
>servlet APIs contract for ServletConfig's getRealPath() method).
>getRealPath() is returning null because even if your log file
>configuration points to a reasonable place, your log file doesn't yet
>exist.
>
>I am not happy with this behavior. Jason, do we have another method
>which mirrors the path resolution functionality of getRealPath() but
>doesn't need the file to already exist?
>
>Daniel
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]