2 Replies Latest reply on May 8, 2010 9:58 PM by Nicklas Karlsson

    Error Rendering View javax.el.ELException ... java.lang.NullPointerException

    Joe Joe Newbie

      Hello, I am attempting to run a simple program that displays a value from a class 'b1' that calls another class 'b2'. I am using Jboss 6.0 and Java 6 with web.xml version 2.5 and face config version 2.0 but getting an error message for ELException and NullPointerException.


      my view xhtml file has the following


      #{b1.stockValue}



      which checks b1.stockvalue method like so




         @Named("b1")
          @RequestScoped
          ...
          @Current 
          private StockService stkSrv; 
          ...
          public int getStockValue() {
              return stkSrv.getStockValue(this); //passes an instance of this class
          }
          ...
      




      which forwards an instance of this class to another class:


      @Named("b2")
      @ApplicationScoped
          public int getStockValue(QuoteRequest r) { 
              return Math.abs((r.getSym() + r.getQuoteDate().toString()).hashCode());
          }
      



      here is the stack trace, please help! Thanks


      13:06:53,278 SEVERE [javax.enterprise.resource.webcontainer.jsf.application] Error Rendering View[/stockvalue.xhtml]: javax.el.ELException: /stockvalue.xhtml: java.lang.NullPointerException
              at com.sun.faces.facelets.compiler.TextInstruction.write(TextInstruction.java:81) [:2.0.2-FCS]
              at com.sun.faces.facelets.compiler.UIInstructions.encodeBegin(UIInstructions.java:75) [:2.0.2-FCS]
              at com.sun.faces.facelets.compiler.UILeaf.encodeAll(UILeaf.java:176) [:2.0.2-FCS]
              at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1616) [:2.0.2-FCS]
              at com.sun.faces.application.view.FaceletViewHandlingStrategy.renderView(FaceletViewHandlingStrategy.java:380) [:2.0.2-FCS]
              at com.sun.faces.application.view.MultiViewHandler.renderView(MultiViewHandler.java:126) [:2.0.2-FCS]
              at javax.faces.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:273) [:2.0.2-FCS]
              at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:127) [:2.0.2-FCS]
              at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101) [:2.0.2-FCS]
              at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:139) [:2.0.2-FCS]
              at javax.faces.webapp.FacesServlet.service(FacesServlet.java:313) [:2.0.2-FCS]
              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:336) [:6.0.0.20100429-M3]
              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:242) [:6.0.0.20100429-M3]
              at org.jboss.weld.servlet.ConversationPropagationFilter.doFilter(ConversationPropagationFilter.java:68) [:1.0.1.Final]
              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:274) [:6.0.0.20100429-M3]
              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:242) [:6.0.0.20100429-M3]
              at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:293) [:6.0.0.20100429-M3]
              at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191) [:6.0.0.20100429-M3]
              at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:183) [:6.0.0.20100429-M3]
              at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:95) [:6.0.0.20100429-M3]
              at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.process(SecurityContextEstablishmentValve.java:126) [:6.0.0.20100429-M3]
              at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.invoke(SecurityContextEstablishmentValve.java:70) [:6.0.0.20100429-M3]
              at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127) [:6.0.0.20100429-M3]
              at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) [:6.0.0.20100429-M3]
              at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:158) [:6.0.0.20100429-M3]
              at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) [:6.0.0.20100429-M3]
              at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:368) [:6.0.0.20100429-M3]
              at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:872) [:6.0.0.20100429-M3]
              at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:653) [:6.0.0.20100429-M3]
              at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:951) [:6.0.0.20100429-M3]
              at java.lang.Thread.run(Thread.java:619) [:1.6.0_19]
      Caused by: java.lang.NullPointerException