Open mheydem opened 1 year ago
The workaround described here is working for me: https://github.com/icatproject-contrib/icat-ansible/pull/83#issuecomment-1080535203
glassfish/domains/domain/lib/ext/ojdbc8.jar
to glassfish/domains/domain/lib
glassfish/modules/org.eclipse.persistence.oracle.jar
to glassfish/domains/domain/lib
I leave this bug report open, as this is just a workaround.
This is an issue with classloading which on Java 8 used to be fixed with java.ext.dirs
mechanism. In short, the JDBC driver is OK to be placed in domain/lib/ojdbc8.jar
but it won't see the Oracle EclipseLink extension needed for correct JPA mappings to the Oracle DB. The solution to move glassfish/modules/org.eclipse.persistence.oracle.jar
is OK because it moves the Oracle Eclipselink extension on the same level as the JDBC driver.
We'll need to investigate more how to solve this without the work-around. Until then, we could at least document this as the recommended workaround. @mheydem If you can contribute the documentation, we'd greatly appreciate it. Installing the Oracle JDBC driver is mentioned in the Administration guide and Application development guide. The Asciidoc sources are here: https://github.com/eclipse-ee4j/glassfish/tree/master/docs
However, this issue might be complicated to fix properly without any hacks. I recommend seeking professional services from companies that provide commercial support for Eclipse GlassFish, see: https://glassfish.org/support.html
This issue has been marked as inactive and old and will be closed in 7 days if there is no further activity. If you want the issue to remain open please add a comment
I am trying to upgrade form
to
Java SE 8 - GF 6.0
For using the Oracle database driver with EclipseLink the ojdbc8.jar was placed in
glassfish/domains/domain/lib/ext
and in domain.xml this was specified
<jvm-options>-Djava.ext.dirs=${com.sun.aas.javaRoot}/lib/ext${path.separator}${com.sun.aas.javaRoot}/jre/lib/ext${path.separator}${com.sun.aas.instanceRoot}/lib/ext</jvm-options>
Looks like described in this quite old description https://docs.oracle.com/cd/E19798-01/821-1752/beaml/index.html
Java SE 17 - GF 6.2.5
Now, with Java SE 17 the java.ext.dirs option is not valid any longer. The current glassfish documentation seems not to explain how to to it under the new circumstances. If I place the ojdbc8.jar in the
glassfish/domains/domain/lib
directory directly, an exception is raised during application startup:Possibly this bug report in Payara is related: https://github.com/payara/Payara/issues/4613
Would you please explain how this should be done correctly?