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/mod_ibm_ssl.so

<IfModule mod_ibm_ssl.c>
Listen 0.0.0.0:443

<VirtualHost *:443>
ServerName www.mydomain.com
SSLEnable
</VirtualHost>

</IfModule>

SSLDisable
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/mod_was_ap22_http.so
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.


<plugins>

...


<plugin>
  <artifactId>maven-antrun-plugin</artifactId>
  	<version>1.8</version>
	<executions>
  	<execution>
	<phase>prepare-package</phase>
	<configuration>
	   <tasks>
	     <tstamp>
		<format property="now" pattern="yyyy-MM-dd hh:mm:ss" locale="it" />
		  </tstamp>
		    <echo file="<path>/version.txt" append="false">
			Project Version : ${project.version} ${line.separator}Build @ ${now}
		    </echo>
            </tasks>
         </configuration>
	    <goals>
		<goal>run</goal>
	    </goals>
	</execution>
	</executions>
</plugin>

...

</plugins>

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.

 
#!/bin/sh

cd `dirname ${0}`/..

case $1 in
  help)
    java -cp <h2Path>/h2-*.jar org.h2.tools.Server -?
  ;;

  start)
    java -cp <h2Path>/h2-*.jar org.h2.tools.Server -tcp -web -baseDir $HOME &
  ;;

  stop)
    java -cp <h2Path>/h2-*.jar org.h2.tools.Server -tcpShutdown "tcp://localhost"
  ;;

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

Websphere 8 with war java.lang.NoSuchMethodError Exception

Using a war under websphere 8.0 can sometimes throw this exception (In my specific case with jtopen libs) solved with the screen configuration:

war-config

 

 

 

 

 

 

 

ServletWrappe E com.ibm.ws.webcontainer.servlet.ServletWrapper service Uncaught service() exception thrown by servlet main: java.lang.NoSuchMethodError: com/ibm/as400/data/ProgramCallDocument.__jr_selector__(I[Ljava/lang/Object;)Ljava/lang/Object;
at com.fakeclass.genericinvokerweb.beprogram.BEProgram.output(BEProgram.java:217)
at com.fakeclass.genericinvokerweb.PCMLutils.buildOutPut(PCMLutils.java:128)
at com.fakeclass.genericinvokerweb.MainServlet.executeCallAs400(MainServlet.java:104)
at com.fakeclass.genericinvokerweb.MainServlet.doPost(MainServlet.java:86)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:595)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:668)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1230)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:779)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:478)
at com.ibm.ws.webcontainer.servlet.ServletWrapperImpl.handleRequest(ServletWrapperImpl.java:178)
at com.ibm.ws.webcontainer.filter.WebAppFilterManager.invokeFilters(WebAppFilterManager.java:1071)
at com.ibm.ws.webcontainer.webapp.WebApp.__handleRequest(WebApp.java:3815)
at com.ibm.ws.webcontainer.webapp.WebApp.handleRequest(WebApp.java)
at com.ibm.ws.webcontainer.webapp.WebGroup.handleRequest(WebGroup.java:304)
at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:981)
at com.ibm.ws.webcontainer.WSWebContainer.handleRequest(WSWebContainer.java:1662)
at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:200)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:453)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewRequest(HttpInboundLink.java:515)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.processRequest(HttpInboundLink.java:306)
at com.ibm.ws.http.channel.inbound.impl.HttpICLReadCallback.complete(HttpICLReadCallback.java:84)
at com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted(AioReadCompletionListener.java:175)
at com.ibm.io.async.AbstractAsyncFuture.invokeCallback(AbstractAsyncFuture.java:217)
at com.ibm.io.async.AsyncChannelFuture.fireCompletionActions(AsyncChannelFuture.java:161)
at com.ibm.io.async.AsyncFuture.completed(AsyncFuture.java:138)
at com.ibm.io.async.ResultHandler.complete(ResultHandler.java:204)
at com.ibm.io.async.ResultHandler.runEventProcessingLoop(ResultHandler.java:775)
at com.ibm.io.async.ResultHandler$2.run(ResultHandler.java:905)
at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1702)

[17/03/16 16.41.28:730 CET] 00000050 SystemErr R 17-mar-2016 16.41.28 com.ibm.ws.webcontainer.servlet.ServletWrapper service
SEVERE: Uncaught service() exception thrown by servlet main: java.lang.NoSuchMethodError: com/ibm/as400/data/ProgramCallDocument.__jr_selector__(I[Ljava/lang/Object;)Ljava/lang/Object;
at com.fakeclass.genericinvokerweb.beprogram.BEProgram.output(BEProgram.java:217)
at com.fakeclass.genericinvokerweb.PCMLutils.buildOutPut(PCMLutils.java:128)
at com.fakeclass.genericinvokerweb.MainServlet.executeCallAs400(MainServlet.java:104)
at com.fakeclass.genericinvokerweb.MainServlet.doPost(MainServlet.java:86)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:595)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:668)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1230)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:779)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:478)
at com.ibm.ws.webcontainer.servlet.ServletWrapperImpl.handleRequest(ServletWrapperImpl.java:178)
at com.ibm.ws.webcontainer.filter.WebAppFilterManager.invokeFilters(WebAppFilterManager.java:1071)
at com.ibm.ws.webcontainer.webapp.WebApp.__handleRequest(WebApp.java:3815)
at com.ibm.ws.webcontainer.webapp.WebApp.handleRequest(WebApp.java)
at com.ibm.ws.webcontainer.webapp.WebGroup.handleRequest(WebGroup.java:304)
at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:981)
at com.ibm.ws.webcontainer.WSWebContainer.handleRequest(WSWebContainer.java:1662)
at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:200)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:453)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewRequest(HttpInboundLink.java:515)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.processRequest(HttpInboundLink.java:306)
at com.ibm.ws.http.channel.inbound.impl.HttpICLReadCallback.complete(HttpICLReadCallback.java:84)
at com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted(AioReadCompletionListener.java:175)
at com.ibm.io.async.AbstractAsyncFuture.invokeCallback(AbstractAsyncFuture.java:217)
at com.ibm.io.async.AsyncChannelFuture.fireCompletionActions(AsyncChannelFuture.java:161)
at com.ibm.io.async.AsyncFuture.completed(AsyncFuture.java:138)
at com.ibm.io.async.ResultHandler.complete(ResultHandler.java:204)
at com.ibm.io.async.ResultHandler.runEventProcessingLoop(ResultHandler.java:775)
at com.ibm.io.async.ResultHandler$2.run(ResultHandler.java:905)
at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1702)

Add more Swap on linux Vm

How to add more swap on a linux Vm.
It can be used on a physical machine too but remember that swap is store on a file and not in a dedicate partition.

#########################sWap File
#Create Local Folder
mkdir -p /usr/local/swap/

#Create a 2Gb Local File to store swap
dd if=/dev/zero of=/usr/local/swap/swapfile1 bs=1024 count=2097152 #2gb 4194304
mkswap /usr/local/swap/swapfile1

#set Grant On File
cd /usr/local/swap/
chown root:root swapfile1
chmod 0600 swapfile1

#Enable Swap
swapon swapfile1

Add this line in /ect/fstab to load swap on system startup:


/usr/local/swap/swapfile1 swap swap defaults 0 0