Tuesday, January 31, 2012

Using Apache MyFaces CODI with Siwpas 2.0.0

Hello folks,

It has been a long time to write something in my blog because of very busy business. In this blog post, I would like to share how one can use Apache MyFaces CODI with Siwpas, Simple Web Profile Application Server.

*NOTE : To start your CODI applications in Siwpas, do not put "beans.xml" file into the "WEB-INF/classes/" folder if beans.xml is already exist in "WEB-INF/" folder.

Requirements

  • Download Siwpas 2.0.0 trial from http://siwpas.mechsoft.com.tr (In Siwpas 3.0.0, we will remove license constraints to start Siwpas!)
  • Checkout CODI JSF 2.0 sample from CODI SVN
    • svn co http://svn.apache.org/repos/asf/myfaces/extensions/cdi/trunk/examples/ codi-examples
    • cd \codi-examples\jsf-examples\hello_myfaces-codi_jsf20\src\main\resources\META-INF
    • Remove beans.xml file. (For Siwpas, this file is unnecessary because beans.xml is already exist in WEB-INF/ folder of the web application. Otherwise, CODI is not deployed correctly!)
    • Run the following command to create WAR archive
      • mvn clean install -Denvironment=jee6
    • Now, you have a WAR archive in   "\codi-examples\jsf-examples\hello_myfaces-codi_jsf20\target" folder with name "hello-myfaces-codi-jsf20-example-1.0.4-SNAPSHOT.war"
    • Rename  "hello-myfaces-codi-jsf20-example-1.0.4-SNAPSHOT.war" to "hello-codi.war"
  • Deploy "hello-codi.war" to Siwpas
    • Put  "hello-codi.war" into the Siwpas "webapps" folder.
Start Siwpas and Open Application
  • Go to Siwpas bin folder
    • cd /bin folder of the Siwpas
  • Start Siwpas
    • siwpas.bat run
  • Open Browser Page 
    • http://localhost:8080/hello-codi
Links

Enjoy!