2012-05-10 09:18:07,746 ERROR [workflow.util.DateUtils] [http-8080-11] date formatjava.text.SimpleDateFormat@42ee54
2012-05-10 09:18:07,746 ERROR [workflow.util.DateUtils] [http-8080-11] Date dose not match with the Required Format
2012-05-10 09:18:07,746 ERROR [workflow.util.DateUtils] [http-8080-11] Unparseable date: "Fri May 04 09:35:32 CEST 2012"
2012-05-10 09:18:07,746 ERROR [extensions.webscripts.AbstractRuntime] [http-8080-11] Exception from executeScript - redirecting to status template error: 04100012 Wrapped Exception (with status template): null
org.springframework.extensions.webscripts.WebScriptException: 04100012 Wrapped Exception (with status template): null
at org.springframework.extensions.webscripts.AbstractWebScript.createStatusException(AbstractWebScript.java:971)
at org.springframework.extensions.webscripts.DeclarativeWebScript.execute(DeclarativeWebScript.java:171)
at org.alfresco.repo.web.scripts.RepositoryContainer.transactionedExecute(RepositoryContainer.java:348)
at org.alfresco.repo.web.scripts.RepositoryContainer.transactionedExecuteAs(RepositoryContainer.java:500)
at org.alfresco.repo.web.scripts.RepositoryContainer.executeScript(RepositoryContainer.java:316)
at org.springframework.extensions.webscripts.AbstractRuntime.executeScript(AbstractRuntime.java:372)
at org.springframework.extensions.webscripts.AbstractRuntime.executeScript(AbstractRuntime.java:209)
at org.springframework.extensions.webscripts.servlet.WebScriptServlet.service(WebScriptServlet.java:118)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.alfresco.web.app.servlet.GlobalLocalizationFilter.doFilter(GlobalLocalizationFilter.java:58)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:470)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
at org.apache.coyote.http11.Http11AprProcessor.process(Http11AprProcessor.java:861)
at org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.process(Http11AprProtocol.java:579)
at org.apache.tomcat.util.net.AprEndpoint$Worker.run(AprEndpoint.java:1584)
at java.lang.Thread.run(Thread.java:662)
Caused by: java.lang.NullPointerException
at org.alfresco.workflow.util.AlfrescoUtils.getNoOfTaskForDateRange(Unknown Source)
at org.alfresco.repo.web.scripts.webscripts.dashlets.WorkflowStatisticsWebScript.getNoOfSiteActiveWorkflows(Unknown Source)
at org.alfresco.repo.web.scripts.webscripts.dashlets.WorkflowStatisticsWebScript.getSiteData(Unknown Source)
at org.alfresco.repo.web.scripts.webscripts.dashlets.WorkflowStatisticsWebScript.executeImpl(Unknown Source)
at org.springframework.extensions.webscripts.DeclarativeWebScript.executeImpl(DeclarativeWebScript.java:221)
at org.springframework.extensions.webscripts.DeclarativeWebScript.executeImpl(DeclarativeWebScript.java:235)
at org.springframework.extensions.webscripts.DeclarativeWebScript.execute(DeclarativeWebScript.java:64)
… 23 more
J'ai juste changé le format qui était dd-MM-yyyy HH:mm:ss.SSS en EEE MMM dd HH:mm:ss z yyyy et j'ai essayé aussi ddd d mmm yyyy HH:MM:ss mais en vain.package org.alfresco.workflow.util;
import java.text.DateFormat;
/**
* Utility class for Dates
* @author deepak.keswani
*
*/
public class DateUtils
{
public static final String DATE_FORMAT_ALFRESCO = "EEE MMM dd HH:mm:ss z yyyy";// ddd d mmm yyyy HH:MM:ss
private static final String separator = "-";
private final static Log LOGGER = LogFactory.getLog(DateUtils.class);
/**
* Method will convert String to Date Object
* @param str
* @return
*/
public static Date strToDate(String str, String format)
{
//Locale currentLocale = new Locale("en","US");
DateFormat dateFormat = new SimpleDateFormat(format);
Date date = null;
try
{
date = dateFormat.parse(str);
LOGGER.error("test error"+dateFormat.format(new Date()));
} catch (ParseException e)
{
LOGGER.error("Date dose not match with the Required Format");
LOGGER.error(e.getMessage());
}
return date;
}
/**
* Build dates on the basis of start and end of year
* @param startYear
* @param endYear
* @return
*/
public static Map<String, String[]> buildDates(int startYear , int endYear )
{
Map<String, String[]> dateRangeMap = new LinkedHashMap<String, String[]>();
if(endYear - startYear !=0)
{
for( int row = startYear ; row <= endYear; row++)
{
String[] dateRange = new String[2];
dateRange[0]= row + separator + "01" + separator + "01T00:00:00.000";
dateRange[1]= row + separator + "12" + separator + "31T23:59:59.999";
dateRangeMap.put(String.valueOf(row), dateRange);
}
}
else
{
String[] shortMonths = new DateFormatSymbols().getShortMonths();
Calendar calendar = Calendar.getInstance();
for (int i = 0; i <shortMonths.length-1; i++)
{
String[] dateRange = new String[2];
calendar.set(startYear, i, 1);
dateRange[0]= startYear + separator + (i+1) +separator+calendar.getActualMinimum(Calendar.DAY_OF_MONTH)+ "T00:00:00.000";
dateRange[1]= startYear + separator + (i+1) +separator+calendar.getActualMaximum(Calendar.DAY_OF_MONTH)+"T23:59:59.999";
dateRangeMap.put(shortMonths[i], dateRange);
}
}
return dateRangeMap;
}
}
J'ai aussi essayé de changer le Local en ajoutant : Locale currentLocale = new Locale("en","US");
SimpleDateFormat sdf = SimpleDateFormat("EEE MMM dd HH:mm:ss z yyyy");
date = dateFormat.parse(str);
Mais ça pas résolu le problème.Content from pre 2016 and from language groups that have been closed.
Content is read-only.
By using this site, you are agreeing to allow us to collect and use cookies as outlined in Alfresco’s Cookie Statement and Terms of Use (and you have a legitimate interest in Alfresco and our products, authorizing us to contact you in such methods). If you are not ok with these terms, please do not use this website.