Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

readLargeFile() won't work with ACF #297

Open
cfsimplicity opened this issue Aug 9, 2022 · 3 comments
Open

readLargeFile() won't work with ACF #297

cfsimplicity opened this issue Aug 9, 2022 · 3 comments

Comments

@cfsimplicity
Copy link
Owner

cfsimplicity commented Aug 9, 2022

The excel-streaming-reader library doesn't seem to work with Adobe ColdFusion. Calling the builder.open() method results in:

The open method was not found.

Either there are no methods with the specified method name and argument types or the open method is overloaded with argument types that ColdFusion cannot decipher reliably. ColdFusion found 0 methods that match the provided arguments. If this is a Java object and you verified that the method exists, use the javacast function to reduce ambiguity.

I can call and dump the builder class and the open() methods are listed. I've tried using both java.io.File and java.io.InputStream Using javacast as the error suggests doesn't work.

screenshot

Other methods on the builder work, e.g. bufferSize( int ) and getBufferSize().

I wondered if it was a JavaLoader problem, but the same happens using javasettings and CreateObject().

@cfsimplicity
Copy link
Owner Author

Top of the stack trace from ACF:

coldfusion.runtime.java.MethodSelectionException: The open method was not found.
at coldfusion.runtime.java.ObjectHandler.findMethodUsingCFMLRules(ObjectHandler.java:383)
at coldfusion.runtime.StructBean.invoke(StructBean.java:524)
at coldfusion.runtime.CfJspPage._invoke(CfJspPage.java:3316)
at coldfusion.runtime.CfJspPage._invoke(CfJspPage.java:3224)

@cfsimplicity
Copy link
Owner Author

Doesn't work with Lucee either when loading via javasettings, i.e. direct from the class path. But does work in Lucee via JavaLoader or using the osgi bundle.

Here's the Lucee direct class path error trace:

Error (java.lang.NullPointerException)

lucee.runtime.exp.NativeException: No Bundle provided
at java.base/java.util.Objects.requireNonNull(Objects.java:246)
at org.apache.logging.log4j.core.osgi.BundleContextSelector.locateContext(BundleContextSelector.java:137)
at org.apache.logging.log4j.core.osgi.BundleContextSelector.getContext(BundleContextSelector.java:124)
at org.apache.logging.log4j.core.selector.ClassLoaderContextSelector.getContext(ClassLoaderContextSelector.java:117)
at org.apache.logging.log4j.core.impl.Log4jContextFactory.getContext(Log4jContextFactory.java:150)
at org.apache.logging.log4j.core.impl.Log4jContextFactory.getContext(Log4jContextFactory.java:47)
at org.apache.logging.log4j.LogManager.getContext(LogManager.java:196)
at org.apache.logging.log4j.LogManager.getLogger(LogManager.java:599)
at org.apache.poi.openxml4j.opc.OPCPackage.(OPCPackage.java:73)
at com.github.pjfanning.xlsx.impl.StreamingWorkbookReader.init(StreamingWorkbookReader.java:119)
at com.github.pjfanning.xlsx.impl.StreamingWorkbookReader.init(StreamingWorkbookReader.java:97)
at com.github.pjfanning.xlsx.StreamingReader$Builder.open(StreamingReader.java:532)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at lucee.runtime.reflection.pairs.MethodInstance.invoke(MethodInstance.java:56)
at lucee.runtime.reflection.Reflector.callMethod(Reflector.java:877)
at lucee.runtime.util.VariableUtilImpl.callFunctionWithoutNamedValues(VariableUtilImpl.java:831)
at lucee.runtime.PageContextImpl.getFunction(PageContextImpl.java:1762)

@cfsimplicity
Copy link
Owner Author

The Lucee trace suggests a problem with logging. ESR uses SLF4J whereas POI uses log4J. Have tried using the bridging jar but with no success. It does change the error trace in Lucee though (but not ACF):

Error (java.lang.NoClassDefFoundError)

lucee.runtime.exp.NativeException: Could not initialize class org.apache.poi.openxml4j.opc.OPCPackage
at com.github.pjfanning.xlsx.impl.StreamingWorkbookReader.init(StreamingWorkbookReader.java:119)
at com.github.pjfanning.xlsx.impl.StreamingWorkbookReader.init(StreamingWorkbookReader.java:97)
at com.github.pjfanning.xlsx.StreamingReader$Builder.open(StreamingReader.java:532)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at lucee.runtime.reflection.pairs.MethodInstance.invoke(MethodInstance.java:56)
at lucee.runtime.reflection.Reflector.callMethod(Reflector.java:877)
at lucee.runtime.util.VariableUtilImpl.callFunctionWithoutNamedValues(VariableUtilImpl.java:831)
at lucee.runtime.PageContextImpl.getFunction(PageContextImpl.java:1762)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant