Configure Jrebel with remote server

After 3 hours turning around over many examples, finally I’ve configured Jrebel with remote webpshere portal.
This is my step by step configuration guide:

-) Step 1 : download the client from this url :

Archived JRebel Releases

-) Step 2 : copy and unpack downloaded file on the remote server (I usually use: C:\IBM\jrebel\)

-) Step 3 : Activate client using a valid licence (I’ve used activate script in client’s bin directory)

-) Step 4 : Generate bootstrap file using this command (Don’t forget to use websphere portal jvm ):

cd C:\IBM\jrebel

C:\IBM\WebSphere\AppServer\java\jre\bin\java -jar jrebel.jar

-) Step 5 : Copy jrebel-bootstrap.jar from [userHome]/.jrebel to C:\IBM\jrebel\

-) Step 6 : Add jrebel parameter to websphere portal jvm (if you don’t know how visit this : :

-Xshareclasses:none -Xbootclasspath/p:C:\IBM\jrebel\jrebel-bootstrap.jar;C:\IBM\jrebel\jrebel.jar -Drebel.remoting_plugin=true 

finally my configuration seems like this:

-Xshareclasses:none -Xbootclasspath/p:C:\IBM\jrebel\jrebel-bootstrap.jar;C:\IBM\jrebel\jrebel.jar -Drebel.remoting_plugin=true ${WPS_JVM_ARGUMENTS_EXT} -Dderby.system.home=${USER_INSTALL_ROOT}/PortalServer/derby${WAS_TEMP_DIR} -Xdump:stack:events=allocation,filter=#10m -Xgcpolicy:gencon -verbose:gc -Xverbosegclog:${SERVER_LOG_ROOT}/verbosegc.%Y%m%d.%H%M%S.%pid.txt,20,10000

-) Step 7 : Finally don’t foget generate password using this command:

cd C:\IBM\jrebel

C:\IBM\WebSphere\AppServer\java\jre\bin\java -jar jrebel.jar -set-remote-password password

How to split String in words and populate an array

Here a simply method to split a string in words and generate an array.
In this case I use a Length param to limit substring size.



public static String[] splitStringInWordsAndCreateArrayWithLineInSize(String input,Integer lineLength){
		String[] words = input.split(" ");
 		List<String> list = new ArrayList<String>();
 		StringBuilder line = new StringBuilder();
 		for (int x = 0; x < words.length; x++) {
 			Boolean c = ((line.toString()+words[x]+" ").length()<lineLength);
 				line.append(words[x]).append(" ");
 				line = new StringBuilder(words[x]).append(" ");
 		Object[] arrObj = list.toArray();
 		String[] arrString = Arrays.copyOf(arrObj, arrObj.length, String[].class);
		return arrString;


And here unit test:


	 	public void testSplitStringInWordsAndCreateArrayWithLineInSize(){
	 		String s = "Prodotti tricologici per la cura e la bellezza dei capelli,quali shampoo, lozioni per capelli, preparati per ondulare icapelli, preparati per effettuare la permanente dei capelli,tinture per capelli, gel per capelli, lacche e fissatori percapelli,preparati per ravvivare il colore dei capelli . ";
	 		Integer lineLength = 62;
	 		String[] out = FYStringUtils.splitStringInWordsAndCreateArrayWithLineInSize(s, lineLength);
	 		StringBuilder rebuild = new StringBuilder();
	 		for(int x=0;x<out.length;x++){


step by step to Integrate https with ibm connections

1)  Verify where kdb and sth files are stored :

Was console: security -> SSL certificate and key management -> Key stores and certificates -> CMSKeyStore (verify path)

2) Open plugin xml and verify where store sth and kdb files  then copy from websphere path (1) .

Server Types-> Web servers > webserver1 > Plug-in properties -> Plug-in key store directory and file name
If not present:

-) Configure Ihs using ibm docs then open  Was console: servertypes / webServers / webservername -> plugin options-> copy kdb to plugin folder
-) Set default cert in kdb using ikeyman

3) Configure virtual host to use ssl :

LoadModule ibm_ssl_module modules/

<IfModule mod_ibm_ssl.c>

<VirtualHost *:443>


Keyfile "<path used in plugin>\plugin-key.kdb"
SSLStashFile "<path used in plugin>\plugin-key.sth"

LoadModule was_ap22_module /opt/ibm/Plugins/bin/64bits/
WebSpherePluginConfig /opt/ibm/Plugins/config/webserver1/Plugin-cfg.xml

Generate version.txt in a maven project

If you need to generate a txt with project version / timestamp in project’s root you can use an ant build like this.



		<format property="now" pattern="yyyy-MM-dd hh:mm:ss" locale="it" />
		    <echo file="<path>/version.txt" append="false">
			Project Version : ${project.version} ${line.separator}Build @ ${now}



Start H2 Db as daemon

Here my script to start H2 db as daemon under linux Os.
Please note param “-baseDir $HOME” this means that default storage path is the home of the user that start db,
change variable with absolute path to prevent new Db creation with wrong users.


cd `dirname ${0}`/..

case $1 in
    java -cp <h2Path>/h2-*.jar -?

    java -cp <h2Path>/h2-*.jar -tcp -web -baseDir $HOME &

    java -cp <h2Path>/h2-*.jar -tcpShutdown "tcp://localhost"

    echo "Usage ${0} (help|start|stop)"