From: Pif - 34 on
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
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
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
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
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