A question about apache poi: Invalid arg type for SUMPRODUCT: (org.apache.poi.ss.formula.eval.ErrorEval) - excel

problem:
Here is the formula in excel: =SUMPRODUCT(($A$3:$A$257=$H3)*($B$1:$G$1=$I3)*$B$3:$G$257)
When I run the code I get this error:
java.lang.RuntimeException: Invalid arg type for SUMPRODUCT: (org.apache.poi.ss.formula.eval.ErrorEval)
at org.apache.poi.ss.formula.functions.Sumproduct.evaluate(Sumproduct.java:85)
at org.apache.poi.ss.formula.OperationEvaluatorFactory.evaluate(OperationEvaluatorFactory.java:133)
at org.apache.poi.ss.formula.WorkbookEvaluator.evaluateFormula(WorkbookEvaluator.java:537)
at org.apache.poi.ss.formula.WorkbookEvaluator.evaluateAny(WorkbookEvaluator.java:264)
at org.apache.poi.ss.formula.WorkbookEvaluator.evaluate(WorkbookEvaluator.java:205)
at org.apache.poi.xssf.usermodel.BaseXSSFFormulaEvaluator.evaluateFormulaCellValue(BaseXSSFFormulaEvaluator.java:57)
at org.apache.poi.ss.formula.BaseFormulaEvaluator.evaluate(BaseFormulaEvaluator.java:109)
at com.brucewan.FormulaCalcServer.controller.ExcelController.test(ExcelController.java:34)
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 org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:205)
at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:150)
at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:117)
at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:895)
at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:808)
at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:87)
at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1067)
at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:963)
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:1006)
at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:898)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:655)
at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:883)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:764)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:227)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)
at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:100)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)
at org.springframework.web.filter.FormContentFilter.doFilterInternal(FormContentFilter.java:93)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)
at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:201)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:197)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:97)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:540)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:135)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:78)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:357)
at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:382)
at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:65)
at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:895)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1732)
at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
at org.apache.tomcat.util.threads.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1191)
at org.apache.tomcat.util.threads.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:659)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.lang.Thread.run(Thread.java:748)
java.lang.RuntimeException: Invalid arg type for SUMPRODUCT: (org.apache.poi.ss.formula.eval.ErrorEval)
at org.apache.poi.ss.formula.functions.Sumproduct.evaluate(Sumproduct.java:85)
at org.apache.poi.ss.formula.OperationEvaluatorFactory.evaluate(OperationEvaluatorFactory.java:133)
at org.apache.poi.ss.formula.WorkbookEvaluator.evaluateFormula(WorkbookEvaluator.java:537)
at org.apache.poi.ss.formula.WorkbookEvaluator.evaluateAny(WorkbookEvaluator.java:264)
at org.apache.poi.ss.formula.WorkbookEvaluator.evaluate(WorkbookEvaluator.java:205)
at org.apache.poi.xssf.usermodel.BaseXSSFFormulaEvaluator.evaluateFormulaCellValue(BaseXSSFFormulaEvaluator.java:57)
at org.apache.poi.ss.formula.BaseFormulaEvaluator.evaluate(BaseFormulaEvaluator.java:109)
at com.brucewan.FormulaCalcServer.controller.ExcelController.test(ExcelController.java:34)
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 org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:205)
at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:150)
at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:117)
at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:895)
at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:808)
at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:87)
at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1067)
at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:963)
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:1006)
at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:898)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:655)
at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:883)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:764)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:227)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)
at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:100)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)
at org.springframework.web.filter.FormContentFilter.doFilterInternal(FormContentFilter.java:93)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)
at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:201)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:197)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:97)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:540)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:135)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:78)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:357)
at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:382)
at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:65)
at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:895)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1732)
at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
at org.apache.tomcat.util.threads.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1191)
at org.apache.tomcat.util.threads.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:659)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.lang.Thread.run(Thread.java:748)
java.lang.RuntimeException: Invalid arg type for SUMPRODUCT: (org.apache.poi.ss.formula.eval.ErrorEval)
at org.apache.poi.ss.formula.functions.Sumproduct.evaluate(Sumproduct.java:85)
at org.apache.poi.ss.formula.OperationEvaluatorFactory.evaluate(OperationEvaluatorFactory.java:133)
at org.apache.poi.ss.formula.WorkbookEvaluator.evaluateFormula(WorkbookEvaluator.java:537)
at org.apache.poi.ss.formula.WorkbookEvaluator.evaluateAny(WorkbookEvaluator.java:264)
at org.apache.poi.ss.formula.WorkbookEvaluator.evaluate(WorkbookEvaluator.java:205)
at org.apache.poi.xssf.usermodel.BaseXSSFFormulaEvaluator.evaluateFormulaCellValue(BaseXSSFFormulaEvaluator.java:57)
at org.apache.poi.ss.formula.BaseFormulaEvaluator.evaluate(BaseFormulaEvaluator.java:109)
at com.brucewan.FormulaCalcServer.controller.ExcelController.test(ExcelController.java:34)
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 org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:205)
at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:150)
at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:117)
at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:895)
at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:808)
at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:87)
at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1067)
at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:963)
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:1006)
at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:898)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:655)
at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:883)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:764)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:227)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)
at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:100)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)
at org.springframework.web.filter.FormContentFilter.doFilterInternal(FormContentFilter.java:93)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)
at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:201)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:197)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:97)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:540)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:135)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:78)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:357)
at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:382)
at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:65)
at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:895)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1732)
at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
at org.apache.tomcat.util.threads.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1191)
at org.apache.tomcat.util.threads.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:659)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.lang.Thread.run(Thread.java:748)
If you open this up in Excel, you can calculate it correctly。
code
poi version: 5.2.0
Row row = sheet.getRow(2);
Cell cell = row.getCell(11);
CellValue cellValue = evaluator.evaluate(cell);
excel data
颜色
XS
S
M
L
XL
2XL
颜色
尺码
SKU
ASIN
入库总数
总
=SUM(L3:L200)
白底红花
2
4
6
3
5
48#黑色
2XL
JA033-01Black-2XL-FBA
B09F345ZCS
=SUMPRODUCT(($A$3:$A$257=$H3)($B$1:$G$1=$I3)$B$3:$G$257)
K2-009 4#红橙点
7
2
7
45#酒红
1
12
1#白色
3
12
8
13
4
K2-009 4#红橙点
2
4
白色印花
4
8
5
10
3
45#酒红
6
6
黑色波点
4
4
1
4
5
48#黑色
3
3
2
1
5

Related

Getting same birthday for all users in Liferay

I am trying to display age in years on my jsp. I converted the birthday to years.
But I am getting same age for all the users.
Before converting to years also, the birthday was still the same for all the users i.e (Tue Aug 02 11:44:26 GMT 2022) in jsp but different in the DB.
After converting i am getting the age as 52 for all the users (I think its taking default age of liferay 1970-01-01 00:00:00).
Can anyone please tell how to get the same birthday as stored in DB.
This is how i tried.
<td>
<fmt:parseDate type = "date" pattern = "yyyy-MM-dd" var = "parsedDate" value = "${listContacts.birthday}"/>
<jsp:useBean id = "today" class = "java.util.Date" />
<fmt:parseNumber type = "number" integerOnly = "true" value = "${(today.time - parsedDate.time)/(1000 * 60 * 60 * 24 * 365)}"/>
</td>
Edit 1
This is how i am retrieving the list of users:
List<User> getUsers = UserLocalServiceUtil.getUsers(QueryUtil.ALL_POS, QueryUtil.ALL_POS);
renderRequest.setAttribute("users", getUsers);
For retrieving the birthday from contact_ table:
List<Contact> getContacts = ContactLocalServiceUtil.getContacts(-1, 1);
renderRequest.setAttribute("contacts", getContacts);
Edit 2
I tried to do these two ways also, But getting the same exceptions for both of them.
First:
<td>
<c:forEach var = "listContacts" items = "${contacts}">
<fmt:parseDate type = "date" pattern = "yyyy-MM-dd" var = "parsedDate" value = "${listContacts.birthday}"/>
<jsp:useBean id = "today" class = "java.util.Date" />
<fmt:parseNumber type = "number" integerOnly = "true" value = "${(today.time - parsedDate.time)/(1000 * 60 * 60 * 24 * 365)}"/>
</c:forEach>
</td>
Second: So that i can compare the id's in both the table and display them.
<td>
<c:forEach var = "listContacts" items = "${contacts}">
<c:if test = "${listUsers.userId eq listContacts.userId}">
<fmt:parseDate type = "date" pattern = "yyyy-MM-dd" var = "parsedDate" value = "${listContacts.birthday}"/>
<jsp:useBean id = "today" class = "java.util.Date" />
<fmt:parseNumber type = "number" integerOnly = "true" value = "${(today.time - parsedDate.time)/(1000 * 60 * 60 * 24 * 365)}"/>
</c:if>
</c:forEach>
</td>
Stack Trace:
2022-08-03 10:06:20.914 ERROR [http-nio-8080-exec-3][PortletRequestDispatcherImpl:331] Unable to dispatch request: In <parseDate>, value attribute can not be parsed: "Tue Aug 02 11:44:26 GMT 2022"
2022-08-03 10:06:20.916 ERROR [http-nio-8080-exec-3][PortletServlet:112] javax.portlet.PortletException: javax.servlet.ServletException: In <parseDate>, value attribute can not be parsed: "Tue Aug 02 11:44:26 GMT 2022"
javax.portlet.PortletException: javax.servlet.ServletException: In <parseDate>, value attribute can not be parsed: "Tue Aug 02 11:44:26 GMT 2022"
at com.liferay.portlet.internal.PortletRequestDispatcherImpl.dispatch(PortletRequestDispatcherImpl.java:333)
at com.liferay.portlet.internal.PortletRequestDispatcherImpl.include(PortletRequestDispatcherImpl.java:128)
at com.liferay.portal.kernel.portlet.bridges.mvc.MVCPortlet.include(MVCPortlet.java:589)
at com.liferay.portal.kernel.portlet.bridges.mvc.MVCPortlet.include(MVCPortlet.java:605)
at com.liferay.portal.kernel.portlet.bridges.mvc.MVCPortlet.doDispatch(MVCPortlet.java:489)
at javax.portlet.GenericPortlet.render(GenericPortlet.java:291)
at com.liferay.portal.kernel.portlet.bridges.mvc.MVCPortlet.render(MVCPortlet.java:316)
at my.registration.form.portlet.MyRegistrationFormPortlet.render(MyRegistrationFormPortlet.java:96)
at com.liferay.portlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:127)
at com.liferay.portlet.ScriptDataPortletFilter.doFilter(ScriptDataPortletFilter.java:58)
at com.liferay.portlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:124)
at com.liferay.portal.kernel.portlet.PortletFilterUtil.doFilter(PortletFilterUtil.java:71)
at com.liferay.portal.kernel.servlet.PortletServlet.service(PortletServlet.java:108)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:741)
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:120)
at org.eclipse.equinox.http.servlet.internal.servlet.RequestDispatcherAdaptor.include(RequestDispatcherAdaptor.java:48)
at com.liferay.portlet.internal.InvokerPortletImpl.invoke(InvokerPortletImpl.java:564)
at com.liferay.portlet.internal.InvokerPortletImpl.invokeRender(InvokerPortletImpl.java:660)
at com.liferay.portlet.internal.InvokerPortletImpl.render(InvokerPortletImpl.java:357)
at com.liferay.portal.monitoring.internal.portlet.MonitoringInvokerPortlet.lambda$render$0(MonitoringInvokerPortlet.java:280)
at com.liferay.portal.monitoring.internal.portlet.MonitoringInvokerPortlet._render(MonitoringInvokerPortlet.java:383)
at com.liferay.portal.monitoring.internal.portlet.MonitoringInvokerPortlet.render(MonitoringInvokerPortlet.java:278)
at org.apache.jsp.html.portal.render_005fportlet_jsp._jspService(render_005fportlet_jsp.java:1534)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:741)
at com.liferay.portal.servlet.DirectRequestDispatcher.include(DirectRequestDispatcher.java:64)
at com.liferay.portal.servlet.DirectRequestDispatcherFactoryImpl$IndirectRequestDispatcher.include(DirectRequestDispatcherFactoryImpl.java:202)
at com.liferay.portal.servlet.ClassLoaderRequestDispatcherWrapper.doDispatch(ClassLoaderRequestDispatcherWrapper.java:79)
at com.liferay.portal.servlet.ClassLoaderRequestDispatcherWrapper.include(ClassLoaderRequestDispatcherWrapper.java:53)
at com.liferay.portal.servlet.TransferHeadersHelperImpl$TransferHeadersRequestDispatcher.include(TransferHeadersHelperImpl.java:162)
at com.liferay.portlet.internal.PortletContainerImpl._render(PortletContainerImpl.java:870)
at com.liferay.portlet.internal.PortletContainerImpl.lambda$render$2(PortletContainerImpl.java:216)
at com.liferay.portlet.internal.PortletContainerImpl._preserveGroupIds(PortletContainerImpl.java:395)
at com.liferay.portlet.internal.PortletContainerImpl.render(PortletContainerImpl.java:205)
at com.liferay.portlet.SecurityPortletContainerWrapper.render(SecurityPortletContainerWrapper.java:142)
at com.liferay.portlet.RestrictPortletContainerWrapper.lambda$render$0(RestrictPortletContainerWrapper.java:126)
at com.liferay.portlet.RestrictPortletContainerWrapper._render(RestrictPortletContainerWrapper.java:183)
at com.liferay.portlet.RestrictPortletContainerWrapper.render(RestrictPortletContainerWrapper.java:124)
at com.liferay.portal.kernel.portlet.PortletContainerUtil.render(PortletContainerUtil.java:212)
at com.liferay.portal.layoutconfiguration.util.PortletRenderer._render(PortletRenderer.java:192)
at com.liferay.portal.layoutconfiguration.util.PortletRenderer.render(PortletRenderer.java:84)
at com.liferay.portal.layoutconfiguration.util.RuntimePageImpl.doProcessTemplate(RuntimePageImpl.java:568)
at com.liferay.portal.layoutconfiguration.util.RuntimePageImpl.doDispatch(RuntimePageImpl.java:340)
at com.liferay.portal.layoutconfiguration.util.RuntimePageImpl.processTemplate(RuntimePageImpl.java:154)
at com.liferay.portal.layoutconfiguration.util.RuntimePageImpl.processTemplate(RuntimePageImpl.java:175)
at com.liferay.portal.kernel.layoutconfiguration.util.RuntimePageUtil.processTemplate(RuntimePageUtil.java:94)
at org.apache.jsp.html.portal.layout.view.portlet_jsp._jspService(portlet_jsp.java:728)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:741)
at com.liferay.portal.servlet.DirectRequestDispatcher.include(DirectRequestDispatcher.java:64)
at com.liferay.portal.servlet.DirectRequestDispatcherFactoryImpl$IndirectRequestDispatcher.include(DirectRequestDispatcherFactoryImpl.java:202)
at com.liferay.portal.servlet.ClassLoaderRequestDispatcherWrapper.doDispatch(ClassLoaderRequestDispatcherWrapper.java:79)
at com.liferay.portal.servlet.ClassLoaderRequestDispatcherWrapper.include(ClassLoaderRequestDispatcherWrapper.java:53)
at com.liferay.portal.servlet.TransferHeadersHelperImpl$TransferHeadersRequestDispatcher.include(TransferHeadersHelperImpl.java:162)
at com.liferay.portal.model.impl.LayoutTypeControllerImpl.includeLayoutContent(LayoutTypeControllerImpl.java:171)
at com.liferay.portal.model.impl.LayoutImpl.includeLayoutContent(LayoutImpl.java:904)
at com.liferay.portal.action.LayoutAction.processLayout(LayoutAction.java:407)
at com.liferay.portal.action.LayoutAction.execute(LayoutAction.java:174)
at com.liferay.portal.struts.PortalRequestProcessor._processActionPerform(PortalRequestProcessor.java:706)
at com.liferay.portal.struts.PortalRequestProcessor._process(PortalRequestProcessor.java:646)
at com.liferay.portal.struts.PortalRequestProcessor.process(PortalRequestProcessor.java:194)
at com.liferay.portal.servlet.MainServlet.process(MainServlet.java:1067)
at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:449)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:634)
at com.liferay.portal.servlet.MainServlet.callParentService(MainServlet.java:598)
at com.liferay.portal.servlet.MainServlet.service(MainServlet.java:575)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:741)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:119)
at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:144)
at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:103)
at com.liferay.portal.apio.internal.architect.servlet.filter.APIDocumentationFilter.processFilter(APIDocumentationFilter.java:74)
at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:49)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:207)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:112)
at com.liferay.portal.servlet.filters.password.modified.PasswordModifiedFilter.processFilter(PasswordModifiedFilter.java:57)
at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:49)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:207)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:112)
at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:144)
at com.liferay.portal.servlet.filters.secure.BaseAuthFilter.processFilter(BaseAuthFilter.java:340)
at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:49)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:207)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:112)
at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:144)
at com.liferay.portal.monitoring.internal.servlet.filter.MonitoringFilter.processFilter(MonitoringFilter.java:178)
at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:49)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:207)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:112)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilter.doFilter(InvokerFilter.java:101)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:712)
at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:459)
at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:384)
at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:312)
at com.liferay.friendly.url.internal.servlet.FriendlyURLServlet.service(FriendlyURLServlet.java:372)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:741)
at com.liferay.portal.servlet.ServletAdapter.service(ServletAdapter.java:98)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:741)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:119)
at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:144)
at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:103)
at com.liferay.portal.apio.internal.architect.servlet.filter.APIDocumentationFilter.processFilter(APIDocumentationFilter.java:74)
at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:49)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:207)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:112)
at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:144)
at com.liferay.portal.servlet.filters.strip.StripFilter.processFilter(StripFilter.java:340)
at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:49)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:207)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:112)
at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:144)
at com.liferay.portal.servlet.filters.i18n.I18nFilter.processFilter(I18nFilter.java:360)
at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:49)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:207)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:112)
at com.liferay.portal.servlet.filters.password.modified.PasswordModifiedFilter.processFilter(PasswordModifiedFilter.java:57)
at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:49)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:207)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:112)
at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:144)
at com.liferay.portal.servlet.filters.secure.BaseAuthFilter.processFilter(BaseAuthFilter.java:340)
at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:49)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:207)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:112)
at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:144)
at com.liferay.portal.servlet.filters.autologin.AutoLoginFilter.processFilter(AutoLoginFilter.java:260)
at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:49)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:207)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:112)
at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:144)
at com.liferay.portal.sharepoint.SharepointFilter.processFilter(SharepointFilter.java:88)
at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:49)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:207)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:112)
at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:144)
at com.liferay.portal.servlet.filters.virtualhost.VirtualHostFilter.processFilter(VirtualHostFilter.java:263)
at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:49)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:207)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:112)
at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:144)
at com.liferay.portal.monitoring.internal.servlet.filter.MonitoringFilter.processFilter(MonitoringFilter.java:178)
at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:49)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:207)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:112)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDirectCallFilter(InvokerFilterChain.java:188)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:96)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDirectCallFilter(InvokerFilterChain.java:188)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:96)
at org.tuckey.web.filters.urlrewrite.RuleChain.handleRewrite(RuleChain.java:176)
at org.tuckey.web.filters.urlrewrite.RuleChain.doRules(RuleChain.java:145)
at org.tuckey.web.filters.urlrewrite.UrlRewriter.processRequest(UrlRewriter.java:92)
at org.tuckey.web.filters.urlrewrite.UrlRewriteFilter.doFilter(UrlRewriteFilter.java:389)
at com.liferay.portal.servlet.filters.urlrewrite.UrlRewriteFilter.processFilter(UrlRewriteFilter.java:65)
at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:49)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:207)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:112)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDirectCallFilter(InvokerFilterChain.java:168)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:96)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDirectCallFilter(InvokerFilterChain.java:168)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:96)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDirectCallFilter(InvokerFilterChain.java:188)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:96)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilter.doFilter(InvokerFilter.java:101)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:199)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:491)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:139)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343)
at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:408)
at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)
at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:764)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1388)
at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.lang.Thread.run(Thread.java:748)
Caused by: javax.servlet.ServletException: In <parseDate>, value attribute can not be parsed: "Tue Aug 02 11:44:26 GMT 2022"
at org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:950)
at org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:885)
at com.liferay.taglib.servlet.PageContextWrapper.handlePageException(PageContextWrapper.java:173)
at org.apache.jsp.listUser_jsp._jspService(listUser_jsp:379)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:111)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:741)
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:741)
at com.liferay.portal.osgi.web.servlet.jsp.compiler.internal.JspServlet.service(JspServlet.java:319)
at com.liferay.portal.osgi.web.servlet.jsp.compiler.internal.JspServlet.service(JspServlet.java:330)
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:120)
at org.eclipse.equinox.http.servlet.internal.servlet.RequestDispatcherAdaptor.include(RequestDispatcherAdaptor.java:48)
at com.liferay.portlet.internal.PortletRequestDispatcherImpl.dispatch(PortletRequestDispatcherImpl.java:318)
... 193 more
Caused by: java.text.ParseException: Unparseable date: "Tue Aug 02 11:44:26 GMT 2022"
at java.text.DateFormat.parse(DateFormat.java:366)
at org.apache.taglibs.standard.tag.common.fmt.ParseDateSupport.doEndTag(ParseDateSupport.java:219)
at org.apache.jsp.listUser_jsp._jspx_meth_fmt_parseDate_0(listUser_jsp:642)
at org.apache.jsp.listUser_jsp._jspx_meth_c_forEach_1(listUser_jsp:592)
at org.apache.jsp.listUser_jsp._jspService(listUser_jsp:343)
... 206 more
2022-08-03 10:06:20.922 ERROR [http-nio-8080-exec-3][render_portlet_jsp:131] null
java.text.ParseException: Unparseable date: "Tue Aug 02 11:44:26 GMT 2022"
at java.text.DateFormat.parse(DateFormat.java:366)
at org.apache.taglibs.standard.tag.common.fmt.ParseDateSupport.doEndTag(ParseDateSupport.java:219)
at org.apache.jsp.listUser_jsp._jspx_meth_fmt_parseDate_0(listUser_jsp:642)
at org.apache.jsp.listUser_jsp._jspx_meth_c_forEach_1(listUser_jsp:592)
at org.apache.jsp.listUser_jsp._jspService(listUser_jsp:343)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:111)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:741)
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:741)
at com.liferay.portal.osgi.web.servlet.jsp.compiler.internal.JspServlet.service(JspServlet.java:319)
at com.liferay.portal.osgi.web.servlet.jsp.compiler.internal.JspServlet.service(JspServlet.java:330)
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:120)
at org.eclipse.equinox.http.servlet.internal.servlet.RequestDispatcherAdaptor.include(RequestDispatcherAdaptor.java:48)
at com.liferay.portlet.internal.PortletRequestDispatcherImpl.dispatch(PortletRequestDispatcherImpl.java:318)
at com.liferay.portlet.internal.PortletRequestDispatcherImpl.include(PortletRequestDispatcherImpl.java:128)
at com.liferay.portal.kernel.portlet.bridges.mvc.MVCPortlet.include(MVCPortlet.java:589)
Some suggestions - let me know if one of them works:
figure out if User or Contact hold the birthday. In your code, you're using ${listContacts.birthday} - and if they're not in the contacts, but in the users - here's a problem.
It looks like you're parsing "Tue Aug 02 11:44:26 GMT 2022" with the pattern "yyyy-MM-dd" - there's quite some mismatch between the two (but I'm not your regular JSTL guy - take this one with a grain of salt.
before you do any math on the date: output ${parsedDate} directly on the page, to see what you got, and if it matches with your expectation from the currently shown user's birthdate.
Earlier I was only getting the data for one user. I changed it to.
// for retrieving all Contact Details from "contact_" table form db
List<Contact> getContacts = ContactLocalServiceUtil.getContacts(QueryUtil.ALL_POS, QueryUtil.ALL_POS);
renderRequest.setAttribute("contacts", getContacts);
Then changed my code in JSP like this.
<td>
<c:forEach var = "listContacts" items = "${contacts}"> // For retrieving the contact list from DB.
<c:if test = "${listContacts.userId eq listUsers.userId}"> // For Equating the ID's in contact_ table and user_ table.
<fmt:formatDate type = "date" pattern = "yyyy-MM-dd" var = "parsedDate" value = "${listContacts.birthday}"/>
<jsp:useBean id = "today" class = "java.util.Date" />
<fmt:parseNumber type = "number" integerOnly = "true" value = "${(today.time - listContacts.birthday.time)/(1000 * 60 * 60 * 24 * 365)}"/> // Taking the difference between todays time and dob and converting it in years.
</c:if>
</c:forEach>
</td>

JSF component binding without bean property throwing conversion error

In a column of a table I've tried to bind a component value to a local scoped EL variable and later on to use that variable as a paramter:
<h:column>
<h:outputLabel value="Enter a quantity to put into the cart" for="qty"/>
<h:inputText id="qty" binding="#{qty}" converter="javax.faces.Number"/>
</h:column>
<h:column>
<h:commandButton value="Put into cart" type="submit"
action="#{shoppingCart.addToCart(product, qty)}"/>
</h:column>
Where product is the current element of the datatable (a list of filtered or unfiltered products that are not in the cart).
Now when trying to add a product to the cart (e.g. with the quantity 12) it throws the following exception:
javax.faces.el.EvaluationException: java.lang.IllegalArgumentException: Cannot convert javax.faces.component.html.HtmlInputText#377c8b02 of type class javax.faces.component.html.HtmlInputText to class java.lang.Integer
at javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:101)
at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:102)
at javax.faces.component.UICommand.broadcast(UICommand.java:315)
at javax.faces.component.UIData.broadcast(UIData.java:1108)
at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:790)
at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:1282)
at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:81)
at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:198)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:658)
at org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1682)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:318)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:160)
at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:734)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:673)
at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:99)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:174)
at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:416)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:283)
at com.sun.enterprise.v3.services.impl.ContainerMapper$HttpHandlerCallable.call(ContainerMapper.java:459)
at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:167)
at org.glassfish.grizzly.http.server.HttpHandler.runService(HttpHandler.java:206)
at org.glassfish.grizzly.http.server.HttpHandler.doHandle(HttpHandler.java:180)
at org.glassfish.grizzly.http.server.HttpServerFilter.handleRead(HttpServerFilter.java:235)
at org.glassfish.grizzly.filterchain.ExecutorResolver$9.execute(ExecutorResolver.java:119)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeFilter(DefaultFilterChain.java:283)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeChainPart(DefaultFilterChain.java:200)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.execute(DefaultFilterChain.java:132)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.process(DefaultFilterChain.java:111)
at org.glassfish.grizzly.ProcessorExecutor.execute(ProcessorExecutor.java:77)
at org.glassfish.grizzly.nio.transport.TCPNIOTransport.fireIOEvent(TCPNIOTransport.java:536)
at org.glassfish.grizzly.strategies.AbstractIOStrategy.fireIOEvent(AbstractIOStrategy.java:112)
at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.run0(WorkerThreadIOStrategy.java:117)
at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.access$100(WorkerThreadIOStrategy.java:56)
at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy$WorkerThreadRunnable.run(WorkerThreadIOStrategy.java:137)
at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:591)
at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.run(AbstractThreadPool.java:571)
at java.lang.Thread.run(Thread.java:745)
I'm using Glassfish 4.1.1 with JSF version 2.2.12.
I'd be grateful for any ideas
CLARIFACATION
As pointed out by BalusC in this question JSF component binding without bean property and others, binding="#{var}" is actually valid XHTML. This way no backing bean is needed and the declared variable is request scoped. I find this option more elegant and hence would like to stick with it.
Instead of binding="#{qty}" (which should be used to bind your input component to a Java instance of your component in a managed bean), use: value="#{shoppingCart.quantityAsInteger}", or if you are working with a list of shopping cart items: value="#{shoppingCartItem.quantityAsInteger}".
Apart from proper value binding this will also give you the benefit of having the quantity as part of your model. Additionally, when the value is bound to an Integer, there is no need to add a converter. JSF will take care of Integer (and some other types) conversion by default.
So, make sure you have a managed bean containing the quantity or a list of cart items which each have a quantity. In case of a list of cart items, you will end up with something like:
ShoppingCart.java
// You will probably already have something like this for your table
private List<ShoppingCartItem> shoppingCartItems;
ShoppingCartItem.java
// Quantity used for binding (add getter and setter).
private Integer quantity;
private Product product;
XHTML
<h:column>
<h:outputLabel value="Enter a quantity to put into the cart" for="qty"/>
<h:inputText id="qty" binding="#{shoppingCartItem.quantity}" />
</h:column>
Try using value attribute instead of binding attribute in h:inputText and use binding attribute on a table component. That way you can access to the selected (clicked) row in a action method: if binding attribute of a table has value #{bean.dataTable}, you can get row data in a method like getDataTable.getRowData().
Though declaring an EL variable is valid XHTML, the component itself is bound to the variable, if using the binding attribute. No conversion errors are thrown when using the EL variable with the value attribute, like that:
<h:inputText id="qty" value="#{qty}" converter="javax.faces.Number"/>
....
<h:commandButton value="Put into cart" type="submit"
action="#{shoppingCart.addToCart(product, qty)}"/>

Posting a 2D array in JSF

I have an application with a risk matrix. The headings are 5 severities (from the severitiesBean in my example) and 5 likelihoods (from the likelihoodsBean in my example). (The headings go by different names in literature, such as exposure or probability or consequences.) In each cell there is a risk rating (enumerated from the riskRatingsBean). To give you an idea of what this looks like visually, there is an example here.
I am able to display the matrix just fine, which seems all people asking related questions on SO cared about. However, I want to display and allow the administrator of the system to edit the risk for each cell in the grid. A selectOneMenu dropdown in either h: or p: (PrimeFaces) seems like a good way of allowing the selection.
Here's the JSF:
<h:panelGroup id="editArea">
<table border="1" style="border-collapse:collapse;" class="riskMatrix">
<tr>
<td rowspan="2" colspan="2"></td>
<th colspan="5">Severity</th>
</tr>
<tr>
<!-- Severities going across the top -->
<ui:repeat var="severity" value="#{severitiesBean.severities}">
<th style="text-align: center;">
<h:outputText value="#{severity.name}"/>
</th>
</ui:repeat>
</tr>
<ui:repeat id="likelihoodLoop" var="likelihood" value="#{likelihoodsBean.likelihoods}" varStatus="lkhdvar">
<tr>
<ui:fragment rendered="#{lkhdvar.index == 0}">
<th rowspan="5">Likelihood</th>
</ui:fragment>
<!-- Likelihoods going down the side -->
<th>
<h:outputText value="#{likelihood.name}"/>
</th>
<!-- The rating for each cell going across -->
<ui:repeat id="severitiesLoop" var="severity" value="#{severitiesBean.severities}">
<td class="#{riskRatingsBean.riskRatings.get(riskMatrixBean.riskMatrix[severity.id-1][likelihood.id-1]-1).cssClass}" style="text-align: center;">
<p:selectOneMenu
id="RiskRatingDropDown" effect="none"
value="#{riskMatrixBean.riskMatrix[severity.id-1][likelihood.id-1]}">
<f:selectItems value="#{riskRatingsBean.riskRatings}" var="rating" itemLabel="#{rating.name}" itemValue="#{rating.id}"/>
</p:selectOneMenu>
</td>
</ui:repeat>
</tr>
</ui:repeat>
</table>
</h:panelGroup>
<h:messages id="riskMatrixErrorMessages"/>
<p:commandButton id="SaveButton" value="Update" actionListener="#{riskMatrixBean.saveRiskMatrix}"
update="editArea"/>
In the riskMatrixBean, the matrix is defined like this:
public int[][] getRiskMatrix()
{
return riskMatrix;
}
This all displays perfectly. However, I want to be able to update the values. When I click on the submit button, I get an exception:
javax.faces.component.UpdateModelException: java.lang.ClassCastException: Unable to add an object of type [java.lang.Integer] to an array of objects of type [int]
at javax.faces.component.UIInput.updateModel(UIInput.java:866)
at javax.faces.component.UIInput.processUpdates(UIInput.java:749)
at com.sun.faces.facelets.component.UIRepeat.process(UIRepeat.java:633)
at com.sun.faces.facelets.component.UIRepeat.processUpdates(UIRepeat.java:880)
at com.sun.faces.facelets.component.UIRepeat.process(UIRepeat.java:633)
at com.sun.faces.facelets.component.UIRepeat.processUpdates(UIRepeat.java:880)
at javax.faces.component.UIComponentBase.processUpdates(UIComponentBase.java:1291)
at javax.faces.component.UIComponentBase.processUpdates(UIComponentBase.java:1291)
at javax.faces.component.UIForm.processUpdates(UIForm.java:281)
at javax.faces.component.UIComponentBase.processUpdates(UIComponentBase.java:1291)
at javax.faces.component.UIViewRoot.processUpdates(UIViewRoot.java:1254)
at com.sun.faces.lifecycle.UpdateModelValuesPhase.execute(UpdateModelValuesPhase.java:78)
at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:198)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:650)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.apache.myfaces.webapp.filter.ExtensionsFilter.doFilter(ExtensionsFilter.java:357)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:581)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:931)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1004)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:589)
at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:312)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.ClassCastException: Unable to add an object of type [java.lang.Integer] to an array of objects of type [int]
at javax.el.ArrayELResolver.setValue(ArrayELResolver.java:96)
at com.sun.faces.el.DemuxCompositeELResolver._setValue(DemuxCompositeELResolver.java:255)
at com.sun.faces.el.DemuxCompositeELResolver.setValue(DemuxCompositeELResolver.java:281)
at org.apache.el.parser.AstValue.setValue(AstValue.java:218)
at org.apache.el.ValueExpressionImpl.setValue(ValueExpressionImpl.java:253)
at com.sun.faces.facelets.el.TagValueExpression.setValue(TagValueExpression.java:131)
at javax.faces.component.UIInput.updateModel(UIInput.java:832)
... 33 more
I'm at a loss as to what I'm doing wrong. Obviously the updateModel during the updateModelValuesPhase doesn't know how to deal with the int[][] and how I've specified the selectOneMenu value attribute. I suspect there is something wrong with the approach, but I'm not sure what. Maybe it's something to do with the nested ui:repeats? I tried to change to using Integer[][] and to List<List<Integer>>, and still no luck, although I probably did something else wrong along the way. I'm open to changing my data type as necessary.
Thanks in advance!

Parsing xml data into nested list bash

I'm working on a Plex Geeklet, and I have a string of recently added TV shows.
SHOW_DATA=$(curl --silent "http://localhost:32400/library/sections/3/recentlyAdded?X-Plex-Container-Start=0&X-Plex-Container-Size=10")
This is an example of my data:
<?xml version="1.0" encoding="UTF-8"?>
<MediaContainer size="10" totalSize="50" allowSync="1" art="/:/resources/show-fanart.jpg" identifier="com.plexapp.plugins.library" librarySectionID="3" librarySectionTitle="TV Shows" librarySectionUUID="600cd0c5-fd4b-460a-846b-e4bad1ecdf4a" mediaTagPrefix="/system/bundle/media/flags/" mediaTagVersion="1402960845" mixedParents="1" nocache="1" offset="0" thumb="/:/resources/show.png" title1="TV Shows" title2="Recently Added" viewGroup="episode" viewMode="65592">
<Video ratingKey="588" key="/library/metadata/588" parentRatingKey="587" grandparentRatingKey="586" type="episode" title="Pilot" grandparentKey="/library/metadata/586" parentKey="/library/metadata/587" grandparentTitle="Community" contentRating="TV-PG" summary="Fast-talking lawyer Jeff Winger (Joel McHale) enrolls at Greendale Community College after the State Bar discovered his illegitimate degree and threatened to suspend his license. When Jeff pretends to be a Spanish tutor to get close to his classmate Britta (Gillian Jacobs), he winds up with an entire study group of students looking for his help. Pierce (Chevy Chase), Abed (Danny Pudi), Shirley (Yvette Nicole Brown), Annie (Alison Brie), Troy (Donald Glover), and Britta comprise the band of misfits that Jeff never asked for, but may end up needing when he realizes his connection to Greendale professor Ian Duncan (John Oliver) won&apos;t pay off like he hoped." index="1" parentIndex="1" rating="7.4000000953674299" year="2009" thumb="/library/metadata/588/thumb/1403755683" art="/library/metadata/586/art/1403755684" parentThumb="/library/metadata/587/thumb/1403755684" grandparentThumb="/library/metadata/586/thumb/1403755684" grandparentTheme="/library/metadata/586/theme/1403755684" duration="1525134" originallyAvailableAt="2009-09-17" addedAt="1403755618" updatedAt="1403755683">
<Media videoResolution="480" id="479" duration="1525134" bitrate="2509" width="854" height="480" aspectRatio="1.78" audioChannels="2" audioCodec="aac" videoCodec="h264" container="mp4" videoFrameRate="24p" optimizedForStreaming="0" has64bitOffsets="0">
<Part id="522" key="/library/parts/522/file.mp4" duration="1525134" file="/Users/joe/Videos/TV Shows/Community/Season 1/01 Pilot.mp4" size="478232014" container="mp4" has64bitOffsets="0" optimizedForStreaming="0" />
</Media>
<Writer tag="Dan Harmon" />
<Director tag="Anthony Russo" />
<Director tag="Joe Russo" />
</Video>
<Video ratingKey="589" key="/library/metadata/589" parentRatingKey="587" grandparentRatingKey="586" type="episode" title="Spanish 101" grandparentKey="/library/metadata/586" parentKey="/library/metadata/587" grandparentTitle="Community" contentRating="TV-PG" summary="Jeff&apos;s (Joel McHale) efforts to win over Britta (Gillian Jacobs) backfire, and he finds himself paired up with Pierce (Chevy Chase) for their Spanish class project. The two give teacher Señor Chang (Ken Jeong) the presentation of a lifetime. Meanwhile, inspired by Britta&apos;s awareness of social issues, Annie (Alison Brie) and Shirley (Yvette Nicole Brown) stage a protest on Greendale&apos;s campus." index="2" parentIndex="1" rating="7.4000000953674299" year="2009" thumb="/library/metadata/589/thumb/1403755684" art="/library/metadata/586/art/1403755684" parentThumb="/library/metadata/587/thumb/1403755684" grandparentThumb="/library/metadata/586/thumb/1403755684" grandparentTheme="/library/metadata/586/theme/1403755684" duration="1278352" originallyAvailableAt="2009-09-24" addedAt="1403755618" updatedAt="1403755684">
<Media videoResolution="480" id="480" duration="1278352" bitrate="2253" width="854" height="480" aspectRatio="1.78" audioChannels="2" audioCodec="aac" videoCodec="h264" container="mp4" videoFrameRate="24p" optimizedForStreaming="0" has64bitOffsets="0">
<Part id="523" key="/library/parts/523/file.mp4" duration="1278352" file="/Users/joe/Videos/TV Shows/Community/Season 1/02 Spanish 101.mp4" size="359953984" container="mp4" has64bitOffsets="0" optimizedForStreaming="0" />
</Media>
<Writer tag="Dan Harmon" />
<Director tag="Joe Russo" />
</Video>
<Video ratingKey="591" key="/library/metadata/591" parentRatingKey="587" grandparentRatingKey="586" type="episode" title="Introduction to Statistics" grandparentKey="/library/metadata/586" parentKey="/library/metadata/587" grandparentTitle="Community" contentRating="TV-PG" summary="It&apos;s Halloween at Greendale, and Jeff (Joel McHale) has the hots for one of his teachers (Lauren Stamile) and gets dating advice from Señor Chang (Ken Jeong). Meanwhile Annie (Alison Brie) throws a ""Dia de los Muertos" party for extra credit." index="7" parentIndex="1" rating="7.9000000953674299" year="2009" thumb="/library/metadata/591/thumb/1403755686" art="/library/metadata/586/art/1403755684" parentThumb="/library/metadata/587/thumb/1403755684" grandparentThumb="/library/metadata/586/thumb/1403755684" grandparentTheme="/library/metadata/586/theme/1403755684" duration="1276610" originallyAvailableAt="2009-10-29" addedAt="1403755618" updatedAt="1403755686">
<Media videoResolution="480" id="482" duration="1276610" bitrate="2258" width="854" height="480" aspectRatio="1.78" audioChannels="2" audioCodec="aac" videoCodec="h264" container="mp4" videoFrameRate="24p" optimizedForStreaming="0" has64bitOffsets="0">
<Part id="525" key="/library/parts/525/file.mp4" duration="1276610" file="/Users/joe/Videos/TV Shows/Community/Season 1/07 Introduction to Statistics.mp4" size="360268838" container="mp4" has64bitOffsets="0" optimizedForStreaming="0" />
</Media>
<Writer tag="Jon Pollack" />
<Writer tag="Tim Hobert" />
<Director tag="Justin Lin" />
</Video>
<Video ratingKey="592" key="/library/metadata/592" parentRatingKey="587" grandparentRatingKey="586" type="episode" title="Home Economics" grandparentKey="/library/metadata/586" parentKey="/library/metadata/587" grandparentTitle="Community" contentRating="TV-PG" summary="Britta (Gillian Jacobs) tries to rid Jeff (Joel McHale) of his materialistic ways. Meanwhile Pierce (Chevy Chase) joins a rock band on campus, and Annie (Alison Brie) grudgingly helps Troy (Donald Glover) plan a date with another girl." index="8" parentIndex="1" rating="7.5999999046325701" year="2009" thumb="/library/metadata/592/thumb/1403755686" art="/library/metadata/586/art/1403755684" parentThumb="/library/metadata/587/thumb/1403755684" grandparentThumb="/library/metadata/586/thumb/1403755684" grandparentTheme="/library/metadata/586/theme/1403755684" duration="1275844" originallyAvailableAt="2009-11-05" addedAt="1403755618" updatedAt="1403755686">
<Media videoResolution="480" id="483" duration="1275844" bitrate="2340" width="854" height="480" aspectRatio="1.78" audioChannels="2" audioCodec="aac" videoCodec="h264" container="mp4" videoFrameRate="24p" optimizedForStreaming="0" has64bitOffsets="0">
<Part id="526" key="/library/parts/526/file.mp4" duration="1275844" file="/Users/joe/Videos/TV Shows/Community/Season 1/08 Home Economics.mp4" size="373156573" container="mp4" has64bitOffsets="0" optimizedForStreaming="0" />
</Media>
<Writer tag="Lauren Pomerantz" />
<Director tag="Anthony Russo" />
</Video>
<Video ratingKey="593" key="/library/metadata/593" parentRatingKey="587" grandparentRatingKey="586" type="episode" title="Comparative Religion" grandparentKey="/library/metadata/586" parentKey="/library/metadata/587" grandparentTitle="Community" contentRating="TV-PG" summary="Shirley (Yvette Nicole Brown) tries to get everyone in the Christmas spirit, but Jeff (Joel McHale) threatens her holiday cheer when he decides to fight the school bully (guest star Anthony Michael Hall)." index="12" parentIndex="1" rating="7.8000001907348597" year="2009" thumb="/library/metadata/593/thumb/1403755688" art="/library/metadata/586/art/1403755684" parentThumb="/library/metadata/587/thumb/1403755684" grandparentThumb="/library/metadata/586/thumb/1403755684" grandparentTheme="/library/metadata/586/theme/1403755684" duration="1276355" originallyAvailableAt="2009-12-10" addedAt="1403755618" updatedAt="1403755688">
<Media videoResolution="480" id="484" duration="1276355" bitrate="2446" width="854" height="480" aspectRatio="1.78" audioChannels="2" audioCodec="aac" videoCodec="h264" container="mp4" videoFrameRate="24p" optimizedForStreaming="0" has64bitOffsets="0">
<Part id="527" key="/library/parts/527/file.mp4" duration="1276355" file="/Users/joe/Videos/TV Shows/Community/Season 1/12 Comparative Religion.mp4" size="390216047" container="mp4" has64bitOffsets="0" optimizedForStreaming="0" />
</Media>
<Writer tag="Liz Cackowski" />
<Director tag="Adam Davidson" />
</Video>
<Video ratingKey="594" key="/library/metadata/594" parentRatingKey="587" grandparentRatingKey="586" type="episode" title="Investigative Journalism" grandparentKey="/library/metadata/586" parentKey="/library/metadata/587" grandparentTitle="Community" contentRating="TV-PG" summary="Everyone&apos;s vibe is thrown off when an unwanted outsider tries to join the study group. Meanwhile, Jeff (Joel McHale) becomes the new editor of Greendale&apos;s school newspaper and appoints Annie (Alison Brie) as his ace reporter." index="13" parentIndex="1" rating="7.5" year="2010" thumb="/library/metadata/594/thumb/1403755689" art="/library/metadata/586/art/1403755684" parentThumb="/library/metadata/587/thumb/1403755684" grandparentThumb="/library/metadata/586/thumb/1403755684" grandparentTheme="/library/metadata/586/theme/1403755684" duration="1269923" originallyAvailableAt="2010-01-14" addedAt="1403755618" updatedAt="1403755689">
<Media videoResolution="480" id="485" duration="1269923" bitrate="1998" width="854" height="480" aspectRatio="1.78" audioChannels="2" audioCodec="aac" videoCodec="h264" container="mp4" videoFrameRate="24p" optimizedForStreaming="0" has64bitOffsets="0">
<Part id="528" key="/library/parts/528/file.mp4" duration="1269923" file="/Users/joe/Videos/TV Shows/Community/Season 1/13 Investigative Journalism.mp4" size="317146865" container="mp4" has64bitOffsets="0" optimizedForStreaming="0" />
</Media>
<Writer tag="Jon Pollack" />
<Writer tag="Tim Hobert" />
<Director tag="Joe Russo" />
</Video>
<Video ratingKey="595" key="/library/metadata/595" parentRatingKey="587" grandparentRatingKey="586" type="episode" title="Romantic Expressionism" grandparentKey="/library/metadata/586" parentKey="/library/metadata/587" grandparentTitle="Community" contentRating="TV-PG" summary="Britta (Gillian Jacobs) and Jeff (Joel McHale) stage an intervention when Annie (Alison Brie) gets cozy with Vaughn (Eric Christian Olsen). Meanwhile Pierce (Chevy Chase) struggles to prove his wit when he crashes Abed (Danny Pudi) and Troy’s (Donald Glover) movie night." index="15" parentIndex="1" rating="7.9000000953674299" year="2010" thumb="/library/metadata/595/thumb/1403755689" art="/library/metadata/586/art/1403755684" parentThumb="/library/metadata/587/thumb/1403755684" grandparentThumb="/library/metadata/586/thumb/1403755684" grandparentTheme="/library/metadata/586/theme/1403755684" duration="1274799" originallyAvailableAt="2010-02-04" addedAt="1403755618" updatedAt="1403755689">
<Media videoResolution="480" id="486" duration="1274799" bitrate="2059" width="854" height="480" aspectRatio="1.78" audioChannels="2" audioCodec="aac" videoCodec="h264" container="mp4" videoFrameRate="24p" optimizedForStreaming="0" has64bitOffsets="0">
<Part id="529" key="/library/parts/529/file.mp4" duration="1274799" file="/Users/joe/Videos/TV Shows/Community/Season 1/15 Romantic Expressionism.mp4" size="328027632" container="mp4" has64bitOffsets="0" optimizedForStreaming="0" />
</Media>
<Writer tag="Andrew Guest" />
<Director tag="Joe Russo" />
</Video>
<Video ratingKey="596" key="/library/metadata/596" parentRatingKey="587" grandparentRatingKey="586" type="episode" title="Communication Studies" grandparentKey="/library/metadata/586" parentKey="/library/metadata/587" grandparentTitle="Community" contentRating="TV-PG" summary="When Britta (Gillian Jacobs) drunk dials Jeff (Joel McHale) things get awkward between them and Jeff attempts to repair their relationship. Meanwhile, Annie (Alison Brie) and Shirley (Yvette Nicole Brown) conspire to humiliate Señor Chang (Ken Jeong)." index="16" parentIndex="1" rating="7.8000001907348597" year="2010" thumb="/library/metadata/596/thumb/1403755691" art="/library/metadata/586/art/1403755684" parentThumb="/library/metadata/587/thumb/1403755684" grandparentThumb="/library/metadata/586/thumb/1403755684" grandparentTheme="/library/metadata/586/theme/1403755684" duration="1267206" originallyAvailableAt="2010-02-11" addedAt="1403755618" updatedAt="1403755691">
<Media videoResolution="480" id="487" duration="1267206" bitrate="2278" width="854" height="480" aspectRatio="1.78" audioChannels="2" audioCodec="aac" videoCodec="h264" container="mp4" videoFrameRate="24p" optimizedForStreaming="0" has64bitOffsets="0">
<Part id="530" key="/library/parts/530/file.mp4" duration="1267206" file="/Users/joe/Videos/TV Shows/Community/Season 1/16 Communication Studies.mp4" size="360777073" container="mp4" has64bitOffsets="0" optimizedForStreaming="0" />
</Media>
<Writer tag="Chris McKenna" />
<Director tag="Adam Davidson" />
</Video>
<Video ratingKey="597" key="/library/metadata/597" parentRatingKey="587" grandparentRatingKey="586" type="episode" title="Modern Warfare" grandparentKey="/library/metadata/586" parentKey="/library/metadata/587" grandparentTitle="Community" contentRating="TV-PG" summary="JEFF AND BRITTA&apos;S SEXUAL TENSION HEATS UP ? The sexual tension between Jeff (Joel McHale) and Britta (Gillian Jacobs) becomes a hot topic among the study group. Meanwhile, what starts out as a simple contest for a chance at early class registration turns the peaceful campus of Greendale Community College into an all-out war zone. Friendships are tested, as only one student can be victorious." index="23" parentIndex="1" rating="8.5" year="2010" thumb="/library/metadata/597/thumb/1403755692" art="/library/metadata/586/art/1403755684" parentThumb="/library/metadata/587/thumb/1403755684" grandparentThumb="/library/metadata/586/thumb/1403755684" grandparentTheme="/library/metadata/586/theme/1403755684" duration="1260333" originallyAvailableAt="2010-05-06" addedAt="1403755618" updatedAt="1403755692">
<Media videoResolution="480" id="488" duration="1260333" bitrate="2233" width="854" height="480" aspectRatio="1.78" audioChannels="2" audioCodec="aac" videoCodec="h264" container="mp4" videoFrameRate="24p" optimizedForStreaming="0" has64bitOffsets="0">
<Part id="531" key="/library/parts/531/file.mp4" duration="1260333" file="/Users/joe/Videos/TV Shows/Community/Season 1/23 Modern Warfare.mp4" size="351822199" container="mp4" has64bitOffsets="0" optimizedForStreaming="0" />
</Media>
<Writer tag="Emily Cutler" />
<Director tag="Justin Lin" />
</Video>
<Video ratingKey="590" key="/library/metadata/590" parentRatingKey="587" grandparentRatingKey="586" type="episode" title="Advanced Criminal Law" grandparentKey="/library/metadata/586" parentKey="/library/metadata/587" grandparentTitle="Community" contentRating="TV-PG" summary="Señor Chang (Ken Jeong) invokes an inquisition and trial when one of the gang cheats on an exam. Annie (Alison Brie) enlists Pierce (Chevy Chase) to help her compose Greendale&apos;s new school song, and Troy (Donald Glover) educates Abed (Danny Pudi) on the art of joking." index="5" parentIndex="1" rating="7.8000001907348597" year="2009" thumb="/library/metadata/590/thumb/1403755683" art="/library/metadata/586/art/1403755684" parentThumb="/library/metadata/587/thumb/1403755684" grandparentThumb="/library/metadata/586/thumb/1403755684" grandparentTheme="/library/metadata/586/theme/1403755684" originallyAvailableAt="2009-10-15" addedAt="1403755618" updatedAt="1403755683">
<Media id="481" container="">
<Part id="524" key="/library/parts/524/file.mp4" file="/Users/joe/Videos/TV Shows/Community/Season 1/05 Advanced Criminal Law.mp4" size="48" />
</Media>
<Writer tag="Andrew Guest" />
<Director tag="Joe Russo" />
</Video>
</MediaContainer>
I'm trying to get this into an orders list like this
[ [show_title_1, episode_title_1], [show_title_2, episode_title_2], ... [show_title_10, episode_title_10] ]
so I can eventually print it as (for example)
Community: Pilot
Arrested Development: My Mother, the Car
I've been able to get them into separate newline-delimited strings like so:
SHOW_NAMES=$("$SHOW_DATA" | grep -o 'grandparentTitle="\([^"]*\)"' | sed -e 's/grandparentTitle="//' -e 's/"//' | perl -MHTML::Entities -ne 'print decode_entities($_)'))
SHOW_TITLES=$("$SHOW_DATA" | grep -o 'title="\([^"]*\)"' | sed -e 's/title="//' -e 's/"//' | perl -MHTML::Entities -ne 'print decode_entities($_)'))
So is it possible to convert them both to lists, and use a loop to construct a new list containing nested lists of those values? I've really hit a wall here.
If I were you I would get rid of all the grep and sed, etc.. and just rely on pattern matching. I guessed at which exact fields you wanted, but you can easily update the code as needed. I used your data file to test with, so this will work. The script takes 1 input, that being the filename to the downloaded .xml file:
#!/bin/bash
test -r "$1" || { echo "error: invalid input, usage: ${0//*\//} filename.xml"; exit 1; }
let idx=0
while read line || test -n "$line"; do
if test "${line:0:2}" == '<V'; then
tmp=${line##* title=}
title=${tmp%% grandparentKey*}
tmp=${line##*grandparentTitle=}
gptitle=${tmp%% contentRating*}
if test "$idx" -lt "1" ; then
let idx=1
echo -n "[ [ $title, $gptitle ]"
else
echo -n ", [ $title, $gptitle ]"
fi
fi
done <"$1"
echo " ]"
exit 0
The following will read the values into an array to allow later processing. You can add additional arrays as you like, you can even read the entire file into an array if you like (but re-reading if from disk is simple enough as well) The output is the same as above (it is just for illustration):
let idx=0
declare -a title
declare -a gptitle
declare -a allvideo
while read line || test -n "$line"; do
if test "${line:0:2}" == '<V'; then
allvideo+=( "$line" )
tmp=${line##* title=}
title+=( "${tmp%% grandparentKey*}" )
tmp=${line##*grandparentTitle=}
gptitle+=( "${tmp%% contentRating*}" )
fi
done <"$1"
# output the original 2 variables
for ((i=0; i<${#title[#]}; i++)); do
if test "$i" -eq 0 ; then
echo -n "[ [ ${title[$i]}, ${gptitle[$i]} ]"
else
echo -n ", [ ${title[$i]}, ${gptitle[$i]} ]"
fi
done
echo " ]"
oldifs=$IFS
IFS=$'\n' # set Internal Field Separator to only break on newlines
# output the entire file with the allvideo array
for i in ${allvideo[#]}; do
echo "$i"
done
IFS=$oldifs
output:
[ [ "Pilot", "Community" ], [ "Spanish 101", "Community" ], \
[ "Introduction to Statistics", "Community" ], [ "Home Economics", "Community" ], \
[ "Comparative Religion", "Community" ], [ "Investigative Journalism", "Community" ], \
[ "Romantic Expressionism", "Community" ], [ "Communication Studies", "Community" ], \
[ "Modern Warfare", "Community" ], [ "Advanced Criminal Law", "Community" ] ]
**the dump of the original file is omitted for brevity.
Let me know if you have any additional questions.

Solr wrong sort text fields

I have "text_general" field in schema.xml
<fieldType name="text_general" class="solr.TextField" positionIncrementGap="100">
<analyzer type="index">
<tokenizer class="solr.WhitespaceTokenizerFactory"/>
<filter class="solr.WordDelimiterFilterFactory" generateWordParts="1" generateNumberParts="1" catenateWords="1" catenateNumbers="1" catenateAll="0" splitOnCaseChange="1"/>
<filter class="solr.LowerCaseFilterFactory"/>
</analyzer>
<analyzer type="query">
<tokenizer class="solr.WhitespaceTokenizerFactory"/>
<filter class="solr.WordDelimiterFilterFactory" generateWordParts="1" generateNumberParts="1" catenateWords="1" catenateNumbers="1" catenateAll="0" splitOnCaseChange="1"/><filter class="solr.LowerCaseFilterFactory"/>
</analyzer>
</fieldType>
I have stored documents:
document1:
spell = "contro un indice generale dei prezzi salito del 2, 1%. Rincari ben piщ evidenti, tra i prodotti da bar"
testata = "Mattino di Padova (Il)"
document2:
spell="con i prodotti di qualitа vinco la crisi dei consumi Farinetti: con"
testata = "Italia Oggi"
document3
spell = "convenienza Il 2008 porta i primi aumenti nei pre zi L'Ipercoop cresce il listino"
testata = "Nuova Ferrara (La)"
"spell" and "testata" fields has a "text_general" type.
Searching working fine for me:
http://localhost:8080/solr/select?q={!type=edismax qf=spell v='co*'}
But with sorting exists some problem:
http://localhost:8080/solr/select?q={!type=edismax qf=spell v='co*'}&sort=testata desc
It returns me this result:
document1:
spell = "contro un indice generale dei prezzi salito del 2, 1%. Rincari ben piщ evidenti, tra i prodotti da bar"
testata = "Mattino di Padova (Il)"
document2:
spell="con i prodotti di qualitа vinco la crisi dei consumi Farinetti: con"
testata = "Italia Oggi"
document3
spell = "convenienza Il 2008 porta i primi aumenti nei pre zi L'Ipercoop cresce il listino"
testata = "Nuova Ferrara (La)"
I don`t understand why my sorting working not properly. It should returns me result like this:
document3
spell = "convenienza Il 2008 porta i primi aumenti nei pre zi L'Ipercoop cresce il listino"
testata = "Nuova Ferrara (La)"
document1:
spell = "contro un indice generale dei prezzi salito del 2, 1%. Rincari ben piщ evidenti, tra i prodotti da bar"
testata = "Mattino di Padova (Il)"
document2:
spell="con i prodotti di qualitа vinco la crisi dei consumi Farinetti: con"
testata = "Italia Oggi"
Sorting doesn't work good on multivalued and tokenized fields.
As testata has been defined with text_general field type, it will be tokensized and hence the sort would not work fine.
Sorting can be done on the "score" of the document, or on any
multiValued="false" indexed="true" field provided that field is either
non-tokenized (ie: has no Analyzer) or uses an Analyzer that only
produces a single Term (ie: uses the KeywordTokenizer)
Source: http://wiki.apache.org/solr/CommonQueryParameters#sort
Use string as the field type and copy the title field into the new field.
<field name="testata_sort" type="string" indexed="true" stored="false"/>
<copyField source="testata" dest="testata_sort" />

Resources