I have a service in a Grails application. However, I need to get the configuration for some configuration in my application. But when I try to use def grailsApplication in my service, it still gets null.
My service is located in the "Services" section.
class RelationService { def grailsApplication private String XML_DATE_FORMAT = "yyyy-MM-dd" private String token = 'hej123' private String tokenName String WebserviceHost = 'xxx' def getRequest(end_url) {
I looked at the Grails application configuration for applications , but it does not give me an answer, since everything seems to be correct.
However, I call my Service as follows: def xml = new RelationService().getRequest(url)
EDIT:
Forgot to enter my error, which is: Cannot get property 'config' on null object
source share