cfsimplicity / spreadsheet-cfml

Standalone library for working with spreadsheets and CSV in CFML
MIT License
126 stars 35 forks source link

Regression version 3.10.0 in ACF 2023 #335

Closed sebviatour-iteamlu closed 11 months ago

sebviatour-iteamlu commented 11 months ago

Hello,

I update the spreadsheet-cfml to the version 3.10.0 and it seems to have a regression.

When I try to read a csv file, I got this message.

org.apache.commons.io.output.UnsynchronizedByteArrayOutputStream$Builder org.apache.commons.io.output.UnsynchronizedByteArrayOutputStream.builder()' The specific sequence of files included or processed is: C:\ColdFusion2023\cfusion\wwwroot\neo-dev\admin\print\import_plotter_post.cfm, line: 24 java.lang.NoSuchMethodError: 'org.apache.commons.io.output.UnsynchronizedByteArrayOutputStream$Builder org.apache.commons.io.output.UnsynchronizedByteArrayOutputStream.builder()' at org.apache.poi.util.IOUtils.peekFirstNBytes(IOUtils.java:144) at org.apache.poi.poifs.filesystem.FileMagic.valueOf(FileMagic.java:209) at org.apache.poi.ss.usermodel.WorkbookFactory.create(WorkbookFactory.java:222) at org.apache.poi.ss.usermodel.WorkbookFactory.create(WorkbookFactory.java:185) at jdk.internal.reflect.GeneratedMethodAccessor279.invoke(Unknown Source) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:568) at coldfusion.runtime.java.JavaProxy.invoke(JavaProxy.java:106) at coldfusion.runtime.CfJspPage._invoke(CfJspPage.java:4142) at coldfusion.runtime.CfJspPage._invoke(CfJspPage.java:4105) at cfworkbook2ecfc950457327$funcWORKBOOKFROMFILE.runFunction(C:\Website\modules\spreadsheet-cfml\helpers\workbook.cfc:24) at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:629) at coldfusion.runtime.UDFMethod$ReturnTypeFilter.invoke(UDFMethod.java:559) at coldfusion.runtime.UDFMethod$ArgumentCollectionFilter.invoke(UDFMethod.java:522) at coldfusion.filter.FunctionAccessFilter.invoke(FunctionAccessFilter.java:95) at coldfusion.runtime.UDFMethod.runFilterChain(UDFMethod.java:469) at coldfusion.runtime.UDFMethod.runFilterChain(UDFMethod.java:444) at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:316) at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:975) at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:696) at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:503) at coldfusion.runtime.CfJspPage._invoke(CfJspPage.java:4142) at coldfusion.runtime.CfJspPage._invoke(CfJspPage.java:4105) at cfSpreadsheet2ecfc553323889$funcREAD.runFunction(C:\Website\modules\spreadsheet-cfml\Spreadsheet.cfc:1135) at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:629) at coldfusion.runtime.UDFMethod$ReturnTypeFilter.invoke(UDFMethod.java:559) at coldfusion.runtime.UDFMethod$ArgumentCollectionFilter.invoke(UDFMethod.java:522) at coldfusion.filter.FunctionAccessFilter.invoke(FunctionAccessFilter.java:95) at coldfusion.runtime.UDFMethod.runFilterChain(UDFMethod.java:469) at coldfusion.runtime.UDFMethod.runFilterChain(UDFMethod.java:444) at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:687) at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:980) at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:762) at coldfusion.runtime.CfJspPage._invoke(CfJspPage.java:4053) at coldfusion.runtime.CfJspPage._invoke(CfJspPage.java:4017) at ...

When I try to generate an Excel file (that works with the version 3.9.0), I got this error.

Receiver class org.apache.poi.xssf.usermodel.XSSFColor does not define or inherit an implementation of the resolved method 'abstract byte[] getStoredRGB()' of abstract class org.apache.poi.ss.usermodel.ExtendedColor. The specific sequence of files included or processed is: C:\ColdFusion2023\cfusion\wwwroot\neo-dev\e-cone\impression\potentiels_fonciers\excel.cfm, line: 205 java.lang.AbstractMethodError: Receiver class org.apache.poi.xssf.usermodel.XSSFColor does not define or inherit an implementation of the resolved method 'abstract byte[] getStoredRGB()' of abstract class org.apache.poi.ss.usermodel.ExtendedColor. at org.apache.poi.ss.usermodel.ExtendedColor.getRGBOrARGB(ExtendedColor.java:100) at org.apache.poi.xssf.usermodel.XSSFColor.getRGB(XSSFColor.java:189) at org.apache.poi.xssf.usermodel.XSSFFont.setColor(XSSFFont.java:421) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:568) at coldfusion.runtime.StructBean.invoke(StructBean.java:509) at coldfusion.runtime.CfJspPage._invoke(CfJspPage.java:4253) at coldfusion.runtime.CfJspPage._invoke(CfJspPage.java:4105) at cfformat2ecfc1603989295$funcSETCELLSTYLEFROMFORMATSETTING.runFunction(C:\Website\modules\spreadsheet-cfml\helpers\format.cfc:205) at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:629) at coldfusion.runtime.UDFMethod$ReturnTypeFilter.invoke(UDFMethod.java:559) at coldfusion.runtime.UDFMethod$ArgumentCollectionFilter.invoke(UDFMethod.java:522) at coldfusion.filter.FunctionAccessFilter.invoke(FunctionAccessFilter.java:95) at coldfusion.runtime.UDFMethod.runFilterChain(UDFMethod.java:469) at coldfusion.runtime.UDFMethod.runFilterChain(UDFMethod.java:444) at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:316) at coldfusion.runtime.CfJspPage._invokeUDF(CfJspPage.java:4899) at coldfusion.runtime.CfJspPage._invokeUDF(CfJspPage.java:4879) at cfformat2ecfc1603989295$funcBUILDCELLSTYLE.runFunction(C:\Website\modules\spreadsheet-cfml\helpers\format.cfc:60) at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:629) at coldfusion.runtime.UDFMethod$ReturnTypeFilter.invoke(UDFMethod.java:559) at coldfusion.runtime.UDFMethod$ArgumentCollectionFilter.invoke(UDFMethod.java:522) at coldfusion.filter.FunctionAccessFilter.invoke(FunctionAccessFilter.java:95) at coldfusion.runtime.UDFMethod.runFilterChain(UDFMethod.java:469) at coldfusion.runtime.UDFMethod.runFilterChain(UDFMethod.java:444) at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:316) at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:975) at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:696) at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:503) at coldfusion.runtime.CfJspPage._invoke(CfJspPage.java:4142) at coldfusion.runtime.CfJspPage._invoke(CfJspPage.java:4105) at cfSpreadsheet2ecfc553323889$funcCREATECELLSTYLE.runFunction(C:\Website\modules\spreadsheet-cfml\Spreadsheet.cfc:473)

Thanks for your feedback.

Best Regards,

Sébastien VIATOUR

cfsimplicity commented 11 months ago

Hi Sébastien

That's strange. All of the tests are passing on ACF2023, and that includes reading from CSV files and generating spreadsheet files with formatting.

The stack traces suggest to me that your instance of ACF is not loading the correct jars. Try running:

spreadsheet.flushPoiLoader();

to see if that makes any difference. Restarting your ACF instance might also fix the issue?

cfsimplicity commented 11 months ago

To check where the jars are being loaded from, you can use this library method:

spreadsheet.dumpPathToClass( "org.apache.commons.io.output.ByteArrayOutputStream" );

You should see:

file:/C:/Website/modules/spreadsheet-cfml/lib/commons-io-2.13.0.jar!/org/apache/commons/io/output/ByteArrayOutputStream.class
sebviatour-iteamlu commented 11 months ago

Hi Julian,

Thanks for your support.

It works now.

Best Regards,

Sébastien