Excel has unreadable content Error When creating excel using SXSSF API

classic Classic list List threaded Threaded
10 messages Options
Reply | Threaded
Open this post in threaded view
|

Excel has unreadable content Error When creating excel using SXSSF API

rhyashu
This post was updated on .
I am getting "Excel has unreadable content Error" When creating excel using SXSSF API.
Below are the jars that i am using:
poi-3.9
poi-ooxml-3.9.jar
poi-ooxml-schemas-3.9.jar
xmlbeans-2.4.0.jar

Sample_Code.txt
Reply | Threaded
Open this post in threaded view
|

Re: Excel has unreadable content Error When creating excel using SXSSF API

Nick Burch-2
On Thu, 2 Feb 2017, rhyashu wrote:
> I am getting "Excel has unreadable content Error" When creating excel using
> SXSSF API.
> Below are the jars that i am using:
> poi-3.9
> poi-ooxml-3.9.jar
> poi-ooxml-schemas-3.9.jar
> xmlbeans-2.4.0.jar

Why are you using an old version of Apache POI? What happens when you
upgrade?

Nick

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Excel has unreadable content Error When creating excel using SXSSF API

rhyashu
I tried with POI 3.11 version but with that i am getting some other error. I researched and found that it has somthing to do with JRE 1.6. Our app is currently running on WAS 8.5 with JRE 1.6. Thats why it throw below error:
java.lang.NoSuchMethodError: javax/xml/stream/XMLEventFactory.newFactory()Ljavax/xml/stream/XMLEventFactory; at org.apache.poi.openxml4j.opc.internal.marshallers.PackagePropertiesMarshaller

And jar used are:
poi-11
poi-ooxml-11

I cant upgrade the JRE as of now. SO i tried using the older versions, Please let me know if there is any other workaround. Thanks.
Reply | Threaded
Open this post in threaded view
|

Re: Excel has unreadable content Error When creating excel using SXSSF API

Javen O'Neal-2
The latest version of POI is built and tested with OpenJDK and Oracle Java
1.6, so there shouldn't be a problem with your JVM.

Make sure you aren't mixing POI versions, which could be brought in as
dependencies for other libraries.
https://poi.apache.org/faq.html

Also make sure you have the right ooxml schemas and xmlbeans dependencies.
https://poi.apache.org/overview.html

On Feb 2, 2017 11:33, "rhyashu" <[hidden email]> wrote:

I tried with POI 3.11 version but with that i am getting some other error. I
researched and found that it has somthing to do with JRE 1.6. Our app is
currently running on WAS 8.5 with JRE 1.6. Thats why it throw below error:
java.lang.NoSuchMethodError:
javax/xml/stream/XMLEventFactory.newFactory()Ljavax/xml/stream/
XMLEventFactory;
at
org.apache.poi.openxml4j.opc.internal.marshallers.
PackagePropertiesMarshaller

And jar used are:
poi-11
poi-ooxml-11

I cant upgrade the JRE as of now. SO i tried using the older versions,
Please let me know if there is any other workaround. Thanks.



--
View this message in context: http://apache-poi.1045710.n5.
nabble.com/Excel-has-unreadable-content-Error-When-
creating-excel-using-SXSSF-API-tp5726456p5726458.html
Sent from the POI - User mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]
Reply | Threaded
Open this post in threaded view
|

Re: Excel has unreadable content Error When creating excel using SXSSF API

rhyashu
I was using poi-3.11, poi-ooxml-3.11 and xmlbeans-2.6 versions and i was able to run the reports fine in my local system but when i tried deploying that application in WAS8.5 with JRE 1.6 its started giving me that error.
Please let me know what all jar i should be including and if there is any version mismatch between what i have used.

Thanks a lot for your help.
Reply | Threaded
Open this post in threaded view
|

Re: Excel has unreadable content Error When creating excel using SXSSF API

Javen O'Neal-2
Does your project have any other dependencies?

What dependencies does WAS bring in?

On Feb 2, 2017 12:17, "rhyashu" <[hidden email]> wrote:

> I was using poi-3.11, poi-ooxml-3.11 and xmlbeans-2.6 versions and i was
> able
> to run the reports fine in my local system but when i tried deploying that
> application in WAS8.5 with JRE 1.6 its started giving me that error.
> Please let me know what all jar i should be including and if there is any
> version mismatch between what i have used.
>
> Thanks a lot for your help.
>
>
>
> --
> View this message in context: http://apache-poi.1045710.n5.
> nabble.com/Excel-has-unreadable-content-Error-When-
> creating-excel-using-SXSSF-API-tp5726456p5726462.html
> Sent from the POI - User mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>
Reply | Threaded
Open this post in threaded view
|

Re: Excel has unreadable content Error When creating excel using SXSSF API

rhyashu
Thanks, Yes there are other dependencies as well mentioned below:
dependencies {
        // spring dependencies
        compile("org.springframework.boot:spring-boot-configuration-processor")
        compile("org.springframework.boot:spring-boot-starter")
        compile("org.springframework.boot:spring-boot-starter-aop")
        compile("org.springframework.boot:spring-boot-starter-web") {
                exclude group: 'org.springframework.boot', module: 'spring-boot-starter-tomcat'
        }
        compile("org.springframework.boot:spring-boot-starter-jdbc")
        compile("org.springframework.boot:spring-boot-starter-security")
        compile("org.springframework.boot:spring-boot-starter-mail")
        compile("org.springframework.boot:spring-boot-starter-cache")
        compile("org.springframework.boot:spring-boot-starter-actuator")
        compile("org.springframework.boot:spring-boot-starter-thymeleaf")
        //compile("org.thymeleaf:thymeleaf-spring4:2.1.1.RELEASE")
        // Commons framework jars
        compile("commons-validator:commons-validator:1.5.1")
       
        // Spring Mobile Framework
        compile("org.springframework.boot:spring-boot-starter-mobile")
       
        // runtime dependencies
        runtime("org.springframework.boot:spring-boot-starter-thymeleaf")
        runtime("org.springframework.boot:spring-boot-starter-log4j2")
       
        // javax dependencies
        providedCompile("javax.servlet:javax.servlet-api")

        // apache commons dependencies
        compile("org.apache.commons:commons-lang3")
        compile("commons-beanutils:commons-beanutils")
        compile("commons-fileupload:commons-fileupload")
    compile("org.apache.httpcomponents:httpclient:4.2.3")
   
        // external dependencies
        compile("org.mybatis:mybatis:3.3.0")
        compile("org.mybatis:mybatis-spring:1.2.3")
        compile("org.apache.poi:poi")
        compile("org.apache.poi:poi-ooxml")
        compile("org.jolokia:jolokia-core")
        //compile("com.itextpdf:itextpdf:2.1.7")
       
       
        //local dependencies
        //compile("com.walgreens:accelerate:" + project.ext["accelerate.version"])
        //compile("oracle:ojdbc:" + project.ext["ojdbc.version"])
        compile files("src/build/lib/accelerate-" + project.ext["accelerate.version"] + ".jar")
        compile files("src/build/lib/ojdbc" + project.ext["ojdbc.version"] + ".jar")
        compile files("src/build/lib/iText-2.1.7.jar")
        compile files("src/build/lib/javacsv-2.0.jar")
        // itextpdf-5.5.8.jar

compile("com.itextpdf:itextpdf:5.5.8")
       
       
        // webjars
        runtime("org.webjars:normalize.css:3.0.2")
        runtime("org.webjars:modernizr:2.8.3")
        runtime("org.webjars:font-awesome:4.5.0")
        runtime("org.webjars:jquery:2.1.4")
        runtime("org.webjars:bootstrap:3.3.6")
        runtime("org.webjars:angularjs:1.4.8")
        runtime("org.webjars:datatables:1.10.11")
        runtime("org.webjars:datatables-tools:2.2.4-1")
        runtime("org.webjars:datatables-fixedheader:2.1.2-1")
        runtime("org.webjars.bower:datatables-fixedcolumns:3.0.4") {
                exclude module: 'jquery'
                exclude module: 'datatables'
        }
        runtime("org.webjars:bootstrap-tokenfield:0.12.1")
        runtime("org.webjars:jquery-ui:1.11.4")
        runtime("org.webjars.bower:moment:2.12.0")
        runtime("org.webjars.bower:jquery.maskedinput:1.4.1")
Reply | Threaded
Open this post in threaded view
|

Re: Excel has unreadable content Error When creating excel using SXSSF API

Javen O'Neal-2
Can you attach the log showing all of the subdependencies and versions that
are pulled in by your build script?

On Feb 2, 2017 12:56 PM, "rhyashu" <[hidden email]> wrote:

Thanks, Yes there are other dependencies as well mentioned below:
dependencies {
        // spring dependencies
        compile("org.springframework.boot:spring-boot-
configuration-processor")
        compile("org.springframework.boot:spring-boot-starter")
        compile("org.springframework.boot:spring-boot-starter-aop")
        compile("org.springframework.boot:spring-boot-starter-web") {
                exclude group: 'org.springframework.boot', module:
'spring-boot-starter-tomcat'
        }
        compile("org.springframework.boot:spring-boot-starter-jdbc")
        compile("org.springframework.boot:spring-boot-starter-security")
        compile("org.springframework.boot:spring-boot-starter-mail")
        compile("org.springframework.boot:spring-boot-starter-cache")
        compile("org.springframework.boot:spring-boot-starter-actuator")
        compile("org.springframework.boot:spring-boot-starter-thymeleaf")
        //compile("org.thymeleaf:thymeleaf-spring4:2.1.1.RELEASE")
        // Commons framework jars
        compile("commons-validator:commons-validator:1.5.1")

        // Spring Mobile Framework
        compile("org.springframework.boot:spring-boot-starter-mobile")

        // runtime dependencies
        runtime("org.springframework.boot:spring-boot-starter-thymeleaf")
        runtime("org.springframework.boot:spring-boot-starter-log4j2")

        // javax dependencies
        providedCompile("javax.servlet:javax.servlet-api")

        // apache commons dependencies
        compile("org.apache.commons:commons-lang3")
        compile("commons-beanutils:commons-beanutils")
        compile("commons-fileupload:commons-fileupload")
    compile("org.apache.httpcomponents:httpclient:4.2.3")

        // external dependencies
        compile("org.mybatis:mybatis:3.3.0")
        compile("org.mybatis:mybatis-spring:1.2.3")
        compile("org.apache.poi:poi")
        compile("org.apache.poi:poi-ooxml")
        compile("org.jolokia:jolokia-core")
        //compile("com.itextpdf:itextpdf:2.1.7")


        //local dependencies
        //compile("com.walgreens:accelerate:" + project.ext["accelerate.
version"])
        //compile("oracle:ojdbc:" + project.ext["ojdbc.version"])
        compile files("src/build/lib/accelerate-" +
project.ext["accelerate.version"] + ".jar")
        compile files("src/build/lib/ojdbc" + project.ext["ojdbc.version"] +
".jar")
        compile files("src/build/lib/iText-2.1.7.jar")
        compile files("src/build/lib/javacsv-2.0.jar")
        // itextpdf-5.5.8.jar

compile("com.itextpdf:itextpdf:5.5.8")


        // webjars
        runtime("org.webjars:normalize.css:3.0.2")
        runtime("org.webjars:modernizr:2.8.3")
        runtime("org.webjars:font-awesome:4.5.0")
        runtime("org.webjars:jquery:2.1.4")
        runtime("org.webjars:bootstrap:3.3.6")
        runtime("org.webjars:angularjs:1.4.8")
        runtime("org.webjars:datatables:1.10.11")
        runtime("org.webjars:datatables-tools:2.2.4-1")
        runtime("org.webjars:datatables-fixedheader:2.1.2-1")
        runtime("org.webjars.bower:datatables-fixedcolumns:3.0.4") {
                exclude module: 'jquery'
                exclude module: 'datatables'
        }
        runtime("org.webjars:bootstrap-tokenfield:0.12.1")
        runtime("org.webjars:jquery-ui:1.11.4")
        runtime("org.webjars.bower:moment:2.12.0")
        runtime("org.webjars.bower:jquery.maskedinput:1.4.1")



--
View this message in context: http://apache-poi.1045710.n5.
nabble.com/Excel-has-unreadable-content-Error-When-
creating-excel-using-SXSSF-API-tp5726456p5726464.html
Sent from the POI - User mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]
Reply | Threaded
Open this post in threaded view
|

Re: Excel has unreadable content Error When creating excel using SXSSF API

rhyashu
Hi These are all the dependencies that i shared earlier.If you want i can share the complete build.gradle file.
I am not getting anything in the logs during build.

Thanks for your help really appreciate it.
Reply | Threaded
Open this post in threaded view
|

Re: Excel has unreadable content Error When creating excel using SXSSF API

rhyashu
I did try to replicate the scenario on a temp WAS system with JRE 1.7 and i was able to run the poi-3.11 version to generate XLSX using streaming API but after excel file was generated i was getting the "unreadble content found" error, screen shot attached.
This is the same error that i was getting in JRE 1.6 with older POI jar like poi-3.9 etc.

Error1.jpg