Cannot get DBD::JDBC working -- any suggestions?

R

rob

I am trying to get the DBD::JDBC package working under Cygwin on Windows.
However I am running into what seems to be a Java-related issue.

The JAR file (dbd_jdbc.jar) from CPAN (http://search.cpan.org/~vizdom/DBD-JDBC-0.71/JDBC.pod) is supposed to contain a class com.vizdom.dbd.jdbc.Server. Yet when I try to run that as per the instructions I get an error that this class is not found (see below). It looks as if this JAR just doesn't contain that class, which would be odd.

Did anyone come across this, and got it working somehow?
Any suggestions greatly appreciated!

# java -D$DRIVERS -Ddbd.port=9001 -classpath .:/home/dbd/dbd_jdbc.jar:/home/dbd/log4j-1.2.13.jar:/home/dbd/hsqldb-1.8.0.2.jar com.vizdom.dbd.jdbc.Server
Exception in thread "main" java.lang.NoClassDefFoundError: com/vizdom/dbd/jdbc/Server
Caused by: java.lang.ClassNotFoundException: com.vizdom.dbd.jdbc.Server
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
Could not find the main class: com.vizdom.dbd.jdbc.Server. Program will exit.


Rob V.
 
J

Jim Gibson

I am trying to get the DBD::JDBC package working under Cygwin on Windows.
However I am running into what seems to be a Java-related issue.

The JAR file (dbd_jdbc.jar) from CPAN
(http://search.cpan.org/~vizdom/DBD-JDBC-0.71/JDBC.pod) is supposed to
contain a class com.vizdom.dbd.jdbc.Server. Yet when I try to run that as per
the instructions I get an error that this class is not found (see below). It
looks as if this JAR just doesn't contain that class, which would be odd.

Did anyone come across this, and got it working somehow?
Any suggestions greatly appreciated!

# java -D$DRIVERS -Ddbd.port=9001 -classpath
.:/home/dbd/dbd_jdbc.jar:/home/dbd/log4j-1.2.13.jar:/home/dbd/hsqldb-1.8.0.2.j
ar com.vizdom.dbd.jdbc.Server
Exception in thread "main" java.lang.NoClassDefFoundError:
com/vizdom/dbd/jdbc/Server
Caused by: java.lang.ClassNotFoundException: com.vizdom.dbd.jdbc.Server
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
Could not find the main class: com.vizdom.dbd.jdbc.Server. Program will exit.

What does the following produce:

jar tvf /home/dbd/dbd_jdbc.jar | grep com.vizdom.dbd.jdbc.Server.class
 
R

rob

What does the following produce:



jar tvf /home/dbd/dbd_jdbc.jar | grep com.vizdom.dbd.jdbc.Server.class


As you would expect, it show the class being there:

# jar tvf dbd_jdbc.jar | grep com.vizdom.dbd.jdbc.Server.class
5783 Wed Feb 04 17:01:02 CET 2009 com/vizdom/dbd/jdbc/Server.class

Yet somehow I cannot figure out how to get it running. Since Google turns up preciously little I suppose that means others got it working with ease. SO my best guess is I'm overlooking something trivial...

Thanks in advance,

Rob V.
 
R

Rainer Weikusat

I am trying to get the DBD::JDBC package working under Cygwin on Windows.
However I am running into what seems to be a Java-related issue.

The JAR file (dbd_jdbc.jar) from CPAN (http://search.cpan.org/~vizdom/DBD-JDBC-0.71/JDBC.pod) is supposed to contain a class com.vizdom.dbd.jdbc.Server. Yet when I try to run that as per the instructions I get an error that this class is not found (see below). It looks as if this JAR just doesn't contain that class, which would be odd.

Did anyone come across this, and got it working somehow?
Any suggestions greatly appreciated!

# java -D$DRIVERS -Ddbd.port=9001 -classpath .:/home/dbd/dbd_jdbc.jar:/home/dbd/log4j-1.2.13.jar:/home/dbd/hsqldb-1.8.0.2.jar com.vizdom.dbd.jdbc.Server
Exception in thread "main" java.lang.NoClassDefFoundError: com/vizdom/dbd/jdbc/Server
Caused by: java.lang.ClassNotFoundException: com.vizdom.dbd.jdbc.Server
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
Could not find the main class: com.vizdom.dbd.jdbc.Server. Program will exit.

I downloaded the jar file and tried to run it with

java -classpath /tmp/dbd_jdbc.jar com.vizdom.dbd.jdbc.Server

The error I got was

Exception in thread "main" java.lang.NoClassDefFoundError: org.apache.log4j.Logger
at com.vizdom.dbd.jdbc.Server.<clinit>(Server.java:76)
at java.lang.Class.initializeClass(libgcj.so.90)

This means it found the class and aborted because I didn't bother to
get log4j as well.
 
R

rob

I downloaded the jar file and tried to run it with



java -classpath /tmp/dbd_jdbc.jar com.vizdom.dbd.jdbc.Server



The error I got was



Exception in thread "main" java.lang.NoClassDefFoundError: org.apache.log4j.Logger

at com.vizdom.dbd.jdbc.Server.<clinit>(Server.java:76)

at java.lang.Class.initializeClass(libgcj.so.90)



This means it found the class and aborted because I didn't bother to

get log4j as well.


I got that too, but as soon as I include log4j it says it cannot find com.vizdom.dbd.jdbc.Server:

# java -classpath dbd_jdbc.jar:log4j-1.2.13.jar com.vizdom.dbd.jdbc.Server
Error: Could not find or load main class com.vizdom.dbd.jdbc.Server

R.
 
R

Rainer Weikusat

[...]
[...]

I downloaded the jar file and tried to run it with
java -classpath /tmp/dbd_jdbc.jar com.vizdom.dbd.jdbc.Server

The error I got was
[...]

I got that too, but as soon as I include log4j it says it cannot
find com.vizdom.dbd.jdbc.Server:

# java -classpath dbd_jdbc.jar:log4j-1.2.13.jar com.vizdom.dbd.jdbc.Server
Error: Could not find or load main class com.vizdom.dbd.jdbc.Server

I copied a log4j.jar out of a 'random jboss installation'
(6.1.0.Final) and after adding that to classpath (and setting
dbd.port), it started.

NB: This has preciously little relation to perl.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,900
Latest member
Nell636132

Latest Threads

Top