pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Antony Paul <antonypaul24@gmail.com>
To: java unix <javaunix123@gmail.com>
Cc: PostgreSQL JDBC <pgsql-jdbc@postgresql.org>
Subject: Re: problem while running simple java program
Date: Mon, 14 Mar 2005 14:05:59 +0530
Message-ID: <2989532e050314003572de64eb@mail.gmail.com> (raw)
In-Reply-To: <534957390503140027124dc439@mail.gmail.com>
References: <534957390503140027124dc439@mail.gmail.com>

it seems that you are using GNU Java installed in your system(libgcj).
You can test this by giving full path to Sun java compiler instead of
java.


On Mon, 14 Mar 2005 00:27:57 -0800, java unix <javaunix123@gmail.com> wrote:
> hi,
> 
>  when i run a simple program as given below
> 
> import java.sql.*;
> 
> class PostgreSQLTest {
> 
> public static void main (String[] args) {
> 
> try{
> 
> Class.forName("org.postgresql.Driver");
> 
> Connection con =
> DriverManager.getConnection("jdbc:postgresql://localhost:5432/test","postgres","roopesh");
> 
> Statement stmt = con.createStatement();
> 
> ResultSet rs = stmt.executeQuery("select col1 from test");
> 
> while(rs.next())
> 
> {
> 
> System.out.println(rs.getString(1)+"<br>");
> 
> }
> 
> }catch(Exception e){
> 
> System.out.println(e);
> 
> }
> 
> }
> 
> }
> 
> when i run it i am getting the following errors
> 
> [root@roopesh root]# java PostgreSQLTest
> Exception in thread "main" java.lang.InternalError:
> unexpected exception during
> linking: java.lang.ClassNotFoundException:
> javax.net.ssl.SSLSocket
>    at 0x40268e17:
> java.lang.Throwable.Throwable(java.lang.String)
> (/usr/lib/./li
> bgcj.so.3)
>    at 0x4025bc8e:
> java.lang.Error.Error(java.lang.String)
> (/usr/lib/./libgcj.so.
> 3)
>    at 0x402691fa:
> java.lang.VirtualMachineError.VirtualMachineError(java.lang.St
> ring) (/usr/lib/./libgcj.so.3)
>    at 0x4025d62e:
> java.lang.InternalError.InternalError(java.lang.String)
> (/usr/
> lib/./libgcj.so.3)
>    at 0x4025ad82:
> java.lang.ClassLoader.resolveClass0(java.lang.Class)
> (/usr/lib
> /./libgcj.so.3)
>    at 0x4024646c: java.lang.Class.initializeClass()
> (/usr/lib/./libgcj.so.3)
>    at 0x40244d04:
> java.lang.Class.forName(java.lang.String, boolean,
> java.lang.C
> lassLoader) (/usr/lib/./libgcj.so.3)
>    at 0x40244d9f:
> java.lang.Class.forName(java.lang.String)
> (/usr/lib/./libgcj.s
> o.3)
>    at 0x403831e7: ffi_call_SYSV
> (/usr/lib/./libgcj.so.3)
>    at 0x403831a7: ffi_raw_call
> (/usr/lib/./libgcj.so.3)
>    at 0x402306e8:
> _Jv_InterpMethod.continue1(_Jv_InterpMethodInvocation)
> (/usr/l
> ib/./libgcj.so.3)
>    at 0x40230ff4: _Jv_InterpMethod.run(ffi_cif, void,
> ffi_raw, _Jv_InterpMethodI
> nvocation) (/usr/lib/./libgcj.so.3)
>    at 0x4022e504: _Jv_InterpMethod.run_normal(ffi_cif,
> void, ffi_raw, void) (/us
> r/lib/./libgcj.so.3)
>    at 0x4038305c: ?? (??:0)
>    at 0x40242dd8:
> gnu.gcj.runtime.FirstThread.call_main()
> (/usr/lib/./libgcj.so.
> 3)
>    at 0x402ad02d: gnu.gcj.runtime.FirstThread.run()
> (/usr/lib/./libgcj.so.3)
>    at 0x4024fc4c: _Jv_ThreadRun(java.lang.Thread)
> (/usr/lib/./libgcj.so.3)
>    at 0x4021c8ac: _Jv_RunMain(java.lang.Class, byte
> const, int, byte const, bool
> ean) (/usr/lib/./libgcj.so.3)
>    at 0x08048910: ?? (??:0)
>    at 0x42015574: __libc_start_main
> (/lib/tls/libc.so.6)
>    at 0x080486c1: ?? (??:0)
> 
> the classpath set is as follows
> 
> [root@roopesh root]# echo $CLASSPATH
> /usr/java/j2sdk1.4.2_07/lib/tools.jar:/usr/java/j2sdk1.4.2_07/jre/lib/rt.jar:/us
> r/local/pgsql/pg74.215.jdbc3.jar:/usr/local/pgsql/pg74:/usr/local/pgsql/pg74/org
> /postgresql:/usr/local/pgsql
> 
> i donot know what is the problem
> 
> thank you
> 
> ---------------------------(end of broadcast)---------------------------
> TIP 6: Have you searched our list archives?
> 
>                http://archives.postgresql.org
> 


-- 
rgds
Antony Paul
http://www.geocities.com/antonypaul24/



view thread (3+ messages)  latest in thread

Message-ID: <2989532e050314003572de64eb@mail.gmail.com>
Permalink:  ../2989532e050314003572de64eb@mail.gmail.com/
Also on:    postgresql.org/message-id/2989532e050314003572de64eb@mail.gmail.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-jdbc@postgresql.org
  Cc: antonypaul24@gmail.com, javaunix123@gmail.com
  Subject: Re: problem while running simple java program
  In-Reply-To: <2989532e050314003572de64eb@mail.gmail.com>
  References: <534957390503140027124dc439@mail.gmail.com> <2989532e050314003572de64eb@mail.gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox