How to debug dpconf with netbeans

If you need to launch dpconf under netbeans debugger you have to follow this procedure:

 1- Modify dpconf C command wrapper in order to enable JODA debugger

  • In a 6.x,7.x DSEE wks, edit the file <wks>/ldap/dps/dpcfg/starter/dpcfg_starter.c and add the following lines (in red) in the main function
... 
if (ldapUnsecuredOptSetProperty[0] != '\\0') {
    spawnArgs[i++] = ldapUnsecuredOptSetProperty;
    }
       
    spawnArgs[i++] = "-Xdebug";
    spawnArgs[i++] = "-Xnoagent";
    spawnArgs[i++]= "-Djava.compiler=none";

    spawnArgs[i++]= "-Xrunjdwp:transport=dt_socket,server=y,address=8010,suspend=y";
    spawnArgs[i++] = "-classpath";
    spawnArgs[i++] = classPath;
    spawnArgs[i++] = "com.sun.directory.proxy.dpcfg.cli.DpcfgMain";
    
    /\* Copy argv to spawnArgs
     \*
...
  • Then compile dsee and copy the built dpconf command under the DSEE install you have to debug

2- Launch dpconf command and attach netbeans to the process

You are now ready to attach the dpconf command you want to debug under a netbeans session. You first need to create a new java project with the corresponding source (use <wks>/ldap/dps/dpcfg/java as Package Folder for source). Put some breakpoints and then attach the debugger "Debug->Attach Debugger..." under netbeans (specify port 8010).


Comments:

Post a Comment:
  • HTML Syntax: NOT allowed
About

Patrice Duc-Jacquet

Search

Categories
Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today