Closed watta90 closed 8 years ago
is that TestManager
defined as a spring bean? if not, no autowiring will take place.
Thanks for the really quick reply!
No I haven't declared it in grails-app/conf/spring/resources.groovy but will it not be considered as a spring object when I use the annotation @Singleton?
I did put this in resources.groovy
beans = {
myBean TestManager
}
But it fails in run time with this message Failed to instantiate [test.TestManager]: Constructor threw exception; nested exception is java.lang.RuntimeException: Can't instantiate singleton test.TestManager. Use test.TestManager.instance
this seems unrelated to the websocket plugin but is rather essential spring.
just remove the @Singleton
which prevents spring from instatiating that class.
(defining a spring bean will make it a singleton in the application context by default and if you then access that bean by autowiring it into other beans you will always get the same instance)
Thanks man! You are right, it became unrelated to your plugin but thanks for clarifying how spring works! Have a nice day/evening/night!
Hi,
I would like to use brokerMessagingTemplate in a class that I have in src/main/groovy, i.e. not in grails-app, but I get that the template is null.
This is how I'm trying to use it:
Any idea of what is wrong? Thanks in advance