Forums

Home » Liferay Portal » English » 3. Development

Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
Brian Choi
Custom Portlet and Work flow
September 25, 2012 9:08 PM
Answer

Brian Choi

Rank: New Member

Posts: 4

Join Date: June 8, 2010

Recent Posts

Hi,

I got the issue on "Custom Portlet" when click on "My Workflow Task" or "My Submissions" details. Got the blank page .

This issue related AssetRender or Workflow ?





Exception

11:15:52,974 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/].] (ajp--0.0.0.0-8009-5) Servlet.service() for servlet jsp threw exception: java.lang.AbstractMethodError: com.vigasia.gitform.asset.GitFormAssetRender.getUserName()Ljava/lang/String;
at org.apache.jsp.html.portlet.workflow_005finstances.edit_005fworkflow_005finstance_jsp._jspService(edit_005fworkflow_005finstance_jsp.java:1027)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70) [jbossweb-7.0.13.Final.jar:]
at javax.servlet.http.HttpServlet.service(HttpServlet.java:847) [jboss-servlet-api_3.0_spec-1.0.0.Final.jar:1.0.0.Final]
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:369) [jbossweb-7.0.13.Final.jar:]
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:326) [jbossweb-7.0.13.Final.jar:]
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:253) [jbossweb-7.0.13.Final.jar:]
at javax.servlet.http.HttpServlet.service(HttpServlet.java:847) [jboss-servlet-api_3.0_spec-1.0.0.Final.jar:1.0.0.Final]

liferay-portlet.xml
<portlet>
<portlet-name>GitForm</portlet-name>
<icon>/icon.png</icon>
<asset-renderer-factory>com.vigasia.gitform.asset.GitFormAssetRendererFactory</asset-renderer-factory>
<workflow-handler>
com.vigasia.gitform.workflow.GitformWorkflowHandler
</workflow-handler>
<instanceable>false</instanceable>
<header-portlet-css>/css/main.css</header-portlet-css>
<footer-portlet-javascript>/js/main.js</footer-portlet-javascript>
<css-class-wrapper>GitForm-portlet</css-class-wrapper>
<add-default-resource>true</add-default-resource>
</portlet>
David H Nebinger
RE: Custom Portlet and Work flow
September 25, 2012 9:36 PM
Answer

David H Nebinger

Community Moderator

Rank: Liferay Legend

Posts: 9267

Join Date: September 1, 2006

Recent Posts

Brian Choi:
java.lang.AbstractMethodError: com.vigasia.gitform.asset.GitFormAssetRender.getUserName()Ljava/lang/String;


Seems to indicate that the getUserName() method of GitFormAssetRenderer is an abstract method. Did your factory class instantiate and return a concrete instance instead of an abstract one?
Brian Choi
RE: Custom Portlet and Work flow
September 26, 2012 7:37 PM
Answer

Brian Choi

Rank: New Member

Posts: 4

Join Date: June 8, 2010

Recent Posts

Thank you help and reply.

I not have abstract method .. post the GitFormAssetRender.java and GitFormAssetRendererFactory.java

// @Override
public String getUesrName() {
// return _gitForm.getTitle();
System.out.println("Get User Name!");
try {
return UserLocalServiceUtil.getUser(_gitForm.getUserId()).getFullName();
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
return "";
}
}
Attachments: GitFormAssetRender.java (2.4k), GitFormAssetRendererFactory.java (1.7k)
David H Nebinger
RE: Custom Portlet and Work flow
September 26, 2012 8:05 PM
Answer

David H Nebinger

Community Moderator

Rank: Liferay Legend

Posts: 9267

Join Date: September 1, 2006

Recent Posts

Brian Choi:
// @Override
public String getUesrName() {


See how you misspelled the method name? It means the original abstract method, the one being called, is abstract and your method will never be invoked.

Probably why you had to comment out the @override as it would have indicated that it was not overriding a superclass method.
Brian Choi
RE: Custom Portlet and Work flow
September 26, 2012 10:33 PM
Answer

Brian Choi

Rank: New Member

Posts: 4

Join Date: June 8, 2010

Recent Posts

But i got the build error.

@Override
public String getUesrName() {
// return _gitForm.getTitle();
System.out.println("Get User Name!");
try {
// String abc = UserLocalServiceUtil.getUser(_gitForm.getUserId()).getFullName();
return "Abc";
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
return "";
}
}

compile-java:
Compiling 1 source file to E:\Java\liferay\liferay-plugins-sdk-6.1.0-ce-ga1\portlets\Git
Form-portlet\docroot\WEB-INF\classes
----------
1. ERROR in E:\Java\liferay\liferay-plugins-sdk-6.1.0-ce-ga1\portlets\GitForm-portlet\do
croot\WEB-INF\src\com\vigasia\gitform\asset\GitFormAssetRender.java (at line 70)
public String getUesrName() {
^^^^^^^^^^^^^
The method getUesrName() of type GitFormAssetRender must override a superclass method
----------
1 problem (1 error)

BUILD FAILED
David H Nebinger
RE: Custom Portlet and Work flow
September 27, 2012 11:40 AM
Answer

David H Nebinger

Community Moderator

Rank: Liferay Legend

Posts: 9267

Join Date: September 1, 2006

Recent Posts

YOU MISSED THAT YOU MISSPELLED THE METHOD NAME!

Do not call the method "getUesrName()", call the method "getUserName()".

That's the source of your whole problem. You misspelled the method name, therefore the @override caught that it was misspelled, but instead of fixing it you just commented it out.
Brian Choi
RE: Custom Portlet and Work flow
September 28, 2012 1:34 AM
Answer

Brian Choi

Rank: New Member

Posts: 4

Join Date: June 8, 2010

Recent Posts

Removed the getUesrName() method.

Got other's issue emoticon. Because now we want to using custom portlet , workflow and need to view "My Submissions, My Workflow Tasks". Any good example or source code for reference.

Current URL /group/control_panel/manage?p_p_id=158&p_p_lifecycle=0&p_p_state=maximized&p_p_mode=view&doAsGroupId=11054&_158_struts_action=%2Fmy_workflow_instances%2Fedit_workflow_instance&_158_redirect=http%3A%2F%2Fxxxxx.abc.com%2Fgroup%2Fcontrol_panel%2Fmanage%3Fp_p_id%3D158%26p_p_lifecycle%3D0%26p_p_state%3Dmaximized%26p_p_mode%3Dview%26doAsGroupId%3D11054%26_158_doAsGroupId%3D11054&_158_workflowInstanceId=22102 generates exception: java.lang.AbstractMethodError
16:24:38,550 INFO (ajp--0.0.0.0-8009-7) 16:24:38,549 ERROR [ajp--0.0.0.0-8009-7][IncludeTag:154] java.lang.AbstractMethodError
16:24:38,550 INFO (ajp--0.0.0.0-8009-7) at org.apache.jsp.html.portlet.workflow_005finstances.edit_005fworkflow_005finstance_jsp._jspService(edit_005fworkflow_005finstance_jsp.java:1027)