掲示板

Liferay search with service.xml

7年前 に Venkat N によって更新されました。

Liferay search with service.xml

New Member 投稿: 11 参加年月日: 12/02/14 最新の投稿
Hi Guys,

Using service.xml created the table. Able to add data to table and created indexes using IndexerRegistryUtil.
Now I am using liferay default search portlet to get the data from the created tables.

AwsIssues issue1 = AwsIssuesLocalServiceUtil.addAwsIssues(awsIssues);
Indexer indexer = IndexerRegistryUtil.nullSafeGetIndexer(AwsIssues.class);
indexer.reindex(issue1);

Override the BaseIndexer class .....
@Override
protected Summary doGetSummary(Document arg0, Locale arg1, String arg2,
PortletURL arg3) throws Exception {
// TODO Auto-generated method stub
System.out.println("***** doGetSummary begin****");
System.out.println("Before::"+arg0+"::"+arg1+"::"+arg2+"::"+arg3);
// Summary summary = createSummary(arg0);
// summary.setMaxContentLength(200);
// return summary;
String title = arg0.get(Field.TITLE);
String content = arg2;
if (Validator.isNull(arg2)) {
content = arg0.get(Field.DESCRIPTION);
if (Validator.isNull(content)) {
content = StringUtil.shorten(arg0.get(Field.CONTENT), 200);
}
}
String issueId = arg0.get(Field.ENTRY_CLASS_PK);
arg3.setParameter("mvcPath", "/html/view_issue.jsp");
arg3.setParameter("issueId", issueId);

System.out.println("Last::"+arg0+"::"+arg1+"::"+arg2+"::"+arg3);
System.out.println("***** doGetSummary End****");
return new Summary(title, content, arg3);
}

I am getting the following error ::::::::::::

03:19:26,476 ERROR [http-bio-8080-exec-12][IncludeTag:129] Current URL /web/guest/venkat?p_p_id=3&p_p_lifecycle=0&p_p_state=maximized&p_p_mode=view&p_p_col_id=column-1&p_p_col_count=1&_3_struts_action=%2Fsearch%2Fsearch&_3_redirect=%2Fweb%2Fguest%2Fvenkat&_3_keywords=Tmobile1501&_3_groupId=0 generates exception: null
java.lang.NullPointerException
at org.apache.jsp.html.portlet.search.facets.asset_005fentries_jsp._jspService(asset_005fentries_jsp.java:930)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:731)
at com.liferay.portal.servlet.DirectRequestDispatcher.include(DirectRequestDispatcher.java:57)
at com.liferay.portal.servlet.ClassLoaderRequestDispatcherWrapper.doDispatch(ClassLoaderRequestDispatcherWrapper.java:78)
at com.liferay.portal.servlet.ClassLoaderRequestDispatcherWrapper.include(ClassLoaderRequestDispatcherWrapper.java:53)
at com.liferay.taglib.util.IncludeTag.include(IncludeTag.java:295)
at com.liferay.taglib.util.IncludeTag.doInclude(IncludeTag.java:192)
at com.liferay.taglib.util.IncludeTag.doEndTag(IncludeTag.java:83)
at org.apache.jsp.html.portlet.search.search_jsp._jspService(search_jsp.java:1157)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:731)
at com.liferay.portal.servlet.DirectRequestDispatcher.include(DirectRequestDispatcher.java:57)
at com.liferay.portal.servlet.ClassLoaderRequestDispatcherWrapper.doDispatch(ClassLoaderRequestDispatcherWrapper.java:78)
at com.liferay.portal.servlet.ClassLoaderRequestDispatcherWrapper.include(ClassLoaderRequestDispatcherWrapper.java:53)
at com.liferay.taglib.util.IncludeTag.include(IncludeTag.java:295)
at com.liferay.taglib.util.IncludeTag.doInclude(IncludeTag.java:192)
at com.liferay.taglib.util.IncludeTag.doEndTag(IncludeTag.java:83)
at org.apache.jsp.html.common.themes.portlet_jsp._jspService(portlet_jsp.java:3815)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
***** doGetSummary begin****
Before::{uid=[AwsIssues_WAR_AwsIssuesportlet_PORTLET_35], entryClassName=[com.portlets.tmobile.awsissue.model.AwsIssues], scopeGroupId=[20201], snippet_description=[Tmobile1501], entryClassPK=[35], modified=[20160607000522], groupId=[20201], stagingGroup=[false], title=[AC1501], description=[Tmobile1501], companyId=[20154], modified_sortable=[1465257922710], title_sortable=[ac1501], portletId=[AwsIssues_WAR_AwsIssuesportlet]}::en_US::::http://localhost:8080/web/guest/venkat?p_p_id=AwsIssues_WAR_AwsIssuesportlet&p_p_lifecycle=0&p_p_state=maximized&p_p_mode=view&_AwsIssues_WAR_AwsIssuesportlet_returnToFullPageURL=%2Fweb%2Fguest%2Fvenkat
Last::{uid=[AwsIssues_WAR_AwsIssuesportlet_PORTLET_35], entryClassName=[com.portlets.tmobile.awsissue.model.AwsIssues], scopeGroupId=[20201], snippet_description=[Tmobile1501], entryClassPK=[35], modified=[20160607000522], groupId=[20201], stagingGroup=[false], title=[AC1501], description=[Tmobile1501], companyId=[20154], modified_sortable=[1465257922710], title_sortable=[ac1501], portletId=[AwsIssues_WAR_AwsIssuesportlet]}::en_US::::http://localhost:8080/web/guest/venkat?p_p_id=AwsIssues_WAR_AwsIssuesportlet&p_p_lifecycle=0&p_p_state=maximized&p_p_mode=view&_AwsIssues_WAR_AwsIssuesportlet_returnToFullPageURL=%2Fweb%2Fguest%2Fvenkat&_AwsIssues_WAR_AwsIssuesportlet_mvcPath=%2Fhtml%2Fview_issue.jsp&_AwsIssues_WAR_AwsIssuesportlet_issueId=35
***** doGetSummary End****



Plz help to resolve this ..........
7年前 に Venkat N によって更新されました。

RE: Liferay search with service.xml

New Member 投稿: 11 参加年月日: 12/02/14 最新の投稿
I got solution for this error ......

Need to IMPLEMENTING ASSET RENDERERS ...emoticonemoticonemoticonemoticonemoticon
https://dev.liferay.com/develop/tutorials/-/knowledge_base/6-2/implementing-asset-renderers