Forums

Home » Liferay Portal » English » 3. Development

Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
dave ch
Null pointer exception issue
August 7, 2012 5:46 AM
Answer

dave ch

Rank: Regular Member

Posts: 164

Join Date: February 6, 2012

Recent Posts

Hi all,

I am getting NullPointerException when trying to get the values. How to get rid of this issue.
THANKS IN ADVANCE

 1ExpandoColumn column=null;
 2ExpandoColumn column1=null;
 3com.liferay.portlet.expando.model.ExpandoValue [b]value[/b]=null;
 4com.liferay.portlet.expando.model.ExpandoValue [b]value1[/b]=null;
 5
 6
 7long userClassNameId = ClassNameLocalServiceUtil.getClassNameId(DDLRecordSet.class.getName());
 8System.out.println("ClassName/////////......"+ClassNameLocalServiceUtil.getClassNameId(DDLRecordSet.class.getName()));
 9ExpandoTable table = ExpandoTableLocalServiceUtil.getTable( themeDisplay.getCompanyId(), DDLRecordSet.class.getName(), ExpandoTableConstants.DEFAULT_TABLE_NAME);
10System.out.println("TableName/////////......"+ExpandoTableLocalServiceUtil.getTable( themeDisplay.getCompanyId(),DDLRecordSet.class.getName(), ExpandoTableConstants.DEFAULT_TABLE_NAME));
11//ExpandoColumn column = ExpandoColumnLocalServiceUtil.getColumn(companyId, classNameId, tableName, name)
12column = ExpandoColumnLocalServiceUtil.getColumn(themeDisplay.getCompanyId(), DDLRecordSet.class.getName(), ExpandoTableConstants.DEFAULT_TABLE_NAME, "displaydate");
13column1 = ExpandoColumnLocalServiceUtil.getColumn(themeDisplay.getCompanyId(), DDLRecordSet.class.getName(), ExpandoTableConstants.DEFAULT_TABLE_NAME, "expirationdate");
14System.out.println("ColmnName/////////......"+ExpandoColumnLocalServiceUtil.getColumn(themeDisplay.getCompanyId(), DDLRecordSet.class.getName(), ExpandoTableConstants.DEFAULT_TABLE_NAME, "displaydate"));
15System.out.println("Colmn1Name/////////......"+ExpandoColumnLocalServiceUtil.getColumn(themeDisplay.getCompanyId(), DDLRecordSet.class.getName(), ExpandoTableConstants.DEFAULT_TABLE_NAME, "expirationdate"));
16
17[b] [b]value[/b] = ExpandoValueLocalServiceUtil.getValue(themeDisplay.getCompanyId(),DDLRecordSet.class.getName(),ExpandoTableConstants.DEFAULT_TABLE_NAME, column.getName(), recordSet.getPrimaryKey());
18[b] value1[/b] = ExpandoValueLocalServiceUtil.getValue(themeDisplay.getCompanyId(),DDLRecordSet.class.getName(),ExpandoTableConstants.DEFAULT_TABLE_NAME, column1.getName(), recordSet.getPrimaryKey());
19
20value.getData();[/b]
dave ch
RE: Null pointer exception issue
August 7, 2012 10:16 PM
Answer

dave ch

Rank: Regular Member

Posts: 164

Join Date: February 6, 2012

Recent Posts

The error i am getting is:

  1ClassName/////////......10097
  2TableName/////////......{tableId=28102, companyId=10154, classNameId=10097, name=CUSTOM_FIELDS}
  3ColmnName/////////......{columnId=28103, companyId=10154, tableId=28102, name=displaydate, type=15, defaultData=, typeSettings=}
  4Colmn1Name/////////......{columnId=28104, companyId=10154, tableId=28102, name=expirationdate, type=15, defaultData=, typeSettings=}
  5display date///////////////nullexpiration date..////////null
  6java.lang.NullPointerException
  7    at org.apache.jsp.html.portlet.dynamic_005fdata_005flists.view_005frecord_005fset_jsp._jspService(view_005frecord_005fset_jsp.java:973)
  8    at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
  9    at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
 10    at com.liferay.portal.kernel.servlet.DirectRequestDispatcher.include(DirectRequestDispatcher.java:45)
 11    at com.liferay.taglib.util.IncludeTag.include(IncludeTag.java:323)
 12    at com.liferay.taglib.util.IncludeTag._doInclude(IncludeTag.java:418)
 13    at com.liferay.taglib.util.IncludeTag.doEndTag(IncludeTag.java:92)
 14    at org.apache.jsp.html.portlet.dynamic_005fdata_005flist_005fdisplay.view_jsp._jspService(view_jsp.java:675)
 15    at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
 16    at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
 17    at com.liferay.portal.kernel.servlet.DirectRequestDispatcher.include(DirectRequestDispatcher.java:45)
 18    at com.liferay.taglib.util.IncludeTag.include(IncludeTag.java:323)
 19    at com.liferay.taglib.util.IncludeTag._doInclude(IncludeTag.java:418)
 20    at com.liferay.taglib.util.IncludeTag.doEndTag(IncludeTag.java:92)
 21    at org.apache.jsp.html.common.themes.portlet_jsp._jspService(portlet_jsp.java:3971)
 22    at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
 23    at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
 24    at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:432)
 25    at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:390)
 26    at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334)
 27    at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
 28    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
 29    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
 30    at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:72)
 31    at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilter.doFilter(InvokerFilter.java:113)
 32    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
 33    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
 34    at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:684)
 35    at org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:593)
 36    at org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:530)
 37    at com.liferay.portlet.PortletRequestDispatcherImpl.dispatch(PortletRequestDispatcherImpl.java:316)
 38    at com.liferay.portlet.PortletRequestDispatcherImpl.include(PortletRequestDispatcherImpl.java:120)
 39    at com.liferay.portal.struts.PortletRequestProcessor.doInclude(PortletRequestProcessor.java:281)
 40    at com.liferay.portal.struts.PortletRequestProcessor.doForward(PortletRequestProcessor.java:251)
 41    at org.apache.struts.tiles.TilesRequestProcessor.processTilesDefinition(TilesRequestProcessor.java:239)
 42    at org.apache.struts.tiles.TilesRequestProcessor.internalModuleRelativeForward(TilesRequestProcessor.java:341)
 43    at org.apache.struts.action.RequestProcessor.processForward(RequestProcessor.java:572)
 44    at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:221)
 45    at com.liferay.portal.struts.PortletRequestProcessor.process(PortletRequestProcessor.java:230)
 46    at com.liferay.portlet.StrutsPortlet.include(StrutsPortlet.java:239)
 47    at com.liferay.portlet.StrutsPortlet.doView(StrutsPortlet.java:152)
 48    at com.liferay.portal.kernel.portlet.LiferayPortlet.doDispatch(LiferayPortlet.java:211)
 49    at javax.portlet.GenericPortlet.render(GenericPortlet.java:233)
 50    at com.liferay.portlet.FilterChainImpl.doFilter(FilterChainImpl.java:100)
 51    at com.liferay.portal.kernel.portlet.PortletFilterUtil.doFilter(PortletFilterUtil.java:64)
 52    at com.liferay.portlet.InvokerPortletImpl.invoke(InvokerPortletImpl.java:651)
 53    at com.liferay.portlet.InvokerPortletImpl.invokeRender(InvokerPortletImpl.java:722)
 54    at com.liferay.portlet.InvokerPortletImpl.render(InvokerPortletImpl.java:426)
 55    at org.apache.jsp.html.portal.render_005fportlet_jsp._jspService(render_005fportlet_jsp.java:1217)
 56    at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
 57    at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
 58    at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:432)
 59    at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:390)
 60    at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334)
 61    at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
 62    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
 63    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
 64    at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:72)
 65    at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilter.doFilter(InvokerFilter.java:113)
 66    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
 67    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
 68    at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:684)
 69    at org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:593)
 70    at org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:530)
 71    at com.liferay.portal.util.PortalImpl.renderPortlet(PortalImpl.java:4735)
 72    at com.liferay.portal.util.PortalUtil.renderPortlet(PortalUtil.java:1456)
 73    at com.liferay.portlet.layoutconfiguration.util.RuntimePortletImpl.processPortlet(RuntimePortletImpl.java:213)
 74    at com.liferay.portlet.layoutconfiguration.util.RuntimePortletImpl.processPortlet(RuntimePortletImpl.java:148)
 75    at com.liferay.portlet.layoutconfiguration.util.RuntimePortletImpl.processTemplate(RuntimePortletImpl.java:309)
 76    at com.liferay.portlet.layoutconfiguration.util.RuntimePortletImpl.processTemplate(RuntimePortletImpl.java:234)
 77    at com.liferay.portlet.layoutconfiguration.util.RuntimePortletUtil.processTemplate(RuntimePortletUtil.java:106)
 78    at org.apache.jsp.html.portal.layout.view.portlet_jsp._jspService(portlet_jsp.java:514)
 79    at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
 80    at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
 81    at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:432)
 82    at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:390)
 83    at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334)
 84    at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
 85    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
 86    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
 87    at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:72)
 88    at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilter.doFilter(InvokerFilter.java:113)
 89    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
 90    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
 91    at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:684)
 92    at org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:593)
 93    at org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:530)
 94    at com.liferay.portal.action.LayoutAction.includeLayoutContent(LayoutAction.java:412)
 95    at com.liferay.portal.action.LayoutAction.processLayout(LayoutAction.java:680)
 96    at com.liferay.portal.action.LayoutAction.execute(LayoutAction.java:244)
 97    at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:431)
 98    at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:236)
 99    at com.liferay.portal.struts.PortalRequestProcessor.process(PortalRequestProcessor.java:174)
100    at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)
101    at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:414)
102    at javax.servlet.http.HttpServlet.service(HttpServlet.java:621)
103    at com.liferay.portal.servlet.MainServlet.callParentService(MainServlet.java:533)
104    at com.liferay.portal.servlet.MainServlet.service(MainServlet.java:510)
105    at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
106    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
107    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
108    at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:72)
109    at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:113)
110    at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:113)
111    at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:113)
112    at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:121)
113    at com.liferay.portal.servlet.filters.secure.SecureFilter.processFilter(SecureFilter.java:201)
114    at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:48)
115    at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:203)
116    at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:105)
117    at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilter.doFilter(InvokerFilter.java:113)
118    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
119    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
120    at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:684)
121    at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:471)
122    at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:402)
123    at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:329)
124    at com.liferay.portal.servlet.FriendlyURLServlet.service(FriendlyURLServlet.java:135)
125    at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
126    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
127    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
128    at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:72)
129    at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:121)
130    at com.liferay.portal.servlet.filters.strip.StripFilter.processFilter(StripFilter.java:304)
131    at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:48)
132    at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:203)
133    at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:105)
134    at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:113)
135    at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:121)
136    at com.liferay.portal.servlet.filters.gzip.GZipFilter.processFilter(GZipFilter.java:123)
137    at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:48)
138    at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:203)
139    at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:105)
140    at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:121)
141    at com.liferay.portal.servlet.filters.secure.SecureFilter.processFilter(SecureFilter.java:201)
142    at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:48)
143    at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:203)
144    at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:105)
145    at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:121)
146    at com.liferay.portal.servlet.filters.i18n.I18nFilter.processFilter(I18nFilter.java:241)
147    at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:48)
148    at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:203)
149    at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:105)
150    at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:121)
151    at com.liferay.portal.servlet.filters.etag.ETagFilter.processFilter(ETagFilter.java:55)
152    at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:48)
153    at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:203)
154    at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:105)
155    at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:121)
156    at com.liferay.portal.servlet.filters.sso.ntlm.NtlmPostFilter.processFilter(NtlmPostFilter.java:83)
157    at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:48)
158    at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:203)
159    at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:105)
160    at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:121)
161    at com.liferay.portal.sharepoint.SharepointFilter.processFilter(SharepointFilter.java:80)
162    at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:48)
163    at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:203)
164    at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:105)
165    at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:121)
166    at com.liferay.portal.servlet.filters.virtualhost.VirtualHostFilter.processFilter(VirtualHostFilter.java:208)
167    at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:48)
168    at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:203)
169    at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:105)
170    at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDirectCallFilter(InvokerFilterChain.java:184)
171    at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:92)
172    at org.tuckey.web.filters.urlrewrite.UrlRewriteFilter.doFilter(UrlRewriteFilter.java:738)
173    at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:203)
174    at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:105)
175    at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDirectCallFilter(InvokerFilterChain.java:164)
176    at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:92)
177    at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDirectCallFilter(InvokerFilterChain.java:164)
178    at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:92)
179    at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDirectCallFilter(InvokerFilterChain.java:184)
180    at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:92)
181    at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilter.doFilter(InvokerFilter.java:113)
182    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
183    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
184    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:224)
185    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:169)
186    at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
187    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:168)
188    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98)
189    at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:928)
190    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
191    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
192    at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:987)
193    at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:539)
194    at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:300)
195    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
196    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
197    at java.lang.Thread.run(Thread.java:619)
Dhrutika Vyas
RE: Null pointer exception issue
August 8, 2012 5:01 AM
Answer

Dhrutika Vyas

Rank: Expert

Posts: 438

Join Date: February 9, 2009

Recent Posts

HI,
Your custom column doesn't have any data,thats why its getting exception when you do value.getData().

Add null check before writing that statement.
if (value.getData()!=null){
do something }

Regards,
Dhrutika
dave ch
RE: Null pointer exception issue
August 8, 2012 5:08 AM
Answer

dave ch

Rank: Regular Member

Posts: 164

Join Date: February 6, 2012

Recent Posts

HI,
Your custom column doesn't have any data,thats why its getting exception when you do value.getData().

Add null check before writing that statement.
if (value.getData()!=null){
do something }


Hi Parekh,

Thanks for the input.
What should i do after : if (value.getData()!=null){

regards
Dave
Dhrutika Vyas
RE: Null pointer exception issue
August 8, 2012 5:14 AM
Answer

Dhrutika Vyas

Rank: Expert

Posts: 438

Join Date: February 9, 2009

Recent Posts

Hi,

I think your value is null and you are doing value.getData(), so place that line inside condition.

Regards,
Dhrutika
Amit Doshi
RE: Null pointer exception issue
August 8, 2012 6:34 AM
Answer

Amit Doshi

Rank: Liferay Master

Posts: 549

Join Date: December 29, 2010

Recent Posts

you can use directly the Validator Class of Liferay.
if(Validator.isNotNull(value.getData())
{
}

Thanks & Regards,
Amit Doshi