3 Replies Latest reply: Nov 29, 2012 7:09 AM by Tshifhiwa RSS

    javax.faces.el.EvaluationException: java.lang.NullPointerException

    Tshifhiwa
      Hi am able to get this value when debuging
      USERNAMEametest juliatest14
      USERNAMEametest nomsatest
      USERNAMEametest julianev1
      getusername julianev1
      rolenameoid dfdgd

      but when i what to send this value hear Map usr = (Map)actionEvent.getComponent().getAttributes().get(getusername()); am geting NPE error,why am i able to get the value but not able to pass them
      public class Details {
       private String name;
          public void setName(String name) {
              this.name = name;
          }
      
          public String getName() {
              return name;
          }
          public String getusername(){
              DCIteratorBinding it = ADFUtils.findIterator("addmemberBeanIterator");
               Row r1 = null;
              String usrw = null;
              if(it != null && it.size() >0){
              ArrayList<AddmemberBean> co = new  ArrayList<AddmemberBean> (it .size());
               for(Row r : it.getAllRowsInRange() ) {
                    AddmemberBean rt = new AddmemberBean();
                   
               usrw = (String)r.getAttribute("name");
              rt.setName((String)r.getAttribute("name"));
                   System.out.println("USERNAMEtest " + usrw);
                     co.add(rt);
                  }
              this.setAaddMember(co);
              }
              return usrw;
                  
                   
          }
          public String GetNextStopPayment(){
               
          OIDOperations resu = new OIDOperations();
        
          System.out.println("getusernametooid " + this.getusername());
          System.out.println("rolenametooid " + name);
          Map usr = (Map)actionEvent.getComponent().getAttributes().get(getusername());
         
          resu.assignRoleToUsers(name,usr); 
          System.out.println("uuseraddedin oi " + getusername());
          System.out.println("rolenameaddedin oid " + name);
      }
      }
      when i get hear am geting null value= Map usr = (Map)actionEvent.getComponent().getAttributes().get(getusername());

      am in jdeveloper 11.1.16.0
      log error is
      Caused by: javax.faces.el.EvaluationException: java.lang.NullPointerException
           at org.apache.myfaces.trinidad.component.MethodExpressionMethodBinding.invoke(MethodExpressionMethodBinding.java:51)
           at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:102)
           at org.apache.myfaces.trinidad.component.UIXCommand.broadcast(UIXCommand.java:190)
           at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent$1.run(ContextSwitchingComponent.java:92)
           at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent._processPhase(ContextSwitchingComponent.java:361)
           at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent.broadcast(ContextSwitchingComponent.java:96)
           at oracle.adf.view.rich.component.fragment.UIXInclude.broadcast(UIXInclude.java:102)
           at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent$1.run(ContextSwitchingComponent.java:92)
           at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent._processPhase(ContextSwitchingComponent.java:361)
           at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent.broadcast(ContextSwitchingComponent.java:96)
           at oracle.adf.view.rich.component.fragment.UIXInclude.broadcast(UIXInclude.java:96)
           at oracle.adf.view.rich.component.fragment.UIXRegion.broadcast(UIXRegion.java:148)
           at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl.broadcastEvents(LifecycleImpl.java:1018)
           at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl._executePhase(LifecycleImpl.java:386)
           at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:194)
           at javax.faces.webapp.FacesServlet.service(FacesServlet.java:265)
           ... 38 more
      Caused by: java.lang.NullPointerException
           at Details.GetNextStopPayment(OrgDetails.java:486)
           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.sun.el.parser.AstValue.invoke(Unknown Source)
           at com.sun.el.MethodExpressionImpl.invoke(Unknown Source)
           at org.apache.myfaces.trinidad.component.MethodExpressionMethodBinding.invoke(MethodExpressionMethodBinding.java:46)

      am in jdeveloper 11.1.1.6.0

      Edited by: adf0994 on 2012/11/29 1:02 PM