-
Notifications
You must be signed in to change notification settings - Fork 181
Help Needed #941
Description
Good day.
We are running on an Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit.
A while back we added jsch-0.1.55 and jzlib-1.1.3 to our database in order to be able to connect to secure ftps that our partners were starting to set up.
Today we are working on Migrating this to an Oracle Database 19c and are looking at using the code from this project
to replace the old jsch version.
I downloaded Maven 3.9.11, Git 2.51.2-64 & Java 25 to build the jar file for jsch and I was able to build successfully.
But when I tried to javaload the jar file into Oracle, I got the following message:
creating : resource META-INF/maven/com.github.mwiede/jsch/pom.xml
loading : resource META-INF/maven/com.github.mwiede/jsch/pom.xml
creating : resource META-INF/maven/com.github.mwiede/jsch/pom.properties
loading : resource META-INF/maven/com.github.mwiede/jsch/pom.properties
creating : class META-INF/versions/9/module-info
loading : class META-INF/versions/9/module-info
Error while creating class META-INF/versions/9/module-info
ORA-29509: incorrectly formed Java binary class definition
ORA-06512: at line 1
The following operations failed
class META-INF/versions/9/module-info: creation (createFailed)
exiting : Failures occurred during processing
And a bunch of Java classes that were invalid on the database.
So, I checked the Java version in use on the 19c database and it is version 1.8.0_461.
Because it is on an ODA (Oracle Database Appliance), it is almost impossible to update Java.
We have a server with Java JDK version 1.8.0_441, so I went on it and tried to build this again.
Both Maven and this project say that I need at least Java 8 to run, so I tried again.
This time the build was not successful.
Got: [ERROR] Detected JDK C:\Java\jdk\jre is version 1.8.0-441 which is not in the allowed range [25,).
I then changed the POM.XML to:
<requireJavaVersion>
<version>[1.8,)</version>
</requireJavaVersion>
Tried again.
Got: [ERROR] Failed to execute goal org.apache.maven.plugins:maven-toolchains-plugin:3.2.0:select-jdk-toolchain (default) on project jsch: Cannot find matching toolchain definitions for the following toolchain types:{version=[25,)}
[ERROR] Define the required toolchains in your ~/.m2/toolchains.xml file.
I removed the executions lines from this:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-toolchains-plugin</artifactId>
<version>3.2.0</version>
<executions>
</executions>
</plugin>
Tried again.
Got: [ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.14.1:compile (default-compile-9) on project jsch: Fatal error compiling: invalid flag: --module-path -> [Help 1]
[ERROR]
I removed the executions lines from this:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.14.1</version>
<executions>
</executions>
</plugin>
I used Gemini to guide me and I ended up doing a lot more changes ( around <groupId>org.apache.maven.plugins</groupId> and <artifactId>maven-source-plugin</artifactId>),
removing the line <manifestFile>${project.build.outputDirectory}/META-INF/MANIFEST.MF</manifestFile> and removing executions from org.apache.maven.plugins.
With all of that, it was able to build the jar file, but long story short, when loading into the database I got other errors. For example:
ORA-29521: referenced name com/sun/jna/platform/win32/WinDef$WPARAM could not be found
ORA-29521: referenced name org/bouncycastle/crypto/params/KeyParameter could not be found
ORA-29521: referenced name org/bouncycastle/crypto/DefaultBufferedBlockCipher could not be found
I located the jars used for bouncycastle and jna and got errors like:
Error while creating class META-INF/versions/9/module-info
ORA-29509: incorrectly formed Java binary class definition
At this point, I am wondering if anybody can point me into the right direction to be able to build this project successfully given the constraint of Java 8 in order to load it into the database.
Thanks