Where should the JDBC driver JAR files reside on a Tomcat deployment with a datasource?

前端 未结 2 1583
梦如初夏
梦如初夏 2020-12-11 05:12

I have java web application using Spring, Hibernate, Tomcat7 & MySql. I use Datasource for database operations. I am not very clear about what is the standard location t

2条回答
  •  清歌不尽
    2020-12-11 05:56

    When it comes to location of jars to be decided, the thumb rule is that:

    1. Use a jar in the server lib location.
    2. If the jar is not available, include the same in the application's lib folder.
    3. To find a suitable Jars, system looks in the following repositories, in the order:

    Bootstrap classes of your JVM

    System class loader classes (described above)

    /WEB-INF/classes of your web application /WEB-INF/lib/*.jar of

    your web application $CATALINA_HOME/common/classes

    $CATALINA_HOME/common/endorsed/*.jar

    $CATALINA_HOME/common/i18n/*.jar

    $CATALINA_HOME/common/lib/*.jar

    $CATALINA_BASE/shared/classes

    $CATALINA_BASE/shared/lib/*.jar

提交回复
热议问题