2 Replies Latest reply on May 21, 2012 2:32 AM by Sinan Doğan

    Getting nullpointerexception while persisting

    Sinan Doğan Newbie

      Hi. I am getting nullpointer exception while persisting an object. I checked values in debug, all of objects is loadded but when step came entitymanager.persist that exception has been throwing. 

       

      //PartStockFacade
      public void loadFromPartCatalog(PartCatalog partCatalog){
        
                          this.partNumber = partCatalog.getPartNumber();
                          this.getPartStock().setDescription(partCatalog.getDescription());
                          this.getPartStock().setListPrice(partCatalog.getListPrice());
                          this.getPartStock().setMake(partCatalog.getMake());
                          this.getPartStock().setPartCategory(partCatalog.getPartCategory());
                          this.getPartStock().setPartSupplier(partCatalog.getPartSupplier());
                          this.getPartStock().setInvalid(true);
                          this.getPartStock().setBarCode(partCatalog.getBarCode()); 
                          this.add();
        
                }
      
      public void add(){
        
                          partStockKey = new PartStockKey();
                          partStockKey.setPartNumber(partNumber);
                          partStockKey.setDepot(partStockDepot);
                          partStock.setPartStockKey(partStockKey);
                          partStock.setCreateDate(new Date());
        
                          partStockController.persist(partStock);
        
                          partStock = new PartStock();
                          partNumber = new String();
                          partStockDepot = new Depot();
                }
      
      //PartStockController
      public void persist(PartStock partStock){
        
                          if(this.find(partStock) == null){
                                    entityManager.merge(partStock); 
                          }else{
                                    facesMessages.add("Parca Stokta Zaten Var!");
                          }
                }
      
      

       

      17:05:15,547 FATAL [application] java.lang.NullPointerException

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

                at javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:91)

                at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:91)

                at org.primefaces.application.CleanupActionListener.processAction(CleanupActionListener.java:42)

                at javax.faces.component.UICommand.broadcast(UICommand.java:383)

                at org.ajax4jsf.component.AjaxActionComponent.broadcast(AjaxActionComponent.java:55)

                at org.ajax4jsf.component.AjaxViewRoot.processEvents(AjaxViewRoot.java:321)

                at org.ajax4jsf.component.AjaxViewRoot.broadcastEvents(AjaxViewRoot.java:296)

                at org.ajax4jsf.component.AjaxViewRoot.processPhase(AjaxViewRoot.java:253)

                at org.ajax4jsf.component.AjaxViewRoot.processApplication(AjaxViewRoot.java:466)

                at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:97)

                at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:251)

                at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:117)

                at javax.faces.webapp.FacesServlet.service(FacesServlet.java:244)

                at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)

                at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)

                at org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:90)

                at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)

                at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)

                at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:83)

                at org.jboss.seam.web.IdentityFilter.doFilter(IdentityFilter.java:40)

                at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)

                at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:73)

                at org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:64)

                at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)

                at org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:45)

                at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)

                at org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:178)

                at org.ajax4jsf.webapp.BaseFilter.handleRequest(BaseFilter.java:290)

                at org.ajax4jsf.webapp.BaseFilter.processUploadsAndHandleRequest(BaseFilter.java:368)

                at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:495)

                at org.jboss.seam.web.Ajax4jsfFilter.doFilter(Ajax4jsfFilter.java:56)

                at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)

                at org.jboss.seam.web.LoggingFilter.doFilter(LoggingFilter.java:60)

                at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)

                at org.jboss.seam.web.HotDeployFilter.doFilter(HotDeployFilter.java:53)

                at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)

                at org.jboss.seam.servlet.SeamFilter.doFilter(SeamFilter.java:158)

                at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)

                at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)

                at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)

                at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)

                at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)

                at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)

                at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)

                at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:179)

                at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:432)

                at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)

                at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)

                at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)

                at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)

                at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)

                at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:262)

                at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)

                at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)

                at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:446)

                at java.lang.Thread.run(Unknown Source)

      Caused by: java.lang.NullPointerException

                at org.hibernate.type.AbstractType.getHashCode(AbstractType.java:112)

                at org.hibernate.type.AbstractType.getHashCode(AbstractType.java:120)

                at org.hibernate.type.EntityType.getHashCode(EntityType.java:279)

                at org.hibernate.type.ComponentType.getHashCode(ComponentType.java:189)

                at org.hibernate.engine.EntityKey.generateHashCode(EntityKey.java:104)

                at org.hibernate.engine.EntityKey.<init>(EntityKey.java:48)

                at org.hibernate.event.def.DefaultLoadEventListener.onLoad(DefaultLoadEventListener.java:92)

                at org.hibernate.impl.SessionImpl.fireLoad(SessionImpl.java:878)

                at org.hibernate.impl.SessionImpl.get(SessionImpl.java:815)

                at org.hibernate.impl.SessionImpl.get(SessionImpl.java:808)

                at org.hibernate.ejb.AbstractEntityManagerImpl.find(AbstractEntityManagerImpl.java:182)

                at org.jboss.seam.persistence.EntityManagerProxy.find(EntityManagerProxy.java:87)

                at org.domain.carsclass.controller.PartStockControlBean.find(PartStockControlBean.java:51)

                at org.domain.carsclass.controller.PartStockControlBean.persist(PartStockControlBean.java:33)

                at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

                at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)

                at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

                at java.lang.reflect.Method.invoke(Unknown Source)

                at org.jboss.seam.util.Reflections.invoke(Reflections.java:22)

                at org.jboss.seam.intercept.RootInvocationContext.proceed(RootInvocationContext.java:32)

                at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:56)

                at org.jboss.seam.transaction.RollbackInterceptor.aroundInvoke(RollbackInterceptor.java:28)

                at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)

                at org.jboss.seam.core.BijectionInterceptor.aroundInvoke(BijectionInterceptor.java:77)

                at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)

                at org.jboss.seam.core.MethodContextInterceptor.aroundInvoke(MethodContextInterceptor.java:44)

                at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)

                at org.jboss.seam.core.SynchronizationInterceptor.aroundInvoke(SynchronizationInterceptor.java:32)

                at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)

                at org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:107)

                at org.jboss.seam.intercept.JavaBeanInterceptor.interceptInvocation(JavaBeanInterceptor.java:185)

                at org.jboss.seam.intercept.JavaBeanInterceptor.invoke(JavaBeanInterceptor.java:103)

                at org.domain.carsclass.controller.PartStockControlBean_$$_javassist_seam_13.persist(PartStockControlBean_$$_javassist_seam_13.java)

                at org.domain.carsclass.session.PartStockFacade.add(PartStockFacade.java:68)

                at org.domain.carsclass.session.PartStockFacade.loadFromPartCatalog(PartStockFacade.java:118)

                at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

                at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)

                at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

                at java.lang.reflect.Method.invoke(Unknown Source)

                at org.jboss.seam.util.Reflections.invoke(Reflections.java:22)

                at org.jboss.seam.intercept.RootInvocationContext.proceed(RootInvocationContext.java:32)

                at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:56)

                at org.jboss.seam.transaction.RollbackInterceptor.aroundInvoke(RollbackInterceptor.java:28)

                at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)

                at org.jboss.seam.core.BijectionInterceptor.aroundInvoke(BijectionInterceptor.java:77)

                at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)

                at org.jboss.seam.core.MethodContextInterceptor.aroundInvoke(MethodContextInterceptor.java:44)

                at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)

                at org.jboss.seam.core.SynchronizationInterceptor.aroundInvoke(SynchronizationInterceptor.java:32)

                at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)

                at org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:107)

                at org.jboss.seam.intercept.JavaBeanInterceptor.interceptInvocation(JavaBeanInterceptor.java:185)

                at org.jboss.seam.intercept.JavaBeanInterceptor.invoke(JavaBeanInterceptor.java:103)

                at org.domain.carsclass.session.PartStockFacade_$$_javassist_seam_12.loadFromPartCatalog(PartStockFacade_$$_javassist_seam_12.java)

                at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

                at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)

                at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

                at java.lang.reflect.Method.invoke(Unknown Source)

                at org.jboss.el.util.ReflectionUtil.invokeMethod(ReflectionUtil.java:335)

                at org.jboss.el.util.ReflectionUtil.invokeMethod(ReflectionUtil.java:280)

                at org.jboss.el.parser.AstMethodSuffix.getValue(AstMethodSuffix.java:59)

                at org.jboss.el.parser.AstMethodSuffix.invoke(AstMethodSuffix.java:65)

                at org.jboss.el.parser.AstValue.invoke(AstValue.java:96)

                at org.jboss.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:276)

                at com.sun.facelets.el.TagMethodExpression.invoke(TagMethodExpression.java:68)

                at javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:77)

                ... 55 more

      17:05:15,566 WARN  [lifecycle] #{partStockFacade.loadFromPartCatalog(partCatalogFacade.partCatalog)}: java.lang.NullPointerException

      javax.faces.FacesException: #{partStockFacade.loadFromPartCatalog(partCatalogFacade.partCatalog)}: java.lang.NullPointerException

                at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:107)

                at org.primefaces.application.CleanupActionListener.processAction(CleanupActionListener.java:42)

                at javax.faces.component.UICommand.broadcast(UICommand.java:383)

                at org.ajax4jsf.component.AjaxActionComponent.broadcast(AjaxActionComponent.java:55)

                at org.ajax4jsf.component.AjaxViewRoot.processEvents(AjaxViewRoot.java:321)

                at org.ajax4jsf.component.AjaxViewRoot.broadcastEvents(AjaxViewRoot.java:296)

                at org.ajax4jsf.component.AjaxViewRoot.processPhase(AjaxViewRoot.java:253)

                at org.ajax4jsf.component.AjaxViewRoot.processApplication(AjaxViewRoot.java:466)

                at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:97)

                at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:251)

                at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:117)

                at javax.faces.webapp.FacesServlet.service(FacesServlet.java:244)

                at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)

                at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)

                at org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:90)

                at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)

                at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)

                at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:83)

                at org.jboss.seam.web.IdentityFilter.doFilter(IdentityFilter.java:40)

                at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)

                at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:73)

                at org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:64)

                at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)

                at org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:45)

                at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)

                at org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:178)

                at org.ajax4jsf.webapp.BaseFilter.handleRequest(BaseFilter.java:290)

                at org.ajax4jsf.webapp.BaseFilter.processUploadsAndHandleRequest(BaseFilter.java:368)

                at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:495)

                at org.jboss.seam.web.Ajax4jsfFilter.doFilter(Ajax4jsfFilter.java:56)

                at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)

                at org.jboss.seam.web.LoggingFilter.doFilter(LoggingFilter.java:60)

                at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)

                at org.jboss.seam.web.HotDeployFilter.doFilter(HotDeployFilter.java:53)

                at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)

                at org.jboss.seam.servlet.SeamFilter.doFilter(SeamFilter.java:158)

                at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)

                at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)

                at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)

                at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)

                at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)

                at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)

                at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)

                at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:179)

                at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:432)

                at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)

                at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)

                at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)

                at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)

                at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)

                at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:262)

                at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)

                at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)

                at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:446)

                at java.lang.Thread.run(Unknown Source)

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

                at javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:91)

                at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:91)

                ... 54 more

      Caused by: java.lang.NullPointerException

                at org.hibernate.type.AbstractType.getHashCode(AbstractType.java:112)

                at org.hibernate.type.AbstractType.getHashCode(AbstractType.java:120)

                at org.hibernate.type.EntityType.getHashCode(EntityType.java:279)

                at org.hibernate.type.ComponentType.getHashCode(ComponentType.java:189)

                at org.hibernate.engine.EntityKey.generateHashCode(EntityKey.java:104)

                at org.hibernate.engine.EntityKey.<init>(EntityKey.java:48)

                at org.hibernate.event.def.DefaultLoadEventListener.onLoad(DefaultLoadEventListener.java:92)

                at org.hibernate.impl.SessionImpl.fireLoad(SessionImpl.java:878)

                at org.hibernate.impl.SessionImpl.get(SessionImpl.java:815)

                at org.hibernate.impl.SessionImpl.get(SessionImpl.java:808)

                at org.hibernate.ejb.AbstractEntityManagerImpl.find(AbstractEntityManagerImpl.java:182)

                at org.jboss.seam.persistence.EntityManagerProxy.find(EntityManagerProxy.java:87)

                at org.domain.carsclass.controller.PartStockControlBean.find(PartStockControlBean.java:51)

                at org.domain.carsclass.controller.PartStockControlBean.persist(PartStockControlBean.java:33)

                at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

                at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)

                at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

                at java.lang.reflect.Method.invoke(Unknown Source)

                at org.jboss.seam.util.Reflections.invoke(Reflections.java:22)

                at org.jboss.seam.intercept.RootInvocationContext.proceed(RootInvocationContext.java:32)

                at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:56)

                at org.jboss.seam.transaction.RollbackInterceptor.aroundInvoke(RollbackInterceptor.java:28)

                at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)

                at org.jboss.seam.core.BijectionInterceptor.aroundInvoke(BijectionInterceptor.java:77)

                at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)

                at org.jboss.seam.core.MethodContextInterceptor.aroundInvoke(MethodContextInterceptor.java:44)

                at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)

                at org.jboss.seam.core.SynchronizationInterceptor.aroundInvoke(SynchronizationInterceptor.java:32)

                at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)

                at org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:107)

                at org.jboss.seam.intercept.JavaBeanInterceptor.interceptInvocation(JavaBeanInterceptor.java:185)

                at org.jboss.seam.intercept.JavaBeanInterceptor.invoke(JavaBeanInterceptor.java:103)

                at org.domain.carsclass.controller.PartStockControlBean_$$_javassist_seam_13.persist(PartStockControlBean_$$_javassist_seam_13.java)

                at org.domain.carsclass.session.PartStockFacade.add(PartStockFacade.java:68)

                at org.domain.carsclass.session.PartStockFacade.loadFromPartCatalog(PartStockFacade.java:118)

                at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

                at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)

                at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

                at java.lang.reflect.Method.invoke(Unknown Source)

                at org.jboss.seam.util.Reflections.invoke(Reflections.java:22)

                at org.jboss.seam.intercept.RootInvocationContext.proceed(RootInvocationContext.java:32)

                at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:56)

                at org.jboss.seam.transaction.RollbackInterceptor.aroundInvoke(RollbackInterceptor.java:28)

                at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)

                at org.jboss.seam.core.BijectionInterceptor.aroundInvoke(BijectionInterceptor.java:77)

                at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)

                at org.jboss.seam.core.MethodContextInterceptor.aroundInvoke(MethodContextInterceptor.java:44)

                at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)

                at org.jboss.seam.core.SynchronizationInterceptor.aroundInvoke(SynchronizationInterceptor.java:32)

                at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)

                at org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:107)

                at org.jboss.seam.intercept.JavaBeanInterceptor.interceptInvocation(JavaBeanInterceptor.java:185)

                at org.jboss.seam.intercept.JavaBeanInterceptor.invoke(JavaBeanInterceptor.java:103)

                at org.domain.carsclass.session.PartStockFacade_$$_javassist_seam_12.loadFromPartCatalog(PartStockFacade_$$_javassist_seam_12.java)

                at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

                at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)

                at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

                at java.lang.reflect.Method.invoke(Unknown Source)

                at org.jboss.el.util.ReflectionUtil.invokeMethod(ReflectionUtil.java:335)

                at org.jboss.el.util.ReflectionUtil.invokeMethod(ReflectionUtil.java:280)

                at org.jboss.el.parser.AstMethodSuffix.getValue(AstMethodSuffix.java:59)

                at org.jboss.el.parser.AstMethodSuffix.invoke(AstMethodSuffix.java:65)

                at org.jboss.el.parser.AstValue.invoke(AstValue.java:96)

                at org.jboss.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:276)

                at com.sun.facelets.el.TagMethodExpression.invoke(TagMethodExpression.java:68)

                at javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:77)

                ... 55 more

      17:05:15,570 WARN  [lifecycle] executePhase(INVOKE_APPLICATION 5,com.sun.faces.context.FacesContextImpl@129a559) threw exception

      javax.faces.FacesException: #{partStockFacade.loadFromPartCatalog(partCatalogFacade.partCatalog)}: java.lang.NullPointerException

                at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:105)

                at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:251)

                at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:117)

                at javax.faces.webapp.FacesServlet.service(FacesServlet.java:244)

                at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)

                at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)

                at org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:90)

                at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)

                at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)

                at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:83)

                at org.jboss.seam.web.IdentityFilter.doFilter(IdentityFilter.java:40)

                at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)

                at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:73)

                at org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:64)

                at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)

                at org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:45)

                at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)

                at org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:178)

                at org.ajax4jsf.webapp.BaseFilter.handleRequest(BaseFilter.java:290)

                at org.ajax4jsf.webapp.BaseFilter.processUploadsAndHandleRequest(BaseFilter.java:368)

                at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:495)

                at org.jboss.seam.web.Ajax4jsfFilter.doFilter(Ajax4jsfFilter.java:56)

                at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)

                at org.jboss.seam.web.LoggingFilter.doFilter(LoggingFilter.java:60)

                at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)

                at org.jboss.seam.web.HotDeployFilter.doFilter(HotDeployFilter.java:53)

                at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)

                at org.jboss.seam.servlet.SeamFilter.doFilter(SeamFilter.java:158)

                at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)

                at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)

                at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)

                at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)

                at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)

                at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)

                at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)

                at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:179)

                at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:432)

                at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)

                at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)

                at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)

                at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)

                at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)

                at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:262)

                at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)

                at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)

                at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:446)

                at java.lang.Thread.run(Unknown Source)

      Caused by: javax.faces.FacesException: #{partStockFacade.loadFromPartCatalog(partCatalogFacade.partCatalog)}: java.lang.NullPointerException

                at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:107)

                at org.primefaces.application.CleanupActionListener.processAction(CleanupActionListener.java:42)

                at javax.faces.component.UICommand.broadcast(UICommand.java:383)

                at org.ajax4jsf.component.AjaxActionComponent.broadcast(AjaxActionComponent.java:55)

                at org.ajax4jsf.component.AjaxViewRoot.processEvents(AjaxViewRoot.java:321)

                at org.ajax4jsf.component.AjaxViewRoot.broadcastEvents(AjaxViewRoot.java:296)

                at org.ajax4jsf.component.AjaxViewRoot.processPhase(AjaxViewRoot.java:253)

                at org.ajax4jsf.component.AjaxViewRoot.processApplication(AjaxViewRoot.java:466)

                at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:97)

                ... 46 more

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

                at javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:91)

                at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:91)

                ... 54 more

      Caused by: java.lang.NullPointerException

                at org.hibernate.type.AbstractType.getHashCode(AbstractType.java:112)

                at org.hibernate.type.AbstractType.getHashCode(AbstractType.java:120)

                at org.hibernate.type.EntityType.getHashCode(EntityType.java:279)

                at org.hibernate.type.ComponentType.getHashCode(ComponentType.java:189)

                at org.hibernate.engine.EntityKey.generateHashCode(EntityKey.java:104)

                at org.hibernate.engine.EntityKey.<init>(EntityKey.java:48)

                at org.hibernate.event.def.DefaultLoadEventListener.onLoad(DefaultLoadEventListener.java:92)

                at org.hibernate.impl.SessionImpl.fireLoad(SessionImpl.java:878)

                at org.hibernate.impl.SessionImpl.get(SessionImpl.java:815)

                at org.hibernate.impl.SessionImpl.get(SessionImpl.java:808)

                at org.hibernate.ejb.AbstractEntityManagerImpl.find(AbstractEntityManagerImpl.java:182)

                at org.jboss.seam.persistence.EntityManagerProxy.find(EntityManagerProxy.java:87)

                at org.domain.carsclass.controller.PartStockControlBean.find(PartStockControlBean.java:51)

                at org.domain.carsclass.controller.PartStockControlBean.persist(PartStockControlBean.java:33)

                at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

                at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)

                at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

                at java.lang.reflect.Method.invoke(Unknown Source)

                at org.jboss.seam.util.Reflections.invoke(Reflections.java:22)

                at org.jboss.seam.intercept.RootInvocationContext.proceed(RootInvocationContext.java:32)

                at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:56)

                at org.jboss.seam.transaction.RollbackInterceptor.aroundInvoke(RollbackInterceptor.java:28)

                at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)

                at org.jboss.seam.core.BijectionInterceptor.aroundInvoke(BijectionInterceptor.java:77)

                at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)

                at org.jboss.seam.core.MethodContextInterceptor.aroundInvoke(MethodContextInterceptor.java:44)

                at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)

                at org.jboss.seam.core.SynchronizationInterceptor.aroundInvoke(SynchronizationInterceptor.java:32)

                at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)

                at org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:107)

                at org.jboss.seam.intercept.JavaBeanInterceptor.interceptInvocation(JavaBeanInterceptor.java:185)

                at org.jboss.seam.intercept.JavaBeanInterceptor.invoke(JavaBeanInterceptor.java:103)

                at org.domain.carsclass.controller.PartStockControlBean_$$_javassist_seam_13.persist(PartStockControlBean_$$_javassist_seam_13.java)

                at org.domain.carsclass.session.PartStockFacade.add(PartStockFacade.java:68)

                at org.domain.carsclass.session.PartStockFacade.loadFromPartCatalog(PartStockFacade.java:118)

                at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

                at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)

                at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

                at java.lang.reflect.Method.invoke(Unknown Source)

                at org.jboss.seam.util.Reflections.invoke(Reflections.java:22)

                at org.jboss.seam.intercept.RootInvocationContext.proceed(RootInvocationContext.java:32)

                at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:56)

                at org.jboss.seam.transaction.RollbackInterceptor.aroundInvoke(RollbackInterceptor.java:28)

                at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)

                at org.jboss.seam.core.BijectionInterceptor.aroundInvoke(BijectionInterceptor.java:77)

                at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)

                at org.jboss.seam.core.MethodContextInterceptor.aroundInvoke(MethodContextInterceptor.java:44)

                at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)

                at org.jboss.seam.core.SynchronizationInterceptor.aroundInvoke(SynchronizationInterceptor.java:32)

                at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)

                at org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:107)

                at org.jboss.seam.intercept.JavaBeanInterceptor.interceptInvocation(JavaBeanInterceptor.java:185)

                at org.jboss.seam.intercept.JavaBeanInterceptor.invoke(JavaBeanInterceptor.java:103)

                at org.domain.carsclass.session.PartStockFacade_$$_javassist_seam_12.loadFromPartCatalog(PartStockFacade_$$_javassist_seam_12.java)

                at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

                at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)

                at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

                at java.lang.reflect.Method.invoke(Unknown Source)

                at org.jboss.el.util.ReflectionUtil.invokeMethod(ReflectionUtil.java:335)

                at org.jboss.el.util.ReflectionUtil.invokeMethod(ReflectionUtil.java:280)

                at org.jboss.el.parser.AstMethodSuffix.getValue(AstMethodSuffix.java:59)

                at org.jboss.el.parser.AstMethodSuffix.invoke(AstMethodSuffix.java:65)

                at org.jboss.el.parser.AstValue.invoke(AstValue.java:96)

                at org.jboss.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:276)

                at com.sun.facelets.el.TagMethodExpression.invoke(TagMethodExpression.java:68)

                at javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:77)

                ... 55 more

       

        • 1. Re: Getting nullpointerexception while persisting
          Sinan Doğan Newbie

          my xhtml page :

           

          <h:panelGrid columns="3">

                                                            <h:outputText value="Bulundugu Depolar" />

                                                            <h:outputText value=":"/>

                                                            <h:selectOneMenu rendered="#{partStockFacade.isDepotOfPartCat == true}" style="width:150px;">

                                                                                <s:selectItems value="#{partStockFacade.depotsOfPartCatalogList}" var="depot" label="#{depot.name}" />

                                                                                <s:convertEntity />

                                                            </h:selectOneMenu>

                                                            <h:outputText value="Parca Depolarda Bulunmamaktadir." style="font-style: italic;" rendered="#{partStockFacade.isDepotOfPartCat == false}"/>

           

                                                            <rich:spacer height="10" /><rich:spacer /><rich:spacer />

           

                                                            <h:outputText value="Stok Olustur" style="font-weight: bold; float: right;" />

                                                            <rich:spacer />

                                                            <rich:separator lineType="beveled" height="5"/>

           

                                                            <h:outputText value="Depo" />

                                                            <h:outputText value=":" />

                                                            <h:selectOneMenu value="#{partStockFacade.partStockDepot}" style="width:150px;">

                                                                      <s:selectItems value="#{depotFacade.shopKeeperDepotList}" var="depot" label="#{depot.name}" />

                                                                      <s:convertEntity />

                                                            </h:selectOneMenu>

           

                                                            <h:outputText value="Ortalama Fiyat" />

                                                            <h:outputText value=":" />

                                                            <h:inputText value="#{partStockFacade.partStock.averagePrice}" />

           

                                                            <rich:spacer />

                                                            <rich:spacer />

                                                            <a4j:commandButton action="#{partStockFacade.loadFromPartCatalog(partCatalogFacade.partCatalog)}" value="Stok Olustur" reRender="stockInf" style="float:rigth;" ajaxSingle="true"/>

                                                  </h:panelGrid>