Unexpected exception occurred invoking async method

Hi Team,

When I’m trying to add the @Async and @Trascational annotation in one method getting below error. Please help me to fix the issue.

Unexpected exception occurred invoking async method: public void com.company.saas.service.FileUploaderServiceBean.uploadFile(com.haulmont.cuba.core.entity.FileDescriptor,byte[],java.util.UUID,java.lang.Integer) throws java.lang.Exception
java.lang.SecurityException: No security context bound to the current thread

image
image

Hi @rajkumar.k,
When you start an async process, you should provide the security context.

Take a look at @artamonov’s answers in another topic.

Regards,
Peterson.

2 Likes