I have an application in struts with external tomcat. I have implemented a CustomDataSourceFactory in extrernal that reads the context.xml file and create datasource for application. I have included the external jar in my application as maven dependency.
When the application boots up, I can see the logs of CustomDataSourceFactory that I have added.
But After few seconds, I see the error
org.apache.catalina.core.NamingContextListener.addResource Failed to register in JMX: [javax.naming.NamingException: Could not load resource factory class [Root exception is java.lang.ClassNotFoundException: com.custom.ds.CustomDataSourceFactory]] .
The application is then deployed in tomcat but has no datasource.
If tomcat is not able to find CustomDataSourceFactory, how can I see the logs of CustomDataSourceFactory running.
My tomcat is tomcat 9.0.72 .
I tried adding tomcat dependency in my application but it did not worked.
Ayush is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.