有没有将oracle12.jar放在tomcat的common的lib下面
还有要将oracle12.zip改称oracle12.jar

解决方案 »

  1.   

    String dbName ="java:comp/env/jdbc/Oracle";
    ---》
    String dbName ="java:/comp/env";Context initCtx = new InitialContext();
    Context envCtx = (Context) initCtx.lookup("java:comp/env");
    DataSource ds = (DataSource)envCtx.lookup("jdbc/Oracle");
    //分2步,不是一步到位的!
    请参考:
    http://expert.csdn.net/Expert/topic/1190/1190848.xml?temp=.5132868
      

  2.   

    org.apache.jasper.JasperException: Cannot load JDBC driver class 'oracle.jdbc.driver.OracleDriver'
    根据你的异常信息很清楚地看到 你的 驱动程序 不能正确加载
    sandyen(杉叶)所说的是正确的方法 
    另外一步应该是可以的
      

  3.   

    按照sandyen(杉叶)的建议我把驱动程序的那个包放在common/lib下,并改写后缀为jar,确实找到了.
    1.可直接改写没有meta-inf的信息,还能读,那不就是没分别了嘛,是支持的压缩包就可以。我会试试别的。
    2.为什么放在examples/的web-inf/lib下就读不出来驱动呢??
      

  4.   

    还真是common/lib下只能读取*.jar的.....
      

  5.   

    to zxhong(红透半边天):我后来又试了一步直接查找的,也可以了,没有先查找环境设置,在通过初始化环境设置的context去找xxx/xxx...看来我的问题就是出在包的存放位置和.jar还是zip上了.....
      

  6.   

    我原来 也放到过 web-inf/lib下 好像不行,后来放到 common/lib就可以了
      

  7.   

    为什么会这样呢,兄台
    lib directory. All the JAR/zip files used by the web application, including the
    third-party JAR/zip files, go in this directory. For example, if a servlet uses JDBC
    to connect to a database, the JDBC driver JAR file should go here. We can also
    package the servlet classes in a JAR file and keep that file in this directory. At
    runtime, the servlet container adds all the JAR/zip files from this directory to
    the classpath for this web application.(摘自某刊物^-^)
      

  8.   

    不过当我使用 struts的时候 是可以的
    我想可以理解是这样的
    你配置jndi的web.xml是服务器用的,这样的一般都要放到 common/lib
    而自己用的 就可以用 web-inf/lib
      

  9.   

    我试了一个不同JNDI的,直接jdbc,放在someContext/web-inf/lib下,还是不行...该不会是bug吧.....可是装个jChatBox,smartupload的包都放在lib下就好的..........晕.
      

  10.   

    要知道web-inf/lib是程序调用的时候才加载
    而common/lib下是WEB服务器起来的时候就需要加载的