java.lang.NoClassDefFoundError: oracle/jdbc/driver/OracleDriver [message #90967] |
Fri, 18 January 2002 01:07 |
Baris Aksu
Messages: 4 Registered: January 2002
|
Junior Member |
|
|
I have a problem with Class.forName() or DriverManager.registerDriver() methods both of which tries to load the necessary jdbc driver in my simple servlet program . My configuration is Win98,tomcat 4.0.1 and jdk 1.3.1_0.2.
"classes12.zip" is in "C:orahome2jdbclib" in my computer, and here is my autoexec.bat to set classpath and path environment variables:
*****
SET classpath=.;C:orahome2jdbclibclasses12.zip;C:jakarta-tomcat-4.0.1commonlibservlet.jar;
*********
SET Path=C:jdk1.3.1_02bin;C:orahome2bin;"C:PROGRAM FÝLESORACLEJRE1.1.7BÝN";C:ORAHOME2LIB;C:ORAHOME2JDBCLIB;
**********
""The same program runs successfully as a standalone java program and after loading the driver retrieves some rows from oracle database. But when it is called simply from an HTML form, the suitable driver cannot be loaded.""
I went through related problems and answers here and they seem to stem from misconfigurations in classpath environment variable, so I suspect a problem with mine.
I need urgent help, thanks in advance...
Baris Aksu
|
|
|
|
Re: java.lang.NoClassDefFoundError: oracle/jdbc/driver/OracleDriver [message #91066 is a reply to message #90967] |
Mon, 18 March 2002 16:55 |
Bogus
Messages: 1 Registered: March 2002
|
Junior Member |
|
|
Srinivas!
Lots of people stating the obvious! Of course we checked the classpath? Looks good! (It has the zip file in it). Still doesn't work?
I advise setting the classpath on the command line with -cp OR -classpath ... OR if you are setting the CLASSPATH environment variable set it in an AUTOEXEC.BAT and not via Control Panel->System etc. I had mine set okay and it STILL did not pick it up until I put it in the AUTOEXEC.BAT
Hope it works for you too!
|
|
|
|
Re: java.lang.NoClassDefFoundError: oracle/jdbc/driver/OracleDriver [message #91087 is a reply to message #90967] |
Sat, 30 March 2002 21:56 |
Charlie Kuharski
Messages: 1 Registered: March 2002
|
Junior Member |
|
|
I'm having the same problem. I'm suspecting it is a problem using win98. I'm using FORTE and have no problems connecting remotely. The applet is just fine until I deploy it to Tomcat and try to run. It seems to never pick it up from my classpath. I've classes12.jar delcared several places and it still throws the exception.
I'm thinking of abondoning either win98 or Tomcat
|
|
|
|
|
|
Re: java.lang.NoClassDefFoundError: oracle/jdbc/driver/OracleDriver [message #91189 is a reply to message #90967] |
Mon, 20 May 2002 21:41 |
ying
Messages: 143 Registered: May 2002
|
Senior Member |
|
|
I have same problem in Linux, the platform is Linux+tomcat+oracle, I have exported the classes12.jar in my lib directory,like:
export CLASSPATH=$CLASSPATH:~/lib/classes12.jar;
There is no problem when I compile the jdbc file which include"DriverManager.registerDriver (new oracle.jdbc.driver.OracleDriver());".
But when I run JSP or servlet, it still generate the "java.lang.NoClassDefFoundError: oracle/jdbc/driver/OracleDriver" error. Plz help me!
|
|
|
|
|
|
|
|
problems with drivers oracle.jdbc.driver.OracleDriver [message #91302 is a reply to message #90967] |
Thu, 04 July 2002 08:26 |
cristianch
Messages: 1 Registered: July 2002
|
Junior Member |
|
|
i am working with tomcat & netbeans and i have problems with drivers oracle.jdbc.driver.OracleDriver
this is the error when i compile .java
examples/JdbcTest.java [[10:1]] cannot resolve symbol
symbol : class OracleDriver
location: package driver
DriverManager.registerDriver (new oracle.jdbc.driver.OracleDriver());
^
1 error
Errors compiling JdbcTest.
thanks to all
Cristian
|
|
|
error.... [message #91354 is a reply to message #90967] |
Fri, 26 July 2002 01:26 |
Mayur Solanki
Messages: 2 Registered: July 2002
|
Junior Member |
|
|
Hello,
Please help to solve first step of java.
My "j2sdk1.4.0_01" installation on linux platform is already done.
All paths are set ok.
Now what is problem, When we create one file suppose file1.java, its class file is also created regularly but when i am going to run by : "java file1" then error occured :
"Exception in thread "main" java.lang.NoClassDefFoundError: file1
Please give the way to solve it as far....
Mayur.
|
|
|
|
|
|
|
Re: problems with drivers oracle.jdbc.driver.OracleDriver [message #91518 is a reply to message #90967] |
Wed, 16 October 2002 05:49 |
Rainer Reitz
Messages: 2 Registered: October 2002
|
Junior Member |
|
|
Hi,
I think you will have to download a JDBC driver first (www.oracle.com) --> Thin driver.
If you are using JDK2, the following class-library is fine: classes.zip
Put this file into: c:JAVA_HOMEjrelib
Define Environment:
PATH = c:j2sdk1.4.0_02bin (==> Java-Executables)
JAVA_HOME = c:j2sdk1.4.0_02 (==> Root-Verzeichnis der kompletten JDK-Installation)
CLASSPATH = c:j2sdk1.4.0_02libtools.jar; c:j2sdk1.4.0_02jrelibrt.jar; c:j2sdk1.4.0_02jrelibclasses12.zip; . (==> Oracle8i 8.1.7.1 JDBC Thin Driver for JDK 1.2)
|
|
|
|
|
Re: java.lang.NoClassDefFoundError: oracle/jdbc/driver/OracleDriver [message #91763 is a reply to message #90967] |
Fri, 07 February 2003 00:51 |
Rahul
Messages: 94 Registered: December 1998
|
Member |
|
|
java.lang.NoClassDefFoundError: oracle/jdbc/pool/OracleDataSource...Does anyone have an answer for this...
Details:
Hi, I'm Using Tomcat4.0.2 and trying to migrate an application already running on SandBox server.I am getting a runtime error as "java.lang.NoClassDefFoundError:oracle/jdbc/pool/OracleDataSource"/,though i've taken care of the classpath settings and included the classes12.zip in it,the problem still persists.As a clue i have a change to be made to the catalina.bat file and the varible to be added here as:-DDefaultConfig="%CATALINA_HOME%webappssctconfigadmin.cfg".I'm not able to make out that where should i put it and what is the role of this batch file in loading the JDBC files.Or else there is an alternate solution which is much simpler. Kindly help me out ASAP. Thanx
|
|
|
|
|
Re: java.lang.NoClassDefFoundError: oracle/jdbc/driver/OracleDriver [message #92298 is a reply to message #91778] |
Thu, 20 May 2004 22:25 |
Praneet
Messages: 1 Registered: May 2004
|
Junior Member |
|
|
First of all check if . is there in your classpath
Basically u need to tell the runtime env that ur class is residing in that particular location where the compiler has put it
The interpreter namely java has a bug on some plafs where it does n t look in the current dir
Certainly sun ppl are lookin into the matter
hope for best
cheers
Praneet
|
|
|
|
|
Re: java.lang.NoClassDefFoundError: oracle/jdbc/driver/OracleDriver [message #194618 is a reply to message #90967] |
Sat, 23 September 2006 01:08 |
Arkhel
Messages: 1 Registered: September 2006 Location: México
|
Junior Member |
|
|
Ok, me tomó una extenuante media hora, pero ahi va.
Primero tenemos nuestra directorio de trabajo
C:\JAVA\Ejemplo
dentro de este esta la carpeta classes
C:\JAVA\Ejemplo\classes
la cual contiene la clase Ejemplo.class y Ejemplo.htm,
copiamos a esta carpeta (classes) el archivo que contiene el driver, que en mi caso es classes111.zip, y abrimos con el bloque de notas el archivo Ejemplo.htm y lo editamos.
Generalmente, en un ejemplo sencillo, aparecería:
<HTML>
<HEAD>
</HEAD>
<BODY BGCOLOR="000000">
<CENTER>
<APPLET
code = "Empleado.class"
width = "500"
height = "300"
>
</APPLET>
</CENTER>
</BODY>
</HTML>
solamente le agregamos la propiedad ARCHIVE, especificando el nombre del archivo, quedaría:
<HTML>
<HEAD>
</HEAD>
<BODY BGCOLOR="000000">
<CENTER>
<APPLET ARCHIVE="classes111.zip"
code = "Empleado.class"
width = "500"
height = "300"
>
</APPLET>
</CENTER>
</BODY>
</HTML>
Con esto ya queda, suponiendo que ya hayan puesto, desde el compilador que esten utilzando, el path del archivo, si no es solamente agregarlo a propiedades del proyecto (JCreator pro) en Project/Project Settings, seleccionan la pestaña Requiered Libraries, le dan New/Add Archive, y buscan en C:\JAVA\Ejemplo\classes\classes111.zip, lo agregan y de dan ok.
Mi código de java:
import java.sql.*;
import oracle.jdbc.driver.*;
import javax.swing.*;
import java.awt.*;
import java.applet.*;
public class Empleado extends Applet {
public static Connection conn;
//TextField TxtNombre, TxtEdad;
//Button ButAceptar
public void init() {
ConexionOracle();
}
public static void ConexionOracle()
{
try
{
DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
conn = DriverManager.getConnection("jdbc:oracle:thin:@Ratiugsoft:1521:JAVA","angel","angel");
}catch(Exception ex)
{
System.out.println("Error durante la conexión. " + ex);
}
}
}
-----------------
Fausto
No busco mi dicha en la indiferencia...
|
|
|
|