Maybe need to be in a static scope to get it to happen earlier than the H5 one

example from a linux case I was debugging

..............
        static
        {
            try {
                //System.loadLibrary("jqb");
//System.load(System.getProperty("QB_HOME")+"/lib/libjqb.so"); //System.load("/home/roger/NetBeansProjects/jhdf5hl/dist/libjhdf5hl.so"); //System.load("/home/roger/Software/hdf5-1.8.5/dist/lib/libhdf5_hl.so"); //System.load("/home/roger/Software/hdf5-1.8.5/dist/lib/libhdf5.so"); //System.load("/home/roger/Software/openmpi-1.4.3/dist/lib/libmpi.so"); //System.load("/home/roger/Software/openmpi-1.4.3/dist/lib/libmpi_cxx.so");
                //System.loadLibrary("mpi");
                System.loadLibrary("open-rte");
                System.loadLibrary("open-pal");
                System.loadLibrary("mpi");
                System.loadLibrary("hdf5");
                System.loadLibrary("hdf5_hl");
                System.loadLibrary("jhdf5");
                //System.loadLibrary("mpi_cxx");
                H5.H5open();
                //H5.
            } catch (UnsatisfiedLinkError e) {
System.err.println("Native code library failed to load. Unsatisfied Link Error\n" + e);
            } catch (Exception e) {
System.err.println("Native code library failed to load. \n" + e);
            }
        int plist = HDF5Constants.H5P_DEFAULT;
        int[] version_info = new int[4];
        try {
            H5.H5Pget_version(plist,version_info);
        } catch (Exception ex) {
        }
        }
..............

where I open the commented System.load's to test

On 05/14/2013 09:52 AM, Marko Kurm wrote:
I'm trying to open/read an existing HDF5 file using the Java library. I have the "jhdf.dll" and "jhdf5.dll" files on the system path. The code I have in my main method is taken from the HDF samples, and looks like this:

H5File h5file = new H5File("C:\\dev\\workspaces\\hdf5\\hdf5\\src\\main\\java\\com\\vaisala\\hdf5\\hdf5_test.h5", HDF5Constants.H5F_ACC_RDONLY);

        try
        {
            // open file and retrieve the file structure
            h5file.open();
        }
        catch (Exception ex)
        {
            System.out.println(ex);
        }

When I run it, it throws the following exception:

Exception in thread "main" java.lang.UnsatisfiedLinkError: ncsa.hdf.hdf5lib.H5.H5Gget_obj_info_all(ILjava/lang/String;[Ljava/lang/String;[I[JI)I
at ncsa.hdf.hdf5lib.H5.H5Gget_obj_info_all(Native Method)
at ncsa.hdf.hdf5lib.H5.H5Gget_obj_info_all(H5.java:4588)
at ncsa.hdf.object.h5.H5File.depth_first(H5File.java:1617)
at ncsa.hdf.object.h5.H5File.loadTree(H5File.java:1554)
at ncsa.hdf.object.h5.H5File.open(H5File.java:1520)
at ncsa.hdf.object.h5.H5File.open(H5File.java:1464)
at ncsa.hdf.object.h5.H5File.open(H5File.java:825)
at com.vaisala.hdf5.TestH5File.main(TestH5File.java:24)

Any ideas what could be wrong?

Marko Kurm


_______________________________________________
Hdf-forum is for HDF software users discussion.
[email protected]
http://mail.hdfgroup.org/mailman/listinfo/hdf-forum_hdfgroup.org

_______________________________________________
Hdf-forum is for HDF software users discussion.
[email protected]
http://mail.hdfgroup.org/mailman/listinfo/hdf-forum_hdfgroup.org

Reply via email to