NetBeans Forums

 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
  

java.lang.nullpointerexception

 
Post new topic   Reply to topic    NetBeans Forums -> Java EE Users
View previous topic :: View next topic  
Author Message
harini19



Joined: 29 Apr 2009
Posts: 28
Location: India

PostPosted: Mon May 18, 2009 11:59 am    Post subject: java.lang.nullpointerexception Reply with quote

public TbdbTasktable[] getUsers() throws NotSupportedException, SystemException, RollbackException, HeuristicMixedException, HeuristicRollbackException {
EntityManager em = getEntityManager();


try {

TbdbProcesstable process=new TbdbProcesstable();
TbdbTasktable task=new TbdbTasktable();
process=task.getProcess();
users=process.getTaskCollection().toArray(new TbdbTasktable[0]);
return (users);

} finally {
}
}
}


I'm gettint java.lang.nullpointerexception

details:
I've two tables
TbdbProcesstable(ProcessId,ProcessName,UpdatedBy,TimeStamp)
ProcessId is the primary key
TdbdbTasktable(ProcessId,TaskId,TaskName,UpdatedBy,TimeStamp)
ProcessId+TaskId is the primary key

This is the case of composite primary key
When I use netbeans, it creates two classes for TdbdbTasktable, one TdbdbTasktable and the other TdbdbTasktablePK.

Processtable has onetomany relationship with Tasktable
I've added the following code in TbdbProcesstable

@OneToMany(targetEntity=TbdbTasktable.class,cascade = CascadeType.ALL, mappedBy = "process")
private Collection<TbdbTasktable> taskCollection;

public Collection<TbdbTasktable> getTaskCollection() {
return taskCollection;
}

public void setTaskCollection(Collection<TbdbTasktable> taskCollection) {
this.taskCollection = taskCollection;
}


Similarly in TdbdbTasktable, I've added the following code
@ManyToOne(targetEntity=TbdbProcesstable.class,cascade = CascadeType.ALL)
@JoinColumn(name = "ProcessId", referencedColumnName = "ProcessId")
private TbdbProcesstable process;

public TbdbProcesstable getProcess() {
return process;
}

public void setProcess(TbdbProcesstable process) {
this.process = process;
}
Back to top
harini19



Joined: 29 Apr 2009
Posts: 28
Location: India

PostPosted: Mon May 18, 2009 12:08 pm    Post subject: java.lang.nullpointerexception Reply with quote

The stack trace:
javax.faces.FacesException: javax.el.ELException: javax.faces.el.EvaluationException: javax.el.ELException: java.lang.NullPointerException
at javax.faces.component.UIData.getValue(UIData.java:585)
at com.icesoft.faces.component.panelseries.UISeries.getDataModel(UISeries.java:310)
at com.icesoft.faces.component.panelseries.UISeries.processCurrentRowData(UISeries.java:138)
at com.icesoft.faces.component.panelseries.UISeries.setRowIndex(UISeries.java:130)
at com.icesoft.faces.component.ext.renderkit.TableRenderer.renderFacet(TableRenderer.java:142)
at com.icesoft.faces.renderkit.dom_html_basic.TableRenderer.encodeBegin(TableRenderer.java:117)
at javax.faces.component.UIComponentBase.encodeBegin(UIComponentBase.java:788)
at javax.faces.component.UIData.encodeBegin(UIData.java:879)
at com.icesoft.faces.component.panelseries.UISeries.encodeBegin(UISeries.java:251)
at com.icesoft.faces.renderkit.dom_html_basic.DomBasicRenderer.encodeParentAndChildren(DomBasicRenderer.java:350)
at com.icesoft.faces.renderkit.dom_html_basic.GroupRenderer.encodeChildren(GroupRenderer.java:92)
at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:812)
at com.icesoft.faces.component.util.CustomComponentUtils.renderChild(CustomComponentUtils.java:339)
at com.icesoft.faces.component.panelstack.PanelStackRenderer.encodeChildren(PanelStackRenderer.java:112)
at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:812)
at com.icesoft.faces.renderkit.dom_html_basic.DomBasicRenderer.encodeParentAndChildren(DomBasicRenderer.java:352)
at com.icesoft.faces.renderkit.dom_html_basic.GroupRenderer.encodeChildren(GroupRenderer.java:92)
at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:812)
at com.icesoft.faces.component.util.CustomComponentUtils.renderChild(CustomComponentUtils.java:339)
at com.icesoft.faces.component.paneldivider.PanelDividerRenderer.renderPane(PanelDividerRenderer.java:89)
at com.icesoft.faces.component.paneldivider.PanelDividerRenderer.encodeBegin(PanelDividerRenderer.java:54)
at javax.faces.component.UIComponentBase.encodeBegin(UIComponentBase.java:788)
at com.icesoft.faces.component.paneldivider.PanelDivider.encodeBegin(PanelDivider.java:83)
at com.icesoft.faces.application.D2DViewHandler.renderResponse(D2DViewHandler.java:568)
at com.icesoft.faces.application.D2DViewHandler.renderResponse(D2DViewHandler.java:575)
at com.icesoft.faces.application.D2DViewHandler.renderResponse(D2DViewHandler.java:575)
at com.icesoft.faces.application.D2DViewHandler.renderResponse(D2DViewHandler.java:575)
at com.icesoft.faces.application.D2DViewHandler.renderResponse(D2DViewHandler.java:575)
at com.icesoft.faces.application.D2DViewHandler.renderResponse(D2DViewHandler.java:551)
at com.icesoft.faces.application.D2DViewHandler.renderView(D2DViewHandler.java:159)
at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:106)
at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:251)
at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:144)
at com.icesoft.faces.webapp.http.core.JsfLifecycleExecutor.apply(JsfLifecycleExecutor.java:1Cool
at com.icesoft.faces.webapp.http.core.ReceiveSendUpdates.renderCycle(ReceiveSendUpdates.java:94)
at com.icesoft.faces.webapp.http.core.ReceiveSendUpdates.service(ReceiveSendUpdates.java:54)
at com.icesoft.faces.webapp.http.core.RequestVerifier.service(RequestVerifier.java:26)
at com.icesoft.faces.webapp.http.common.standard.PathDispatcherServer.service(PathDispatcherServer.java:24)
at com.icesoft.faces.webapp.http.servlet.MainSessionBoundServlet.service(MainSessionBoundServlet.java:160)
at com.icesoft.faces.webapp.http.servlet.SessionDispatcher$1.service(SessionDispatcher.java:3Cool
at com.icesoft.faces.webapp.http.servlet.ThreadBlockingAdaptingServlet.service(ThreadBlockingAdaptingServlet.java:19)
at com.icesoft.faces.webapp.http.servlet.EnvironmentAdaptingServlet.service(EnvironmentAdaptingServlet.java:63)
at com.icesoft.faces.webapp.http.servlet.SessionDispatcher.service(SessionDispatcher.java:55)
at com.icesoft.faces.webapp.http.servlet.SessionVerifier.service(SessionVerifier.java:19)
at com.icesoft.faces.webapp.http.servlet.PathDispatcher.service(PathDispatcher.java:23)
at com.icesoft.faces.webapp.http.servlet.MainServlet.service(MainServlet.java:91)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:831)
at com.icesoft.faces.webapp.xmlhttp.BlockingServlet.service(BlockingServlet.java:56)
at org.apache.catalina.core.ApplicationFilterChain.servletService(ApplicationFilterChain.java:411)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:290)
at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:271)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:202)
at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:632)
at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:577)
at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:94)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:206)
at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:632)
at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:577)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:571)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:1080)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:150)
at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:632)
at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:577)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:571)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:1080)
at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:272)
at com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.invokeAdapter(DefaultProcessorTask.java:637)
at com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.doProcess(DefaultProcessorTask.java:568)
at com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.process(DefaultProcessorTask.java:813)
at com.sun.enterprise.web.connector.grizzly.DefaultReadTask.executeProcessorTask(DefaultReadTask.java:341)
at com.sun.enterprise.web.connector.grizzly.DefaultReadTask.doTask(DefaultReadTask.java:263)
at com.sun.enterprise.web.connector.grizzly.DefaultReadTask.doTask(DefaultReadTask.java:214)
at com.sun.enterprise.web.connector.grizzly.TaskBase.run(TaskBase.java:265)
at com.sun.enterprise.web.connector.grizzly.ssl.SSLWorkerThread.run(SSLWorkerThread.java:106)
Caused by: javax.el.ELException: javax.faces.el.EvaluationException: javax.el.ELException: java.lang.NullPointerException
at javax.faces.component.ValueExpressionValueBindingAdapter.getValue(ValueExpressionValueBindingAdapter.java:76)
at javax.faces.component.UIData.getValue(UIData.java:582)
... 73 more
Caused by: javax.faces.el.EvaluationException: javax.el.ELException: java.lang.NullPointerException
at com.sun.faces.application.ValueBindingValueExpressionAdapter.getValue(ValueBindingValueExpressionAdapter.java:106)
at javax.faces.component.ValueExpressionValueBindingAdapter.getValue(ValueExpressionValueBindingAdapter.java:73)
... 74 more
Caused by: javax.el.ELException: java.lang.NullPointerException
at javax.el.BeanELResolver.getValue(BeanELResolver.java:266)
at javax.el.CompositeELResolver.getValue(CompositeELResolver.java:143)
at com.sun.faces.el.FacesCompositeELResolver.getValue(FacesCompositeELResolver.java:64)
at com.sun.el.parser.AstValue.getValue(AstValue.java:138)
at com.sun.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:206)
at com.sun.faces.application.ValueBindingValueExpressionAdapter.getValue(ValueBindingValueExpressionAdapter.java:102)
... 75 more
Caused by: java.lang.NullPointerException
at DWFSWeb.InitiateBean.getUsers(InitiateBean.java:49)
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 javax.el.BeanELResolver.getValue(BeanELResolver.java:261)
... 80 more
Back to top
Display posts from previous:   
Post new topic   Reply to topic    NetBeans Forums -> Java EE Users All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB
By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2012, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo