Saturday, July 2, 2016

Setting up maven in eclipse

Here's what you do to open a maven project in eclipse:

1. Install maven (m2e) plugin:
http://stackoverflow.com/questions/8620127/maven-in-eclipse-step-by-step-installation
http://o7planning.org/web/fe/default/en/document/5189/install-maven-into-eclipse
http://www.vogella.com/tutorials/EclipseMaven/article.html


2. In eclipse, choose File-> Import -> Maven -> Existing Maven Projects, and then Enter

3. Root Directory -> Browse and choose the directory where the pom.xml file exists

4. Finish

And you are done! (build the project as the next step via Run As -> Maven Build)

Why do I get “must override a superclass method” with @Override?

Do note, if you get this error, most likely your compiler compliance is not set to at least 1.6.

If using eclipse, check the project's properties and verify that Java Compiler -> Compiler compliance level is set to 1.6.

Sunday, July 12, 2015

Deploying Axis2 on WebSphere 8.5.5

Recently, I had to deploy move my webservice that was previously deployed on WebLogic running on AIX to WebSphere 8.5.5 on Solaris.

For those starting out for the first time, here's a very good link on deploying Axis2 on WebSphere:
http://zacktutorials.blogspot.sg/2014_04_01_archive.html

For my case, even though, I followed every step, I still keep getting the following error:
[7/11/15 13:10:43:344 SGT] 00000055 SystemOut     O [INFO] org.apache.axis2.deployment.DeploymentException: Two services cannot have same name.  A service with the PartyIdService name already exists in the system.
[7/11/15 13:10:43:343 SGT] 00000055 SystemOut     O [ERROR] The PartyIdService service, which is not valid, caused Two services cannot have same name.  A service with the PartyIdService name already exists in the system.
org.apache.axis2.AxisFault: Two services cannot have same name.  A service with the PartyIdService name already exists in the system.

I checked back on my old posts and found out that I had to do a workaround when deploying my webservice on WebLogic AIX:  http://java-vignettes.blogspot.sg/2010/11/deploy-axis2-on-aix.html

The main point was that I had to duplicate the service by packaging the webservice into a .aar file before Axis2 can recognize the web service. On other operating systems like Windows, packaging the war file without the .aar file works fine!

Once removed the aar file, my webservice was deployed successfully and everything worked fine:
[7/12/15 15:11:33:592 SGT] 00000054 ApplicationMg A   WSVR0200I: Starting application: PartyIdService_war
[7/12/15 15:11:33:595 SGT] 00000054 ApplicationMg A   WSVR0204I: Application: PartyIdService_war  Application build level: Unknown
[7/12/15 15:11:34:097 SGT] 00000054 webapp        I com.ibm.ws.webcontainer.webapp.WebGroupImpl WebGroup SRVE0169I: Loading Web Module: PartyIdService.
[7/12/15 15:11:34:185 SGT] 00000054 WASSessionCor I SessionContextRegistry getSessionContext SESN0176I: Will create a new session context for application key default_host/PartyIdService
[7/12/15 15:11:36:985 SGT] 00000054 SystemOut     O [INFO] Clustering has been disabled
[7/12/15 15:11:37:079 SGT] 00000054 SystemOut     O [INFO] Deploying module: soapmonitor-1.5.1 - file:/apps/IBM/WebSphere8.5.5/AppServer/profiles/uirt/installedApps/localhostNode04Cell/PartyIdService_war.ear/PartyIdService.war/WEB-INF/modules/soapmonitor-1.5.1.mar
[7/12/15 15:11:37:094 SGT] 00000054 SystemOut     O [INFO] Deploying module: metadataExchange-1.5.1 - file:/apps/IBM/WebSphere8.5.5/AppServer/profiles/uirt/installedApps/localhostNode04Cell/PartyIdService_war.ear/PartyIdService.war/WEB-INF/modules/mex-1.5.1.mar
[7/12/15 15:11:37:102 SGT] 00000054 SystemOut     O [INFO] Deploying module: script-1.5.1 - file:/apps/IBM/WebSphere8.5.5/AppServer/profiles/uirt/installedApps/localhostNode04Cell/PartyIdService_war.ear/PartyIdService.war/WEB-INF/modules/scripting-1.5.1.mar
[7/12/15 15:11:37:107 SGT] 00000054 SystemOut     O [INFO] Deploying module: mtompolicy-1.5.1 - file:/apps/IBM/WebSphere8.5.5/AppServer/profiles/uirt/installedApps/localhostNode04Cell/PartyIdService_war.ear/PartyIdService.war/WEB-INF/modules/mtompolicy-1.5.1.mar
[7/12/15 15:11:37:113 SGT] 00000054 SystemOut     O [INFO] Deploying module: ping-1.5.1 - file:/apps/IBM/WebSphere8.5.5/AppServer/profiles/uirt/installedApps/localhostNode04Cell/PartyIdService_war.ear/PartyIdService.war/WEB-INF/modules/ping-1.5.1.mar
[7/12/15 15:11:37:143 SGT] 00000054 SystemOut     O [INFO] Deploying module: addressing-1.5.1 - file:/apps/IBM/WebSphere8.5.5/AppServer/profiles/uirt/installedApps/localhostNode04Cell/PartyIdService_war.ear/PartyIdService.war/WEB-INF/modules/addressing-1.5.1.mar
[7/12/15 15:11:37:161 SGT] 00000054 SystemOut     O [INFO] Deploying module: mtompolicy-1.5.1 - file:/apps/IBM/WebSphere8.5.5/AppServer/profiles/uirt/installedApps/localhostNode04Cell/PartyIdService_war.ear/PartyIdService.war/WEB-INF/lib/mtompolicy-1.5.1.jar
[7/12/15 15:11:37:168 SGT] 00000054 SystemOut     O [INFO] Deploying module: script-1.5.1 - file:/apps/IBM/WebSphere8.5.5/AppServer/profiles/uirt/installedApps/localhostNode04Cell/PartyIdService_war.ear/PartyIdService.war/WEB-INF/lib/scripting-1.5.1.jar
[7/12/15 15:11:37:175 SGT] 00000054 SystemOut     O [INFO] Deploying module: metadataExchange-1.5.1 - file:/apps/IBM/WebSphere8.5.5/AppServer/profiles/uirt/installedApps/localhostNode04Cell/PartyIdService_war.ear/PartyIdService.war/WEB-INF/lib/mex-1.5.1.jar
[7/12/15 15:11:37:187 SGT] 00000054 SystemOut     O [INFO] Deploying module: addressing-1.5.1 - file:/apps/IBM/WebSphere8.5.5/AppServer/profiles/uirt/installedApps/localhostNode04Cell/PartyIdService_war.ear/PartyIdService.war/WEB-INF/lib/addressing-1.5.1.jar
[7/12/15 15:11:37:194 SGT] 00000054 SystemOut     O [INFO] Deploying module: ping-1.5.1 - file:/apps/IBM/WebSphere8.5.5/AppServer/profiles/uirt/installedApps/localhostNode04Cell/PartyIdService_war.ear/PartyIdService.war/WEB-INF/lib/ping-1.5.1.jar
[7/12/15 15:11:37:204 SGT] 00000054 SystemOut     O [INFO] Deploying module: soapmonitor-1.5.1 - file:/apps/IBM/WebSphere8.5.5/AppServer/profiles/uirt/installedApps/localhostNode04Cell/PartyIdService_war.ear/PartyIdService.war/WEB-INF/lib/soapmonitor-1.5.1.jar
[7/12/15 15:11:37:342 SGT] 00000054 SystemOut     O [INFO] Deploying Web service: PartyIdService - file:/apps/IBM/WebSphere8.5.5/AppServer/profiles/uirt/installedApps/localhostNode04Cell/PartyIdService_war.ear/PartyIdService.war/WEB-INF/services/PartyIdService/
[7/12/15 15:11:37:362 SGT] 00000054 SystemOut     O [INFO] Deploying Web service: version.aar - file:/apps/IBM/WebSphere8.5.5/AppServer/profiles/uirt/installedApps/localhostNode04Cell/PartyIdService_war.ear/PartyIdService.war/WEB-INF/services/version.aar
[7/12/15 15:11:37:385 SGT] 00000054 ServletWrappe I com.ibm.ws.webcontainer.servlet.ServletWrapper init SRVE0242I: [PartyIdService_war] [/PartyIdService] [AxisAdminServlet]: Initialization successful.
[7/12/15 15:11:37:391 SGT] 00000054 webcontainer  I com.ibm.ws.webcontainer.VirtualHostImpl addWebApplication SRVE0250I: Web Module PartyIdService has been bound to default_host[*:9083,*:80,*:9446,*:5067,*:5066,*:443].
[7/12/15 15:11:37:416 SGT] 00000054 ApplicationMg A   WSVR0221I: Application started: PartyIdService_war


Anyway, here's what I had to do:
1. Create a backup of the PartyIDService.war
$ pwd
/apps/IBM/EMM/applications
$ mkdir archive
$ ls -l PartyIdService.war   
-rwxrwxrwx. 1 unica unica 7269242 Nov 25  2010 PartyIdService.war
$ cp -p PartyIdService.war archive/PartyIdService.war.20110710

 2.Unwar my war file into a tmp folder:
$ mkdir tmp
$ cd tmp
$ jar -xvf ../PartyIdService.war
  inflated: META-INF/MANIFEST.MF
 inflated: axis2-web/LeftFrame.jsp
 inflated: axis2-web/EngageToServiceGroup.jsp
 inflated: WEB-INF/classes/partyIdService.properties
 inflated: WEB-INF/lib/axis2-java2wsdl-1.5.1.jar
 inflated: WEB-INF/lib/axiom-impl-LICENSE.txt
 inflated: WEB-INF/lib/axiom-api-LICENSE.txt
  created: WEB-INF/classes/org/apache/
  created: WEB-INF/services/PartyIdService/com/ocbc/
 inflated: axis2-web/include/adminheader.jsp
 inflated: axis2-web/error.jsp
 inflated: axis2-web/ListServiceGroup.jsp
 inflated: WEB-INF/lib/axis2-kernel-1.5.1.jar
 inflated: WEB-INF/lib/axis2-adb-codegen-1.5.1.jar
 inflated: WEB-INF/lib/XmlSchema-1.4.3.jar
 inflated: axis2-web/listModules.jsp
 inflated: axis2-web/ViewContexts.jsp
 inflated: axis2-web/Login.jsp
 inflated: WEB-INF/conf/axis2.xml
 inflated: WEB-INF/services/PartyIdService.aar
  created: axis2-web/css/
 inflated: WEB-INF/lib/wstx-LICENSE.txt
 inflated: WEB-INF/modules/addressing-1.5.1.mar
 inflated: WEB-INF/lib/axis2-fastinfoset-1.5.1.jar
 inflated: WEB-INF/lib/commons-fileupload-1.2.jar
 inflated: WEB-INF/lib/wsdl4j-1.6.2.jar
 inflated: WEB-INF/modules/soapmonitor-1.5.1.mar
 inflated: axis2-web/Error/AuthError.html
 inflated: WEB-INF/lib/annogen-LICENSE.txt
 inflated: WEB-INF/lib/commons-fileupload-LICENSE.txt
 inflated: WEB-INF/lib/woden-api-LICENSE.txt
 inflated: axis2-web/include/adminfooter.inc
 inflated: axis2-web/engagingtoaservice.jsp
 inflated: WEB-INF/services/version.aar
 inflated: WEB-INF/classes/org/apache/axis2/webapp/AdminAgent.class
 inflated: WEB-INF/services/PartyIdService/com/ocbc/unica/interact/PartyIdService.class
 inflated: axis2-web/engagingglobally.jsp
 inflated: WEB-INF/classes/org/apache/axis2/webapp/AxisAdminServlet.class
 inflated: WEB-INF/modules/ping-1.5.1.mar
 inflated: axis2-web/listSingleService.jsp
  created: axis2-web/include/
 inflated: axis2-web/disengage.jsp
 inflated: axis2-web/admin.jsp
  created: axis2-web/Error/
 inflated: WEB-INF/lib/axiom-dom-LICENSE.txt
 inflated: axis2-web/include/header.inc
 inflated: WEB-INF/lib/axis2-jaxws-1.5.1.jar
 inflated: WEB-INF/lib/axiom-impl-1.2.8.jar
 inflated: WEB-INF/lib/axiom-api-1.2.8.jar
 inflated: WEB-INF/classes/com/ocbc/unica/interact/NameValuePair.class
 inflated: axis2-web/include/link-footer.inc
 inflated: axis2-web/ViewGlobalHandlers.jsp
  created: WEB-INF/classes/com/ocbc/unica/
 inflated: WEB-INF/lib/httpcore-4.0.jar
 inflated: WEB-INF/lib/log4j-1.2.15.jar
 inflated: WEB-INF/lib/neethi-LICENSE.txt
 inflated: WEB-INF/services/PartyIdService/META-INF/services.xml
 inflated: axis2-web/index.jsp
 inflated: WEB-INF/lib/axis2-adb-1.5.1.jar
  created: axis2-web/
 inflated: WEB-INF/lib/axis2-json-1.5.1.jar
 inflated: WEB-INF/lib/axis2-clustering-1.5.1.jar
  created: WEB-INF/classes/com/ocbc/unica/interact/
 inflated: WEB-INF/modules/mtompolicy-1.5.1.mar
 inflated: WEB-INF/modules/scripting-1.5.1.mar
 inflated: axis2-web/listGroupService.jsp
 inflated: axis2-web/errorModule.jsp
 inflated: axis2-web/css/axis-style.css
 inflated: axis2-web/MainFrame.jsp
 inflated: axis2-web/Error/GenError.html
 inflated: WEB-INF/web.xml
  created: META-INF/
 inflated: WEB-INF/lib/woden-api-1.0M8.jar
  created: WEB-INF/services/
 inflated: WEB-INF/lib/commons-io-LICENSE.txt
 inflated: WEB-INF/lib/neethi-2.0.4.jar
 inflated: WEB-INF/lib/axis2-codegen-1.5.1.jar
 inflated: WEB-INF/lib/commons-io-1.4.jar
 inflated: WEB-INF/lib/geronimo-stax-api_1.0_spec-1.0.1.jar
 inflated: axis2-web/listService.jsp
 inflated: axis2-web/images/axis.jpg
 inflated: WEB-INF/lib/axis2-transport-http-1.5.1.jar
 inflated: WEB-INF/lib/axis2-xmlbeans-1.5.1.jar
 inflated: WEB-INF/lib/woden-impl-dom-LICENSE.txt
 inflated: axis2-web/TopFrame.jsp
 inflated: WEB-INF/lib/axis2-spring-1.5.1.jar
 inflated: WEB-INF/lib/axis2-corba-1.5.1.jar
 inflated: WEB-INF/lib/axiom-dom-1.2.8.jar
 inflated: axis2-web/ViewServiceHandlers.jsp
 inflated: axis2-web/SelectService.jsp
 inflated: axis2-web/Error/error500.jsp
 inflated: WEB-INF/services/PartyIdService/com/ocbc/unica/interact/NameValuePair.class
  created: WEB-INF/services/PartyIdService/com/ocbc/unica/
 inflated: axis2-web/include/link-footer.jsp
 inflated: axis2-web/images/axis.gif
 inflated: WEB-INF/lib/axis2-metadata-1.5.1.jar
  created: WEB-INF/classes/com/
 inflated: WEB-INF/lib/axis2-transport-local-1.5.1.jar
  created: WEB-INF/services/PartyIdService/META-INF/
 inflated: WEB-INF/lib/axis2-LICENSE.txt
  created: WEB-INF/conf/
 inflated: WEB-INF/lib/commons-codec-1.3.jar
 inflated: WEB-INF/lib/commons-codec-LICENSE.txt
  created: WEB-INF/services/PartyIdService/com/ocbc/unica/interact/
 inflated: axis2-web/listServices.jsp
 inflated: axis2-web/Error/error404.jsp
  created: WEB-INF/classes/org/apache/axis2/
  created: WEB-INF/lib/
 inflated: WEB-INF/modules/mex-1.5.1.mar
 inflated: axis2-web/viewphases.jsp
 inflated: axis2-web/images/asf-logo.gif
 inflated: axis2-web/InActivateService.jsp
  created: WEB-INF/classes/org/
  created: WEB-INF/classes/
 inflated: axis2-web/include/footer.inc
 inflated: WEB-INF/lib/activation-1.1.jar
 inflated: WEB-INF/lib/commons-lang-2.3.jar
 inflated: WEB-INF/lib/wstx-asl-3.2.4.jar
  created: WEB-INF/modules/
 inflated: WEB-INF/classes/com/ocbc/unica/interact/PartyIdException.class
 inflated: axis2-web/viewServiceContext.jsp
 inflated: axis2-web/include/adminheader.inc
  created: axis2-web/images/
 inflated: axis2-web/ServiceParaEdit.jsp
 inflated: WEB-INF/services/services.list
  created: WEB-INF/classes/com/ocbc/
 inflated: WEB-INF/lib/woden-impl-dom-1.0M8.jar
 inflated: axis2-web/viewServiceGroupContext.jsp
 inflated: axis2-web/listFaultyService.jsp
 inflated: WEB-INF/lib/axis2-jibx-1.5.1.jar
 inflated: WEB-INF/classes/log4j.properties
 inflated: WEB-INF/classes/commons-logging.properties
 inflated: WEB-INF/lib/activation-LICENSE.txt
 inflated: axis2-web/upload.jsp
 inflated: axis2-web/engagingtoanoperation.jsp
 inflated: axis2-web/HappyAxis.jsp
  created: WEB-INF/classes/org/apache/axis2/webapp/
 inflated: WEB-INF/lib/mail-LICENSE.txt
 inflated: axis2-web/ActivateService.jsp
 inflated: WEB-INF/lib/axis2-saaj-1.5.1.jar
 inflated: WEB-INF/lib/axis2-mtompolicy-1.5.1.jar
 inflated: WEB-INF/lib/XmlSchema-LICENSE.txt
 inflated: WEB-INF/lib/commons-httpclient-3.1.jar
 inflated: WEB-INF/lib/commons-httpclient-LICENSE.txt
 inflated: WEB-INF/lib/mail-1.4.jar
  created: WEB-INF/services/PartyIdService/com/
  created: WEB-INF/
 inflated: WEB-INF/lib/axis2-jaxbri-1.5.1.jar
 inflated: WEB-INF/modules/modules.list
 inflated: axis2-web/images/axis_l.jpg
 inflated: axis2-web/globalModules.jsp
 inflated: WEB-INF/lib/axis2-ant-plugin-1.5.1.jar
 inflated: WEB-INF/lib/commons-logging-LICENSE.txt
 inflated: WEB-INF/lib/log4j-LICENSE.txt
 inflated: WEB-INF/lib/wsdl4j-LICENSE.txt
 inflated: WEB-INF/classes/com/ocbc/unica/interact/PartyIdService.class
 inflated: axis2-web/include/httpbase.jsp
 inflated: WEB-INF/lib/commons-logging-1.1.1.jar
  created: WEB-INF/services/PartyIdService/


3. cd WEB-INF/modules
$ cd WEB-INF/modules
$ ls -l
total 164
-rw-rw-r--. 1 unica unica 24917 Sep 18  2010 addressing-1.5.1.mar
-rw-rw-r--. 1 unica unica 33793 Sep 18  2010 mex-1.5.1.mar
-rw-rw-r--. 1 unica unica  1666 Sep 18  2010 modules.list
-rw-rw-r--. 1 unica unica 13882 Sep 18  2010 mtompolicy-1.5.1.mar
-rw-rw-r--. 1 unica unica 12837 Sep 18  2010 ping-1.5.1.mar
-rw-rw-r--. 1 unica unica 24267 Sep 18  2010 scripting-1.5.1.mar
-rw-rw-r--. 1 unica unica 37303 Sep 18  2010 soapmonitor-1.5.1.mar

4. Copy (Not Move) the mar file to a jar file and move it to single jar file

The final jar file should be placed to the WEB-INF\lib
Reason: IBM Websphere 8 doesn’t class load automatically for modules
$ cd WEB-INF/modules
$ ls -l
total 164
-rw-rw-r--. 1 unica unica 24917 Sep 18  2010 addressing-1.5.1.mar
-rw-rw-r--. 1 unica unica 33793 Sep 18  2010 mex-1.5.1.mar
-rw-rw-r--. 1 unica unica  1666 Sep 18  2010 modules.list
-rw-rw-r--. 1 unica unica 13882 Sep 18  2010 mtompolicy-1.5.1.mar
-rw-rw-r--. 1 unica unica 12837 Sep 18  2010 ping-1.5.1.mar
-rw-rw-r--. 1 unica unica 24267 Sep 18  2010 scripting-1.5.1.mar
-rw-rw-r--. 1 unica unica 37303 Sep 18  2010 soapmonitor-1.5.1.mar

$ cp addressing-1.5.1.mar addressing-1.5.1.jar
$ cp mex-1.5.1.mar mex-1.5.1.mar.jar
$ cp mtompolicy-1.5.1.mar mtompolicy-1.5.1..jar
$ cp ping-1.5.1.mar ping-1.5.1.jar
$ cp scripting-1.5.1.mar scripting-1.5.1.jar
$ cp soapmonitor-1.5.1.mar soapmonitor-1.5.1.jar
$ ls -l    
total 324
-rw-rw-r--. 1 unica unica 24917 Jul 12 15:49 addressing-1.5.1.jar
-rw-rw-r--. 1 unica unica 24917 Sep 18  2010 addressing-1.5.1.mar
-rw-rw-r--. 1 unica unica 33793 Sep 18  2010 mex-1.5.1.mar
-rw-rw-r--. 1 unica unica 33793 Jul 12 15:49 mex-1.5.1.mar.jar
-rw-rw-r--. 1 unica unica  1666 Sep 18  2010 modules.list
-rw-rw-r--. 1 unica unica 13882 Jul 12 15:50 mtompolicy-1.5.1..jar
-rw-rw-r--. 1 unica unica 13882 Sep 18  2010 mtompolicy-1.5.1.mar
-rw-rw-r--. 1 unica unica 12837 Jul 12 15:50 ping-1.5.1.jar
-rw-rw-r--. 1 unica unica 12837 Sep 18  2010 ping-1.5.1.mar
-rw-rw-r--. 1 unica unica 24267 Jul 12 15:50 scripting-1.5.1.jar
-rw-rw-r--. 1 unica unica 24267 Sep 18  2010 scripting-1.5.1.mar
-rw-rw-r--. 1 unica unica 37303 Jul 12 15:50 soapmonitor-1.5.1.jar
-rw-rw-r--. 1 unica unica 37303 Sep 18  2010 soapmonitor-1.5.1.mar

$ ls -l ../lib/add*
ls: cannot access ../lib/add*: No such file or directory
$ mv *.jar ../lib
$ ls -l
total 164
-rw-rw-r--. 1 unica unica 24917 Sep 18  2010 addressing-1.5.1.mar
-rw-rw-r--. 1 unica unica 33793 Sep 18  2010 mex-1.5.1.mar
-rw-rw-r--. 1 unica unica  1666 Sep 18  2010 modules.list
-rw-rw-r--. 1 unica unica 13882 Sep 18  2010 mtompolicy-1.5.1.mar
-rw-rw-r--. 1 unica unica 12837 Sep 18  2010 ping-1.5.1.mar
-rw-rw-r--. 1 unica unica 24267 Sep 18  2010 scripting-1.5.1.mar
-rw-rw-r--. 1 unica unica 37303 Sep 18  2010 soapmonitor-1.5.1.mar

5. Add to WEB-INF/conf/axis2.xml:
true



$ cd conf
$ pwd
/apps/IBM/EMM/applications/tmp/WEB-INF/conf
$ ls -l
total 32
-rw-rw-r--. 1 unica unica 29534 Sep 18  2010 axis2.xml







6. Delete PartyIdService.aar file:
$ pwd
/apps/IBM/EMM/applications/tmp/WEB-INF/services
$ ls -l
total 20
drwxrwxr-x. 4 unica unica 4096 Sep 18  2010 PartyIdService
-rw-rw-r--. 1 unica unica 4115 Nov 25  2010 PartyIdService.aar
-rw-rw-r--. 1 unica unica  813 Sep 22  2010 services.list
-rw-rw-r--. 1 unica unica 1804 Sep 18  2010 version.aar
$ rm PartyIdService.aar

7. Re-create the war file:
$ pwd
/apps/IBM/EMM/applications/tmp
$ jar -cvf ../PartyIdService.war .                          
added manifest
ignoring entry META-INF/
ignoring entry META-INF/MANIFEST.MF
adding: axis2-web/(in = 0) (out= 0)(stored 0%)
adding: axis2-web/css/(in = 0) (out= 0)(stored 0%)
adding: axis2-web/css/axis-style.css(in = 1587) (out= 745)(deflated 53%)
adding: axis2-web/engagingtoaservice.jsp(in = 5105) (out= 1342)(deflated 73%)
adding: axis2-web/ActivateService.jsp(in = 2734) (out= 1239)(deflated 54%)
adding: axis2-web/ViewContexts.jsp(in = 2875) (out= 1104)(deflated 61%)
adding: axis2-web/SelectService.jsp(in = 3742) (out= 1369)(deflated 63%)
adding: axis2-web/listService.jsp(in = 6384) (out= 1997)(deflated 68%)
adding: axis2-web/include/(in = 0) (out= 0)(stored 0%)
adding: axis2-web/include/adminheader.jsp(in = 3740) (out= 1178)(deflated 68%)
adding: axis2-web/include/footer.inc(in = 1261) (out= 644)(deflated 48%)
adding: axis2-web/include/adminheader.inc(in = 1125) (out= 607)(deflated 46%)
adding: axis2-web/include/adminfooter.inc(in = 903) (out= 510)(deflated 43%)
adding: axis2-web/include/link-footer.jsp(in = 3139) (out= 952)(deflated 69%)
adding: axis2-web/include/httpbase.jsp(in = 4146) (out= 1364)(deflated 67%)
adding: axis2-web/include/header.inc(in = 1134) (out= 617)(deflated 45%)
adding: axis2-web/include/link-footer.inc(in = 927) (out= 534)(deflated 42%)
adding: axis2-web/HappyAxis.jsp(in = 17082) (out= 4940)(deflated 71%)
adding: axis2-web/errorModule.jsp(in = 1400) (out= 747)(deflated 46%)
adding: axis2-web/Login.jsp(in = 3578) (out= 1383)(deflated 61%)
adding: axis2-web/upload.jsp(in = 2615) (out= 1249)(deflated 52%)
adding: axis2-web/ViewServiceHandlers.jsp(in = 5931) (out= 1168)(deflated 80%)
adding: axis2-web/images/(in = 0) (out= 0)(stored 0%)
adding: axis2-web/images/axis.jpg(in = 3355) (out= 3203)(deflated 4%)
adding: axis2-web/images/asf-logo.gif(in = 5866) (out= 5869)(deflated 0%)
adding: axis2-web/images/axis.gif(in = 2494) (out= 2408)(deflated 3%)
adding: axis2-web/images/axis_l.jpg(in = 12340) (out= 11816)(deflated 4%)
adding: axis2-web/viewServiceGroupContext.jsp(in = 2350) (out= 975)(deflated 58%)
adding: axis2-web/listFaultyService.jsp(in = 3811) (out= 1388)(deflated 63%)
adding: axis2-web/ServiceParaEdit.jsp(in = 5037) (out= 1412)(deflated 71%)
adding: axis2-web/disengage.jsp(in = 1030) (out= 573)(deflated 44%)
adding: axis2-web/listSingleService.jsp(in = 4104) (out= 1515)(deflated 63%)
adding: axis2-web/EngageToServiceGroup.jsp(in = 4754) (out= 1457)(deflated 69%)
adding: axis2-web/ViewGlobalHandlers.jsp(in = 5461) (out= 1069)(deflated 80%)
adding: axis2-web/MainFrame.jsp(in = 1063) (out= 591)(deflated 44%)
adding: axis2-web/TopFrame.jsp(in = 1129) (out= 618)(deflated 45%)
adding: axis2-web/listModules.jsp(in = 3349) (out= 1249)(deflated 62%)
adding: axis2-web/globalModules.jsp(in = 2175) (out= 967)(deflated 55%)
adding: axis2-web/index.jsp(in = 2181) (out= 1024)(deflated 53%)
adding: axis2-web/viewServiceContext.jsp(in = 1841) (out= 870)(deflated 52%)
adding: axis2-web/viewphases.jsp(in = 4297) (out= 1002)(deflated 76%)
adding: axis2-web/error.jsp(in = 1252) (out= 663)(deflated 47%)
adding: axis2-web/Error/(in = 0) (out= 0)(stored 0%)
adding: axis2-web/Error/error500.jsp(in = 2269) (out= 996)(deflated 56%)
adding: axis2-web/Error/AuthError.html(in = 1473) (out= 724)(deflated 50%)
adding: axis2-web/Error/error404.jsp(in = 2265) (out= 997)(deflated 55%)
adding: axis2-web/Error/GenError.html(in = 1420) (out= 689)(deflated 51%)
adding: axis2-web/ListServiceGroup.jsp(in = 2618) (out= 1036)(deflated 60%)
adding: axis2-web/LeftFrame.jsp(in = 5400) (out= 1214)(deflated 77%)
adding: axis2-web/engagingglobally.jsp(in = 2891) (out= 1215)(deflated 57%)
adding: axis2-web/listServices.jsp(in = 5181) (out= 1790)(deflated 65%)
adding: axis2-web/admin.jsp(in = 1411) (out= 748)(deflated 46%)
adding: axis2-web/InActivateService.jsp(in = 2752) (out= 1246)(deflated 54%)
adding: axis2-web/listGroupService.jsp(in = 3907) (out= 1395)(deflated 64%)
adding: axis2-web/engagingtoanoperation.jsp(in = 4694) (out= 1359)(deflated 71%)
adding: WEB-INF/(in = 0) (out= 0)(stored 0%)
adding: WEB-INF/conf/(in = 0) (out= 0)(stored 0%)
adding: WEB-INF/conf/axis2.xml(in = 29605) (out= 6789)(deflated 77%)
adding: WEB-INF/modules/(in = 0) (out= 0)(stored 0%)
adding: WEB-INF/modules/soapmonitor-1.5.1.mar(in = 37303) (out= 33475)(deflated 10%)
adding: WEB-INF/modules/mex-1.5.1.mar(in = 33793) (out= 29850)(deflated 11%)
adding: WEB-INF/modules/scripting-1.5.1.mar(in = 24267) (out= 21384)(deflated 11%)
adding: WEB-INF/modules/mtompolicy-1.5.1.mar(in = 13882) (out= 12230)(deflated 11%)
adding: WEB-INF/modules/modules.list(in = 1666) (out= 518)(deflated 68%)
adding: WEB-INF/modules/ping-1.5.1.mar(in = 12837) (out= 11369)(deflated 11%)
adding: WEB-INF/modules/addressing-1.5.1.mar(in = 24917) (out= 22968)(deflated 7%)
adding: WEB-INF/services/(in = 0) (out= 0)(stored 0%)
adding: WEB-INF/services/PartyIdService.aar(in = 4115) (out= 3892)(deflated 5%)
adding: WEB-INF/services/services.list(in = 813) (out= 469)(deflated 42%)
adding: WEB-INF/services/PartyIdService/(in = 0) (out= 0)(stored 0%)
adding: WEB-INF/services/PartyIdService/META-INF/(in = 0) (out= 0)(stored 0%)
adding: WEB-INF/services/PartyIdService/META-INF/services.xml(in = 514) (out= 249)(deflated 51%)
adding: WEB-INF/services/PartyIdService/com/(in = 0) (out= 0)(stored 0%)
adding: WEB-INF/services/PartyIdService/com/ocbc/(in = 0) (out= 0)(stored 0%)
adding: WEB-INF/services/PartyIdService/com/ocbc/unica/(in = 0) (out= 0)(stored 0%)
adding: WEB-INF/services/PartyIdService/com/ocbc/unica/interact/(in = 0) (out= 0)(stored 0%)
adding: WEB-INF/services/PartyIdService/com/ocbc/unica/interact/PartyIdService.class(in = 5191) (out= 2753)(deflated 46%)
adding: WEB-INF/services/PartyIdService/com/ocbc/unica/interact/NameValuePair.class(in = 1608) (out= 599)(deflated 62%)
adding: WEB-INF/services/version.aar(in = 1804) (out= 1413)(deflated 21%)
adding: WEB-INF/classes/(in = 0) (out= 0)(stored 0%)
adding: WEB-INF/classes/org/(in = 0) (out= 0)(stored 0%)
adding: WEB-INF/classes/org/apache/(in = 0) (out= 0)(stored 0%)
adding: WEB-INF/classes/org/apache/axis2/(in = 0) (out= 0)(stored 0%)
adding: WEB-INF/classes/org/apache/axis2/webapp/(in = 0) (out= 0)(stored 0%)
adding: WEB-INF/classes/org/apache/axis2/webapp/AxisAdminServlet.class(in = 2355) (out= 1070)(deflated 54%)
adding: WEB-INF/classes/org/apache/axis2/webapp/AdminAgent.class(in = 18104) (out= 7646)(deflated 57%)
adding: WEB-INF/classes/partyIdService.properties(in = 570) (out= 268)(deflated 52%)
adding: WEB-INF/classes/commons-logging.properties(in = 1387) (out= 645)(deflated 53%)
adding: WEB-INF/classes/log4j.properties(in = 2341) (out= 891)(deflated 61%)
adding: WEB-INF/classes/com/(in = 0) (out= 0)(stored 0%)
adding: WEB-INF/classes/com/ocbc/(in = 0) (out= 0)(stored 0%)
adding: WEB-INF/classes/com/ocbc/unica/(in = 0) (out= 0)(stored 0%)
adding: WEB-INF/classes/com/ocbc/unica/interact/(in = 0) (out= 0)(stored 0%)
adding: WEB-INF/classes/com/ocbc/unica/interact/PartyIdService.class(in = 5765) (out= 3009)(deflated 47%)
adding: WEB-INF/classes/com/ocbc/unica/interact/NameValuePair.class(in = 1545) (out= 580)(deflated 62%)
adding: WEB-INF/classes/com/ocbc/unica/interact/PartyIdException.class(in = 452) (out= 292)(deflated 35%)
adding: WEB-INF/lib/(in = 0) (out= 0)(stored 0%)
adding: WEB-INF/lib/wstx-LICENSE.txt(in = 11359) (out= 3949)(deflated 65%)
adding: WEB-INF/lib/axis2-jaxws-1.5.1.jar(in = 643786) (out= 578698)(deflated 10%)
adding: WEB-INF/lib/neethi-LICENSE.txt(in = 11358) (out= 3948)(deflated 65%)
adding: WEB-INF/lib/axiom-impl-LICENSE.txt(in = 11560) (out= 3963)(deflated 65%)
adding: WEB-INF/lib/neethi-2.0.4.jar(in = 32900) (out= 29479)(deflated 10%)
adding: WEB-INF/lib/woden-impl-dom-LICENSE.txt(in = 11358) (out= 3948)(deflated 65%)
adding: WEB-INF/lib/annogen-LICENSE.txt(in = 11560) (out= 3963)(deflated 65%)
adding: WEB-INF/lib/axiom-impl-1.2.8.jar(in = 131352) (out= 120119)(deflated 8%)
adding: WEB-INF/lib/XmlSchema-LICENSE.txt(in = 11560) (out= 3963)(deflated 65%)
adding: WEB-INF/lib/axiom-dom-LICENSE.txt(in = 11358) (out= 3948)(deflated 65%)
adding: WEB-INF/lib/axis2-adb-codegen-1.5.1.jar(in = 168186) (out= 163512)(deflated 2%)
adding: WEB-INF/lib/axis2-metadata-1.5.1.jar(in = 392467) (out= 351232)(deflated 10%)
adding: WEB-INF/lib/mex-1.5.1.mar.jar(in = 33793) (out= 29850)(deflated 11%)
adding: WEB-INF/lib/axis2-LICENSE.txt(in = 11358) (out= 3948)(deflated 65%)
adding: WEB-INF/lib/axis2-java2wsdl-1.5.1.jar(in = 25976) (out= 23668)(deflated 8%)
adding: WEB-INF/lib/axis2-saaj-1.5.1.jar(in = 88619) (out= 83767)(deflated 5%)
adding: WEB-INF/lib/axis2-adb-1.5.1.jar(in = 777098) (out= 699337)(deflated 10%)
adding: WEB-INF/lib/axis2-codegen-1.5.1.jar(in = 244009) (out= 225019)(deflated 7%)
adding: WEB-INF/lib/activation-LICENSE.txt(in = 16834) (out= 5470)(deflated 67%)
adding: WEB-INF/lib/axis2-kernel-1.5.1.jar(in = 997666) (out= 933311)(deflated 6%)
adding: WEB-INF/lib/mtompolicy-1.5.1..jar(in = 13882) (out= 12230)(deflated 11%)
adding: WEB-INF/lib/axis2-jibx-1.5.1.jar(in = 35407) (out= 33344)(deflated 5%)
adding: WEB-INF/lib/commons-codec-1.3.jar(in = 46725) (out= 41643)(deflated 10%)
adding: WEB-INF/lib/woden-api-LICENSE.txt(in = 11358) (out= 3948)(deflated 65%)
adding: WEB-INF/lib/log4j-1.2.15.jar(in = 391834) (out= 356984)(deflated 8%)
adding: WEB-INF/lib/axis2-jaxbri-1.5.1.jar(in = 25500) (out= 23397)(deflated 8%)
adding: WEB-INF/lib/axis2-mtompolicy-1.5.1.jar(in = 13523) (out= 11224)(deflated 17%)
adding: WEB-INF/lib/commons-logging-1.1.1.jar(in = 60686) (out= 55987)(deflated 7%)
adding: WEB-INF/lib/mail-LICENSE.txt(in = 16834) (out= 5470)(deflated 67%)
adding: WEB-INF/lib/wsdl4j-LICENSE.txt(in = 11663) (out= 4074)(deflated 65%)
adding: WEB-INF/lib/axiom-api-LICENSE.txt(in = 11358) (out= 3948)(deflated 65%)
adding: WEB-INF/lib/axis2-spring-1.5.1.jar(in = 11194) (out= 9280)(deflated 17%)
adding: WEB-INF/lib/commons-logging-LICENSE.txt(in = 11359) (out= 3949)(deflated 65%)
adding: WEB-INF/lib/commons-io-LICENSE.txt(in = 11359) (out= 3949)(deflated 65%)
adding: WEB-INF/lib/axiom-dom-1.2.8.jar(in = 161377) (out= 148664)(deflated 7%)
adding: WEB-INF/lib/axis2-ant-plugin-1.5.1.jar(in = 16740) (out= 14896)(deflated 11%)
adding: WEB-INF/lib/commons-io-1.4.jar(in = 109043) (out= 97889)(deflated 10%)
adding: WEB-INF/lib/mail-1.4.jar(in = 388826) (out= 362457)(deflated 6%)
adding: WEB-INF/lib/scripting-1.5.1.jar(in = 24267) (out= 21384)(deflated 11%)
adding: WEB-INF/lib/woden-api-1.0M8.jar(in = 149442) (out= 125427)(deflated 16%)
adding: WEB-INF/lib/axis2-transport-http-1.5.1.jar(in = 145208) (out= 133878)(deflated 7%)
adding: WEB-INF/lib/axis2-transport-local-1.5.1.jar(in = 10840) (out= 8817)(deflated 18%)
adding: WEB-INF/lib/woden-impl-dom-1.0M8.jar(in = 225594) (out= 207319)(deflated 8%)
adding: WEB-INF/lib/addressing-1.5.1.jar(in = 24917) (out= 22968)(deflated 7%)
adding: WEB-INF/lib/axis2-xmlbeans-1.5.1.jar(in = 26599) (out= 24280)(deflated 8%)
adding: WEB-INF/lib/commons-lang-2.3.jar(in = 245274) (out= 228453)(deflated 6%)
adding: WEB-INF/lib/commons-fileupload-LICENSE.txt(in = 11560) (out= 3963)(deflated 65%)
adding: WEB-INF/lib/axis2-clustering-1.5.1.jar(in = 101955) (out= 90906)(deflated 10%)
adding: WEB-INF/lib/log4j-LICENSE.txt(in = 11358) (out= 3948)(deflated 65%)
adding: WEB-INF/lib/commons-fileupload-1.2.jar(in = 53082) (out= 45474)(deflated 14%)
adding: WEB-INF/lib/ping-1.5.1.jar(in = 12837) (out= 11369)(deflated 11%)
adding: WEB-INF/lib/commons-httpclient-3.1.jar(in = 305001) (out= 280532)(deflated 8%)
adding: WEB-INF/lib/axis2-fastinfoset-1.5.1.jar(in = 71371) (out= 65788)(deflated 7%)
adding: WEB-INF/lib/XmlSchema-1.4.3.jar(in = 143145) (out= 126536)(deflated 11%)
adding: WEB-INF/lib/commons-httpclient-LICENSE.txt(in = 11560) (out= 3963)(deflated 65%)
adding: WEB-INF/lib/wsdl4j-1.6.2.jar(in = 148429) (out= 128062)(deflated 13%)
adding: WEB-INF/lib/geronimo-stax-api_1.0_spec-1.0.1.jar(in = 28804) (out= 22546)(deflated 21%)
adding: WEB-INF/lib/axis2-json-1.5.1.jar(in = 16898) (out= 15056)(deflated 10%)
adding: WEB-INF/lib/httpcore-4.0.jar(in = 172914) (out= 152751)(deflated 11%)
adding: WEB-INF/lib/commons-codec-LICENSE.txt(in = 11560) (out= 3963)(deflated 65%)
adding: WEB-INF/lib/activation-1.1.jar(in = 63018) (out= 58118)(deflated 7%)
adding: WEB-INF/lib/wstx-asl-3.2.4.jar(in = 520092) (out= 494747)(deflated 4%)
adding: WEB-INF/lib/soapmonitor-1.5.1.jar(in = 37303) (out= 33475)(deflated 10%)
adding: WEB-INF/lib/axiom-api-1.2.8.jar(in = 245780) (out= 221545)(deflated 9%)
adding: WEB-INF/lib/axis2-corba-1.5.1.jar(in = 141770) (out= 133444)(deflated 5%)
adding: WEB-INF/web.xml(in = 1738) (out= 450)(deflated 74%)




7. Deploy on WebSphere:
     Install as Enterprise Application

  
 Choose Fast Path



 Put PartyIdService as Context Root




 Click on Class loading and update detection:
 Change to parent last:

 Go to Manage Modules:

 Change to parent last







8. If successful:
[7/12/15 16:19:19:981 SGT] 00000058 AdminHelper   A   ADMN1008I: An attempt is made to start the PartyIdService_war application. (User ID = defaultWIMFileBasedRealm/admin)
[7/12/15 16:19:20:011 SGT] 00000058 CompositionUn A   WSVR0190I: Starting composition unit WebSphere:cuname=PartyIdService_war in BLA WebSphere:blaname=PartyIdService_war.
[7/12/15 16:19:20:152 SGT] 00000058 ApplicationMg A   WSVR0200I: Starting application: PartyIdService_war
[7/12/15 16:19:20:154 SGT] 00000058 ApplicationMg A   WSVR0204I: Application: PartyIdService_war  Application build level: Unknown
[7/12/15 16:19:20:883 SGT] 00000058 webapp        I com.ibm.ws.webcontainer.webapp.WebGroupImpl WebGroup SRVE0169I: Loading Web Module: PartyIdService.
[7/12/15 16:19:20:913 SGT] 00000058 WASSessionCor I SessionContextRegistry getSessionContext SESN0176I: Will create a new session context for application key default_host/PartyIdService
[7/12/15 16:19:23:556 SGT] 00000058 SystemOut     O [INFO] Clustering has been disabled
[7/12/15 16:19:23:633 SGT] 00000058 SystemOut     O [INFO] Deploying module: soapmonitor-1.5.1 - file:/apps/IBM/WebSphere8.5.5/AppServer/profiles/uirt/installedApps/localhostNode04Cell/PartyIdService_war.ear/PartyIdService.war/WEB-INF/modules/soapmonitor-1.5.1.mar
[7/12/15 16:19:23:646 SGT] 00000058 SystemOut     O [INFO] Deploying module: metadataExchange-1.5.1 - file:/apps/IBM/WebSphere8.5.5/AppServer/profiles/uirt/installedApps/localhostNode04Cell/PartyIdService_war.ear/PartyIdService.war/WEB-INF/modules/mex-1.5.1.mar
[7/12/15 16:19:23:650 SGT] 00000058 SystemOut     O [INFO] Deploying module: script-1.5.1 - file:/apps/IBM/WebSphere8.5.5/AppServer/profiles/uirt/installedApps/localhostNode04Cell/PartyIdService_war.ear/PartyIdService.war/WEB-INF/modules/scripting-1.5.1.mar
[7/12/15 16:19:23:656 SGT] 00000058 SystemOut     O [INFO] Deploying module: mtompolicy-1.5.1 - file:/apps/IBM/WebSphere8.5.5/AppServer/profiles/uirt/installedApps/localhostNode04Cell/PartyIdService_war.ear/PartyIdService.war/WEB-INF/modules/mtompolicy-1.5.1.mar
[7/12/15 16:19:23:660 SGT] 00000058 SystemOut     O [INFO] Deploying module: ping-1.5.1 - file:/apps/IBM/WebSphere8.5.5/AppServer/profiles/uirt/installedApps/localhostNode04Cell/PartyIdService_war.ear/PartyIdService.war/WEB-INF/modules/ping-1.5.1.mar
[7/12/15 16:19:23:680 SGT] 00000058 SystemOut     O [INFO] Deploying module: addressing-1.5.1 - file:/apps/IBM/WebSphere8.5.5/AppServer/profiles/uirt/installedApps/localhostNode04Cell/PartyIdService_war.ear/PartyIdService.war/WEB-INF/modules/addressing-1.5.1.mar
[7/12/15 16:19:23:693 SGT] 00000058 SystemOut     O [INFO] Deploying module: mtompolicy-1.5.1 - file:/apps/IBM/WebSphere8.5.5/AppServer/profiles/uirt/installedApps/localhostNode04Cell/PartyIdService_war.ear/PartyIdService.war/WEB-INF/lib/mtompolicy-1.5.1..jar
[7/12/15 16:19:23:697 SGT] 00000058 SystemOut     O [INFO] Deploying module: script-1.5.1 - file:/apps/IBM/WebSphere8.5.5/AppServer/profiles/uirt/installedApps/localhostNode04Cell/PartyIdService_war.ear/PartyIdService.war/WEB-INF/lib/scripting-1.5.1.jar
[7/12/15 16:19:23:705 SGT] 00000058 SystemOut     O [INFO] Deploying module: metadataExchange-1.5.1 - file:/apps/IBM/WebSphere8.5.5/AppServer/profiles/uirt/installedApps/localhostNode04Cell/PartyIdService_war.ear/PartyIdService.war/WEB-INF/lib/mex-1.5.1.jar
[7/12/15 16:19:23:718 SGT] 00000058 SystemOut     O [INFO] Deploying module: addressing-1.5.1 - file:/apps/IBM/WebSphere8.5.5/AppServer/profiles/uirt/installedApps/localhostNode04Cell/PartyIdService_war.ear/PartyIdService.war/WEB-INF/lib/addressing-1.5.1.jar
[7/12/15 16:19:23:720 SGT] 00000058 SystemOut     O [INFO] Deploying module: ping-1.5.1 - file:/apps/IBM/WebSphere8.5.5/AppServer/profiles/uirt/installedApps/localhostNode04Cell/PartyIdService_war.ear/PartyIdService.war/WEB-INF/lib/ping-1.5.1.jar
[7/12/15 16:19:23:729 SGT] 00000058 SystemOut     O [INFO] Deploying module: soapmonitor-1.5.1 - file:/apps/IBM/WebSphere8.5.5/AppServer/profiles/uirt/installedApps/localhostNode04Cell/PartyIdService_war.ear/PartyIdService.war/WEB-INF/lib/soapmonitor-1.5.1.jar
[7/12/15 16:19:23:819 SGT] 00000058 SystemOut     O [INFO] Deploying Web service: PartyIdService - file:/apps/IBM/WebSphere8.5.5/AppServer/profiles/uirt/installedApps/localhostNode04Cell/PartyIdService_war.ear/PartyIdService.war/WEB-INF/services/PartyIdService/
[7/12/15 16:19:23:833 SGT] 00000058 SystemOut     O [INFO] Deploying Web service: version.aar - file:/apps/IBM/WebSphere8.5.5/AppServer/profiles/uirt/installedApps/localhostNode04Cell/PartyIdService_war.ear/PartyIdService.war/WEB-INF/services/version.aar
[7/12/15 16:19:23:851 SGT] 00000058 ServletWrappe I com.ibm.ws.webcontainer.servlet.ServletWrapper init SRVE0242I: [PartyIdService_war] [/PartyIdService] [AxisAdminServlet]: Initialization successful.
[7/12/15 16:19:23:852 SGT] 00000058 webcontainer  I com.ibm.ws.webcontainer.VirtualHostImpl addWebApplication SRVE0250I: Web Module PartyIdService has been bound to default_host[*:9083,*:80,*:9446,*:5067,*:5066,*:443].
[7/12/15 16:19:23:868 SGT] 00000058 ApplicationMg A   WSVR0221I: Application started: PartyIdService_war
[7/12/15 16:19:23:870 SGT] 00000058 CompositionUn A   WSVR0191I: Composition unit WebSphere:cuname=PartyIdService_war in BLA WebSphere:blaname=PartyIdService_war started.

9. Test by calling the WSDL end point:
http://localhost.localdomain:9083/PartyIdService/services/PartyIdService?wsdl



Sunday, January 22, 2012

Difference between hashing and encryption

Neither MD5 nor SHA-1 is an "encryption" algorithm. Both are "hashing" algorithms.

In the simple sense, something that is encrypted can later be decrypted to get the original back.

Something that is properly hashed stays that way; it is a 'fingerprint' of the original pattern that cannot be 'dehashed' to reconstruct the original.

Ideally, there is only a single unique hash value that can be derived from each unique string of characters.

Of course, it's easy to prove that that's not possible when hash values are small -- small as in 160 or 256 or 512 bits. But in practice, because the strings of characters aren't random, because they're patterns of words more than just patterns of letters, the number of likely hash values gets smaller.

The value of unique hashes is that they can be used to verify that the original string hasn't been changed. If I send you a message along with a hash, you can run the message through the hash algorithm to see if the same hash value comes out. If it does, you can feel confident that you're reading exactly what was written.

Writing a password encryptor in Java

Happy New Year everyone!

In a recent project, I need to write a password encryptor so that passwords using my shell scripts are not exposed in clear text. Note that this does not stop people from getting the passwords - it just does not expose the password in clear text.

After doing some research, I've decided to use AES to encrypt my password. It will take in 2 parameters - the key and the password.

Two problems arise:
1. The encryption method outputs in bytes - I need to handle this so that I can encode the byte output as a String (text) and then be able to decode it back to byte to decrypt it back. Many of the examples out there uses sun.misc.Base64Encoder but this is not encouraged (do a google to find out why). There are alternatives. Here's a good link on this. Basically using Apache Commons Codec or Base64.

But the better way if you are using Java6 is to use import javax.xml.bind.DatatypeConverter or else use JavaMail which provides Base64 encoding/decoding via MimeUtility.

In the end I used javax.xml.bind.DatatypeConverter since I am using Java6.

2. The second problem is since I am letting the users decide what key to use, I need to be able to hash the key via MD5 or SHA, then extract the bytes from the hash into the key byte[].

A good discussion on this can be found here.

Note: here's a good link on using DES to do this.

Anyway, here's my final code:
import javax.crypto.Cipher;
import javax.crypto.spec.*;

import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;

import javax.xml.bind.DatatypeConverter;


public class AES {

// init vector for randomness
static byte[] iv = { (byte) 0xcb, (byte) 0x53, (byte) 0x03, (byte) 0x0f,
(byte) 0xe0, (byte) 0x79, (byte) 0x9d, (byte) 0xdc, (byte) 0x80,
(byte) 0xa9, (byte) 0x83, (byte) 0xf1, (byte) 0x03, (byte) 0xb6,
(byte) 0x59, (byte) 0x83 };


public static void encryptText(String text, String password) throws Exception {
SecretKeySpec skeySpec = new SecretKeySpec(getKeyFromPassword(password), "AES");
IvParameterSpec ivSpec = new IvParameterSpec(iv);
Cipher aes = Cipher.getInstance("AES/CBC/PKCS5Padding");
aes.init(Cipher.ENCRYPT_MODE, skeySpec, ivSpec);
byte[] encrypted = aes.doFinal((text.getBytes()));
//System.out.println("Encrypted string: " + DatatypeConverter.printBase64Binary(encrypted));
System.out.println(DatatypeConverter.printBase64Binary(encrypted));
}

public static void decryptText(String encrypted, String password) throws Exception {
SecretKeySpec skeySpec = new SecretKeySpec(getKeyFromPassword(password), "AES");
IvParameterSpec ivSpec = new IvParameterSpec(iv);
Cipher aes = Cipher.getInstance("AES/CBC/PKCS5Padding");
aes.init(Cipher.DECRYPT_MODE, skeySpec, ivSpec);
//Cipher cipher = Cipher.getInstance("AES");
//cipher.init(Cipher.DECRYPT_MODE, skeySpec);
byte[] original = aes.doFinal(DatatypeConverter.parseBase64Binary(encrypted));
String originalString = new String(original);
// System.out.println("Decrypted string: " + originalString + " " + asHex(original));
System.out.println(originalString);
}


public static byte[] md5sum(byte[] buffer) {
try {
MessageDigest md5 = MessageDigest.getInstance("MD5");
md5.update(buffer);
return md5.digest();
} catch (NoSuchAlgorithmException e) {
System.out.println("MD5 Algorithm not available on this machine");
}
return null;
}

// converts key to machine readable form
public static byte[] getKeyFromPassword(String s) {
return md5sum(s.toString().getBytes());
}

// prints pretty error messages and exits
public static void errorExit(String s) {
System.out.println(s);
System.exit(0);
}

public static void main(String[] args) throws Exception {
String usage = "Usage: java AES [-e | -d] [text] [password]";

if (args.length < 2 || args.length > 3) {
errorExit(usage);
}
if (args[0].equalsIgnoreCase("-e")) {
encryptText(args[1], args[2]);
} else if (args[0].equalsIgnoreCase("-d")) {
decryptText(args[1], args[2]);
} else {
System.out.println(usage);
}
Runtime.getRuntime().gc(); // force flush
}
}

Sunday, December 18, 2011

JAXB can't handle interfaces

If you get the following error:

Caused by: com.sun.xml.internal.bind.v2.runtime.IllegalAnnotationsException: 2 counts of IllegalAnnotationExceptions com.unicacorp.interact.api.NameValuePair is an interface, and JAXB can't handle interfaces. this problem is related to the following location:
at com.unicacorp.interact.api.NameValuePair
at public com.unicacorp.interact.api.NameValuePair[] com.singtel
.ma.rto.jaxws.GetCustomerOffers.arg6
at com.singtel.ma.rto.jaxws.GetCustomerOffershttp://www.blogger.com/img/blank.gif
com.unicacorp.interact.api.NameValuePair does not have a no-arg default construc
tor.
this problem is related to the following location:
at com.unicacorp.interact.api.NameValuePairhttp://www.blogger.com/img/blank.gif
at public com.unicacorp.interact.api.NameValuePair[] com.singtel
.ma.rto.jaxws.GetCustomerOffers.arg6
at com.singtel.ma.rto.jaxws.GetCustomerOffers


Make sure you are using the right classes (not interface). If you really need to use interface, check out this link

Adding the "@XmlJavaTypeAdapter(AnyTypeAdapter.class)" annotation to the object interface solved this problem by telling JAXB to use a special type adapter needed for interfaces. @XmlJavaTypeAdapter(AnyTypeAdapter.class) @XmlRootElement public interface MyObject { ... }
Note: The AnyTypeAdapter.java source code is very simple and can be readily found online.


Marshalling Error Encountered

It turns out that adding the AnyTypeAdapter annotation was only part of the solution. Although this annotation lets the web service start successfully, the first call to getMyObjects() resulted in a marshalling error.
INFO: Interceptor has thrown exception, unwinding noworg.apache.cxf.interceptor.Fault: Marshalling Error: class com.attivio.webservice.WebServiceTest$MyObjectImpl1 nor any of its super class is known to this context. Caused by: javax.xml.bind.MarshalException - with linked exception: [javax.xml.bind.JAXBException: class com.attivio.webservice.WebServiceTest$MyObjectImpl1 nor any of its super class is known to this context.]
The final piece of the puzzle was solved by creating a per-module interface, MyApi1, which extends MyApi and has the “@XmlSeeAlso({MyObjectImpl1.class, MyObjectImpl2.class})” annotation. By extending this interface and registering it as the endpoint class, JAXB was able to find the appropriate implementations of the MyObject interface for serialization. By putting the annotation on a module specific interface, instead of the base interface, different modules can have different objects and APIs without the need to know details of the other modules.
@WebService @XmlSeeAlso({MyObjectImpl1.class, MyObjectImpl2.class}) public interface MyApi1 extends MyApi { } public static class MyApiImpl implements MyApi1 { ... }

Tuesday, October 4, 2011

WebSphere & JAX-WS

What better for a novice like me to learn how to deploy Webservices on WebSphere than to try it using hello world.

Here's my code:

1. Web Service Endpoint Interface

/**
*
*/
package com.singtel.ma.rto;

import javax.jws.WebMethod;
import javax.jws.WebService;
import javax.jws.soap.SOAPBinding;
import javax.jws.soap.SOAPBinding.Style;
/**
* @author Main Masrudyn
*
*/
//Service Endpoint Interface
@WebService
public interface RTO {


@WebMethod String getHelloWorldAsString(String name);

}


2. Web Service Endpoint Implementation

package com.singtel.ma.rto;


import javax.jws.WebMethod;
import javax.jws.WebService;

//Service Implementation
@WebService(endpointInterface = "com.singtel.ma.rto.RTO")
public class RTOImpl implements RTO {

public String getHelloWorldAsString(String name) {
return "Hello World JAX-WS " + name;
}

}

3. Deploy on WebSphere, choose Detailed:


4. Ensure Deploy Webservice


5. Click on Service providers - ensure listener start




6. Check the webservice is running : http://rhel55-32.mydomain.com:9080/RTO/RTOImplService/RTOImplService.wsdl