what is the latest info for using cf_spreadsheet with .xlsx files?

680 views
Skip to first unread message

Andy Haer

unread,
Feb 10, 2012, 11:04:42 AM2/10/12
to Railo
I found this in the archives but wanted to know if there is any newer
information

http://groups.google.com/group/railo/browse_thread/thread/4fbb8075b8c738dc/d2c572ecb4453048?lnk=gst&q=cf-spreadsheet#d2c572ecb4453048

I'm using Andy's extension version 0.2 (Feb 23, 2009 release) on Railo
3.3.2.000 final. Boy I didn't realize the release date... Am I
even using the proper one? the provider path I used was
http://www.andyjarrett.co.uk/RailoExtensionProvider/ExtensionProvider.cfc
... I did NOT follow the instructions at http://code.google.com/p/cfpoi/wiki/InstallingCFPOI
as I assumed that the railo package took care of everything.

Finally, is this the proper place to even be discussing the
CF_SPREADSHEET extension? I looked for something more specific but
couldn't find anything...

Thanks again

Mark Drew

unread,
Feb 10, 2012, 11:09:26 AM2/10/12
to ra...@googlegroups.com
Not sure how to answer most of this, but I would say this is the best place as any for you to discuss this!
Regards

Mark Drew

Leigh

unread,
Feb 10, 2012, 12:04:22 PM2/10/12
to ra...@googlegroups.com
Hi again Andy,

> but wanted to know if there is any newer information

I did a little work on that extension with the "other" Andy ;) Unfortunately the official installer is a bit behind. There is a patch for that issue in github as well as a few other bleeding edge features.  I think Andy's been tied up with work. But hopefully there will be another release in the near future.

> as I assumed that the railo package took care of everything.

Yes, it does. If you have any questions or problems feel free to open an issue on github ie https://github.com/andyj/RailoExtensionProvider

-Leigh

Leigh

unread,
Feb 10, 2012, 12:27:44 PM2/10/12
to ra...@googlegroups.com
> Not sure how to answer most of this, but I would say this is the best place as any for you to discuss this!

Yep. Though do feel free to open issues/requests on github as well, so we can continue to improve the extension :)
 
-Leigh

Andy Haer

unread,
Feb 23, 2012, 10:05:25 PM2/23/12
to Railo

> I did a little work on that extension with the "other" Andy ;) Unfortunately the official installer is a bit behind. There is a patch for that issue in github as well as a few other bleeding edge features.

Leigh, can you point me to the patch. I tried to find it but I'm not
sure what I'm looking for and I'm a complete newbie on GitHub...

Leigh

unread,
Feb 24, 2012, 12:59:26 AM2/24/12
to ra...@googlegroups.com
Andy, these are the latest changes in v32
https://github.com/andyj/RailoExtensionProvider/commit/f5cee94f17676c9393c1c55b783fb630c300eec3

To simplify things, I zipped the installer files (and brief instructions). You can download it here:
https://github.com/downloads/andyj/RailoExtensionProvider/cfspreadsheetInstaller_v32.zip

If you have any questions or run into any problems, let me know.

-Leigh

Andy Haer

unread,
Feb 24, 2012, 8:53:49 AM2/24/12
to Railo

Leigh,

Thanks for the quick reply... I was able to use the zip to make my own
local provider, verify it and use it to replace my existing install to
v32 (v32 is version displayed in web administrator). Unfortunately
the problem I had still exists. That is any loading of .xlsx files
fails with the error:

Message: Could not initialize class
org.apache.poi.openxml4j.opc.internal.unmarshallers.PackagePropertiesUnmarshaller
Cause: java.lang.NoClassDefFoundError
stack trace:
The Error Occurred in /var/confnet/bsc07/WEB-INF/railo/components/org/
cfpoi/spreadsheet/Spreadsheet.cfc: line 168
168: <cfset Local.exportUtil.process() />
called from/var/confnet/bsc07/WEB-INF/railo/library/tag/
spreadsheet.cfc: line 131
called from/var/confnet/bsc07/$_Sys/railo_cfspreadsheet/cfspreadsheet/
Read_Into_HTML.cfm: line 6

as you can see I get the error running the demo so I know its not
something in my code ;)

additional info - I just ran the demo after a railo_ctl restart and
got a different error the first time I ran it:
java.lang.ExceptionInInitializerError don't know if that means
anything...

Everything works fine with regular .xls files...

Any ideas?

Leigh

unread,
Feb 24, 2012, 10:54:24 AM2/24/12
to ra...@googlegroups.com
> ..  just ran the demo after a railo_ctl restart
> java.lang.ExceptionInInitializerError  don't know if that means
> anything...
 
It might.  Can you post the rest of the stack trace message for that specific error?

-Leigh

Andy Haer

unread,
Feb 26, 2012, 8:03:02 AM2/26/12
to Railo
*** Complete stack trace - first run after railo_ctl restart

Railo 3.3.2.000 Error (java.lang.ExceptionInInitializerError)
Message java.lang.ExceptionInInitializerError
Cause java.lang.ExceptionInInitializerError
Stacktrace The Error Occurred in
/var/confnet/bsc07/WEB-INF/railo/components/org/cfpoi/spreadsheet/
Spreadsheet.cfc: line 168
called from/var/confnet/bsc07/WEB-INF/railo/library/tag/
spreadsheet.cfc: line 131
called from/var/confnet/bsc07/$_Sys/railo_cfspreadsheet/cfspreadsheet/
Read_Into_HTML.cfm: line 6

Java Stacktrace java.lang.ExceptionInInitializerError
at org.dom4j.DocumentFactory.getInstance(DocumentFactory.java:97):
97
at org.dom4j.tree.AbstractNode.<clinit>(AbstractNode.java:39):39
at
org.apache.poi.openxml4j.opc.internal.unmarshallers.PackagePropertiesUnmarshaller.<clinit>(PackagePropertiesUnmarshaller.java:
49):49
at org.apache.poi.openxml4j.opc.OPCPackage.init(OPCPackage.java:
149):149
at org.apache.poi.openxml4j.opc.OPCPackage.<init>(OPCPackage.java:
136):136
at org.apache.poi.openxml4j.opc.Package.<init>(Package.java:54):54
at org.apache.poi.openxml4j.opc.ZipPackage.<init>(ZipPackage.java:
98):98
at org.apache.poi.openxml4j.opc.OPCPackage.open(OPCPackage.java:
199):199
at org.cfsearching.poi.XLSXHandler.process(XLSXHandler.java:342):
342
at
org.cfsearching.poi.XLSXSimpleHTMLHandler.process(XLSXSimpleHTMLHandler.java:
47):47
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method):-2
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source):-1
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown
Source):-1
at java.lang.reflect.Method.invoke(Unknown Source):-1
at
railo.runtime.reflection.pairs.MethodInstance.invoke(MethodInstance.java:
37):37
at railo.runtime.reflection.Reflector.callMethod(Reflector.java:
626):626
at
railo.runtime.util.VariableUtilImpl.callFunctionWithoutNamedValues(VariableUtilImpl.java:
742):742
at railo.runtime.PageContextImpl.getFunction(PageContextImpl.java:
1443):1443
at org.cfpoi.spreadsheet.spreadsheet_cfc$cf._1(/var/confnet/bsc07/
WEB-INF/railo/components/org/cfpoi/spreadsheet/Spreadsheet.cfc:168):
168
at org.cfpoi.spreadsheet.spreadsheet_cfc$cf.udfCall(/var/confnet/
bsc07/WEB-INF/railo/components/org/cfpoi/spreadsheet/
Spreadsheet.cfc):-1
at railo.runtime.type.UDFImpl.implementation(UDFImpl.java:215):215
at railo.runtime.type.UDFImpl._call(UDFImpl.java:434):434
at railo.runtime.type.UDFImpl.callWithNamedValues(UDFImpl.java:377):
377
at railo.runtime.ComponentImpl._call(ComponentImpl.java:616):616
at railo.runtime.ComponentImpl._call(ComponentImpl.java:502):502
at
railo.runtime.ComponentImpl.callWithNamedValues(ComponentImpl.java:
1834):1834
at
railo.runtime.util.VariableUtilImpl.callFunctionWithNamedValues(VariableUtilImpl.java:
769):769
at
railo.runtime.PageContextImpl.getFunctionWithNamedValues(PageContextImpl.java:
1458):1458
at spreadsheet_cfc$cf.udfCall(/var/confnet/bsc07/WEB-INF/railo/
library/tag/spreadsheet.cfc:131):131
at railo.runtime.type.UDFImpl.implementation(UDFImpl.java:215):215
at railo.runtime.type.UDFImpl._call(UDFImpl.java:434):434
at railo.runtime.type.UDFImpl.callWithNamedValues(UDFImpl.java:377):
377
at railo.runtime.ComponentImpl._call(ComponentImpl.java:616):616
at railo.runtime.ComponentImpl._call(ComponentImpl.java:502):502
at
railo.runtime.ComponentImpl.callWithNamedValues(ComponentImpl.java:
1834):1834
at railo.runtime.tag.CFTag.cfcStartTag(CFTag.java:373):373
at railo.runtime.tag.CFTag.doStartTag(CFTag.java:166):166
at $_sys.railo_cfspreadsheet.cfspreadsheet.read_into_html_cfm
$cf.call(/var/confnet/bsc07/$_Sys/railo_cfspreadsheet/cfspreadsheet/
Read_Into_HTML.cfm:6):6
at railo.runtime.PageContextImpl.doInclude(PageContextImpl.java:
761):761
at
railo.runtime.listener.ClassicAppListener._onRequest(ClassicAppListener.java:
35):35
at
railo.runtime.listener.MixedAppListener.onRequest(MixedAppListener.java:
24):24
at railo.runtime.PageContextImpl.execute(PageContextImpl.java:1998):
1998
at railo.runtime.PageContextImpl.execute(PageContextImpl.java:1965):
1965
at
railo.runtime.engine.CFMLEngineImpl.serviceCFML(CFMLEngineImpl.java:
297):297
at railo.loader.servlet.CFMLServlet.service(CFMLServlet.java:32):32
at javax.servlet.http.HttpServlet.service(HttpServlet.java:722):722
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:
304):304
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:
210):210
at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:
224):224
at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:
169):169
at
org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:
472):472
at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:
168):168
at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:
100):100
at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:
118):118
at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:
405):405
at org.apache.coyote.ajp.AjpProcessor.process(AjpProcessor.java:
200):200
at org.apache.coyote.AbstractProtocol
$AbstractConnectionHandler.process(AbstractProtocol.java:515):515
at org.apache.tomcat.util.net.JIoEndpoint
$SocketProcessor.run(JIoEndpoint.java:302):302
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown
Source):-1
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown
Source):-1
at java.lang.Thread.run(Unknown Source):-1


****** Complete stack trace for all following

Railo 3.3.2.000 Error (java.lang.NoClassDefFoundError)
Message Could not initialize class
org.apache.poi.openxml4j.opc.internal.unmarshallers.PackagePropertiesUnmarshaller
Cause java.lang.NoClassDefFoundError
Stacktrace The Error Occurred in
/var/confnet/bsc07/WEB-INF/railo/components/org/cfpoi/spreadsheet/
Spreadsheet.cfc: line 168
called from/var/confnet/bsc07/WEB-INF/railo/library/tag/
spreadsheet.cfc: line 131
called from/var/confnet/bsc07/$_Sys/railo_cfspreadsheet/cfspreadsheet/
Read_Into_HTML.cfm: line 6

Java Stacktrace Could not initialize class
org.apache.poi.openxml4j.opc.internal.unmarshallers.PackagePropertiesUnmarshaller
at org.apache.poi.openxml4j.opc.OPCPackage.init(OPCPackage.java:
149):149
at org.apache.poi.openxml4j.opc.OPCPackage.<init>(OPCPackage.java:
136):136
at org.apache.poi.openxml4j.opc.Package.<init>(Package.java:54):54
at org.apache.poi.openxml4j.opc.ZipPackage.<init>(ZipPackage.java:
98):98
at org.apache.poi.openxml4j.opc.OPCPackage.open(OPCPackage.java:
199):199
at org.cfsearching.poi.XLSXHandler.process(XLSXHandler.java:342):
342
at
org.cfsearching.poi.XLSXSimpleHTMLHandler.process(XLSXSimpleHTMLHandler.java:
47):47
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method):-2
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source):-1
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown
Source):-1
at java.lang.reflect.Method.invoke(Unknown Source):-1
at
railo.runtime.reflection.pairs.MethodInstance.invoke(MethodInstance.java:
37):37
at railo.runtime.reflection.Reflector.callMethod(Reflector.java:
626):626
at
railo.runtime.util.VariableUtilImpl.callFunctionWithoutNamedValues(VariableUtilImpl.java:
742):742
at railo.runtime.PageContextImpl.getFunction(PageContextImpl.java:
1443):1443
at org.cfpoi.spreadsheet.spreadsheet_cfc$cf._1(/var/confnet/bsc07/
WEB-INF/railo/components/org/cfpoi/spreadsheet/Spreadsheet.cfc:168):
168
at org.cfpoi.spreadsheet.spreadsheet_cfc$cf.udfCall(/var/confnet/
bsc07/WEB-INF/railo/components/org/cfpoi/spreadsheet/
Spreadsheet.cfc):-1
at railo.runtime.type.UDFImpl.implementation(UDFImpl.java:215):215
at railo.runtime.type.UDFImpl._call(UDFImpl.java:434):434
at railo.runtime.type.UDFImpl.callWithNamedValues(UDFImpl.java:377):
377
at railo.runtime.ComponentImpl._call(ComponentImpl.java:616):616
at railo.runtime.ComponentImpl._call(ComponentImpl.java:502):502
at
railo.runtime.ComponentImpl.callWithNamedValues(ComponentImpl.java:
1834):1834
at
railo.runtime.util.VariableUtilImpl.callFunctionWithNamedValues(VariableUtilImpl.java:
769):769
at
railo.runtime.PageContextImpl.getFunctionWithNamedValues(PageContextImpl.java:
1458):1458
at spreadsheet_cfc$cf.udfCall(/var/confnet/bsc07/WEB-INF/railo/
library/tag/spreadsheet.cfc:131):131
at railo.runtime.type.UDFImpl.implementation(UDFImpl.java:215):215
at railo.runtime.type.UDFImpl._call(UDFImpl.java:434):434
at railo.runtime.type.UDFImpl.callWithNamedValues(UDFImpl.java:377):
377
at railo.runtime.ComponentImpl._call(ComponentImpl.java:616):616
at railo.runtime.ComponentImpl._call(ComponentImpl.java:502):502
at
railo.runtime.ComponentImpl.callWithNamedValues(ComponentImpl.java:
1834):1834
at railo.runtime.tag.CFTag.cfcStartTag(CFTag.java:373):373
at railo.runtime.tag.CFTag.doStartTag(CFTag.java:166):166
at $_sys.railo_cfspreadsheet.cfspreadsheet.read_into_html_cfm
$cf.call(/var/confnet/bsc07/$_Sys/railo_cfspreadsheet/cfspreadsheet/
Read_Into_HTML.cfm:6):6
at railo.runtime.PageContextImpl.doInclude(PageContextImpl.java:
761):761
at
railo.runtime.listener.ClassicAppListener._onRequest(ClassicAppListener.java:
35):35
at
railo.runtime.listener.MixedAppListener.onRequest(MixedAppListener.java:
24):24
at railo.runtime.PageContextImpl.execute(PageContextImpl.java:1998):
1998
at railo.runtime.PageContextImpl.execute(PageContextImpl.java:1965):
1965
at
railo.runtime.engine.CFMLEngineImpl.serviceCFML(CFMLEngineImpl.java:
297):297
at railo.loader.servlet.CFMLServlet.service(CFMLServlet.java:32):32
at javax.servlet.http.HttpServlet.service(HttpServlet.java:722):722
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:
304):304
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:
210):210
at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:
224):224
at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:
169):169
at
org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:
472):472
at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:
168):168
at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:
100):100
at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:
118):118
at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:
405):405
at org.apache.coyote.ajp.AjpProcessor.process(AjpProcessor.java:
200):200
at org.apache.coyote.AbstractProtocol
$AbstractConnectionHandler.process(AbstractProtocol.java:515):515
at org.apache.tomcat.util.net.JIoEndpoint
$SocketProcessor.run(JIoEndpoint.java:302):302
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown
Source):-1
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown
Source):-1
at java.lang.Thread.run(Unknown Source):-1

Leigh

unread,
Feb 26, 2012, 2:39:21 PM2/26/12
to ra...@googlegroups.com
>Java Stacktrace     java.lang.ExceptionInInitializerError
>  at org.dom4j.DocumentFactory.getInstance(DocumentFactory.java:97):

One of the libraries used by POI is dom4j which is notorious for class loader problems. I am running railo under windows and have not encountered that particular error with the tag. So I am wondering if the issue is specific to linux configurations.  I do remember one person mentioning they had to remove the dom4j jar to resolve issues. While they did not mention their o/s, given your error, I am guessing it was linux. Which version of linux and java are you running?

-Leigh

Andy Haer

unread,
Feb 26, 2012, 3:47:49 PM2/26/12
to ra...@googlegroups.com
OS Linux (2.6.18-238.el5xen) 64bit
Servlet Container Apache Tomcat/7.0.22
Java 1.6.0_29 (Sun Microsystems Inc.) 64bit

This is CentOS 5.6 under a rackspace VM...

I found saw the upgrading Java page on the railo wiki and led me to the java page where see that the latest version 6 JRE is rev 31...    Don't know if I can or should use the latest cd JRE 7

Also when you say they "had to remove the dom4j jar" are you saying that I should try that?   If so how do I do that?  

Thanks

Andy Haer

unread,
Feb 26, 2012, 4:03:36 PM2/26/12
to ra...@googlegroups.com
  I do remember one person mentioning they had to remove the dom4j jar to resolve issues.


I figured I'd give hiding the dom4j file a try and it does fix the crash :)
I simply renamed dom4j.jar to dom4j.j in  /opt/railo/lib then restarted railo \

Am I going to loose any functionality without dom4j.jar?


Leigh

unread,
Feb 26, 2012, 5:21:29 PM2/26/12
to ra...@googlegroups.com
> Am I going to loose any functionality without dom4j.jar?

I do not think so. I am not very familiar with linux, but based on similar problems under windows, what seems to be happening is there is already a version of dom4j being loaded first. Since dom4j does not play well across class loaders, when the spreadsheet tag tries to load another version of the jar it blows up. As long as there is some version of dom4j present (which there seems to be) it should work exactly as expected.
 
> I simply renamed dom4j.jar to dom4j.j in  /opt/railo/lib then restarted railo \

Would you mind submitting this in github? Just to document the problem, and resolution, in case anyone else encounters it.
https://github.com/andyj/RailoExtensionProvider/issues

-Leigh

Leigh

unread,
Feb 26, 2012, 5:38:36 PM2/26/12
to ra...@googlegroups.com
> /opt/railo/lib then restarted railo \

Oh wait .. is that in railo's core path? I think the other guy removed/renamed the jar that is installed by the tag instead.  I would be more inclined to try that rather than mess with core jars used by railo. I think you could do it by just commenting out this line:

 
-Leigh

Leigh

unread,
Feb 26, 2012, 5:41:55 PM2/26/12
to ra...@googlegroups.com
Andy - Oops, hit return too soon.

> I think you could do it by just commenting out the line
... that loads the dom4j jar in the main component:   {...}\components\org\cfpoi\spreadsheet\spreadsheet.cfc

     ie    arrayAppend(Local.paths, expandPath('{railo-web-directory}'&'/lib/dom4j-1.6.1.jar'));       
 
-Leigh

Andy Haer

unread,
Feb 26, 2012, 7:29:27 PM2/26/12
to ra...@googlegroups.com
Ok, I restored the name of the file in opt/railo/lib then commented out the line in Spreadsheet.cfc -- and xlsx files still work :)

So what is this dom4j routines and what, if any, functionality will I loose by not having it?

Andy

Leigh

unread,
Feb 26, 2012, 7:44:26 PM2/26/12
to ra...@googlegroups.com
You should not lose anything because the tag will just use railo's dom4j jar instead. The original problem was caused by having too many versions of the dom4j jar in the class path: one in /opt/railo/lib/ and one in the extension's folder. ;-) By commenting out that line now there is just one: ie /opt/railo/lib/{dom4j.jar}
 
-Leigh

Leigh

unread,
Feb 26, 2012, 8:12:55 PM2/26/12
to ra...@googlegroups.com
One more thing ...

> So what is this dom4j routines
 
POI uses dom4j (and a few other libraries) for parsing and manipulating xlsx files (composed of xml). If dom4j was not present, you would not be able to read/manipulate xlsx files - at all. The fact that you can proves the extension is using railo's dom4j jar instead. ;-)

-Leigh
Reply all
Reply to author
Forward
0 new messages