Enabling JPDA

To enable JPDA for Unwired Platform debugging, the Unwired Server needs to be started in JPDA mode.

This task describes how to setup JPDA and attache the Java standard debugger to Unwired Server.

Alternatively, you can enable Eclipse debugging in Unwired WorkSpace by first setting up a project and switching to the Debug perspective. Within the filter source code, set breakpoints from the context menu in the default Java editor. Then, with the breakpoints in place, a debugging session can be created. When this is completed, double-click the remote Java application of the Debug Configurations wizard and configure the connection type as:
  • use a standard connection (Socket Attach)
  • use host 0.0.0.0
  • set the the port to matches the one enabled in Unwired Server (by default 5005)
  1. Change to the <UnwiredPlatform_InstallDir>\Servers\UnwiredServer\bin.
  2. By default JPDA connects over port 5005. Change the port by running djc-setenv.bat from the same folder and issuing this command:
    set DJC_JPDA_PORT=5005
  3. Start Unwired Server in JPDA mode . How to do this varies, depending on whether or not Unwired Server is installed as a service:
    • If Unwired Server is not a service, run:
      start-unwired-server.bat -jpda 
    • If Unwired Server is installed as a Windows service:
      1. Remove the service:
        sup-server-service.bat remove
      2. Recreate the service to run in JPDA mode:
        sup-server-service.bat install -jpda
  4. Once Unwired Server is restarted, verify that JPDA mode is working by running:
    netstat -an | grep 5005
    Look for these results:
    TCP  0.0.0.0:<JPDAport>   0.0.0.0:0  LISTENING 
  5. Use a standard Java debugger and attach it to Unwired Server by specifying the correct host and the JPDA port used.
Begin debugging the result filter class with the Java debugger.