Prev: (Should be in an FAQ). Reccomended books / tutorails for totalnewbies?
Next: including apache http components in my program
From: Pif - 34 on 3 Jun 2010 17:29 Hello, I encounter a ClassNotFoundException when loading Oracle driver in a servlet (Tomcat 5.5 JDK1.4.2). But my JAR is well placed in the WEBINF/lib folder. When I move the Class.forname from my servlet to a JSP page (wich calls the JSP this works perfectly. So Tomcat seems to have class loader in servlet or JSP that is different. Can somebody help me ? Thanks a lot.
From: Arne Vajhøj on 3 Jun 2010 18:22 On 03-06-2010 17:29, Pif - 34 wrote: > Hello, I encounter a ClassNotFoundException when loading Oracle driver > in a servlet (Tomcat 5.5 JDK1.4.2). But my JAR is well placed in the > WEBINF/lib folder. > > When I move the Class.forname from my servlet to a JSP page (wich calls > the JSP this works perfectly. > > So Tomcat seems to have class loader in servlet or JSP that is different. > > Can somebody help me ? It should work with servlet as well. Did you by any chance copy the JDBC driver jar file to WEB-INF/lib after starting the web app? Arne
From: Pif on 4 Jun 2010 06:07 On 4 juin, 00:22, Arne Vajhøj <a...(a)vajhoej.dk> wrote: > On 03-06-2010 17:29, Pif - 34 wrote: > > > Hello, I encounter a ClassNotFoundException when loading Oracle driver > > in a servlet (Tomcat 5.5 JDK1.4.2). But my JAR is well placed in the > > WEBINF/lib folder. > > > When I move the Class.forname from my servlet to a JSP page (wich calls > > the JSP this works perfectly. > > > So Tomcat seems to have class loader in servlet or JSP that is different. > > > Can somebody help me ? > > It should work with servlet as well. > > Did you by any chance copy the JDBC driver jar file to WEB-INF/lib > after starting the web app? > > Arne I don't understand also. I've restarted tomcat several times after copying the file.
From: Arne Vajhøj on 4 Jun 2010 19:36 On 04-06-2010 06:07, Pif wrote: > On 4 juin, 00:22, Arne Vajh�j<a...(a)vajhoej.dk> wrote: >> On 03-06-2010 17:29, Pif - 34 wrote: >>> Hello, I encounter a ClassNotFoundException when loading Oracle driver >>> in a servlet (Tomcat 5.5 JDK1.4.2). But my JAR is well placed in the >>> WEBINF/lib folder. >> >>> When I move the Class.forname from my servlet to a JSP page (wich calls >>> the JSP this works perfectly. >> >>> So Tomcat seems to have class loader in servlet or JSP that is different. >> >>> Can somebody help me ? >> >> It should work with servlet as well. >> >> Did you by any chance copy the JDBC driver jar file to WEB-INF/lib >> after starting the web app? > > I don't understand also. I've restarted tomcat several times after > copying the file. Exact exception text? Listing of content of webapps/yourwebapp? Arne
From: Pif - 34 on 5 Jun 2010 16:19
I've replaced " Class.forName("oracle.jdbc.driver.OracleDriver"); " by oracle.jdbc.driver.OracleDriver oracleDriver = null; and this works perfectly. So my Jar is well placed, this seems to be an error with the ClassLoader of tomcat !? Arne Vajh�j wrote: > Exact exception text? > > Listing of content of webapps/yourwebapp? > > Arne |