From aa9a5d9b82d3bd78c6f3ab332ee48350fe485d1d Mon Sep 17 00:00:00 2001 From: GDLMadushanka Date: Wed, 18 Oct 2023 11:12:24 +0530 Subject: [PATCH] Fix dependency issue with apache poi Add stax2-api to classpath and introduced add-opens conditions to fix issues when using poi to read excel sheets Fixes /issues/2995 --- distribution/pom.xml | 4 ++++ distribution/src/assembly/bin.xml | 2 ++ distribution/src/scripts/micro-integrator.bat | 2 +- distribution/src/scripts/micro-integrator.sh | 2 +- 4 files changed, 8 insertions(+), 2 deletions(-) diff --git a/distribution/pom.xml b/distribution/pom.xml index 411a80bbf0..6b60eeb129 100644 --- a/distribution/pom.xml +++ b/distribution/pom.xml @@ -68,6 +68,10 @@ javax.jms javax.jms-api + + org.codehaus.woodstox + stax2-api + net.sf.saxon Saxon-HE diff --git a/distribution/src/assembly/bin.xml b/distribution/src/assembly/bin.xml index 6920477e5a..141f0af548 100755 --- a/distribution/src/assembly/bin.xml +++ b/distribution/src/assembly/bin.xml @@ -655,6 +655,8 @@ --> javax.xml.bind:jaxb-api:jar io.netty:netty-tcnative-boringssl-static + + org.codehaus.woodstox:stax2-api:jar diff --git a/distribution/src/scripts/micro-integrator.bat b/distribution/src/scripts/micro-integrator.bat index 4cfb26fe1e..83f02d299a 100644 --- a/distribution/src/scripts/micro-integrator.bat +++ b/distribution/src/scripts/micro-integrator.bat @@ -181,7 +181,7 @@ cd .. rem ---------- Add jars to classpath --c _CLASSPATH% if %JAVA_VERSION% GEQ 110 set CARBON_CLASSPATH=.\wso2\lib\*;%CARBON_CLASSPATH% -if %JAVA_VERSION% GEQ 110 set JAVA_VER_BASED_OPTS=--add-opens=java.base/java.net=ALL-UNNAMED --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens java.rmi/sun.rmi.transport=ALL-UNNAMED +if %JAVA_VERSION% GEQ 110 set JAVA_VER_BASED_OPTS=--add-opens=java.base/java.io=ALL-UNNAMED --add-opens=java.xml/com.sun.org.apache.xerces.internal.util=ALL-UNNAMED --add-opens=java.base/java.net=ALL-UNNAMED --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens java.rmi/sun.rmi.transport=ALL-UNNAMED rem ---------------- Setting default profile for Runtime if not parsed -------------- diff --git a/distribution/src/scripts/micro-integrator.sh b/distribution/src/scripts/micro-integrator.sh index 4446577018..c48da08eab 100644 --- a/distribution/src/scripts/micro-integrator.sh +++ b/distribution/src/scripts/micro-integrator.sh @@ -280,7 +280,7 @@ fi JAVA_VER_BASED_OPTS="" if [ $java_version_formatted -ge 1100 ]; then - JAVA_VER_BASED_OPTS="--add-exports=java.naming/com.sun.jndi.ldap=ALL-UNNAMED --add-opens=java.base/java.net=ALL-UNNAMED --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens java.rmi/sun.rmi.transport=ALL-UNNAMED" + JAVA_VER_BASED_OPTS="--add-opens=java.base/java.io=ALL-UNNAMED --add-opens=java.xml/com.sun.org.apache.xerces.internal.util=ALL-UNNAMED --add-exports=java.naming/com.sun.jndi.ldap=ALL-UNNAMED --add-opens=java.base/java.net=ALL-UNNAMED --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens java.rmi/sun.rmi.transport=ALL-UNNAMED" fi while [ "$status" = "$START_EXIT_STATUS" ]