You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Since #1912 we have started to use scoped services (Request scope in that case). During the review, it appeared that using such services outside the scope they are supposed to be, fails with:
org.springframework.beans.factory.support.ScopeNotActiveException: Error creating bean with name 'scopedTarget.feedbackMessageService': Scope 'request' is not active for the current thread; consider defining a scoped proxy for this bean if you intend to refer to it from a singleton
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:374) ~[spring-beans-6.0.8.jar:6.0.8]
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:200) ~[spring-beans-6.0.8.jar:6.0.8]
at org.springframework.aop.target.SimpleBeanTargetSource.getTarget(SimpleBeanTargetSource.java:35) ~[spring-aop-6.0.8.jar:6.0.8]
at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:686) ~[spring-aop-6.0.8.jar:6.0.8]
at org.eclipse.sirius.components.web.services.FeedbackMessageService$$SpringCGLIB$$0.addFeedbackMessage(<generated>) ~[classes/:na]
at org.eclipse.sirius.components.view.emf.diagram.ViewDiagramDescriptionConverter.lambda$33(ViewDiagramDescriptionConverter.java:364) ~[classes/:na]
at org.eclipse.sirius.components.diagrams.components.NodeComponent.render(NodeComponent.java:96) ~[classes/:na]
at org.eclipse.sirius.components.representations.BaseRenderer.renderComponent(BaseRenderer.java:200) ~[classes/:na]
...
Caused by: java.lang.IllegalStateException: No thread-bound request found: Are you referring to request attributes outside of an actual web request, or processing a request outside of the originally receiving thread? If you are actually operating within a web request and still receive this message, your code is probably running outside of DispatcherServlet: In this case, use RequestContextListener or RequestContextFilter to expose the current request.
at org.springframework.web.context.request.RequestContextHolder.currentRequestAttributes(RequestContextHolder.java:131) ~[spring-web-6.0.8.jar:6.0.8]
at org.springframework.web.context.request.AbstractRequestAttributesScope.get(AbstractRequestAttributesScope.java:42) ~[spring-web-6.0.8.jar:6.0.8]
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:362) ~[spring-beans-6.0.8.jar:6.0.8]
... 69 common frames omitted
This stacktrace can be reproduced using the feedbackMessageService in the function returned by ViewDiagramDescriptionConverter#getSemanticElementsProvider and then, displaying a diagram.
A solution to prevent such stacktrace to be raised will be to check before the call of the service if it is in the scope it is supposed to be thanks to, a try-catch or, in a case of a request scope: if(RequestContextHolder.getRequestAttributes() != null){} or equivalent.
This issue is meant to trace a potential issue with scoped service.
The text was updated successfully, but these errors were encountered:
Since #1912 we have started to use scoped services (Request scope in that case). During the review, it appeared that using such services outside the scope they are supposed to be, fails with:
This stacktrace can be reproduced using the
feedbackMessageService
in the function returned byViewDiagramDescriptionConverter#getSemanticElementsProvider
and then, displaying a diagram.A solution to prevent such stacktrace to be raised will be to check before the call of the service if it is in the scope it is supposed to be thanks to, a try-catch or, in a case of a request scope:
if(RequestContextHolder.getRequestAttributes() != null){}
or equivalent.This issue is meant to trace a potential issue with scoped service.
The text was updated successfully, but these errors were encountered: