At first everything is fine with @Transactional and persistence.getEntityManager(). Then I extend the “LoginPasswordAuthenticationProvider” just like the doc says. Finally the “no active transaction” exception occurs. It’s ok if i use “persistence.createTransaction()” before getEntityManager but what happen?
Looking forward to your kindly reply!
java.lang.IllegalStateException: No active transaction
at com.haulmont.cuba.core.sys.PersistenceImpl.getEntityManager(PersistenceImpl.java:170) ~[na:na]
at com.haulmont.cuba.core.sys.PersistenceImpl.getEntityManager(PersistenceImpl.java:164) ~[na:na]
at com.bocichina.zgbrowse.util.UtilServiceImpl.loginQueryUser(UtilServiceImpl.java:232) ~[na:na]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_211]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_211]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_211]
at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_211]
at com.haulmont.cuba.core.sys.remoting.LocalServiceInvokerImpl.invoke(LocalServiceInvokerImpl.java:94) ~[na:na]
at com.haulmont.cuba.web.sys.remoting.LocalServiceProxy$LocalServiceInvocationHandler.invoke(LocalServiceProxy.java:159) ~[cuba-web-7.3.15.jar:7.3.15]
at com.sun.proxy.$Proxy75.loginQueryUser(Unknown Source) ~[na:na]
at com.bocichina.zgbrowse.web.sys.login.ExtAppLoginWindow.doLogin(ExtAppLoginWindow.java:121) ~[zgbrowse-web-1.jar:na]
at com.haulmont.cuba.web.app.login.LoginScreen.doLogin(LoginScreen.java:243) [cuba-web-7.3.15.jar:7.3.15]
at com.haulmont.cuba.web.app.login.LoginScreen.login(LoginScreen.java:213) [cuba-web-7.3.15.jar:7.3.15]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_211]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_211]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_211]
at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_211]
at com.haulmont.cuba.gui.xml.DeclarativeAction.actionPerform(DeclarativeAction.java:101) [cuba-gui-7.2.11.jar:7.2.11]
at com.haulmont.cuba.web.gui.components.WebFrameActionsHolder.handleAction(WebFrameActionsHolder.java:160) [cuba-web-7.3.15.jar:7.3.15]
at com.vaadin.event.ActionManager.handleAction(ActionManager.java:252) [vaadin-server-8.9.2-17-cuba.jar:8.9.2-17-cuba]
at com.vaadin.event.ActionManager.handleActions(ActionManager.java:235) [vaadin-server-8.9.2-17-cuba.jar:8.9.2-17-cuba]
at com.haulmont.cuba.web.widgets.CubaOrderedActionsLayout.changeVariables(CubaOrderedActionsLayout.java:88) [cuba-web-widgets-7.2.11.jar:na]
at com.vaadin.server.communication.ServerRpcHandler.changeVariables(ServerRpcHandler.java:611) [vaadin-server-8.9.2-17-cuba.jar:8.9.2-17-cuba]
at com.vaadin.server.communication.ServerRpcHandler.handleInvocation(ServerRpcHandler.java:457) [vaadin-server-8.9.2-17-cuba.jar:8.9.2-17-cuba]
at com.vaadin.server.communication.ServerRpcHandler.handleInvocations(ServerRpcHandler.java:400) [vaadin-server-8.9.2-17-cuba.jar:8.9.2-17-cuba]
at com.vaadin.server.communication.ServerRpcHandler.handleRpc(ServerRpcHandler.java:260) [vaadin-server-8.9.2-17-cuba.jar:8.9.2-17-cuba]
at com.vaadin.server.communication.UidlRequestHandler.synchronizedHandleRequest(UidlRequestHandler.java:82) [vaadin-server-8.9.2-17-cuba.jar:8.9.2-17-cuba]
at com.vaadin.server.SynchronizedRequestHandler.handleRequest(SynchronizedRequestHandler.java:40) [vaadin-server-8.9.2-17-cuba.jar:8.9.2-17-cuba]
at com.vaadin.server.VaadinService.handleRequest(VaadinService.java:1578) [vaadin-server-8.9.2-17-cuba.jar:8.9.2-17-cuba]
at com.vaadin.server.VaadinServlet.service(VaadinServlet.java:425) [vaadin-server-8.9.2-17-cuba.jar:8.9.2-17-cuba]
at com.haulmont.cuba.web.sys.CubaApplicationServlet.serviceAppRequest(CubaApplicationServlet.java:329) [cuba-web-7.3.15.jar:7.3.15]
at com.haulmont.cuba.web.sys.CubaApplicationServlet.service(CubaApplicationServlet.java:215) [cuba-web-7.3.15.jar:7.3.15]
at javax.servlet.http.HttpServlet.service(HttpServlet.java:733) [servlet-api.jar:4.0.FR]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231) [catalina.jar:9.0.38]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) [catalina.jar:9.0.38]
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53) [tomcat-websocket.jar:9.0.38]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) [catalina.jar:9.0.38]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) [catalina.jar:9.0.38]