This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 214431 - MIDlet deployment from NetBeans IDE to Nokia phones doesn't work in 64bit Windows 7
Summary: MIDlet deployment from NetBeans IDE to Nokia phones doesn't work in 64bit Win...
Status: RESOLVED FIXED
Alias: None
Product: javame
Classification: Unclassified
Component: -- Other -- (show other bugs)
Version: 7.1.2
Hardware: PC Windows 7 x64
: P3 normal with 1 vote (vote)
Assignee: Roman Svitanic
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-06-19 10:26 UTC by jarmlaht
Modified: 2013-07-04 02:21 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Nokia deployment module with fix for x64 OS (54.76 KB, application/octet-stream)
2013-06-14 14:52 UTC, Roman Svitanic
Details
ConnAPI64.lib for linking (35.31 KB, application/octet-stream)
2013-07-02 10:16 UTC, t_gergely
Details
ConnJNI64.dll dynamically linked with VC++ 2010 (15.00 KB, application/octet-stream)
2013-07-02 10:21 UTC, t_gergely
Details

Note You need to log in before you can comment on or make changes to this bug.
Description jarmlaht 2012-06-19 10:26:38 UTC
It has been possible earlier to deploy MIDlet from NetBeans IDE to Nokia phones. NetBeans has been using Nokia PC Suite(currently Nokia Suite) and its connectivity features for the deployment. Now it seems, that the deployment fails, if Windows 7 64bit OS is used. In project details -> "Deploying" -> "Manage Deployment" is shown: "Nokia PC Suite not installed. Please see http://www.nokia.com/pcsuite for details". If deployment is tried, the following error message is shown in the output view: "Deployment aborted, ConnAPI.dll not found."

I got the following information from the Nokia R&D guys working with Nokia Suite: "It is not possible to load a 32-bit dll from a 64-bit process and execute its code (without some special handling e.g., IPC mechanism). By using correct 64-bit PCCS ConnAPI loader library it should be able to load correctly 64-bit ConnAPI (ConnAPI64.dll) for a 64-bit process. In 64-bit windows  Netbeans.exe is running in 32 bit mode but it is using 64-bit javaw.exe (child process) to load ConnAPI. According to the Process monitor trace ,it seems in 64-bit they are trying to load 32-bit ConnAPI.dll. I think they haven't used ConnAPI loader library, instead they are probably using LoadLibrary/LoadLibraryEx or similar java API( Trace shows that Windows trying to locate ConnAPI.dll by searching in DLL Search order). 

I think they need to review how they are loading ConnAPI.dll. There could be two possible approaches which comes to my mind that they should try 
1. Use correct ConnAPI loader library (32/64 bit) with Netbeans depending on their target platform.
2. If they still want to use LoadLibrary/LoadLibraryEx kind of API, they should use "ConnAPI64.dll" for 64-bit  instead of "ConnAPI.dll". 

Furthermore, the error message instruction shown in deployment settings in Netbeans IDE in 64-bit does not reflect  the real issue ( it shows pc suite is not installed even if I have it installed)."
Comment 1 jarmlaht 2012-06-19 10:38:20 UTC
I have now the following JDK installed:
java version "1.7.0_04"
Java(TM) SE Runtime Environment (build 1.7.0_04-b22)
Java HotSpot(TM) 64-Bit Server VM (build 23.0-b21, mixed mode)

Originally I had jre6 (java version "1.6.0_26") on my PC. I think deployment worked with the combination Windows7 64bit and jre6 32bit.
Comment 2 alexander.burdukov 2012-06-19 13:40:48 UTC
Clear component field - it does not relate to ME SDK integration
Comment 3 David Strupl 2012-06-21 15:07:17 UTC
I order to fix this (to compile 64 bit version of our .dll) I would need header files

#include "Connapi.h"
#include "CONAApplicationInstallation.h"
#include "CONAFileSystem.h"

Any idea from where I can get them?

Thanks,

David
Comment 4 David Strupl 2012-09-14 06:47:14 UTC
Without a cooperation I am not able to fix this. Closing as wontfix. If the reporter or someone else provides the needed info, please reopen. Thanks for understanding.
Comment 5 t_gergely 2013-05-28 13:20:54 UTC
(In reply to comment #3)
> I order to fix this (to compile 64 bit version of our .dll) I would need header
> files
> 
> #include "Connapi.h"
> #include "CONAApplicationInstallation.h"
> #include "CONAFileSystem.h"
> 
> Any idea from where I can get them?
> 
> Thanks,
> 
> David


Please download Nokia_PC_Connectivity_API_3.2.zip from http://www.developer.nokia.com/info/sw.nokia.com/id/bd896b31-92ba-4624-aa9d-ebf732e7cc0d/Nokia_PC_Suite_Connectivity_API_1_1.html
Comment 6 David Strupl 2013-06-13 09:39:44 UTC
Roman, can you please have a look at this? Thanks.
Comment 7 Roman Svitanic 2013-06-13 16:15:06 UTC
jarmlaht or t_gergely:
Can you please provide 64bit DLL? You can find sources to build here: http://hg.netbeans.org/jet-main/file/505ff33fe2a0/mobility.deployment.nokia/lib

Then we can integrate this DLL into module and based on OS architecture load it.
Thanks.
Comment 8 t_gergely 2013-06-13 17:20:50 UTC
(In reply to comment #7)
> jarmlaht or t_gergely:
> Can you please provide 64bit DLL? You can find sources to build here:
> http://hg.netbeans.org/jet-main/file/505ff33fe2a0/mobility.deployment.nokia/lib
> 
> Then we can integrate this DLL into module and based on OS architecture load
> it.
> Thanks.

You mean ConnJNI.dll? Maybe I could. But why would anyone trust the DLL I build?
Comment 9 David Strupl 2013-06-13 17:35:39 UTC
And you could you trust a dll that I build? Taking into account that you most probably will be almost the only  person using that dll you are the correct person to build it ;-)
Comment 10 t_gergely 2013-06-14 14:20:28 UTC
(In reply to comment #9)
> And you could you trust a dll that I build?

I could. I pretend to be security conscious, but I know IT security is mostly an illusion.

Alas, I just realized that I don't have a 64 bit SDK installed, and local policy doesn't allow me to install it, so if you don't compile it, it will take some time for me to have the tools installed.

Does anybody have connapi64.lib, or do we have to hack it from the dll?
Comment 11 t_gergely 2013-06-14 14:23:35 UTC
> Please download Nokia_PC_Connectivity_API_3.2.zip from
> http://www.developer.nokia.com/info/sw.nokia.com/id/bd896b31-92ba-4624-aa9d-ebf732e7cc0d/Nokia_PC_Suite_Connectivity_API_1_1.html

Oops, I must have meant PC_Suite_Connectivity_API_1.1.zip, not Nokia_PC_Connectivity_API_3.2.zip.
Comment 12 Roman Svitanic 2013-06-14 14:50:46 UTC
Thanks, if you will have x64 DLL compiled, please attach it here. Then I'll place it to the libs of Nokia deployment module.

For testing purposes you can copy your DLL to "{NetBeans_DIR}\mobility\modules\lib" as ConnJNI64.dll. Then backup and overwrite original JAR in "{NetBeans_DIR}\mobility\modules" with one from attachment. It should load x64 version of ConnAPI and ConnJNI on x64 Windows.
Comment 13 Roman Svitanic 2013-06-14 14:52:15 UTC
Created attachment 135806 [details]
Nokia deployment module with fix for x64 OS
Comment 14 t_gergely 2013-07-02 10:16:55 UTC
Created attachment 136580 [details]
ConnAPI64.lib for linking
Comment 15 t_gergely 2013-07-02 10:21:08 UTC
Created attachment 136581 [details]
ConnJNI64.dll dynamically linked with VC++ 2010

I've build ConnJNI64.dll. It works for me with the attached org-netbeans-modules-mobility-deployment-nokia.jar. Thanks.
Comment 16 Roman Svitanic 2013-07-03 08:01:27 UTC
fixed in jet-main:
http://hg.netbeans.org/jet-main/rev/3b6d112d73b4

Thanks t_gergely for ConnAPI64.dll
Comment 17 Quality Engineering 2013-07-04 02:21:42 UTC
Integrated into 'main-silver', will be available in build *201307032300* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/3b6d112d73b4
User: Roman Svitanic <rsvitanic@netbeans.org>
Log: #214431 - MIDlet deployment from NetBeans IDE to Nokia phones doesn't work in 64bit Windows 7