[
https://issues.apache.org/jira/browse/FC-287?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Shawn McKinney resolved FC-287.
-------------------------------
Resolution: Fixed
## SECTION 15. Howto Debug a load script
1. Add -Ddebug=port to runtime args:
```
mvn install -Dload.file=./ldap/setup/refreshLDAPData.xml -Ddebug=5432
```
Which suspends the process waiting for connection on port specified, e.g. 5432.
```
fortress-load-debug:
[echo] ############### Run Fortress Ant script to load policy ###############
[startAnt] Listening for transport dt_socket at address: 5432
```
2. Set breakpoints in
[FortressAntTask](src/main/java/org/apache/directory/fortress/core/ant/FortressAntTask.java)
3. Connect with the JDB on the specified port.
> Fortress Ant load improvements
> ------------------------------
>
> Key: FC-287
> URL: https://issues.apache.org/jira/browse/FC-287
> Project: FORTRESS
> Issue Type: Improvement
> Affects Versions: 2.0.5
> Reporter: Shawn McKinney
> Assignee: Shawn McKinney
> Priority: Major
> Fix For: 2.0.6
>
>
> A couple of improvements:
> 1.Add 'debug' mode, startup load in suspended state, allow JDB process to
> attach.
> ```
> mvn install -Dload.file=./ldap/setup/loadFile.xml -Ddebug
> ```
>
> 2. Use maven test classpath instead of classpath element list.
>
> Use this:
> ```
> <java classname="org.apache.tools.ant.launch.Launcher" fork="true"
> clonevm="true" failonerror="true" dir="${basedir}" timeout="600000"
> taskname="startAnt">
> <classpath refid="maven.test.classpath"/>
> ```
>
> Stop doing this:
> ```
> |<target name="fortress-load" if="load.file" description="Loads fortress
> policy into ldap">|
> |<echo message="############### Run Fortress Ant script to load policy
> ###############" />|
> |<java classname="org.apache.tools.ant.launch.Launcher" fork="true"
> clonevm="true" failonerror="true" dir="${basedir}" timeout="600000"
> taskname="startAnt">|
> |<classpath>|
> | |
> |<pathelement location="./config/bootstrap/" />|
> |<pathelement location="./target/classes/" />|
> |<pathelement location="${org.apache.ant:ant-launcher:jar}" />|
> |<pathelement location="${org.apache.ant:ant:jar}" />|
> |<pathelement location="${org.openldap:accelerator-api:jar}" />|
> <pathelement location="${org.openldap:accelerator-impl:jar}" />
> ...
> ```
--
This message was sent by Atlassian Jira
(v8.3.4#803005)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]