Spire.XLS is a professional Excel .NET library that can be used to any type of .NET( C#, VB.NET, ASP.NET, .NET Core) application and Java (J2SE and J2EE) application.

Wed Apr 28, 2021 9:35 am

Hallo ,
I using
Code: Select all
  <dependency>
            <groupId>e-iceblue</groupId>
            <artifactId>spire.xls.free</artifactId>
            <version>3.9.2</version>
        </dependency>

and my code block is this one :
Code: Select all
ExcelPicture userLogo = currWb.getActiveSheet().getPictures().add(1, 11,"./opt/wildfly/user-data/" + user.getId() + "/logo.png");
userLogo.setWidth(100);
userLogo.setHeight(100);

The server that i use is tomee plume 8
When i try to execute this code i got this error

java.lang.NoClassDefFoundError: javax/imageio/ImageTypeSpecifier
at com.github.jaiimageio.impl.plugins.bmp.BMPImageWriterSpi.canEncodeImage(BMPImageWriterSpi.java:110)
at java.desktop/javax.imageio.ImageIO$CanEncodeImageAndFormatFilter.filter(ImageIO.java:600)
at java.desktop/javax.imageio.spi.FilterIterator.advance(ServiceRegistry.java:876)
at java.desktop/javax.imageio.spi.FilterIterator.<init>(ServiceRegistry.java:870)
at java.desktop/javax.imageio.spi.ServiceRegistry.getServiceProviders(ServiceRegistry.java:518)
at java.desktop/javax.imageio.ImageIO.getImageWriters(ImageIO.java:1172)
at java.desktop/javax.imageio.ImageIO.getWriter(ImageIO.java:1609)
at java.desktop/javax.imageio.ImageIO.write(ImageIO.java:1594)
at com.spire.xls.packages.sprphC.spr (uu:1006)
at com.spire.xls.packages.sprphC.spr (uu:516)
at com.spire.xls.packages.sprJRb.spr (Unknown Source)
at com.spire.xls.packages.sprJRb.spr (Unknown Source)
at com.spire.xls.packages.sprJRb.spr (Unknown Source)
at com.spire.xls.packages.sprJRb.<init>(Unknown Source)
at com.spire.xls.packages.sprsSb.spr (Unknown Source)
at com.spire.xls.packages.sprPSb.spr (Unknown Source)
at com.spire.xls.packages.spruRb.spr (Unknown Source)
at com.spire.xls.packages.sprYpb.spr (Unknown Source)
at com.spire.xls.packages.sprVhA.spr (Unknown Source)
at com.spire.xls.packages.sprsPb.spr (Unknown Source)
at com.spire.xls.packages.sprVhA.spr (Unknown Source)
at com.spire.xls.packages.sprsPb.spr (Unknown Source)
at com.spire.xls.packages.sprVhA.spr (Unknown Source)
at com.spire.xls.packages.sprsPb.spr (Unknown Source)
at com.spire.xls.packages.sprVhA.spr (Unknown Source)
at com.spire.xls.packages.sprsPb.spr (Unknown Source)
at com.spire.xls.packages.sprVhA.spr (Unknown Source)
at com.spire.xls.packages.sprsPb.spr (Unknown Source)
at com.spire.xls.packages.sprVhA.spr (Unknown Source)
at com.spire.xls.packages.sprsPb.spr (Unknown Source)
at com.spire.xls.packages.sprVhA.spr (Unknown Source)
at com.spire.xls.packages.spraHA.spr (Unknown Source)
at com.spire.xls.packages.sprwiA.spr (Unknown Source)
at com.spire.xls.packages.spruRb.spr (Unknown Source)
at com.spire.xls.packages.sprtHA.spr (Unknown Source)
at com.spire.xls.packages.sprtHA.spr (Unknown Source)
at com.spire.xls.core.spreadsheet.XlsWorkbook.spr (Unknown Source)
at com.spire.xls.core.spreadsheet.XlsWorkbook.spr (Unknown Source)

stratos_saridakis_R
 
Posts: 2
Joined: Wed Apr 28, 2021 9:28 am

Wed Apr 28, 2021 10:28 am

Hello,

I did an initial test with the Free.Spire.Xls for Java V3.9.2 in the tomee plume 8 server, but did not reproduce your issue.

To help further look into your issue, please share us with your input testing Excel and picture, your jdk version (E.g. jdk1.8), your system information (E.g. Win7, 64 bit) and region setting (E.g. China, Chinese) for reference. Thanks in advance.

Sincerely,
Marcia
E-iceblue support team
User avatar

Marcia.Zhou
 
Posts: 427
Joined: Wed Nov 04, 2020 2:29 am

Wed Apr 28, 2021 11:41 am

Marcia.Zhou wrote:Hello,

I did an initial test with the Free.Spire.Xls for Java V3.9.2 in the tomee plume 8 server, but did not reproduce your issue.

To help further look into your issue, please share us with your input testing Excel and picture, your jdk version (E.g. jdk1.8), your system information (E.g. Win7, 64 bit) and region setting (E.g. China, Chinese) for reference. Thanks in advance.

Sincerely,
Marcia
E-iceblue support team

thnx for the reply
it's centos 8
and JDK 11.0.11

stratos_saridakis_R
 
Posts: 2
Joined: Wed Apr 28, 2021 9:28 am

Thu Apr 29, 2021 10:28 am

Hello,

Thanks for sharing more information!

I did more tests in tomee plume 8.0.5 server, centos 8 and JDK 11.0.11 with Free.Spire.Xls for Java V3.9.2, but still did not reproduce your issue.

Here I also attached my testing code and packaged war package. Please put the "exc2.xlsx" and "pink.png" in the bin directory of tomee and try to run again.
Code: Select all
          Workbook book = new Workbook();
          book.loadFromFile("exc2.xlsx");
          ExcelPicture userLogo = book.getActiveSheet().getPictures().add(1, 11,"pink.png");
          userLogo.setWidth(100);
          userLogo.setHeight(100);
          book.saveToFile("addPic.xlsx", FileFormat.Version2013);

If the issue still persists, please provide your packaged war package to us for reference. Thanks in advance.

Sincerely,
Marcia
E-iceblue support team
User avatar

Marcia.Zhou
 
Posts: 427
Joined: Wed Nov 04, 2020 2:29 am

Return to Spire.XLS