Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

NoClassDefFoundError

4 views
Skip to first unread message

Doug

unread,
Feb 13, 2002, 4:59:20 PM2/13/02
to
Hey all,

Now that I have the 3 .jar files in my classpath I get a new error:

Exception in thread "main" java.lang.NoClassDefFoundError:
com/microsoft/jdbc/base/BaseDriver
at java.lang.ClassLoader.defineClass0(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:486)
at
java.security.SecureClassLoader.defineClass(SecureClassLoader.java:111)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:248)
at java.net.URLClassLoader.access$100(URLClassLoader.java:56)
at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:297)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:286)
at java.lang.ClassLoader.loadClass(ClassLoader.java:253)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:313)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:120)
at jdbctest.main(jdbctest.java:6)


My code is simply this:

import java.sql.*;

public class jdbctest {
public static void main(String args[]) {
try {
Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver");
}
catch (Exception e) {
System.out.println(e.toString());
}
}
}


Sridhar Paladugu[CompCon tech]

unread,
Feb 15, 2002, 9:41:23 AM2/15/02
to
HI,

If your CLASSPATH environment varriable contains reference to the 3 jar
files then this should not happen. You can do use extension mechanism. Copy
3 jar files to
%JDK_HOME%\jre\lib\ext\

and reboot the system just to make sure that JVM updates CLASSPATH.
Let me know if you still have this problem and i will be glad to resolve it.

Thanks

Sridhar Paladugu
Microsoft Developer Support
JDBC Webdata


This posting is provided "AS IS" with no warranties, and confers no rights.

Are you secure? For information about the Strategic Technology Protection
Program and to order
your FREE Security Tool Kit, please visit
<http://www.microsoft.com/security>.

Jon Skeet

unread,
Feb 15, 2002, 10:03:03 AM2/15/02
to
Sridhar Paladugu[CompCon tech] <sr...@online.microsoft.com> wrote:
> If your CLASSPATH environment varriable contains reference to the 3 jar
> files then this should not happen. You can do use extension mechanism. Copy
> 3 jar files to
> %JDK_HOME%\jre\lib\ext\
>
> and reboot the system just to make sure that JVM updates CLASSPATH.
> Let me know if you still have this problem and i will be glad to resolve it.

You don't need to reboot the system, although you will need to restart your
app, I believe.

Note that by default, 2 JREs are installed when you install the JDK. You
need to make sure the jar files are in the correct place (or both). See
http://www.pobox.com/~skeet/java/extensions.html for details of this
gotcha.

--
Jon Skeet - <sk...@pobox.com>
http://www.pobox.com/~skeet/
If replying to the group, please do not mail me too

0 new messages