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

Help! Program with one line. Rowset

0 views
Skip to first unread message

mille...@nospam.yahoo.com

unread,
Sep 17, 2002, 10:21:14 AM9/17/02
to

Please help me.

I am in a need to run a program using CachedRowSet (I have downloaded the Java
Rowset Implementation from Early Access Downloads and I have added its jar
file (rowset.jar) to my classpath). It is only a test program for my students
to know what is a Rowset and how it can be programmed.

But a weird thing happens. First, let us see my code:
import javax.sql.*;
import sun.jdbc.rowset.*;
class TestRowSet {
public static void main (String[] args){
CachedRowSet crs = new CachedRowSet(); //THE ONLY LINE
}
}

Compilation works well. I have no compilation error.

But when I try to execute the program, I get an ClassNotFoundException while
running THE ONLY LINE.

The ClassNotFoundException says that:


Exception in thread "main" java.lang.NoClassDefFoundError: javax/sql/RowSet
at java.lang.ClassLoader.defineClass0(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:486)
at
java.security.SecureClassLoader.defineClass(SecureClassLoader.java:1
1)
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 Example1.main(Example1.java:9)


I have the server up and running. I have JDK 1.4.0. I think RowSet is included
in JDK 1.4.0. Anyway, I have tried to install JDBC 2.0 Optional Package
without success.

I am getting mad trying to solve this problem and I really need for my Java
students.

What could be the problem?

Any help would be really apreciated.

TIA.

Victor Palau


----- Posted via NewsOne.Net: Free (anonymous) Usenet News via the Web -----
http://newsone.net/ -- Free reading and anonymous posting to 60,000+ groups
NewsOne.Net prohibits users from posting spam. If this or other posts
made through NewsOne.Net violate posting guidelines, email ab...@newsone.net

AV

unread,
Sep 17, 2002, 10:45:16 AM9/17/02
to
Hi,

Looks like you have some version inconsistency.
The program was compiled, so javax/sql/RowSet
was visible for javac. Apparently, run-time
classpath is different. It can be because:

-- use of IDE with complex classpath setup

-- having java 1.4 and 1.3 installed and mixup
in PATH, CLASSPATH and registry variables

Try to be more specific in import :
import javax.sql.RowSet;

AlexV.


<mille...@nospam.yahoo.com> wrote in message
news:am7doq$kol$1...@news.netmar.com...

0 new messages