Forums

Home » Liferay Portal » English » 3. Development

Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
Bart Simpson
Can I fetch ResourceAction in startup action? [Solved]
October 9, 2012 2:54 AM
Answer

Bart Simpson

Rank: Liferay Master

Posts: 524

Join Date: August 29, 2011

Recent Posts

When I try to fetch ResourceAction in my startup hook. I see hibernate excetion.

1 Caught unexpected exception org.hibernate.HibernateException
2com.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
3    at com.liferay.portal.service.persistence.impl.BasePersistenceImpl.processException(BasePersistenceImpl.java:193)
4    at com.liferay.portal.service.persistence.ResourceActionPersistenceImpl.fetchByN_A(ResourceActionPersistenceImpl.java:1039)
5    at com.liferay.portal.service.persistence.ResourceActionPersistenceImpl.fetchByN_A(ResourceActionPersistenceImpl.java:930)
6    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
7    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
8    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)


Is it not allowed to use ResourceActionUtil.fetchByN_A(..) in a class extending
1 com.liferay.portal.kernel.events.SimpleAction


Liferay version is 6.1.10 EE
Bart Simpson
RE: Can I fetch ResourceAction in startup action?
October 9, 2012 2:53 AM
Answer

Bart Simpson

Rank: Liferay Master

Posts: 524

Join Date: August 29, 2011

Recent Posts

Found the issue, better to use
1 ResourceActionLocalServiceUtil.fetchResourceAction(...)