[JAVA] BasicDataSourceFactory is ClassNotFoundException when connecting to DB on Tomcat 8

Notes on migrating from Tomcat 7 to Tomcat 8

BasicDataSourceFactory became ClassNotFoundException when connecting to DB.

2015/01/16 10:30:01 ProxyManagerLogger Critical: java.lang.RuntimeException: javax.naming.NamingException: Could not load resource factory class [Root exception is java.lang.ClassNotFoundException: org.apache.tomcat.dbcp.dbcp.BasicDataSourceFactory]

The package has changed from Tomcat 8 to the following.

org.apache.tomcat.dbcp.dbcp2.BasicDataSourceFactory.class

How to respond

Changed factory in context.xml (ʻorg.apache.tomcat.dbcp.dbcp-> ʻorg.apache.tomcat.dbcp.dbcp2)

context.xml


factory="org.apache.tomcat.dbcp.dbcp2.BasicDataSourceFactory"

Recommended Posts

BasicDataSourceFactory is ClassNotFoundException when connecting to DB on Tomcat 8
What to do if ClassNotFoundException occurs when starting Tomcat
[Ruby on Rails] Column restrictions when saving to DB (4 representatives)
"Dh key too small" appears when connecting to https on Ubuntu
[Docker] How to build when the source code is bind-mounted on the container
Notes on what to do when EC2 is set up with t2.micro
What to do if tomcat process remains when tomcat is stopped in eclipse
Notes on what to do when a WebView ClassNotFoundException occurs in JavaFX 12
Relative path when running tomcat on eclipse
[Heroku] How to solve when an error is displayed on git push heroku master
Points to review when Rubocop is slow to run
JDBC basics ① (connecting / disconnecting to DB) Summary memorandum
[Rails MySQL] How to reset DB on heroku