quarkiverse / quarkus-poi

Apache POI is an API to access Microsoft Office files. This extension provides integration with Apache POI
https://poi.apache.org/
Apache License 2.0
12 stars 3 forks source link

Issue when upgrading from 2.0.6 to 2.1.0 or 2.1.1 #131

Closed gian1200 closed 3 weeks ago

gian1200 commented 3 weeks ago

Even though another component fails, posting here because the only change was updating this package.

When updating from Quarkus-poi 2.0.6 to 2.1.0 or 2.1.1, the following error appears.

Error

2024-10-29 21:13:22,896 WARN  {} [io.agr.pool] (agroal-11) Datasource '<default>': Something unusual has occurred to cause the driver to fail. Please report this exception.
2024-10-29 21:13:22,897 WARN  {} [org.hib.eng.jdb.spi.SqlExceptionHelper] (JPA Startup Thread) SQL Error: 0, SQLState: 99999
2024-10-29 21:13:22,897 ERROR {} [org.hib.eng.jdb.spi.SqlExceptionHelper] (JPA Startup Thread) Something unusual has occurred to cause the driver to fail. Please report this exception.
2024-10-29 21:13:22,897 WARN  {} [org.hib.eng.jdb.env.int.JdbcEnvironmentInitiator] (JPA Startup Thread) HHH000342: Could not obtain connection to query metadata: org.hibernate.exception.GenericJDBCException: unable to obtain isolated JDBC connection [Something unusual has occurred to cause the driver to fail. Please report this exception.] [n/a]
 at org.hibernate.exception.internal.StandardSQLExceptionConverter.convert(StandardSQLExceptionConverter.java:63)
 at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:108)
 at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:94)
 at org.hibernate.resource.transaction.backend.jta.internal.JtaIsolationDelegate.doTheWork(JtaIsolationDelegate.java:202)
 at org.hibernate.resource.transaction.backend.jta.internal.JtaIsolationDelegate.lambda$delegateWork$3(JtaIsolationDelegate.java:91)
 at org.hibernate.resource.transaction.backend.jta.internal.JtaIsolationDelegate.doInSuspendedTransaction(JtaIsolationDelegate.java:123)
 at org.hibernate.resource.transaction.backend.jta.internal.JtaIsolationDelegate.delegateWork(JtaIsolationDelegate.java:88)
 at org.hibernate.engine.jdbc.env.internal.JdbcEnvironmentInitiator.getJdbcEnvironmentUsingJdbcMetadata(JdbcEnvironmentInitiator.java:321)
 at org.hibernate.engine.jdbc.env.internal.JdbcEnvironmentInitiator.initiateService(JdbcEnvironmentInitiator.java:130)
 at org.hibernate.engine.jdbc.env.internal.JdbcEnvironmentInitiator.initiateService(JdbcEnvironmentInitiator.java:82)
 at org.hibernate.boot.registry.internal.StandardServiceRegistryImpl.initiateService(StandardServiceRegistryImpl.java:130)
 at org.hibernate.service.internal.AbstractServiceRegistryImpl.createService(AbstractServiceRegistryImpl.java:263)
 at org.hibernate.service.internal.AbstractServiceRegistryImpl.initializeService(AbstractServiceRegistryImpl.java:238)
 at org.hibernate.service.internal.AbstractServiceRegistryImpl.getService(AbstractServiceRegistryImpl.java:215)
 at org.hibernate.service.ServiceRegistry.requireService(ServiceRegistry.java:68)
 at org.hibernate.engine.jdbc.internal.JdbcServicesImpl.configure(JdbcServicesImpl.java:52)
 at org.hibernate.boot.registry.internal.StandardServiceRegistryImpl.configureService(StandardServiceRegistryImpl.java:136)
 at org.hibernate.service.internal.AbstractServiceRegistryImpl.initializeService(AbstractServiceRegistryImpl.java:247)
 at org.hibernate.service.internal.AbstractServiceRegistryImpl.getService(AbstractServiceRegistryImpl.java:215)
 at org.hibernate.service.ServiceRegistry.requireService(ServiceRegistry.java:68)
 at org.hibernate.boot.internal.SessionFactoryOptionsBuilder.<init>(SessionFactoryOptionsBuilder.java:290)
 at io.quarkus.hibernate.orm.runtime.recording.PrevalidatedQuarkusMetadata.buildSessionFactoryOptionsBuilder(PrevalidatedQuarkusMetadata.java:72)
 at io.quarkus.hibernate.orm.runtime.boot.FastBootEntityManagerFactoryBuilder.build(FastBootEntityManagerFactoryBuilder.java:84)
 at io.quarkus.hibernate.orm.runtime.FastBootHibernatePersistenceProvider.createEntityManagerFactory(FastBootHibernatePersistenceProvider.java:73)
 at jakarta.persistence.Persistence.createEntityManagerFactory(Persistence.java:80)
 at jakarta.persistence.Persistence.createEntityManagerFactory(Persistence.java:55)
 at io.quarkus.hibernate.orm.runtime.JPAConfig$LazyPersistenceUnit.get(JPAConfig.java:154)
 at io.quarkus.hibernate.orm.runtime.JPAConfig$1.run(JPAConfig.java:61)
 at java.base@21.0.2/java.lang.Thread.runWith(Thread.java:1596)
 at java.base@21.0.2/java.lang.Thread.run(Thread.java:1583)
 at org.graalvm.nativeimage.builder/com.oracle.svm.core.thread.PlatformThreads.threadStartRoutine(PlatformThreads.java:833)
 at org.graalvm.nativeimage.builder/com.oracle.svm.core.posix.thread.PosixPlatformThreads.pthreadStartRoutine(PosixPlatformThreads.java:211)
Caused by: org.postgresql.util.PSQLException: Something unusual has occurred to cause the driver to fail. Please report this exception.
 at org.postgresql.Driver.connect(Driver.java:321)
 at io.agroal.pool.ConnectionFactory.createConnection(ConnectionFactory.java:225)
 at io.agroal.pool.ConnectionPool$CreateConnectionTask.call(ConnectionPool.java:580)
 at io.agroal.pool.ConnectionPool$CreateConnectionTask.call(ConnectionPool.java:561)
 at java.base@21.0.2/java.util.concurrent.FutureTask.run(FutureTask.java:317)
 at io.agroal.pool.util.PriorityScheduledExecutor.beforeExecute(PriorityScheduledExecutor.java:75)
 at java.base@21.0.2/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
 at java.base@21.0.2/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)
 ... 4 more
Caused by: java.lang.ArrayStoreException
 at org.graalvm.nativeimage.builder/com.oracle.svm.core.graal.jdk.SubstrateArraycopySnippets.doArraycopy(SubstrateArraycopySnippets.java:117)
 at java.base@21.0.2/java.io.ByteArrayInputStream.read(ByteArrayInputStream.java:189)
 at java.base@21.0.2/java.util.zip.CheckedInputStream.read(CheckedInputStream.java:82)
 at java.base@21.0.2/java.util.zip.GZIPInputStream.skipBytes(GZIPInputStream.java:297)
 at java.base@21.0.2/java.util.zip.GZIPInputStream.readHeader(GZIPInputStream.java:185)
 at java.base@21.0.2/java.util.zip.GZIPInputStream.<init>(GZIPInputStream.java:79)
 at java.base@21.0.2/java.util.zip.GZIPInputStream.<init>(GZIPInputStream.java:91)
 at org.graalvm.nativeimage.builder/com.oracle.svm.core.jdk.localization.compression.GzipBundleCompression.decompressBundle(GzipBundleCompression.java:98)
 at org.graalvm.nativeimage.builder/com.oracle.svm.core.jdk.localization.bundles.CompressedBundle.getContent(CompressedBundle.java:43)
 at org.graalvm.nativeimage.builder/com.oracle.svm.core.jdk.localization.BundleContentSubstitutedLocalizationSupport.getBundleContentOf(BundleContentSubstitutedLocalizationSupport.java:125)
 at java.base@21.0.2/java.util.ListResourceBundle.loadLookup(ListResourceBundle.java:47)
 at java.base@21.0.2/java.util.ListResourceBundle.handleKeySet(ListResourceBundle.java:166)
 at java.base@21.0.2/java.util.ResourceBundle.containsKey(ResourceBundle.java:2308)
 at java.base@21.0.2/sun.util.locale.provider.LocaleResources.getNumberStrings(LocaleResources.java:247)
 at java.base@21.0.2/sun.util.locale.provider.LocaleResources.getNumberPatterns(LocaleResources.java:532)
 at java.base@21.0.2/sun.util.locale.provider.NumberFormatProviderImpl.getInstance(NumberFormatProviderImpl.java:184)
 at java.base@21.0.2/sun.util.locale.provider.NumberFormatProviderImpl.getIntegerInstance(NumberFormatProviderImpl.java:133)
 at java.base@21.0.2/java.text.NumberFormat.getInstance(NumberFormat.java:982)
 at java.base@21.0.2/java.text.NumberFormat.getInstance(NumberFormat.java:965)
 at java.base@21.0.2/java.text.NumberFormat.getIntegerInstance(NumberFormat.java:540)
 at org.postgresql.core.ServerVersion.parseServerVersionStr(ServerVersion.java:119)
 at org.postgresql.core.ServerVersion.from(ServerVersion.java:70)
 at org.postgresql.core.v3.ConnectionFactoryImpl.getParametersForStartup(ConnectionFactoryImpl.java:391)
 at org.postgresql.core.v3.ConnectionFactoryImpl.tryConnect(ConnectionFactoryImpl.java:209)
 at org.postgresql.core.v3.ConnectionFactoryImpl.openConnectionImpl(ConnectionFactoryImpl.java:268)
 at org.postgresql.core.ConnectionFactory.openConnection(ConnectionFactory.java:54)
 at org.postgresql.jdbc.PgConnection.<init>(PgConnection.java:273)
 at org.postgresql.Driver.makeConnection(Driver.java:446)
 at org.postgresql.Driver.connect(Driver.java:298)
 ... 11 more
2024-10-29 21:13:22,906 WARN  {} [io.qua.hib.orm.run.ser.QuarkusRuntimeInitDialectFactory] (JPA Startup Thread) Persistence unit <default>: Could not retrieve the database version to check it is at least 12.0.0
2024-10-29 21:13:22,907 INFO  {} [io.quarkus] (main) XXXXXXXXXXXXX 1.0.0-SNAPSHOT native (powered by Quarkus 3.15.1) started in 1.158s. Listening on: http://0.0.0.0:8080
2024-10-29 21:13:22,907 INFO  {} [io.quarkus] (main) Profile prod activated. 
2024-10-29 21:13:22,907 INFO  {} [io.quarkus] (main) Installed features: [agroal, awt, cdi, hibernate-orm, hibernate-orm-panache, jdbc-postgresql, kubernetes, micrometer, narayana-jta, opentelemetry, poi, rest, rest-client, rest-client-jackson, rest-jackson, smallrye-context-propagation, smallrye-health, smallrye-openapi, vertx]
2024-10-29 21:13:30,472 WARN  {} [io.agr.pool] (agroal-11) Datasource '<default>': Something unusual has occurred to cause the driver to fail. Please report this exception.
2024-10-29 21:13:30,472 INFO  {sampled=false, spanId=a131c31b37cda3ad, traceId=e1e1bd38431911edf2fa9b21cff36402} [io.sma.health] (vert.x-eventloop-thread-0) SRHCK01001: Reporting health down status: {"status":"DOWN","checks":[{"name":"Database connections health check","status":"DOWN","data":{"<default>":"Unable to execute the validation check for the default DataSource: Something unusual has occurred to cause the driver to fail. Please report this exception."}}]}

Pom.xml fragment:

<?xml version="1.0"?>
<project
    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"
    xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <modelVersion>4.0.0</modelVersion>
    ... 
    <properties>
        <compiler-plugin.version>3.13.0</compiler-plugin.version>
        <maven.compiler.release>21</maven.compiler.release>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
        <quarkus.platform.artifact-id>quarkus-bom</quarkus.platform.artifact-id>
        <quarkus.platform.group-id>io.quarkus.platform</quarkus.platform.group-id>
        <quarkus.platform.version>3.15.1</quarkus.platform.version>
        <skipITs>true</skipITs>
        <sonar.coverage.jacoco.xmlReportPaths>./target/jacoco-report/jacoco.xml</sonar.coverage.jacoco.xmlReportPaths>
        <sonar.dependencyCheck.jsonReportPath>./target/dependency-check-report.json</sonar.dependencyCheck.jsonReportPath>
        <sonar.dependencyCheck.htmlReportPath>./target/dependency-check-report.html</sonar.dependencyCheck.htmlReportPath>
        <owasp-dependency-check-plugin.version>10.0.4</owasp-dependency-check-plugin.version>
        <surefire-plugin.version>3.5.0</surefire-plugin.version>
    </properties>
    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>${quarkus.platform.group-id}</groupId>
                <artifactId>${quarkus.platform.artifact-id}</artifactId>
                <version>${quarkus.platform.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
        </dependencies>
    </dependencyManagement>
    <dependencies>
        <dependency>
            <groupId>io.quarkus</groupId>
            <artifactId>quarkus-arc</artifactId>
        </dependency>
        <dependency>
            <groupId>io.quarkus</groupId>
            <artifactId>quarkus-kubernetes</artifactId>
        </dependency>
        <!-- HEALTH -->
        <dependency>
            <groupId>io.quarkus</groupId>
            <artifactId>quarkus-smallrye-health</artifactId>
        </dependency>
        <!-- TELEMETRY -->
        <dependency>
            <groupId>io.quarkus</groupId>
            <artifactId>quarkus-micrometer-registry-prometheus</artifactId>
        </dependency>
        <dependency>
            <groupId>io.quarkus</groupId>
            <artifactId>quarkus-opentelemetry</artifactId>
        </dependency>
        <!-- PERSISTENCE -->
        <dependency>
            <groupId>io.quarkus</groupId>
            <artifactId>quarkus-hibernate-orm-panache</artifactId>
        </dependency>
        <dependency>
            <groupId>io.quarkus</groupId>
            <artifactId>quarkus-jdbc-postgresql</artifactId>
        </dependency>
        <!-- REST & JSON -->
        <dependency>
            <groupId>io.quarkus</groupId>
            <artifactId>quarkus-rest</artifactId>
        </dependency>
        <dependency>
            <groupId>io.quarkus</groupId>
            <artifactId>quarkus-rest-jackson</artifactId>
        </dependency>
        <dependency>
            <groupId>io.quarkus</groupId>
            <artifactId>quarkus-rest-client</artifactId>
        </dependency>
        <dependency>
            <groupId>io.quarkus</groupId>
            <artifactId>quarkus-rest-client-jackson</artifactId>
        </dependency>
        <dependency>
            <groupId>io.quarkus</groupId>
            <artifactId>quarkus-smallrye-openapi</artifactId>
        </dependency>
        <!-- TEST -->
        <dependency>
            <groupId>io.quarkus</groupId>
            <artifactId>quarkus-junit5</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>io.quarkus</groupId>
            <artifactId>quarkus-junit5-mockito</artifactId>
            <scope>test</scope>
        <!-- WORKAROUND: https://github.com/quarkusio/quarkus/wiki/Migration-Guide-3.0#fixation-of-the-mockito-subclass-mockmaker -->
            <exclusions>
                <exclusion>
                    <groupId>org.mockito</groupId>
                    <artifactId>mockito-subclass</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <!-- WORKAROUND: https://github.com/quarkusio/quarkus/wiki/Migration-Guide-3.0#fixation-of-the-mockito-subclass-mockmaker -->
        <dependency>
            <groupId>org.mockito</groupId>
            <artifactId>mockito-core</artifactId>
            <version>5.13.0</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>io.quarkus</groupId>
            <artifactId>quarkus-jacoco</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>io.rest-assured</groupId>
            <artifactId>rest-assured</artifactId>
            <scope>test</scope>
        </dependency>

        <!-- Generación de XLS -->
        <!-- https://mvnrepository.com/artifact/org.apache.poi/poi-ooxml -->
        <dependency>
            <groupId>org.apache.poi</groupId>
            <artifactId>poi-ooxml</artifactId>
            <version>5.3.0</version>
        </dependency>
        <!-- https://mvnrepository.com/artifact/org.apache.poi/poi-ooxml-lite -->
        <dependency>
            <groupId>org.apache.poi</groupId>
            <artifactId>poi-ooxml-lite</artifactId>
            <version>5.3.0</version>
        </dependency>
        <!-- https://mvnrepository.com/artifact/org.apache.logging.log4j/log4j-to-slf4j -->
        <dependency>
            <groupId>org.apache.logging.log4j</groupId>
            <artifactId>log4j-to-slf4j</artifactId>
            <version>2.24.0</version>
        </dependency>
        <dependency>
            <groupId>io.quarkiverse.poi</groupId>
            <artifactId>quarkus-poi</artifactId>
            <version>2.1.1</version> <-- ONLY CHANGE
        </dependency>

        <!-- https://github.com/IBM/keyprotect-java-client -->
        <dependency>
            <groupId>com.ibm.cloud</groupId>
            <artifactId>ibm-key-protect-sdk</artifactId>
            <version>1.0.0</version>
            <exclusions>
                <exclusion>
                    <groupId>org.slf4j</groupId>
                    <artifactId>slf4j-simple</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <!-- https://github.com/IBM/java-sdk-core -->
        <dependency>
            <groupId>com.ibm.cloud</groupId>
            <artifactId>sdk-core</artifactId>
            <version>9.21.2</version>
        </dependency>
        <!-- https://square.github.io/okhttp/ -->
        <dependency>
            <groupId>com.squareup.okhttp3</groupId>
            <artifactId>okhttp</artifactId>
            <version>4.12.0</version>
        </dependency>
        <!-- https://projectlombok.org -->
        <dependency>
            <groupId>org.projectlombok</groupId>
            <artifactId>lombok</artifactId>
            <version>1.18.34</version>
        </dependency>
    </dependencies>
    <build>
        <plugins>
            <plugin>
                <groupId>${quarkus.platform.group-id}</groupId>
                <artifactId>quarkus-maven-plugin</artifactId>
                <version>${quarkus.platform.version}</version>
                <extensions>true</extensions>
                <executions>
                    <execution>
                        <goals>
                            <goal>build</goal>
                            <goal>generate-code</goal>
                            <goal>generate-code-tests</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>${compiler-plugin.version}</version>
                <configuration>
                    <compilerArgs>
                        <arg>-parameters</arg>
                    </compilerArgs>
                </configuration>
            </plugin>
            <plugin>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>${surefire-plugin.version}</version>
                <configuration>
                    <systemPropertyVariables>
                        <java.util.logging.manager>org.jboss.logmanager.LogManager</java.util.logging.manager>
                        <maven.home>${maven.home}</maven.home>
                    </systemPropertyVariables>
                </configuration>
            </plugin>
            <plugin>
                <artifactId>maven-failsafe-plugin</artifactId>
                <version>${surefire-plugin.version}</version>
                <executions>
                    <execution>
                        <goals>
                            <goal>integration-test</goal>
                            <goal>verify</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <systemPropertyVariables>
                        <native.image.path>${project.build.directory}/${project.build.finalName}-runner</native.image.path>
                        <java.util.logging.manager>org.jboss.logmanager.LogManager</java.util.logging.manager>
                        <maven.home>${maven.home}</maven.home>
                    </systemPropertyVariables>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.owasp</groupId>
                <artifactId>dependency-check-maven</artifactId>
                <version>${owasp-dependency-check-plugin.version}</version>
                <executions>
                    <execution>
                        <goals>
                            <goal>check</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <formats>
                        <format>HTML</format>
                        <format>JSON</format>
                    </formats>
                    <suppressionFiles>
                        <suppressionFile>${project.basedir}/dependency-cpe-suppression.xml</suppressionFile>
                    </suppressionFiles>
                </configuration>
            </plugin>
        </plugins>
    </build>
    <profiles>
        <profile>
            <id>native</id>
            <activation>
                <property>
                    <name>native</name>
                </property>
            </activation>
            <properties>
                <skipITs>false</skipITs>
                <quarkus.native.enabled>true</quarkus.native.enabled>
                <quarkus.package.jar.enabled>false</quarkus.package.jar.enabled>
            </properties>
        </profile>
    </profiles>
</project>

Additional info

I checked the changelogs and the only thing that might be the cause is https://github.com/quarkiverse/quarkus-poi/pull/110. However, I'm not sure.

gastaldi commented 3 weeks ago

Is there any reason why you are building with ghcr.io/graalvm/graalvm-community:21-ol7 specifically instead of Mandrel (you need Mandrel 23.1.5.0 - see the compatibility matrix for the exact version)?

gastaldi commented 3 weeks ago

Also, you can remove the following dependencies as they are resolved transitively:

        <!-- https://mvnrepository.com/artifact/org.apache.poi/poi-ooxml -->
        <dependency>
            <groupId>org.apache.poi</groupId>
            <artifactId>poi-ooxml</artifactId>
            <version>5.3.0</version>
        </dependency>
        <!-- https://mvnrepository.com/artifact/org.apache.poi/poi-ooxml-lite -->
        <dependency>
            <groupId>org.apache.poi</groupId>
            <artifactId>poi-ooxml-lite</artifactId>
            <version>5.3.0</version>
        </dependency>
gian1200 commented 3 weeks ago

Is there any reason why you are building with ghcr.io/graalvm/graalvm-community:21-ol7 specifically instead of Mandrel (you need Mandrel 23.1.5.0 - see the compatibility matrix for the exact version)?

Good question. Last time I check I wasn't able to use Mandrel in our pipeline, because we needed to use root permissions for a command (the image I found didn't allow it). Maybe it was a different kind of image (first time I see that matrix), or maybe I tried a non oficial image. Will give it a try tomorrow. I'll try to find an equivalent for my ghcr.io/graalvm/graalvm-community:21-ol7.

Thanks!

Also, you can remove the following dependencies as they are resolved transitively:

Although it's true, quarkus-poi doesn't always updates as fast as poi do releases (e.g. quarkus-poi 2.0.6 depends on poi 5.2.5, not 5.3.0 😄 ).

Update

As a workaround, it worked by changing ghcr.io/graalvm/graalvm-community:21-ol7 with ghcr.io/graalvm/native-image-community:21-ol7.

Regarding the Mandrel image. The one I found is quay.io/quarkus/ubi-quarkus-mandrel-builder-image:23.1-jdk-21. Just to confirm, is this the correct source? By default, it seems to have many things disabled (or limited), which seems to be reasonable from a security point of view, but breaks my current pipeline. A quick look to the manifest, make me believe that I should create a Dockerfile to do the compilation (but is something specific to my context, not related to quarkus-poi)

Given that I managed to solve the main issue with a workaround, I'm ok with closing the issue. I'll just wait the confirmation regarding the image source.

gastaldi commented 3 weeks ago

Although it's true, quarkus-poi doesn't always updates as fast as poi do releases (e.g. quarkus-poi 2.0.6 depends on poi 5.2.5, not 5.3.0 😄 ).

You must use the same version quarkus-poi is using, otherwise your native compilation will fail.

Regarding the Mandrel image. The one I found is quay.io/quarkus/ubi-quarkus-mandrel-builder-image:23.1-jdk-21. Just to confirm, is this the correct source?

Yes, that's correct.

Glad you sorted that out. Closing 👍🏻

gian1200 commented 3 weeks ago

Thanks for your answer!

You must use the same version quarkus-poi is using, otherwise your native compilation will fail.

  1. Is it really a MUST, or a recommendation? https://github.com/quarkiverse/quarkus-poi/pull/111 doesn't seem to update anything custom, just pom.xml. Also, have been working fine so far.

  2. I also noticed that quarkus-poi depends on poi-ooxml-full (my use case only needs poi-ooxml-lite). From my little understanding on the matter, it will mean a bigger (unnecessary) compilation output. Am I correct? If that's the case, is there a way to make quarkus-poi use poi-ooxml-lite? Can this be a new requirement, or is a limitation? My guess would be to manually exclude dependencies on my side (pom.xml) and keep my dependencies (I just wonder about the "must" part).

melloware commented 3 weeks ago

It depends on how you are packaging? Native mode already goes through and only includes classes in use. I would think the only way it would matter is Fast Jar or UberJar as far as size goes.

melloware commented 3 weeks ago

from ChatGPT:

The difference between poi-ooxml-full and poi-ooxml-lite mainly lies in the breadth of functionality and dependencies included for working with Microsoft Office Open XML (OOXML) formats in Apache POI:

poi-ooxml-full: This version includes the full set of features and dependencies required to work with OOXML files. It bundles all the required third-party libraries, making it easier for users who need the complete functionality (e.g., advanced formatting, formula evaluation, and handling complex OOXML elements). However, this full version is larger in size due to these extra dependencies.

poi-ooxml-lite: This is a lighter version with a reduced feature set, omitting some of the larger dependencies used in poi-ooxml-full. It’s suitable for applications with basic needs for reading and writing OOXML files without the more advanced or resource-heavy features. This version is ideal for those who want to minimize library size and only need core functionalities.

In general, if your project requires advanced Excel, Word, or PowerPoint features, poi-ooxml-full is a better choice. But if your needs are basic and you want a smaller dependency footprint, poi-ooxml-lite might suffice.

I don't think we want to limit users feature set in an extension?

gian1200 commented 3 weeks ago

Native mode already goes through and only includes classes in use

True, unless reflection is involved. I though that quarkus-poi had some "hardcoded" configuration to make poi work. If that is not the case, then you are absolutely correct.

Ultimately I believe it'd be best for me if I do some testing and comparison before doing any kind of optimization.

Thanks for taking your time to answer!