ClassNotFoundException oracle.jdbc.driver.OracleDriver only in servlet, using Eclipse

This question already has an answer here:

  • How to add JAR libraries to WAR project without facing java.lang.ClassNotFoundException? Classpath vs Build Path vs /WEB-INF/lib 4 answers

  • Probably you aren't deploying the oracle driver with your application.

    You have several options:

  • You can place the driver jars in your WEB-INF/lib folder
  • You export it with your application. -> Right Click on Project -> Build Path -> Configure Build Path... -> Order and Export -> Check the drivers.
  • Place the driver jars in a shared or library extension folder of your application server. (You should go with option one or two though.)

  • You must include the ojdbc6.jar file in the Deployment Assembly of the Project...

  • select the web project which contains the jsp file...

  • select Project tab in the menu bar in Eclipse

  • select properties in the drop down menu

  • select Deployment Assembly

  • Add your ojdbc6.jar file in it.


  • 试试这个,将oracle.jdbc.driver.OracleTypes更改为oracle.jdbc.OracleTypes

    链接地址: http://www.djcxy.com/p/20270.html

    上一篇: ViewModel应该如何关闭表单?

    下一篇: ClassNotFoundException仅在使用Eclipse的servlet中使用oracle.jdbc.driver.OracleDriver