ClassNotFoundException when loading under GCJ on Solaris 
Author Message
 ClassNotFoundException when loading under GCJ on Solaris

I've been using the gnu compiler for java with success.

I got to the point of interfacing with a database
but ran into this snag.

When trying to load the JDBC driver for informix on Solaris,
Class.forName throws ClassNotFoundException

I realized it behaves similarly for any files.

Classpath is set properly and the same code
works fine using java bytecode via Sun's JVM
instead of native compiled via gcj 3.1.

Also, the same code works fine via JVM
as well as native compile via gcj 3.1 under Linux.

I suspect the iconv/locale business but I'm otherwise clueless.

Any ideas?

#############
uname -a
SunOS IMETSf76f7 5.7 Generic_106541-16 sun4u sparc SUNW,Ultra-2

############
try{
    Class.forName( "com.informix.jdbc.IfxDriver" );
    System.out.println( "Loaded postgress driver!" );

Quote:
}

catch(java.lang.ClassNotFoundException e){
    System.err.print("ClassNotFoundException: ");
    System.err.println(e.getMessage());
    System.exit(0);

Quote:
}

yields :

        ClassNotFoundException: com.informix.jdbc.IfxDriver

#############
ldd on Sun Box where it fails yields:

        libgcc_s.so.1 =>         /opt/gcc/lib//libgcc_s.so.1
        libgcj.so.3 =>   /opt/gcc/lib//libgcj.so.3
        libiconv.so.2 =>         /lib/libiconv.so.2
        libpthread.so.1 =>       /lib/libpthread.so.1
        librt.so.1 =>    /lib/librt.so.1
        libsocket.so.1 =>        /lib/libsocket.so.1
        libnsl.so.1 =>   /lib/libnsl.so.1
        libdl.so.1 =>    /lib/libdl.so.1
        libc.so.1 =>     /lib/libc.so.1
        libaio.so.1 =>   /lib/libaio.so.1
        libmp.so.2 =>    /lib/libmp.so.2
        libthread.so.1 =>        /lib/libthread.so.1
        /usr/platform/SUNW,Ultra-2/lib/libc_psr.so.1

ldd on Linux Box where it succeeds yields:

        libgcc_s.so.1 => /usr/lib/libgcc_s.so.1 (0x40028000)
        libgcj.so.3 => /usr/lib/libgcj.so.3 (0x40031000)
        libm.so.6 => /lib/i686/libm.so.6 (0x405ba000)
        libdl.so.2 => /lib/libdl.so.2 (0x405dc000)
        libc.so.6 => /lib/i686/libc.so.6 (0x42000000)
        /lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x40000000)



Tue, 28 Dec 2004 01:38:03 GMT
 ClassNotFoundException when loading under GCJ on Solaris

        Whoops.

        Now I read where the byte code interpreter for
        GCJ is only available for Linux, which explains my situation.

        Does anyone know of the schedule for implementing
        the byte code interpreter for other platforms
        (such as Solaris) in gcj?

        Otherwise I'm off to native compile the
        JDBC drivers.

        Steve.

Quote:

> I've been using the gnu compiler for java with success.

> I got to the point of interfacing with a database
> but ran into this snag.

> When trying to load the JDBC driver for informix on Solaris,
> Class.forName throws ClassNotFoundException

> I realized it behaves similarly for any files.

> Classpath is set properly and the same code
> works fine using java bytecode via Sun's JVM
> instead of native compiled via gcj 3.1.

> Also, the same code works fine via JVM
> as well as native compile via gcj 3.1 under Linux.

> I suspect the iconv/locale business but I'm otherwise clueless.

> Any ideas?

> #############
> uname -a
> SunOS IMETSf76f7 5.7 Generic_106541-16 sun4u sparc SUNW,Ultra-2

> ############
> try{
>     Class.forName( "com.informix.jdbc.IfxDriver" );
>     System.out.println( "Loaded postgress driver!" );
> }
> catch(java.lang.ClassNotFoundException e){
>     System.err.print("ClassNotFoundException: ");
>     System.err.println(e.getMessage());
>     System.exit(0);
> }

> yields :

>    ClassNotFoundException: com.informix.jdbc.IfxDriver

> #############
> ldd on Sun Box where it fails yields:

>         libgcc_s.so.1 =>         /opt/gcc/lib//libgcc_s.so.1
>         libgcj.so.3 =>   /opt/gcc/lib//libgcj.so.3
>         libiconv.so.2 =>         /lib/libiconv.so.2
>         libpthread.so.1 =>       /lib/libpthread.so.1
>         librt.so.1 =>    /lib/librt.so.1
>         libsocket.so.1 =>        /lib/libsocket.so.1
>         libnsl.so.1 =>   /lib/libnsl.so.1
>         libdl.so.1 =>    /lib/libdl.so.1
>         libc.so.1 =>     /lib/libc.so.1
>         libaio.so.1 =>   /lib/libaio.so.1
>         libmp.so.2 =>    /lib/libmp.so.2
>         libthread.so.1 =>        /lib/libthread.so.1
>         /usr/platform/SUNW,Ultra-2/lib/libc_psr.so.1

> ldd on Linux Box where it succeeds yields:

>    libgcc_s.so.1 => /usr/lib/libgcc_s.so.1 (0x40028000)
>    libgcj.so.3 => /usr/lib/libgcj.so.3 (0x40031000)
>    libm.so.6 => /lib/i686/libm.so.6 (0x405ba000)
>    libdl.so.2 => /lib/libdl.so.2 (0x405dc000)
>    libc.so.6 => /lib/i686/libc.so.6 (0x42000000)
>    /lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x40000000)



Tue, 28 Dec 2004 03:22:00 GMT
 
 [ 2 post ] 

 Relevant Pages 

1. gcj - stack dump loading Informix JDBC

2. Dump and load from Solaris on Sparc to Solaris on Intel

3. PG functions in Java: maybe use gcj?

4. MySQL and GCJ

5. Multiple dumps to tape on Solaris: load only 1st

6. Load dump from Solaris on NT

7. We loaded an HP/Sys10 on a Solaris/Sys11

8. Loading Solaris 1192 dump into Linux 1192

9. Sybase to Oracle [connectivity PLUS Data load] on Solaris

10. Problems loading 7.3.3 to Solaris 2.6

11. ClassNotFoundException is thrown in applet

12. java.sql.Clob ClassNotFoundException


 
Powered by phpBB® Forum Software