java.lang.ClassNotFoundException: com.mysql.jdbc.Driver (maven + jboss)

前端 未结 4 1643
轻奢々
轻奢々 2021-01-21 08:02

maven pom.xml



        
4条回答
  •  难免孤独
    2021-01-21 08:30

    As a rule you should not be including your JDBC drivers in your war file.

    I suggest you mark the driver as provided and add it to the lib directory of the server.

    PS. I'm not sure why you would be using

    Class.forName("com.mysql.jdbc.Driver")
    

    in your code. Why not let the contain manage your connections and transactions?

提交回复
热议问题