Closed bwoodcox closed 14 years ago
Definitely an issue. I thought this was working but apparently it's not any longer.I need to change the plugin to register the custom Constraints as Spring beans and then to load them via Spring whenever they are instantiated. Sounds easy... but I've not gotten it to work yet.
Thanks for the report
This is fixed with the 0.5 release.
In the plugin documentation, it indicates that dependency injection of services is supported. The following code doesn't seem to inject the armService into the constraint.
package com.vitalsmarts.ema.constraint
class OrderFoundConstraint { def armService
static defaultMessageCode = "default.order.not.found.error" static failureCode = "order.not.found.error"
def validate = {identifier -> armService.basicOrderInfo(identifier) ? true : false } }
The exception is a null pointer because armService is null. Any suggestions oralternatives?