java.lang.NullPointerException

Stack Overflow | shuchi | 3 months ago
tip
Your exception is missing from the Samebug knowledge base.
Here are the best solutions we found on the Internet.
Click on the to mark the helpful solution and get rewards for you help.
  1. 0

    [LPS-27262] Activating staging environemtn throws - Liferay Issues

    liferay.com | 2 years ago
    org.hibernate.exception.ConstraintViolationException: Could not execute JDBC batch update
  2. 0

    Liferay Portlet Error - "NoSuchResourceActionException _WAR_#VIEW"

    Stack Overflow | 3 years ago | grantmcconnaughey
    com.liferay.portal.NoSuchResourceActionException: <Portlet>_WAR_<PortletApp>#VIEW
  3. Speed up your debug routine!

    Automated exception search integrated into your IDE

  4. 0

    Steps to reproduce: # start Liferay portal # deploy Audience Targeting jar files # Navigate to Configuration # Click Audience Targeting Expected result: No console error and a blank page displayed. Actual result: Exceptions error and a blank page displayed. {code} 16:58:20,192 ERROR [http-nio-8080-exec-10][IncludeTag:128] Current URL /group/guest/~/control_panel/manage/-/audience_targeting/admin?p_p_auth=7QBZakph generates exception: java.lang.IllegalArgumentException: Someone may be trying to circumvent the permission checker: {companyId=20202, name=com.liferay.content.targeting.model, primKey=com.liferay.content.targeting.model, scope=4} com.liferay.portal.kernel.exception.NoSuchResourcePermissionException: {companyId=20202, name=com.liferay.content.targeting.model, primKey=com.liferay.content.targeting.model, scope=4} at com.liferay.portal.service.impl.ResourcePermissionLocalServiceImpl.hasResourcePermission(ResourcePermissionLocalServiceImpl.java:710) at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:153) at com.liferay.portal.spring.transaction.DefaultTransactionExecutor.execute(DefaultTransactionExecutor.java:85) at com.liferay.portal.spring.transaction.TransactionInterceptor.invoke(TransactionInterceptor.java:58) at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:127) at com.liferay.portal.spring.aop.ChainableMethodAdvice.invoke(ChainableMethodAdvice.java:56) at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:127) at com.liferay.portal.spring.aop.ServiceBeanAopProxy.invoke(ServiceBeanAopProxy.java:173) at com.liferay.portal.service.impl.ResourceLocalServiceImpl.hasUserPermissions(ResourceLocalServiceImpl.java:448) at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:153) at com.liferay.portal.spring.transaction.DefaultTransactionExecutor.execute(DefaultTransactionExecutor.java:85) at com.liferay.portal.spring.transaction.TransactionInterceptor.invoke(TransactionInterceptor.java:58) at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:127) at com.liferay.portal.spring.aop.ChainableMethodAdvice.invoke(ChainableMethodAdvice.java:56) at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:127) at com.liferay.portal.spring.aop.ServiceBeanAopProxy.invoke(ServiceBeanAopProxy.java:173) at com.liferay.portal.kernel.service.ResourceLocalServiceUtil.hasUserPermissions(ResourceLocalServiceUtil.java:65) at com.liferay.portal.security.permission.AdvancedPermissionChecker.doCheckPermission(AdvancedPermissionChecker.java:614) at com.liferay.portal.security.permission.AdvancedPermissionChecker.hasUserPermissionImpl(AdvancedPermissionChecker.java:997) at com.liferay.portal.security.permission.AdvancedPermissionChecker.hasPermissionImpl(AdvancedPermissionChecker.java:966) {code}

    Liferay Issues | 1 year ago | Koor Gai
    com.liferay.portal.kernel.exception.NoSuchResourcePermissionException: {companyId=20202, name=com.liferay.content.targeting.model, primKey=com.liferay.content.targeting.model, scope=4}
  5. 0

    When hibernate does session autoflush, in the end it clears out the collection to ensure the following autoflush check will return false. This raises a problem when we do nested autoflush, which happens with MVCC. When a MVCC enabled entity got autoflushed, it notices MVCCSynchronizerPostUpdateEventListener which re-update the entity cache. If the entity has @CacheField, its toCacheModel() calls may need to future access DB, which triggers more nested autoflush check points. In all nested autoflush check points, the check will be false, as they are read only opertations. But the DefaultAutoFlushEventListener blindly clears the ActionQueue to ensure the following autoflush check will return false. If the outter ActionQueue processing is on a list that has more than 1 element, the nested clear will make the following outter loop iteration fail, because of the list is already cleared. A failure example could be like: {code} 14:47:41,214 ERROR [localhost-startStop-1][PortalInstances:500] com.liferay.portal.kernel.events.ActionException: com.liferay.portal.kernel.exception.SystemException: com.liferay.portal.kernel.dao.orm.ORMException: java.lang.IndexOutOfBoundsException: Index: 1, Size: 0 com.liferay.portal.kernel.events.ActionException: com.liferay.portal.kernel.exception.SystemException: com.liferay.portal.kernel.dao.orm.ORMException: java.lang.IndexOutOfBoundsException: Index: 1, Size: 0 at com.liferay.portal.events.AddDefaultLayoutSetPrototypesAction.run(AddDefaultLayoutSetPrototypesAction.java:48) at com.liferay.portal.events.AddDefaultDataAction.run(AddDefaultDataAction.java:45) at com.liferay.portal.kernel.events.SimpleAction.processLifecycleEvent(SimpleAction.java:26) at com.liferay.portal.events.EventsProcessorUtil._process(EventsProcessorUtil.java:129) at com.liferay.portal.events.EventsProcessorUtil.process(EventsProcessorUtil.java:74) at com.liferay.portal.util.PortalInstances._initCompany(PortalInstances.java:494) at com.liferay.portal.util.PortalInstances.initCompany(PortalInstances.java:93) at com.liferay.portal.servlet.MainServlet.initCompanies(MainServlet.java:760) at com.liferay.portal.servlet.MainServlet.init(MainServlet.java:332) at javax.servlet.GenericServlet.init(GenericServlet.java:160) at org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:1280) at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1193) at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1088) at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:5123) at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5407) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901) at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877) at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:633) at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:657) at org.apache.catalina.startup.HostConfig$DeployDescriptor.run(HostConfig.java:1636) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) at java.util.concurrent.FutureTask.run(FutureTask.java:262) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) at java.lang.Thread.run(Thread.java:745) Caused by: com.liferay.portal.kernel.exception.SystemException: com.liferay.portal.kernel.dao.orm.ORMException: java.lang.IndexOutOfBoundsException: Index: 1, Size: 0 at com.liferay.portal.service.persistence.impl.BasePersistenceImpl.processException(BasePersistenceImpl.java:250) at com.liferay.portal.service.persistence.impl.ResourcePermissionPersistenceImpl.fetchByC_N_S_P_R(ResourcePermissionPersistenceImpl.java:3622) at com.liferay.portal.service.persistence.impl.ResourcePermissionPersistenceImpl.fetchByC_N_S_P_R(ResourcePermissionPersistenceImpl.java:3489) at com.liferay.portal.service.impl.ResourcePermissionLocalServiceImpl.doUpdateResourcePermission(ResourcePermissionLocalServiceImpl.java:1102) at com.liferay.portal.service.impl.ResourcePermissionLocalServiceImpl.updateResourcePermission(ResourcePermissionLocalServiceImpl.java:1281) at com.liferay.portal.service.impl.ResourcePermissionLocalServiceImpl.setResourcePermissions(ResourcePermissionLocalServiceImpl.java:1047) at sun.reflect.GeneratedMethodAccessor278.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:115) at com.liferay.portal.spring.transaction.DefaultTransactionExecutor.execute(DefaultTransactionExecutor.java:53) at com.liferay.portal.spring.transaction.TransactionInterceptor.invoke(TransactionInterceptor.java:55) at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:111) at com.liferay.portal.spring.aop.ServiceBeanAopProxy.invoke(ServiceBeanAopProxy.java:169) at com.sun.proxy.$Proxy22.setResourcePermissions(Unknown Source) at com.liferay.portal.service.impl.ResourceLocalServiceImpl.addGroupPermissions(ResourceLocalServiceImpl.java:576) at com.liferay.portal.service.impl.ResourceLocalServiceImpl.addGroupPermissions(ResourceLocalServiceImpl.java:566) at com.liferay.portal.service.impl.ResourceLocalServiceImpl.addResources(ResourceLocalServiceImpl.java:869) at com.liferay.portal.service.impl.ResourceLocalServiceImpl.addResources(ResourceLocalServiceImpl.java:260) at sun.reflect.GeneratedMethodAccessor520.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:115) at com.liferay.portal.spring.transaction.DefaultTransactionExecutor.execute(DefaultTransactionExecutor.java:53) at com.liferay.portal.spring.transaction.TransactionInterceptor.invoke(TransactionInterceptor.java:55) at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:111) at com.liferay.portal.spring.aop.ServiceBeanAopProxy.invoke(ServiceBeanAopProxy.java:169) at com.sun.proxy.$Proxy18.addResources(Unknown Source) at com.liferay.portal.service.impl.LayoutLocalServiceImpl.addLayout(LayoutLocalServiceImpl.java:413) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:115) at com.liferay.portal.service.impl.LayoutLocalServiceVirtualLayoutsAdvice.invoke(LayoutLocalServiceVirtualLayoutsAdvice.java:181) at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:111) at com.liferay.portal.service.impl.LayoutLocalServiceStagingAdvice.invoke(LayoutLocalServiceStagingAdvice.java:139) at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:111) at com.liferay.portal.spring.transaction.DefaultTransactionExecutor.execute(DefaultTransactionExecutor.java:53) at com.liferay.portal.spring.transaction.TransactionInterceptor.invoke(TransactionInterceptor.java:55) at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:111) at com.liferay.portal.spring.aop.ServiceBeanAopProxy.invoke(ServiceBeanAopProxy.java:169) at com.sun.proxy.$Proxy118.addLayout(Unknown Source) at com.liferay.portal.service.LayoutLocalServiceUtil.addLayout(LayoutLocalServiceUtil.java:261) at com.liferay.portal.events.BaseDefaultLayoutPrototypesAction.addLayout(BaseDefaultLayoutPrototypesAction.java:65) at com.liferay.portal.events.AddDefaultLayoutSetPrototypesAction.addPublicSite(AddDefaultLayoutSetPrototypesAction.java:279) at com.liferay.portal.events.AddDefaultLayoutSetPrototypesAction.doRun(AddDefaultLayoutSetPrototypesAction.java:294) at com.liferay.portal.events.AddDefaultLayoutSetPrototypesAction.run(AddDefaultLayoutSetPrototypesAction.java:45) ... 25 more Caused by: com.liferay.portal.kernel.dao.orm.ORMException: java.lang.IndexOutOfBoundsException: Index: 1, Size: 0 at com.liferay.portal.dao.orm.hibernate.ExceptionTranslator.translate(ExceptionTranslator.java:33) at com.liferay.portal.dao.orm.hibernate.QueryImpl.list(QueryImpl.java:125) at com.liferay.portal.dao.orm.hibernate.QueryImpl.list(QueryImpl.java:98) at com.liferay.portal.service.persistence.impl.ResourcePermissionPersistenceImpl.fetchByC_N_S_P_R(ResourcePermissionPersistenceImpl.java:3593) ... 71 more Caused by: java.lang.IndexOutOfBoundsException: Index: 1, Size: 0 at java.util.ArrayList.rangeCheck(ArrayList.java:635) at java.util.ArrayList.get(ArrayList.java:411) at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:265) at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:185) at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:321) at org.hibernate.event.def.DefaultAutoFlushEventListener.onAutoFlush(DefaultAutoFlushEventListener.java:64) at org.hibernate.impl.SessionImpl.autoFlushIfRequired(SessionImpl.java:1185) at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1261) at org.hibernate.impl.QueryImpl.list(QueryImpl.java:102) at com.liferay.portal.dao.orm.hibernate.QueryImpl.list(QueryImpl.java:113) ... 73 more {code}

    Liferay Issues | 3 years ago | Shuyang Zhou
    com.liferay.portal.kernel.events.ActionException: com.liferay.portal.kernel.exception.SystemException: com.liferay.portal.kernel.dao.orm.ORMException: java.lang.IndexOutOfBoundsException: Index: 1, Size: 0

    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. java.lang.NullPointerException

      No message provided

      at com.liferay.portal.service.impl.ResourcePermissionLocalServiceImpl.doUpdateResourcePermission()
    2. Liferay Portal Impl
      ResourcePermissionLocalServiceImpl.setResourcePermissions
      1. com.liferay.portal.service.impl.ResourcePermissionLocalServiceImpl.doUpdateResourcePermission(ResourcePermissionLocalServiceImpl.java:1200)
      2. com.liferay.portal.service.impl.ResourcePermissionLocalServiceImpl.doUpdateResourcePermission(ResourcePermissionLocalServiceImpl.java:1253)
      3. com.liferay.portal.service.impl.ResourcePermissionLocalServiceImpl.updateResourcePermission(ResourcePermissionLocalServiceImpl.java:1407)
      4. com.liferay.portal.service.impl.ResourcePermissionLocalServiceImpl.setResourcePermissions(ResourcePermissionLocalServiceImpl.java:1134)
      4 frames
    3. Java RT
      Method.invoke
      1. sun.reflect.GeneratedMethodAccessor1164.invoke(Unknown Source)
      2. sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
      3. java.lang.reflect.Method.invoke(Unknown Source)
      3 frames
    4. Liferay Portal Impl
      ServiceBeanAopProxy.invoke
      1. com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:115)
      2. com.liferay.portal.spring.transaction.DefaultTransactionExecutor.execute(DefaultTransactionExecutor.java:62)
      3. com.liferay.portal.spring.transaction.TransactionInterceptor.invoke(TransactionInterceptor.java:51)
      4. com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:111)
      5. com.liferay.portal.spring.aop.ServiceBeanAopProxy.invoke(ServiceBeanAopProxy.java:175)
      5 frames
    5. com.sun.proxy
      $Proxy152.setResourcePermissions
      1. com.sun.proxy.$Proxy152.setResourcePermissions(Unknown Source)
      1 frame
    6. Liferay Portal Impl
      ResourcePermissionServiceImpl.setIndividualResourcePermissions
      1. com.liferay.portal.service.impl.ResourcePermissionServiceImpl.setIndividualResourcePermissions(ResourcePermissionServiceImpl.java:238)
      1 frame
    7. Java RT
      Method.invoke
      1. sun.reflect.GeneratedMethodAccessor1163.invoke(Unknown Source)
      2. sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
      3. java.lang.reflect.Method.invoke(Unknown Source)
      3 frames
    8. Liferay Portal Impl
      ServiceBeanAopProxy.invoke
      1. com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:115)
      2. com.liferay.portal.spring.transaction.DefaultTransactionExecutor.execute(DefaultTransactionExecutor.java:62)
      3. com.liferay.portal.spring.transaction.TransactionInterceptor.invoke(TransactionInterceptor.java:51)
      4. com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:111)
      5. com.liferay.portal.spring.aop.ChainableMethodAdvice.invoke(ChainableMethodAdvice.java:56)
      6. com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:111)
      7. com.liferay.portal.spring.aop.ServiceBeanAopProxy.invoke(ServiceBeanAopProxy.java:175)
      7 frames
    9. com.sun.proxy
      $Proxy153.setIndividualResourcePermissions
      1. com.sun.proxy.$Proxy153.setIndividualResourcePermissions(Unknown Source)
      1 frame
    10. Liferay Portal Service
      ResourcePermissionServiceUtil.setIndividualResourcePermissions
      1. com.liferay.portal.service.ResourcePermissionServiceUtil.setIndividualResourcePermissions(ResourcePermissionServiceUtil.java:245)
      1 frame