掲示板

Hibernate Exception by UserUtil.findAll()

11年前 に Tim Taylor によって更新されました。

Hibernate Exception by UserUtil.findAll()

New Member 投稿: 18 参加年月日: 12/09/19 最新の投稿
Hi,

i get an HibernateException when i call UserUtil.findAll();

com.liferay.portal.kernel.exception.SystemException: org.hibernate.HibernateException: No Hibernate Session bound to thread, and configuration does not allow creation of non-transactional one here
at com.liferay.portal.service.persistence.impl.BasePersistenceImpl.processException(BasePersistenceImpl.java:193)
at com.liferay.portal.service.persistence.UserPersistenceImpl.findAll(UserPersistenceImpl.java:3883)
at com.liferay.portal.service.persistence.UserPersistenceImpl.findAll(UserPersistenceImpl.java:3795)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.liferay.portal.security.pacl.PACLBeanHandler.doInvoke(PACLBeanHandler.java:92)
at com.liferay.portal.security.pacl.PACLBeanHandler.invoke(PACLBeanHandler.java:48)
at $Proxy294.findAll(Unknown Source)
at com.liferay.portal.service.persistence.UserUtil.findAll(UserUtil.java:1120)
at com.carano.ipc.TextSendBean.createBook(TextSendBean.java:70)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.jboss.el.util.ReflectionUtil.invokeMethod(ReflectionUtil.java:328)
at org.jboss.el.util.ReflectionUtil.invokeMethod(ReflectionUtil.java:341)
at org.jboss.el.parser.AstPropertySuffix.invoke(AstPropertySuffix.java:58)
at org.jboss.el.parser.AstValue.invoke(AstValue.java:96)
at org.jboss.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:276)
at com.sun.faces.facelets.el.TagMethodExpression.invoke(TagMethodExpression.java:105)
at javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:88)
at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:102)
at javax.faces.component.UICommand.broadcast(UICommand.java:315)
at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:794)
at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:1259)
at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:81)


Thx Tim
thumbnail
11年前 に Neil Griffin によって更新されました。

RE: Hibernate Exception by UserUtil.findAll()

Liferay Legend 投稿: 2655 参加年月日: 05/07/27 最新の投稿
I would recommend that you try calling UserLocalServiceUtil.getUsers(QueryUtil.ALL_POS, QueryUtil.ALL_POS) instead.
11年前 に Tim Taylor によって更新されました。

RE: Hibernate Exception by UserUtil.findAll()

New Member 投稿: 18 参加年月日: 12/09/19 最新の投稿
Thx - it works. The same for OrganizationService, GroupService, CompanyService, ImageService, LayoutService, OrganizationService, PermissionService, UserGroupService, and RoleService.

best regards Tim
thumbnail
11年前 に Neil Griffin によって更新されました。

RE: Hibernate Exception by UserUtil.findAll()

Liferay Legend 投稿: 2655 参加年月日: 05/07/27 最新の投稿
Glad to hear that it is working. Just wanted to mention that the difference between static utility classes like UserServiceUtil and UserLocalServiceUtil is that "local" ones bypass the permission checking system.