poi-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Thaddaeus Fillmore - US <tfillm...@caci.com>
Subject New POI problem
Date Fri, 15 Apr 2016 14:16:22 GMT
Gah, I'm back.  Ok, so now I'm trying to extract the text from a word document being uploaded
to the server.  (This is all in coldfusion).  I first write a temp copy of the file to the
disk.  I have verified the file writes successfully and can be opened in word.  Then, I try
to use POI to read the file, but now I'm getting an exception when I try to use ExtractorFactory
to createExtractor for the file.  All coldfusion is giving me in my catch is the exception
without any output.  I might have to just take it out of try block once and let it bomb out
to see more.  Anyway, the exception I'm getting is java.lang.reflect.InvocationTargetException.
 I really don't get it because I've been following this page as a guide https://www.raymondcamden.com/2009/02/05/Reading-Office-documents-with-ColdFusion-2/.

Here's a snippet of my code:

        <cfset message = "initializing javaloader">
        <cfset variables.loader = createObject("component", "xxx.library.javaloader.JavaLoader").init(paths)>
        <cfset message = "creating extractor factory">
        <cfset wordext = loader.create("org.apache.poi.extractor.ExtractorFactory")>
        <cfset message = "opening file">
        <cfset fileinput = createObject("java", "java.io.File")>
        <cfset fileinput.init("#cffile.serverDirectory#\#cffile.serverFile#")>
        <cfif fileinput.exists()>
            <cfset message = "creating extractor">
            <cfset extractor = wordext.createExtractor(fileinput)>   <-- bombs here
as the last message it outputs is "creating extractor"
            <cfset message = "extracting text">
            <cfset fileBinary = extractor.getText()>
            <cfset message = "closing file">
            <cfset fileinput.close()>


Thaddaeus Fillmore
CACI International Inc.
Systems Analyst

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message