java.lang.NullPointerException

Sakai JIRA | Ian Boston | 4 years ago
  1. 0

    In the XMLUI If I edit a collection Add a role to a workflow step clicking create. Add a user to that role. save then delete the role from the workflow step. I get the following NPE: java.lang.NullPointerException at org.dspace.xmlworkflow.WorkflowUtils.deleteRoleGroup(WorkflowUtils.java:215) at org.dspace.app.xmlui.aspect.administrative.FlowContainerUtils.processDeleteCollectionRole(FlowContainerUtils.java:538) 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.mozilla.javascript.MemberBox.invoke(MemberBox.java:155) at org.mozilla.javascript.NativeJavaMethod.call(NativeJavaMethod.java:243) at org.mozilla.javascript.Interpreter.interpretLoop(Interpreter.java:3237) The method is: public static void deleteRoleGroup(Context context, Collection collection, String roleID) throws SQLException, IOException, WorkflowConfigurationException { Workflow workflow = WorkflowFactory.getWorkflow(collection); Role role = workflow.getRoles().get(roleID); Line: 215>>>>>>> NPE on role if(role.getScope() == Role.Scope.COLLECTION){ CollectionRole ass = CollectionRole.find(context, collection.getID(), roleID); ass.delete(); } } You could do if ( role != null && role.getScope() ... but role should not be null ?

    Sakai JIRA | 4 years ago | Ian Boston
    java.lang.NullPointerException
  2. 0

    In the XMLUI If I edit a collection Add a role to a workflow step clicking create. Add a user to that role. save then delete the role from the workflow step. I get the following NPE: java.lang.NullPointerException at org.dspace.xmlworkflow.WorkflowUtils.deleteRoleGroup(WorkflowUtils.java:215) at org.dspace.app.xmlui.aspect.administrative.FlowContainerUtils.processDeleteCollectionRole(FlowContainerUtils.java:538) 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.mozilla.javascript.MemberBox.invoke(MemberBox.java:155) at org.mozilla.javascript.NativeJavaMethod.call(NativeJavaMethod.java:243) at org.mozilla.javascript.Interpreter.interpretLoop(Interpreter.java:3237) The method is: public static void deleteRoleGroup(Context context, Collection collection, String roleID) throws SQLException, IOException, WorkflowConfigurationException { Workflow workflow = WorkflowFactory.getWorkflow(collection); Role role = workflow.getRoles().get(roleID); Line: 215>>>>>>> NPE on role if(role.getScope() == Role.Scope.COLLECTION){ CollectionRole ass = CollectionRole.find(context, collection.getID(), roleID); ass.delete(); } } You could do if ( role != null && role.getScope() ... but role should not be null ?

    Sakai JIRA | 4 years ago | Ian Boston
    java.lang.NullPointerException
  3. 0

    Android: Saving Map State in Google map

    Stack Overflow | 11 months ago | Junie Negentien
    java.lang.RuntimeException: Unable to resume activity {com.ourThesis.junieNegentien2015/com.ourThesis.junieNegentien2015.MainActivity}: java.lang.NullPointerException
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

    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 org.dspace.xmlworkflow.WorkflowUtils.deleteRoleGroup()
    2. DSpace Kernel :: API and Implementation
      WorkflowUtils.deleteRoleGroup
      1. org.dspace.xmlworkflow.WorkflowUtils.deleteRoleGroup(WorkflowUtils.java:215)
      1 frame
    3. org.dspace.app
      FlowContainerUtils.processDeleteCollectionRole
      1. org.dspace.app.xmlui.aspect.administrative.FlowContainerUtils.processDeleteCollectionRole(FlowContainerUtils.java:538)
      1 frame
    4. Java RT
      Method.invoke
      1. sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      2. sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      3. sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      4. java.lang.reflect.Method.invoke(Method.java:597)
      4 frames
    5. Rhino
      Interpreter.interpretLoop
      1. org.mozilla.javascript.MemberBox.invoke(MemberBox.java:155)
      2. org.mozilla.javascript.NativeJavaMethod.call(NativeJavaMethod.java:243)
      3. org.mozilla.javascript.Interpreter.interpretLoop(Interpreter.java:3237)
      3 frames