I'm doing a porting from Liferay 7.2 to Liferay 7.3.6 GA7. I have a customTable. When i add a first row using ..LocalServiceUtil it's ok. But every subsequent time I use persistence (for example tablePersistence.update(table);) fail and liferay throws:
ERROR [http-nio-8080-exec-1][ExceptionMapper:31] java.lang.NullPointerException java.lang.NullPointerException at com.liferay.portal.cache.internal.dao.orm.FinderCacheImpl._getArguments(FinderCacheImpl.java:466) at com.liferay.portal.cache.internal.dao.orm.FinderCacheImpl.updateByEntityCache(FinderCacheImpl.java:378) at com.liferay.portal.cache.internal.dao.orm.EntityCacheImpl._putResult(EntityCacheImpl.java:439) at com.liferay.portal.cache.internal.dao.orm.EntityCacheImpl.putResult(EntityCacheImpl.java:336) at com.liferay.portal.cache.internal.dao.orm.EntityCacheImpl.putResult(EntityCacheImpl.java:358) at com.liferay.portal.cache.internal.dao.orm.EntityCacheImpl.putResult(EntityCacheImpl.java:328)
The exception is in ..PersistenceImpl when try to do entityCache.putResult(entityCacheEnabled,...); I don't understand if i lost something during porting or if something is missing in 7.3.
This is an example with the method to add a row in customTable, and fooPersistence.update(foo) throws exception after the first time:
@Indexable(type = IndexableType.REINDEX)
public Foo add(ServiceContext serviceContext)
throws PortalException {
long companyId = serviceContext.getCompanyId();
long userId = serviceContext.getUserId();
User user = UserLocalServiceUtil.getUser(userId);
long groupId = user.getGroupId();
long id = counterLocalService.increment();
Foo foo = fooPersistence.create(id);
Date now = new Date();
foo.setCreateDate(now); foo.setCompanyId(companyId);
foo.setGroupId(groupId);
fooPersistence.update(foo);
return foo;
}