JDK-7053559 : REGRESSION:JNI wrapper broken in 6u26 on Windows 7
  • Type: Bug
  • Component: client-libs
  • Sub-Component: java.awt
  • Affected Version: 6u26
  • Priority: P2
  • Status: Closed
  • Resolution: Duplicate
  • OS: windows_7
  • CPU: x86
  • Submitted: 2011-06-10
  • Updated: 2011-07-19
  • Resolved: 2011-07-19
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 6
6u27Resolved
Related Reports
Duplicate :  
Description
J2SE Version (please include all output from java -version flag):
java version "1.6.0_26"

Does this problem occur on J2SE 1.4.x, 1.5 or 6?  Yes / No (pick one)
No, worked fine with 6u25.


Operating System Configuration Information (be specific):
Windows 7 32 bit. Windows XP works ok


Hardware Configuration Information (be specific):
Tested on i386

Bug Description:
 the latest official JDK/JRE (1.6.0_26) has broken something really basic with jni. 
 It shows at least on Windows 7 32 bit. Windows XP works ok.

 What happens for end users is that the "Add images" button inside our desktop
 software jAlbum (http://jalbum.net/software) 
 no longer works. Nothing happens. This is almost the most important button in the
 whole program, 
so for us, this bug is VERY severe. I've traced it down to the
 following JNI call:

  public native byte[][] getFiles2(); 

That call belongs to net.tomahawk.XFileDialog, a Java JNI wrapper for Windows native
file dialog. 
We use this wrapper so our users can select multiple images and see
thumbnails as they do multiple 
image selection from their file system. The Swing
alternative is too outdated and doesn't blend 
with the Windows 7 experience, so 
we're forced to use this workaround. Now it doesn't work anymore 
and we get no 
error at all from this call. When it works, it should pop up the Windows file 
dialog, 
but now nothing happens. I can add that the maker of this wrapper has
abandoned it so we can't 
get any support from him.

What jni related changes have been introduced in 1.6.0_26 that may cause this? 
It worked fine on earlier versions.

Appreciate a quick response to this, cause at the moment, this bug hurts our
business a lot!


Simply download jAlbum(http://jalbum.net/software) on Windows 7 and press the "Add" button to confirm the problem.
Attached x.filedialog.jar and .dll test library files.

Here is also a code snippet for how interact with this API, 
that should trigger the problem:

import net.tomahawk.XFileDialog;
...
XFileDialog dlg=new XFileDialog((Frame)parent);
dlg.setThumbnail(true); 
dlg.setTitle("Add images");
dlg.setDirectory(currentDir.getAbsolutePath());
String[] filenames = dlg.getFiles(); // Returns without opening dialog. Should normally open a modal dialog and wait for user response
Closed as Duplicate of 7056092. Updated the RE / RM to that of 7056092.

Comments
EVALUATION I have verified that the problem is not reproducible on Windows 7 with jdk 7 build 147. I verified also that the problem is still reproducible with jdk 6 update 28. The fixes for library loading are in jdk 7 build 147. So it seems they should not be a cause of the problem. This is still a 7-na issue.
08-07-2011

EVALUATION As far as the problem is 7-na I am transferring the issue to the sustaining team. What I have done. 1.I have reproduced the problem on Windows 7. 2.I built the xfiledialog library. For this you need Visual Studio Professional (because MFC usage). 3.I found that the xfiledialog library is loaded and executed successfully. 4.I built xfiledialog in debug mode What could be done 1.Investigate using dependency walker which dependencies are missed for xfiledialog 2.Investigate the output from the library linked with debug version of MFC 3.Remove the change dedicated to library loading in jdk to check that the problem is related to the change I noticed that dependency walker utility cannot resolve some dependencies on Windows 7 for xfiledialog.dll I found that jawt is used from the xfiledialog.dll. It seens that jawt is loaded successfully. At least we can obtain HWND of java frame.
30-06-2011

EVALUATION This problem does not seem related to AWT. As it is not a jni problem the submitter should ask the autor of x.filedialog.jar library to find the issue.
17-06-2011