Request description
Bonjour,
Lorsque j’export en archive ZIP une ligne de ma liste de campagne
le ZIP est vide avec l’erreur ci-dessous :
Voici la ligne que j’essaie d’exporter :
De plus, quand je fais un export général de mon objet campagne
en archive ZIP, le ZIP n’est pas vide cette fois, mais j’ai toujours cette erreur.
Du coup, je ne sais pas si c’est lié.
Voici ce que j’appelle un export général :
PS : Quand j’export en Excel et pas en archive ZIP, tout est bon et je n’ai pas d’erreur que ce soit un export général ou un export d’une ligne en particulier.
Voici le code de publication :
public byte[] expExcel(PrintTemplate pt){
pt.setFilename(pt.getFilename().replace("[evlCpnName]", getFieldValue("evlCpnName")));
String campainId =getRowId();
ObjectDB fin_info = getGrant().getTmpObject("EvlFinancialHistory");
fin_info.resetFilters();
fin_info.getField("evlFinValId.evlValCpnId").setFilter(campainId);
try{
ExcelPOITool xls = new ExcelPOITool(true);
ExcelPOITool.ExcelSheet sheet = xls.newSheet("Simple sheet");
List<ObjectField> fields = fin_info.getFields();
String[] rowFirst = new String[fields.size()];
for(int i = 0; i < fields.size(); i++){
rowFirst[i] = fields.get(i).getLabel();
}
sheet.addFullRow(0, rowFirst);
int line = 1;
for(String[] row : fin_info.search()){
sheet.addFullRow(line++, row);
}
xls.add(sheet);
return xls.generateToByteArray();
}
catch(Exception e){
AppLog.error(getClass(), "expExcel", "Excel generation error", e, getGrant());
return null;
}
}
Comment régler le problème selon vous ?
Technical information
Instance /health
[Platform]
Status=OK
Version=5.1.37
BuiltOn=2022-04-05 11:19
Git=release/0d9c19594e35d74bd1dead5960d3b31b37337814
Encoding=UTF-8
EndpointIP=10.201.117.1
EndpointURL=http://siparex-simplicite-dev-745fcf686c-ptkfp:8080
TimeZone=Europe/Paris
SystemDate=2022-04-07 10:29:04
Simplicité logs
2022-04-07 10:22:20,778|SIMPLICITE|ERROR||http://siparex-simplicite-dev-745fcf686c-ptkfp:8080||ECORED0001|system|com.simplicite.webapp.ObjectImportExport|exportARC||Error Unable to build zip
java.lang.NullPointerException: Cannot invoke "java.util.List.iterator()" because the return value of "com.simplicite.util.ObjectDB.getDocFields()" is null
at com.simplicite.webapp.ObjectImportExport.toARCdocs(ObjectImportExport.java:929)
at com.simplicite.webapp.ObjectImportExport.toARC(ObjectImportExport.java:900)
at com.simplicite.webapp.ObjectImportExport.toARC(ObjectImportExport.java:844)
at com.simplicite.webapp.ObjectImportExport.export(ObjectImportExport.java:548)
at com.simplicite.webapp.servlets.ui.ImportExportServlet.service(ImportExportServlet.java:109)
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 com.simplicite.webapp.filters.AuthMethodFilter.doFilter(AuthMethodFilter.java:174)
at com.simplicite.webapp.filters.AbstractFilter.doFilter(AbstractFilter.java:37)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)
at com.simplicite.webapp.filters.HTTPHeadersFilter.doFilter(HTTPHeadersFilter.java:39)
at com.simplicite.webapp.filters.AbstractFilter.doFilter(AbstractFilter.java:37)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)
at com.simplicite.webapp.filters.RewriteFilter.doFilter(RewriteFilter.java:86)
at com.simplicite.webapp.filters.AbstractFilter.doFilter(AbstractFilter.java:37)
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:183)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:97)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:541)
at com.simplicite.tomcat.valves.APISessionValve.invoke(APISessionValve.java:242)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:135)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92)
at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:687)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:78)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:360)
at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:399)
at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:65)
at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:890)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1743)
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.base/java.lang.Thread.run(Thread.java:833)