-
Type:
Bug
-
Status: Closed
-
Resolution: Fixed
-
Affects Version/s: 7.0.0 DXP FP10, Master
-
Fix Version/s: 7.0.0 DXP FP11, 7.0.0 DXP SP2, 7.0.3 CE GA4, 7.1.X, Master
-
Component/s: Workflow, Workflow > API, Workflow > API > Kaleo Engine
-
Branch Version/s:7.0.x
-
Backported to Branch:Committed
-
Story Points:1
-
Fix Priority:3
-
Sprint:
-
Git Pull Request:
Steps to reproduce
[As test user]
- Add the example of workflow, which has references to classes such as com.liferay.calendar.service.CalendarBookingLocalServiceUtil, attached to the ticket. (kaleo_workflow_example.xml)
Control Panel -> Configuration -> WorkFlow Definition -> Upload Definition -> [ select from previous file] -> Save - Goto to site "Liferay DXP" -> Configuration -> Workflow Configuration
Edit "Message Boards Message" and select previous workflow added. - Add "Message Board" app in a page.
- Add new user A who could post new threads
[As A user]
- Post new thread
Expected result:
- New thread is under revision of admin user (test)
- All the references to and uses of classes such as com.liferay.calendar.service.CalendarBookingLocalServiceUtil are correctly resolved.
Observed result:
- The message "Your request completed successfully" is showed to user but the posted thread is not been added to the system.
- A exception is thrown in server log:
21:39:08,585 ERROR [http-nio-8080-exec-1][IncludeTag:128] Current URL /web/guest/aesa/-/message_boards/message/31357 generates exception: java.lang.NullPointerException java.lang.NullPointerException at org.apache.jsp.message_005fboards.view_005fthread_005ftree_jsp._jspService(view_005fthread_005ftree_jsp:401) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:111) at javax.servlet.http.HttpServlet.service(HttpServlet.java:729) at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:411) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:473) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:377) at javax.servlet.http.HttpServlet.service(HttpServlet.java:729) at com.liferay.portal.osgi.web.servlet.jsp.compiler.JspServlet.service(JspServlet.java:403) at com.liferay.portal.osgi.web.servlet.jsp.compiler.JspServlet.service(JspServlet.java:414) at org.eclipse.equinox.http.servlet.internal.registration.EndpointRegistration.service(EndpointRegistration.java:153) at org.eclipse.equinox.http.servlet.internal.servlet.ResponseStateHandler.processRequest(ResponseStateHandler.java:62) at org.eclipse.equinox.http.servlet.internal.context.DispatchTargets.doDispatch(DispatchTargets.java:117) at org.eclipse.equinox.http.servlet.internal.servlet.RequestDispatcherAdaptor.include(RequestDispatcherAdaptor.java:48) at com.liferay.portal.servlet.DirectServletPathRegisterDispatcher.include(DirectServletPathRegisterDispatcher.java:67) 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.includePage(IncludeTag.java:380) at com.liferay.taglib.util.IncludeTag.include(IncludeTag.java:362) at com.liferay.taglib.util.IncludeTag.doInclude(IncludeTag.java:206) at com.liferay.taglib.util.IncludeTag.doEndTag(IncludeTag.java:88) 21:39:08,588 ERROR [http-nio-8080-exec-1][IncludeTag:128] Current URL /web/guest/aesa/-/message_boards/message/31357 generates exception: java.lang.NullPointerException java.lang.NullPointerException at com.liferay.portlet.messageboards.model.impl.MBTreeWalkerImpl.getChildrenRange(MBTreeWalkerImpl.java:101) at org.apache.jsp.message_005fboards.view_005fmessage_005fcontent_jsp._jspService(view_005fmessage_005fcontent_jsp:1629) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:111) at javax.servlet.http.HttpServlet.service(HttpServlet.java:729) at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:411) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:473) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:377) at javax.servlet.http.HttpServlet.service(HttpServlet.java:729) at com.liferay.portal.osgi.web.servlet.jsp.compiler.JspServlet.service(JspServlet.java:403) at com.liferay.portal.osgi.web.servlet.jsp.compiler.JspServlet.service(JspServlet.java:414) at org.eclipse.equinox.http.servlet.internal.registration.EndpointRegistration.service(EndpointRegistration.java:153) at org.eclipse.equinox.http.servlet.internal.servlet.ResponseStateHandler.processRequest(ResponseStateHandler.java:62) at org.eclipse.equinox.http.servlet.internal.context.DispatchTargets.doDispatch(DispatchTargets.java:117) at org.eclipse.equinox.http.servlet.internal.servlet.RequestDispatcherAdaptor.include(RequestDispatcherAdaptor.java:48) at com.liferay.portal.servlet.DirectServletPathRegisterDispatcher.include(DirectServletPathRegisterDispatcher.java:67) 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.includePage(IncludeTag.java:380) at com.liferay.taglib.util.IncludeTag.include(IncludeTag.java:362) at com.liferay.taglib.util.IncludeTag.doInclude(IncludeTag.java:206) 21:39:08,663 ERROR [liferay/kaleo_graph_walker-2][ParallelDestination:55] Unable to process message {destinationName=liferay/kaleo_graph_walker, response=null, responseDestinationName=null, responseId=null, payl[email protected]45c5b562, values={defaultLocale=en_US, companyId=20116, groupId=0, principalName=30637, [email protected]288a7fb9, siteDefaultLocale=en_US, themeDisplayLocale=en_US}} com.liferay.portal.kernel.messaging.MessageListenerException: com.liferay.portal.kernel.scripting.ScriptingException: startup failed:_Script1.groovy: 3: unable to resolve class com.liferay.calendar.service.CalendarBookingLocalServiceUtil_ @ line 3, column 8._ import com.liferay.calendar.service.CalendarBookingLocalServiceUtil;_ ^__1 error__Line 1: _Line 2: _Line 3: import com.liferay.calendar.service.CalendarBookingLocalServiceUtil;_Line 4: import com.liferay.portal.kernel.model.Group;_Line 5: import com.liferay.portal.kernel.model.Role;_Line 6: import com.liferay.portal.kernel.service.GroupLocalServiceUtil;_Line 7: import com.liferay.portal.kernel.service.RoleLocalServiceUtil;_Line 8: import com.liferay.portal.kernel.util.GetterUtil;_Line 9: import com.liferay.portal.kernel.workflow.WorkflowConstants;_Line 10: _Line 11: long companyId = GetterUtil.getLong((String)workflowContext.get(WorkflowConstants.CONTEXT_COMPANY_ID));_Line 12: _Line 13: long groupId = GetterUtil.getLong((String)workflowContext.get(WorkflowConstants.CONTEXT_GROUP_ID));_Line 14: _Line 15: Group group = GroupLocalServiceUtil.getGroup(groupId);_Line 16: _Line 17: roles = new ArrayList<Role>();_Line 18: _Line 19: Role adminRole = RoleLocalServiceUtil.getRole(companyId, "Administrator");_Line 20: _Line 21: roles.add(adminRole);_Line 22: _Line 23: if (group.isOrganization()) {_Line 24: Role role = RoleLocalServiceUtil.getRole(companyId, "Organization Content Reviewer");_Line 25: _Line 26: roles.add(role);_Line 27: }_Line 28: else {_Line 29: Role role = RoleLocalServiceUtil.getRole(companyId, "Site Content Reviewer");_Line 30: _Line 31: roles.add(role);_Line 32: }_Line 33: _Line 34: user = null;_Line 35: _Line 36: _ [Sanitized] at com.liferay.portal.kernel.messaging.BaseMessageListener.receive(BaseMessageListener.java:32) at com.liferay.portal.kernel.messaging.InvokerMessageListener.receive(InvokerMessageListener.java:74) at com.liferay.portal.kernel.messaging.ParallelDestination$1.run(ParallelDestination.java:52) at com.liferay.portal.kernel.concurrent.ThreadPoolExecutor$WorkerTask._runTask(ThreadPoolExecutor.java:756) at com.liferay.portal.kernel.concurrent.ThreadPoolExecutor$WorkerTask.run(ThreadPoolExecutor.java:667) at java.lang.Thread.run(Thread.java:745) Caused by: com.liferay.portal.kernel.scripting.ScriptingException: startup failed:_Script1.groovy: 3: unable to resolve class com.liferay.calendar.service.CalendarBookingLocalServiceUtil_ @ line 3, column 8._ import com.liferay.calendar.service.CalendarBookingLocalServiceUtil;_ ^__1 error__Line 1: _Line 2: _Line 3: import com.liferay.calendar.service.CalendarBookingLocalServiceUtil;_Line 4: import com.liferay.portal.kernel.model.Group;_Line 5: import com.liferay.portal.kernel.model.Role;_Line 6: import com.liferay.portal.kernel.service.GroupLocalServiceUtil;_Line 7: import com.liferay.portal.kernel.service.RoleLocalServiceUtil;_Line 8: import com.liferay.portal.kernel.util.GetterUtil;_Line 9: import com.liferay.portal.kernel.workflow.WorkflowConstants;_Line 10: _Line 11: long companyId = GetterUtil.getLong((String)workflowContext.get(WorkflowConstants.CONTEXT_COMPANY_ID));_Line 12: _Line 13: long groupId = GetterUtil.getLong((String)workflowContext.get(WorkflowConstants.CONTEXT_GROUP_ID));_Line 14: _Line 15: Group group = GroupLocalServiceUtil.getGroup(groupId);_Line 16: _Line 17: roles = new ArrayList<Role>();_Line 18: _Line 19: Role adminRole = RoleLocalServiceUtil.getRole(companyId, "Administrator");_Line 20: _Line 21: roles.add(adminRole);_Line 22: _Line 23: if (group.isOrganization()) {_Line 24: Role role = RoleLocalServiceUtil.getRole(companyId, "Organization Content Reviewer");_Line 25: _Line 26: roles.add(role);_Line 27: }_Line 28: else {_Line 29: Role role = RoleLocalServiceUtil.getRole(companyId, "Site Content Reviewer");_Line 30: _Line 31: roles.add(role);_Line 32: }_Line 33: _Line 34: user = null;_Line 35: _Line 36: _ [Sanitized] at com.liferay.portal.scripting.internal.ScriptingImpl.eval(ScriptingImpl.java:91) at com.liferay.portal.workflow.kaleo.runtime.scripting.internal.assignment.ScriptingLanguagesTaskAssignmentSelector.calculateTaskAssignments(ScriptingLanguagesTaskAssignmentSelector.java:65) at com.liferay.portal.workflow.kaleo.runtime.internal.assignment.MultiLanguageTaskAssignmentSelector.calculateTaskAssignments(MultiLanguageTaskAssignmentSelector.java:81) at com.liferay.portal.workflow.kaleo.runtime.internal.node.TaskNodeExecutor.createTaskInstanceToken(TaskNodeExecutor.java:122) at com.liferay.portal.workflow.kaleo.runtime.internal.node.TaskNodeExecutor.doEnter(TaskNodeExecutor.java:159) at com.liferay.portal.workflow.kaleo.runtime.node.BaseNodeExecutor.enter(BaseNodeExecutor.java:51) at com.liferay.portal.workflow.kaleo.runtime.internal.graph.DefaultGraphWalker.follow(DefaultGraphWalker.java:65) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:153) at com.liferay.portal.spring.transaction.DefaultTransactionExecutor.execute(DefaultTransactionExecutor.java:54) at com.liferay.portal.spring.transaction.TransactionInterceptor.invoke(TransactionInterceptor.java:58) at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:127) at com.liferay.portal.spring.aop.ServiceBeanAopProxy.invoke(ServiceBeanAopProxy.java:174) at com.sun.proxy.$Proxy390.follow(Unknown Source) at com.liferay.portal.workflow.kaleo.runtime.internal.graph.messaging.PathElementMessageListener.doReceive(PathElementMessageListener.java:57) at com.liferay.portal.kernel.messaging.BaseMessageListener.receive(BaseMessageListener.java:26) ... 5 more Caused by: org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:_Script1.groovy: 3: unable to resolve class com.liferay.calendar.service.CalendarBookingLocalServiceUtil_ @ line 3, column 8._ import com.liferay.calendar.service.CalendarBookingLocalServiceUtil;_ ^__1 error_ [Sanitized] at org.codehaus.groovy.control.ErrorCollector.failIfErrors(ErrorCollector.java:310) at org.codehaus.groovy.control.CompilationUnit.applyToSourceUnits(CompilationUnit.java:946) at org.codehaus.groovy.control.CompilationUnit.doPhaseOperation(CompilationUnit.java:593) at org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:542) at groovy.lang.GroovyClassLoader.doParseClass(GroovyClassLoader.java:298) at groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:268) at groovy.lang.GroovyShell.parseClass(GroovyShell.java:694) at groovy.lang.GroovyShell.parse(GroovyShell.java:706) at groovy.lang.GroovyShell.parse(GroovyShell.java:742) at groovy.lang.GroovyShell.parse(GroovyShell.java:733) at com.liferay.portal.scripting.groovy.internal.GroovyExecutor.eval(GroovyExecutor.java:58) at com.liferay.portal.scripting.internal.ScriptingImpl.eval(ScriptingImpl.java:87) ... 23 more
- is related to
-
LRDOCS-3215 How to use services in other bundles than under kernel should be included in Scripting in workflow document.
-
- Closed
-