Some error when book reopen via streams

I have found one template, that i unable to reload via streams. We used some like this code for our purposes. There is part of real code, but it does not works. Can you please help me - what wrong with this template?



public void openWorkbook() throws Exception {
//Success
reload(new Workbook(“D://2.xlsx”));

//Failed
reload(new Workbook(“D://1.xlsx”));
}

private void reload(Workbook wb) throws Exception {
try (ByteArrayOutputStream byteOut = new ByteArrayOutputStream()) {
wb.save(byteOut, wb.getFileFormat());
byteOut.flush();

wb = new Workbook(new ByteArrayInputStream(byteOut.toByteArray()));

System.out.println(wb.getWorksheets().getCount());
}
}

I have received floowing output:
4

java.lang.NumberFormatException: For input string: “0,001”
at sun.misc.FloatingDecimal.readJavaFormatString(FloatingDecimal.java:1241)
at java.lang.Double.parseDouble(Double.java:540)
at com.aspose.cells.b.a.o.a(Unknown Source)
at com.aspose.cells.ajq.D(Unknown Source)
at com.aspose.cells.aci.f(Unknown Source)
at com.aspose.cells.aci.a(Unknown Source)
at com.aspose.cells.acg.h(Unknown Source)
at com.aspose.cells.acg.a(Unknown Source)
at com.aspose.cells.acf.a(Unknown Source)
at com.aspose.cells.Workbook.a(Unknown Source)
at com.aspose.cells.Workbook.(Unknown Source)
at com.asuproject.usoi.report.aspose.AsposeBookAdapterTest.reload(AsposeBookAdapterTest.java:70)
at com.asuproject.usoi.report.aspose.AsposeBookAdapterTest.openWorkbook(AsposeBookAdapterTest.java:62)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)
at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
at org.junit.runner.JUnitCore.run(JUnitCore.java:160)
at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:67)

Hi,

Thanks for your posting and using Aspose.Cells.

Please download and use the latest version: Aspose.Cells
for Java v8.0.2.3
it does not exhibit any problem. We have tested your file with the latest version and did not encounter any exception.

Hi Shakeel Faiz.


Error still appears.
I have found some additional conditions for error. Set up for test following locale settings: -Duser.language=ru -Duser.country=RU

Best regards. Alexey

Hi Alexey,

Thanks for your feedback and using Aspose.Cells.

We were able to replicate this issue after setting the local settings: -Duser.language=ru -Duser.country=RU

We have logged this issue in our database for investigation. We will look into it and fix this issue. Once, the issue is resolved or we have some other update for you, we will let you know asap.

This issue has been logged as CELLSJAVA-40840.

Hi Alexey,

Thanks for using Aspose.Cells for Java.

We have fixed this issue.

Please download and try this fix: Aspose.Cells for Java v8.1.0.1 and let us know your feedback.

The issues you have found earlier (filed as CELLSJAVA-40840) have been fixed in this update.


This message was posted using Notification2Forum from Downloads module by Aspose Notifier.