I need to call a method asynchronously. This is what I did, by studying from internet.
Similar code is working in our project, with the same annotations and all, but due to some reason, I am not able to make it work in standalone.
Can anybody help me on this, as to what I have done wrong.
If you want to use an annotation on a class like that, you have to use the class in a context (or framework) which is programmed to use the annotation. It isn't the JVM code which is going to use the annotation, it's some application code somewhere.
You know already that Spring is an example of such an application, it uses that @Async annotation in the way you expect. It would be possible for you to write an application which used that annotation in the same way, but you would actually have to write the code for that usage to happen.
This is a very common mistake that people make when they use Spring: if you create an instance of a Spring bean with new, then it is not a Spring-managed bean, and things like dependency injection (@Autowired) and other Spring features (such as @Async) will not work.
You need to let Spring manage the instance of the Util class, instead of creating it yourself using new.