Thursday, April 25, 2013

Tips - Some useful parameters for starting a WSO2 server

Before you start, first go to <CarbonHOME>/bin . Where <CarbonHOME> is the directory of the carbon server.


Start a carbon server with 1 port offset

(Useful when you need to start multiple servers (ESB, BPS, AS etc) at same time)

$ ./wso2server.sh -DportOffset=1



Start a Carbon server with remote-debug mode on port 5005


$ ./wso2server.sh debug 5005


 

Tips - Remote Debug with Maven 3 - Plug-in Debug

How to Debug a Maven Plug-in at Build time.

1) Open maven plug-in source code using your favorite IDE ( Eclipse, InterlliJ IDEA etc) and set break points in codes that you are going to debug.

2) Start build project using following command.

$ mvnDebug clean install 
 
3) maven starts to Listen on port 8000 till a remote debugger connects.

$ mvnDebug clean install
Preparing to Execute Maven in Debug Mode
Listening for transport dt_socket at address: 8000

 
4) Start remote debug on port 8000 using your IDE. It will trigger the build process with remote debug.

Tips - Remote Debug with Maven 3 - Test-cases

How To Debug Test-cases with Maven at maven run time

1) Open your Project with your favorite IDE ( eclipse, intellij IDEA etc) and set break points that you are going to debug.

2) Build the project using following parameters

$mvn clean install -Dmaven.surefire.debug

3) It starts to build your project and it will stop at test cases.

[INFO] --- maven-compiler-plugin:2.3.2:testCompile (default-testCompile) @ org.wso2.bps.integration.tests ---
[INFO] Compiling 41 source files to /data/source/branch/carbon410/platform/products/bps/3.0.2/modules/integration/org.wso2.bps.integration.tests/target/test-classes
[INFO]
[INFO] --- maven-surefire-plugin:2.12:test (default-test) @ org.wso2.bps.integration.tests ---
[INFO] Surefire report directory: /data/source/branch/carbon410/platform/products/bps/3.0.2/modules/integration/org.wso2.bps.integration.tests/target/surefire-reports

-------------------------------------------------------
 T E S T S
-------------------------------------------------------
Listening for transport dt_socket at address: 5005



4) Start remote debug on port 5005 using your IDE. It will trigger the build process with remote debug.


Source : http://maven.apache.org/surefire/maven-surefire-plugin/examples/debugging.html