Open luisdanielmesa opened 2 years ago
If I'm missing something or made a mistake somewhere, you can point me to a working example of the usage of this property within the context of Payara's repackaged Eclipselink (2.7.9.payara-p2) and close the issue. Thanks!
Hi luisdanielmesa,
Thank you for raising the issue, unfortunately, we don't have an example I can refer you to. I was unable to configure the environment the same way you described it, could you please share the exact configuration of your docker database image, and a small sample application to test with?
Best regards, Felix
Hi luisdanielmesa,
I created this sample application on the same environment as described in your issue, in order to try to reproduce the errors that you encountered. I was able to persist the object in the database with no issues and no errors/warnings from Payara Server.
I attached in this message a .zip archive with my project, please let me know if it works for you.
Hi, thanks for taking the time to make the demo. Unfortunately I'm using EclipseLink, instead of Hibernate, as stated in the title. I have created a small project, inspired by yours, to reproduce.
I've intentionally left the full logging turned on in case you need it, you might want to turn it off if you don't need it.
WARNING: I've used drop-and-create
as schema generation strategy, the scripts are right beside persistence.xml
, don't use on any database that you care about too dearly.
Steps
persistence.xml
and uncomment the eclipselink.cache.database-event-listener
lineDemo project oracle-change-notification.zip
Hi @luisdanielmesa,
Thank you very much for reporting this issue, I was able to reproduce it using your project. I have raised a Jira issue with the internal id FISH-6633
. We always encourage you to contribute, so if you feel confident to do you please raise a PR and a member of the development team will gladly review the changes. If not, we will pick this issue up in the future.
Thanks, Felix
Have you added the Oracle JDBC driver containing oracle.jdbc.dcn.DatabaseChangeListener to you server classpath?
Hi, I have it inside my packaged app. I also tried placing it in several locations as per: this post but it seems in neither of the locations it got picked up...
I did not try the add-library
command because I'm not very familiar with it and wanted to have all non-provided dependencies inside my packaged application. I'm testing multiple servers and I tried to make it as portable as I could to ease my testing.
I also tried your answer to this question where you seemed to suggest just adding it to WEB-INF/lib was enough, but the examples you linked are not accessible and then I didn't try the other answers when I got a little discouraged.
Edit: I don't know if this is useful but I'll paste the screenshot of the exception I get, as well as the dependencies I'm using... thanks for taking the time, I really appreciate it.
Exception Declared dependencies Built dependencies persistence.xml
I've been digging and I've gotten as far as checking osgi.properties Which location(s) are supposed to be supported to place the ojdbc driver? I just want to test in different locations, but I don't want to try randomly.
Is there any update on this? Is there a way I can help?
Have you seen / implemented this: https://docs.payara.fish/community/docs/documentation/payara-server/classloading.html
You would need to do both payara-web.xml with delegate set to false and the system property to turn it off globally
Hi @lprimak thank you for the answer. I thought I was adding a library that Payara didn't contain. Can you explain why turning off class-loading delegation solves this issue? Maybe I'm missing something. Thank you again.
Does it work? The article has all the answers that I have :) I think EclipseLink includes some oracle stuff so it clashes unless you turn off delegation
I tried adding:
<class-loader delegate="false"/>
but I still get the java.lang.NoClassDefFoundError: oracle/jdbc/dcn/DatabaseChangeListener
error.
Did you also include the system property fish.payara.classloading.delegate
to false? You need to do both
I just tried that, but I still get the error, don't worry and thanks for the help, I'll just use Debezium and get the change capture that way... I still think I was on the right track checking this
Did you put your JDBC driver into
I was wondering if anyone had found a way to make this work. I couldn't. Seems the classloading is a bit sketchy now, because you might also need to delegate the classloading for other libraries. It happened to me recently when using Jackson. It wouldn't work if I had delegate=false
Brief Summary
When using the property
eclipselink.cache.database-event-listener
inpersistence.xml
set toorg.eclipse.persistence.platform.database.oracle.dcn.OracleChangeNotificationListener
or toDCN
server startup fails with an exceptionjava.lang.ClassNotFoundException: oracle.jdbc.dcn.DatabaseChangeListener
.Caused by: java.lang.ClassNotFoundException: oracle.jdbc.dcn.DatabaseChangeListener at java.base/java.net.URLClassLoader.findClass(URLClassLoader.java:471) at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:588) at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521) at org.apache.felix.framework.ExtensionManager$ExtensionManagerWiring.getClassByDelegation(ExtensionManager.java:1212) at org.apache.felix.framework.BundleWiringImpl.searchImports(BundleWiringImpl.java:1606) at org.apache.felix.framework.BundleWiringImpl.findClassOrResourceByDelegation(BundleWiringImpl.java:1522) at org.apache.felix.framework.BundleWiringImpl.access$300(BundleWiringImpl.java:79) at org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.loadClass(BundleWiringImpl.java:1970) at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521) ... 59 more
Removing the property allows the app to start normally.
I'm using Oracle 19.3.0 SE2 in a docker container locally as a test environment. Oracle JDK 11.0.8 Payara 5.2022.3 persistence.xml
<persistence version="2.2" ...
I'm evaluating Payara Server Full with the hopes of being able to deploy using Payara Micro in a Kubernetes cluster afterwards.
Expected Outcome
I would expect the server to start without an exception.
eclipse-ee4j/eclipselink persistence.xml example
eclipse-ee4j/eclipselink
Current Outcome
Reproducer
persistence.xml
Operating System
Windows 10 Pro
JDK Version
Oracle JDK 11.0.8
Payara Distribution
Payara Server Full Profile