I do see the Velocity annotation in the jar ( inside the
org.chenillekit.template.services package). I assume that you have an
import statement (e.g. import org.chenillekit.template.services.Velocity)
at the top of your VelocityTemplateServiceImpl ?
The other difference in my case is that for services, I use constructor
injection ( I obviously use freemarker, but it should work just as well in
your case) , e.g. :
class FooService {
private final TemplateService templateService;
public FooService (@FreeMarker TemplateService templateService,
this.templateService = templateService;
}
}
Cheers,
Alex
On Tue, Oct 23, 2012 at 1:47 PM, George Christman
<[email protected]>wrote:
> Alex, when I look into my dependencies package, I see
> chenillekit-template-1.3.3.jar. I have added the contributeVelocityService
> method to my app module, but when I try importing TemplateService or using
> the annotation @Velocity, I get the following compiling errors
>
> can not find symbol
> symbol: class Velocity
> location: class VelocityTemplateServiceImpl
>
> can not find symbol
> symbol: class TemplateService
> location: class VelocityTemplateServiceImpl
>
> Not sure why it's not finding the the classes.
>
> My class using the velocity sample.
>
> public class VelocityTemplateServiceImpl implements VelocityTemplateService
> {
>
> @Inject
> @Velocity
> private TemplateService _templateService;
>
> public void emailBodyTemplate() {
> OutputStream emailBodyStream = new EmailBodyStream();
> Map parameterMap = new HashMap();
> parameterMap.put("user_name", "Athur Dent");
> parameterMap.put("login_tries", getLoginTries());
> parameterMap.put("block_date", new Date());
> parameterMap.put("sysadm_email",
> "[email protected]");
> _templateService.mergeDataWithResource(new
> URIResource("./templates/email_body.ftl"),
> emailBodyStream, parameterMap)
>
> Email email = createEmail(emailBodyStream);
> email.send();
> }
> }
>
>
>
> --
> View this message in context:
> http://tapestry.1045711.n5.nabble.com/chenillekit-velocity-template-injectable-service-not-working-tp5717168p5717178.html
> Sent from the Tapestry - User mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>
>