Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   Perl Misc (http://www.velocityreviews.com/forums/f67-perl-misc.html)
-   -   Cannot get DBD::JDBC working -- any suggestions? (http://www.velocityreviews.com/forums/t958039-cannot-get-dbd-jdbc-working-any-suggestions.html)

rob@sypron.nl 02-25-2013 11:28 AM

Cannot get DBD::JDBC working -- any suggestions?
 
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.

Jim Gibson 02-25-2013 06:14 PM

Re: Cannot get DBD::JDBC working -- any suggestions?
 
In article <eea51f76-b725-4e5e-8835-031bea007b2d@googlegroups.com>,
<rob@sypron.nl> wrote:

> 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

--
Jim Gibson

rob@sypron.nl 02-25-2013 06:51 PM

Re: Cannot get DBD::JDBC working -- any suggestions?
 
On Monday, February 25, 2013 7:14:26 PM UTC+1, Jim Gibson wrote:
> In article <eea51f76-b725-4e5e-8835-031bea007b2d@googlegroups.com>,
>
> <rob@sypron.nl> wrote:
>
>
>
> > 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
>
>
>
> --
>
> Jim Gibson



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.

Rainer Weikusat 02-25-2013 07:45 PM

Re: Cannot get DBD::JDBC working -- any suggestions?
 
rob@sypron.nl writes:
> 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.

rob@sypron.nl 02-25-2013 08:20 PM

Re: Cannot get DBD::JDBC working -- any suggestions?
 
On Monday, February 25, 2013 8:45:44 PM UTC+1, Rainer Weikusat wrote:
> rob@sypron.nl writes:
>
> > 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.



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.

Rainer Weikusat 02-25-2013 08:59 PM

Re: Cannot get DBD::JDBC working -- any suggestions?
 
rob@sypron.nl writes:
> On Monday, February 25, 2013 8:45:44 PM UTC+1, Rainer Weikusat wrote:
>> rob@sypron.nl writes:
>> > I am trying to get the DBD::JDBC package working under Cygwin on Windows.


[...]

>> > # 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


[...]


>> 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.


All times are GMT. The time now is 07:15 AM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.