HDF java create attribue

Hi,
I'm using HDF with java using ncsa.hdf.
I tries to write a hdf file with an attribute. I tried to use the following
example:
http://www.hdfgroup.org/ftp/HDF5/hdf-java/src/hdf-java/examples/intro/H5_CreateAttribute.java
I've got an exception:
ncsa.hdf.hdf5lib.exceptions.HDF5LibraryException
ncsa.hdf.hdf5lib.exceptions.HDF5LibraryException
at ncsa.hdf.hdflib.H5._H5Fopen(Native Method)
at ncsa.hdf.hdflib.H5.H5Fopen(H5.java:1295)
at intro.H5_CreateAttribute.main(H5_CreateAttribute.java:106)
HDF5-DIAG: Error detected in hdf HDF5 (1.8.4) thread 0:
#000: ..\..\..\src\H5Edeprec.c line 182 in
H5Eget_minor(): not a error message ID
major: Invalid arguments to routine
minor: Inappropriate type

Why did it happen?
thanks

Which version of hdf-java and the libraries are you using? Also, what is your environment: OS version, compiler, etc.?

Allen

···

Hi,
I'm using HDF with java using ncsa.hdf.
I tries to write a hdf file with an attribute. I tried to use the following
example:
http://www.hdfgroup.org/ftp/HDF5/hdf-java/src/hdf-java/examples/intro/H5_CreateAttribute.java
I've got an exception:
ncsa.hdf.hdf5lib.exceptions.HDF5LibraryException
ncsa.hdf.hdf5lib.exceptions.HDF5LibraryException
at ncsa.hdf.hdflib.H5._H5Fopen(Native Method)
at ncsa.hdf.hdflib.H5.H5Fopen(H5.java:1295)
at intro.H5_CreateAttribute.main(H5_CreateAttribute.java:106)
HDF5-DIAG: Error detected in hdf HDF5 (1.8.4) thread 0:
#000: ..\..\..\src\H5Edeprec.c line 182 in
H5Eget_minor(): not a error message ID
major: Invalid arguments to routine
minor: Inappropriate type

Why did it happen?
thanks

Please check which version of APIs you are using: check libhdf5.settings file that is in the <HDF5_INSTALL>/lib directory, section "Features", Default API Mapping line. If it is v18, then you need to use

-DH5_USE_16_API flag with your compiler when you build JNI library, i.e,.
CC="gcc -DH5_USE_16_API"
export CC
./configure .....

Elena

···

On Mar 2, 2010, at 8:08 AM, Allen D Byrne wrote:

Which version of hdf-java and the libraries are you using? Also, what is your environment: OS version, compiler, etc.?

Allen

Hi,
I'm using HDF with java using ncsa.hdf.
I tries to write a hdf file with an attribute. I tried to use the following
example:
http://www.hdfgroup.org/ftp/HDF5/hdf-java/src/hdf-java/examples/intro/H5_CreateAttribute.java
I've got an exception:
ncsa.hdf.hdf5lib.exceptions.HDF5LibraryException
ncsa.hdf.hdf5lib.exceptions.HDF5LibraryException
at ncsa.hdf.hdflib.H5._H5Fopen(Native Method)
at ncsa.hdf.hdflib.H5.H5Fopen(H5.java:1295)
at intro.H5_CreateAttribute.main(H5_CreateAttribute.java:106)
HDF5-DIAG: Error detected in hdf HDF5 (1.8.4) thread 0:
#000: ..\..\..\src\H5Edeprec.c line 182 in
H5Eget_minor(): not a error message ID
major: Invalid arguments to routine
minor: Inappropriate type

Why did it happen?
thanks

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

HDF JAVA version - 2.6.
API HDF version 1.8.4
OS: Win Xp Pro Sp2
Java: 1.6.1
Elena, I downloaded the (binaries) dll, so I don't have GCC (i didn't build
the JNI).

···

On Wed, Mar 3, 2010 at 1:42 AM, Elena Pourmal <epourmal@hdfgroup.org> wrote:

Please check which version of APIs you are using: check libhdf5.settings
file that is in the <HDF5_INSTALL>/lib directory, section "Features",
Default API Mapping line. If it is v18, then you need to use

-DH5_USE_16_API flag with your compiler when you build JNI library, i.e,.
CC="gcc -DH5_USE_16_API"
export CC
./configure .....

Elena
On Mar 2, 2010, at 8:08 AM, Allen D Byrne wrote:

> Which version of hdf-java and the libraries are you using? Also, what is
your environment: OS version, compiler, etc.?
>
> Allen
>
>> Hi,
>> I'm using HDF with java using ncsa.hdf.
>> I tries to write a hdf file with an attribute. I tried to use the
following
>> example:
>>
http://www.hdfgroup.org/ftp/HDF5/hdf-java/src/hdf-java/examples/intro/H5_CreateAttribute.java
>> I've got an exception:
>> ncsa.hdf.hdf5lib.exceptions.HDF5LibraryException
>> ncsa.hdf.hdf5lib.exceptions.HDF5LibraryException
>> at ncsa.hdf.hdflib.H5._H5Fopen(Native Method)
>> at ncsa.hdf.hdflib.H5.H5Fopen(H5.java:1295)
>> at intro.H5_CreateAttribute.main(H5_CreateAttribute.java:106)
>> HDF5-DIAG: Error detected in hdf HDF5 (1.8.4) thread 0:
>> #000: ..\..\..\src\H5Edeprec.c line 182 in
>> H5Eget_minor(): not a error message ID
>> major: Invalid arguments to routine
>> minor: Inappropriate type
>>
>> Why did it happen?
>> thanks
>>
>
> _______________________________________________
> Hdf-forum is for HDF software users discussion.
> Hdf-forum@hdfgroup.org
> http://mail.hdfgroup.org/mailman/listinfo/hdf-forum_hdfgroup.org

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

Hello,

I've observed similar error messages when using hdf5dll.dll from two modules in the same application, one based on the Java wrapper functions of jhdf5.dll and the other using the HDF5 C API directly. The Java wrappers are compiled with the flag for 1.6 API whereas the C API is accessed using 1.8 API, so an API version conflict is a plausible explanation. In my case, there is an additional possibility of conflict in that the wrappers were taken from version 1.8.4 whereas the underlying hdf5dll.dll is still of version 1.8.2.

The downloadable jhdf5.dll is a little different from the source code version because it contains the functionality of hdf5dll.dll in itself (no additional DLL needed) so with that you can't have a version conflict of the latter type.

The HDF5 documentation that I found told me that the flag determines macro mappings for cases like H5Dcreate that is mapped to either H5Dcreate1 or H5Dcreate2 but I'm interested to hear what else can be said about the effects of the API version selection flags.
    I tried to find from the source code what could have caused these "not a error message ID" errors but it didn't seem straightforward. For what it's worth, I learned that the deprecated function H5get_minor gives the error message after its call to H5Iobject_verify which invoked H5I_object_verify in which the significant lines seem to be (in H5I.c, around line number 1030):
    if(id_type == H5I_TYPE(id) && NULL != (id_ptr = H5I_find_id(id))) {
        /* Get the object pointer to return */
        ret_value = id_ptr->obj_ptr;
    } /* end if */
And there, either the condition fails or a NULL pointer comes from id_ptr->obj_ptr .

Anyway, I know the library is not tested for use by two API versions at the same time (yet synchronized) although I could not find anything that would obviously go awry in such use.

Best Regards,
  Vesa Paatero

=== Original messages follow ===

···

Date: Tue, 2 Mar 2010 17:42:49 -0600
From: Elena Pourmal <epourmal@hdfgroup.org>
To: Mailing list for users to discuss HDF issues with each other
        <hdf-forum@hdfgroup.org>
Subject: Re: [Hdf-forum] HDF java create attribue
Message-ID: <04BAA83C-EE8D-45EE-BDE2-53903EB0C0AE@hdfgroup.org>
Content-Type: text/plain; charset=us-ascii

Please check which version of APIs you are using: check libhdf5.settings file that is in the <HDF5_INSTALL>/lib directory, section "Features", Default API Mapping line. If it is v18, then you need to use

-DH5_USE_16_API flag with your compiler when you build JNI library, i.e,.
CC="gcc -DH5_USE_16_API"
export CC
./configure .....

Elena
On Mar 2, 2010, at 8:08 AM, Allen D Byrne wrote:

Which version of hdf-java and the libraries are you using? Also, what is your environment: OS version, compiler, etc.?

Allen

Hi,
I'm using HDF with java using ncsa.hdf.
I tries to write a hdf file with an attribute. I tried to use the following
example:
http://www.hdfgroup.org/ftp/HDF5/hdf-java/src/hdf-java/examples/intro/H5_CreateAttribute.java
I've got an exception:
ncsa.hdf.hdf5lib.exceptions.HDF5LibraryException
ncsa.hdf.hdf5lib.exceptions.HDF5LibraryException
at ncsa.hdf.hdflib.H5._H5Fopen(Native Method)
at ncsa.hdf.hdflib.H5.H5Fopen(H5.java:1295)
at intro.H5_CreateAttribute.main(H5_CreateAttribute.java:106)
HDF5-DIAG: Error detected in hdf HDF5 (1.8.4) thread 0:
#000: ..\..\..\src\H5Edeprec.c line 182 in
H5Eget_minor(): not a error message ID
major: Invalid arguments to routine
minor: Inappropriate type

Why did it happen?
thanks

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