<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" version="2.0">

<channel>
	<title>CK's Developer Blog</title>
	
	<link>http://www.karthikeyanc.com/blog</link>
	<description>My Java JEE Code Notes</description>
	<lastBuildDate>Sun, 07 Feb 2010 04:33:28 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.5</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/CksDeveloperBlog" /><feedburner:info xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" uri="cksdeveloperblog" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><item>
		<title>How will you force reload a page in Seam when user clicks Back button</title>
		<link>http://www.karthikeyanc.com/blog/index.php/2010/02/how-will-you-force-reload-a-page-in-seam-when-user-clicks-back-button/</link>
		<comments>http://www.karthikeyanc.com/blog/index.php/2010/02/how-will-you-force-reload-a-page-in-seam-when-user-clicks-back-button/#comments</comments>
		<pubDate>Sun, 07 Feb 2010 04:33:28 +0000</pubDate>
		<dc:creator>Karthikeyan C</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Seam]]></category>

		<guid isPermaLink="false">http://www.karthikeyanc.com/blog/?p=153</guid>
		<description><![CDATA[In Seam, to force reload a page when user clicks Back button add the following in pages.xml. That is to make the page expire immediately once it is rendered. If the user clicks on back button, the page is reloaded again by hitting the server.


&#60;page view-id=&#34;/pathtoview/yourviewname.xhtml&#34;&#62;
 &#60;header name=&#34;Cache-Control&#34;&#62;no-cache, no-store, max-age=0, must-revalidate&#60;/header&#62;
 &#60;/page&#62;






]]></description>
			<content:encoded><![CDATA[<p>In Seam, to force reload a page when user clicks Back button add the following in pages.xml. That is to make the page expire immediately once it is rendered. If the user clicks on back button, the page is reloaded again by hitting the server.</p>
<pre class="brush: xml;">

&lt;page view-id=&quot;/pathtoview/yourviewname.xhtml&quot;&gt;
 &lt;header name=&quot;Cache-Control&quot;&gt;no-cache, no-store, max-age=0, must-revalidate&lt;/header&gt;
 &lt;/page&gt;
</pre>
<!-- Easy AdSense V2.82 -->
<!-- Post[count: 2] -->
<div class="ezAdsense adsense adsense-leadout" style="text-align:left;margin:12px;"><script type="text/javascript"><!--
google_ad_client = "pub-1213643583738263";
/* Plugin: ezAds 234x60, created 6/21/09 */
google_ad_slot = "5695603233";
google_ad_width = 234;
google_ad_height = 60;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></div><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fwww.karthikeyanc.com%2Fblog%2Findex.php%2F2010%2F02%2Fhow-will-you-force-reload-a-page-in-seam-when-user-clicks-back-button%2F&amp;linkname=How%20will%20you%20force%20reload%20a%20page%20in%20Seam%20when%20user%20clicks%20Back%20button"><img src="http://www.karthikeyanc.com/blog/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a>
<p><a href="http://feedads.g.doubleclick.net/~a/n4M3rMjB-pcxWt7u6PQWmsDFYUU/0/da"><img src="http://feedads.g.doubleclick.net/~a/n4M3rMjB-pcxWt7u6PQWmsDFYUU/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/n4M3rMjB-pcxWt7u6PQWmsDFYUU/1/da"><img src="http://feedads.g.doubleclick.net/~a/n4M3rMjB-pcxWt7u6PQWmsDFYUU/1/di" border="0" ismap="true"></img></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.karthikeyanc.com/blog/index.php/2010/02/how-will-you-force-reload-a-page-in-seam-when-user-clicks-back-button/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How To ReRender PrimeFaces growl after Ajax request from RichFaces component</title>
		<link>http://www.karthikeyanc.com/blog/index.php/2010/01/how-to-rerender-primefaces-growl-after-ajax-request-from-richfaces-component/</link>
		<comments>http://www.karthikeyanc.com/blog/index.php/2010/01/how-to-rerender-primefaces-growl-after-ajax-request-from-richfaces-component/#comments</comments>
		<pubDate>Sun, 17 Jan 2010 13:57:22 +0000</pubDate>
		<dc:creator>Karthikeyan C</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[primefaces]]></category>

		<guid isPermaLink="false">http://www.karthikeyanc.com/blog/?p=152</guid>
		<description><![CDATA[The trick is to embed p:growl within a4j:outputPanel (else for some reason PrimeFaces growl is not rerendered even after assigning an id to it)


&#60;a4j:outputPanel id=&#34;pgrowl&#34;&#62;
 &#60;p:growl  showDetail=&#34;true&#34;  sticky=&#34;true&#34;/&#62;
 &#60;/a4j:outputPanel&#62;

The usage is like


&#60;a4j:commandButton reRender=&#34;pgrowl&#34; ..........

]]></description>
			<content:encoded><![CDATA[<p>The trick is to embed p:growl within a4j:outputPanel (else for some reason PrimeFaces growl is not rerendered even after assigning an id to it)</p>
<pre class="brush: xml;">

&lt;a4j:outputPanel id=&quot;pgrowl&quot;&gt;
 &lt;p:growl  showDetail=&quot;true&quot;  sticky=&quot;true&quot;/&gt;
 &lt;/a4j:outputPanel&gt;
</pre>
<p>The usage is like</p>
<pre class="brush: xml;">

&lt;a4j:commandButton reRender=&quot;pgrowl&quot; ..........
</pre>
<a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fwww.karthikeyanc.com%2Fblog%2Findex.php%2F2010%2F01%2Fhow-to-rerender-primefaces-growl-after-ajax-request-from-richfaces-component%2F&amp;linkname=How%20To%20ReRender%20PrimeFaces%20growl%20after%20Ajax%20request%20from%20RichFaces%20component"><img src="http://www.karthikeyanc.com/blog/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a>
<p><a href="http://feedads.g.doubleclick.net/~a/UB2_EZH4Vbn5TCzaIGdvAJj7ixA/0/da"><img src="http://feedads.g.doubleclick.net/~a/UB2_EZH4Vbn5TCzaIGdvAJj7ixA/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/UB2_EZH4Vbn5TCzaIGdvAJj7ixA/1/da"><img src="http://feedads.g.doubleclick.net/~a/UB2_EZH4Vbn5TCzaIGdvAJj7ixA/1/di" border="0" ismap="true"></img></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.karthikeyanc.com/blog/index.php/2010/01/how-to-rerender-primefaces-growl-after-ajax-request-from-richfaces-component/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Google’s Chatback badge similar to Yahoo’s PingBox</title>
		<link>http://www.karthikeyanc.com/blog/index.php/2010/01/googles-chatback-badge-similar-to-yahoos-pingbox/</link>
		<comments>http://www.karthikeyanc.com/blog/index.php/2010/01/googles-chatback-badge-similar-to-yahoos-pingbox/#comments</comments>
		<pubDate>Fri, 15 Jan 2010 15:56:00 +0000</pubDate>
		<dc:creator>Karthikeyan C</dc:creator>
				<category><![CDATA[Tools / Utilities]]></category>
		<category><![CDATA[Google]]></category>

		<guid isPermaLink="false">http://www.karthikeyanc.com/blog/?p=151</guid>
		<description><![CDATA[Recently came across Google&#8217;s chatback badge for your website or blog&#8217;s visitors to chat with you.
http://www.google.com/talk/service/badge/New
]]></description>
			<content:encoded><![CDATA[<p>Recently came across Google&#8217;s chatback badge for your website or blog&#8217;s visitors to chat with you.</p>
<p><a href="http://www.google.com/talk/service/badge/New" target="_blank">http://www.google.com/talk/service/badge/New</a></p>
<a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fwww.karthikeyanc.com%2Fblog%2Findex.php%2F2010%2F01%2Fgoogles-chatback-badge-similar-to-yahoos-pingbox%2F&amp;linkname=Google%26%238217%3Bs%20Chatback%20badge%20similar%20to%20Yahoo%26%238217%3Bs%20PingBox"><img src="http://www.karthikeyanc.com/blog/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a>
<p><a href="http://feedads.g.doubleclick.net/~a/3uss44pBkz2OHbwkhlNaZEe85v0/0/da"><img src="http://feedads.g.doubleclick.net/~a/3uss44pBkz2OHbwkhlNaZEe85v0/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/3uss44pBkz2OHbwkhlNaZEe85v0/1/da"><img src="http://feedads.g.doubleclick.net/~a/3uss44pBkz2OHbwkhlNaZEe85v0/1/di" border="0" ismap="true"></img></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.karthikeyanc.com/blog/index.php/2010/01/googles-chatback-badge-similar-to-yahoos-pingbox/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Fixing audio hiccup (breaking) when using mencoder for conversion</title>
		<link>http://www.karthikeyanc.com/blog/index.php/2010/01/fixing-auido-hiccup-breaking-when-using-mencoder-for-conversion/</link>
		<comments>http://www.karthikeyanc.com/blog/index.php/2010/01/fixing-auido-hiccup-breaking-when-using-mencoder-for-conversion/#comments</comments>
		<pubDate>Sat, 09 Jan 2010 10:04:43 +0000</pubDate>
		<dc:creator>Karthikeyan C</dc:creator>
				<category><![CDATA[Tools / Utilities]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://www.karthikeyanc.com/blog/?p=150</guid>
		<description><![CDATA[I use recordmydesktop to produce screen casts occasionally.  I was using the below  command to convert from ogv to flv format.


mencoder -of lavf -oac mp3lame -lameopts abr:br=56 -srate 22050 -ovc lavc -lavcopts vcodec=flv:vbitrate=250:mbd=2:mv0:trell:v4mv:cbp:last_pred=3 -vf scale=800:600 -o tutorial.flv out.ogv

In the output file which is tutorial.flv, there were small breaks in audio (hiccups). The ogv file was [...]]]></description>
			<content:encoded><![CDATA[<p>I use recordmydesktop to produce screen casts occasionally.  I was using the below  command to convert from ogv to flv format.</p>
<pre class="brush: xml;">

mencoder -of lavf -oac mp3lame -lameopts abr:br=56 -srate 22050 -ovc lavc -lavcopts vcodec=flv:vbitrate=250:mbd=2:mv0:trell:v4mv:cbp:last_pred=3 -vf scale=800:600 -o tutorial.flv out.ogv
</pre>
<p>In the output file which is tutorial.flv, there were small breaks in audio (hiccups). The ogv file was fine as when i played in movie player there were no hiccpus. So the hiccups were introduced during the conversion.</p>
<p><a href="http://en.gentoo-wiki.com/wiki/HOWTO_Mencoder_Introduction_Guide" target="_blank">http://en.gentoo-wiki.com/wiki/HOWTO_Mencoder_Introduction_Guide</a> helped me to make use of the command <strong>mencoder -oac help </strong>to view the options available and I chose the right options. This helped me to create the output file without any audio hiccups.</p>
<a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fwww.karthikeyanc.com%2Fblog%2Findex.php%2F2010%2F01%2Ffixing-auido-hiccup-breaking-when-using-mencoder-for-conversion%2F&amp;linkname=Fixing%20audio%20hiccup%20%28breaking%29%20when%20using%20mencoder%20for%20conversion"><img src="http://www.karthikeyanc.com/blog/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a>
<p><a href="http://feedads.g.doubleclick.net/~a/YRL4QabRuJepocrtSYaAuueaZTA/0/da"><img src="http://feedads.g.doubleclick.net/~a/YRL4QabRuJepocrtSYaAuueaZTA/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/YRL4QabRuJepocrtSYaAuueaZTA/1/da"><img src="http://feedads.g.doubleclick.net/~a/YRL4QabRuJepocrtSYaAuueaZTA/1/di" border="0" ismap="true"></img></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.karthikeyanc.com/blog/index.php/2010/01/fixing-auido-hiccup-breaking-when-using-mencoder-for-conversion/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to install wordpress 2.9 in Apache on your localhost in Ubuntu 9.10</title>
		<link>http://www.karthikeyanc.com/blog/index.php/2009/12/how-to-install-wordpress-2-9-on-apache-on-your-localhost-in-ubuntu-9-10/</link>
		<comments>http://www.karthikeyanc.com/blog/index.php/2009/12/how-to-install-wordpress-2-9-on-apache-on-your-localhost-in-ubuntu-9-10/#comments</comments>
		<pubDate>Tue, 29 Dec 2009 04:44:59 +0000</pubDate>
		<dc:creator>Karthikeyan C</dc:creator>
				<category><![CDATA[Installation / Configuration]]></category>

		<guid isPermaLink="false">http://www.karthikeyanc.com/blog/?p=148</guid>
		<description><![CDATA[This post contains the steps involved to setup wordpress on your local machine in Ubuntu. ( You may want to setup a wordpress blog on local machine to customize your blog (look and feel etc) so as to save the time to FTP to a remote location.)

Install Apache server using the command sudo apt-get install [...]]]></description>
			<content:encoded><![CDATA[<p>This post contains the steps involved to setup wordpress on your local machine in Ubuntu. ( You may want to setup a wordpress blog on local machine to customize your blog (look and feel etc) so as to save the time to FTP to a remote location.)</p>
<ol>
<li>Install Apache server using the command <strong>sudo apt-get install apache2</strong></li>
<li>Install PHP with <strong>sudo apt-get install php5</strong></li>
<li>Install the MySQL Database  <strong>sudo apt-get install mysql-server</strong></li>
<li>Install the PHP module for the Database <strong>sudo apt-get install php5-mysql</strong></li>
<li>Download the latest stable version of wordpress from <a href="http://wordpress.org/download/">http://wordpress.org/download/</a></li>
<li>Extract the wordpress tar.gz or zip file to <strong>/var/www </strong>(using the command <strong>tar -C /var/www -zxvf wordpress-2.9.tar.gz</strong>)</li>
<li>Create a MySQL database and if needed a new user who has required privileges.</li>
<li>Navigate to /var/www/wordpress and execute the following command <strong>cp wp-config-sample.php wp-config.php</strong> (You may do this logging in as root user with the command <strong>sudo su</strong> )</li>
<li>Edit wp-config.php using the command <strong>nano wp-config.php</strong> (or use any other editor like <strong><em>gedit</em></strong>) and configure the values for Database connection.</li>
<li>Edit /etc/apache2/httpd.conf file to add the following lines. 
<pre class="brush: xml;">LoadModule php5_module modules/libphp5.so
AddType application/x-httpd-php  .php .phtml</pre>
</li>
<li>Restart apache server using the command <strong>sudo /etc/init.d/apache2 restart</strong></li>
<li>You can access the blog using http://localhost/wordpress</li>
</ol>
<a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fwww.karthikeyanc.com%2Fblog%2Findex.php%2F2009%2F12%2Fhow-to-install-wordpress-2-9-on-apache-on-your-localhost-in-ubuntu-9-10%2F&amp;linkname=How%20to%20install%20wordpress%202.9%20in%20Apache%20on%20your%20localhost%20in%20Ubuntu%209.10"><img src="http://www.karthikeyanc.com/blog/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a>
<p><a href="http://feedads.g.doubleclick.net/~a/ZMfTplKspd1p---ZL9ofSYlUnNk/0/da"><img src="http://feedads.g.doubleclick.net/~a/ZMfTplKspd1p---ZL9ofSYlUnNk/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/ZMfTplKspd1p---ZL9ofSYlUnNk/1/da"><img src="http://feedads.g.doubleclick.net/~a/ZMfTplKspd1p---ZL9ofSYlUnNk/1/di" border="0" ismap="true"></img></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.karthikeyanc.com/blog/index.php/2009/12/how-to-install-wordpress-2-9-on-apache-on-your-localhost-in-ubuntu-9-10/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Tutorial – Your first CXF web service in 10 minutes</title>
		<link>http://www.karthikeyanc.com/blog/index.php/2009/12/tutorial-your-first-cxf-web-service-in-10-minutes/</link>
		<comments>http://www.karthikeyanc.com/blog/index.php/2009/12/tutorial-your-first-cxf-web-service-in-10-minutes/#comments</comments>
		<pubDate>Wed, 16 Dec 2009 14:07:19 +0000</pubDate>
		<dc:creator>Karthikeyan C</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[CXF]]></category>
		<category><![CDATA[maven]]></category>

		<guid isPermaLink="false">http://www.karthikeyanc.com/blog/?p=146</guid>
		<description><![CDATA[This post is for Java developers who wish to start developing web services using CXF.It is assumed you have Tomcat 6.0.x installed on your machine and an IDE that supports Maven projects.
There are 2 Maven projects involved.

 Project 1 is the web application (deployed in Tomcat) which contains the CXF web service which accepts time [...]]]></description>
			<content:encoded><![CDATA[<p>This post is for Java developers who wish to start developing web services using <a href="http://cxf.apache.org/" target="_blank">CXF</a>.It is assumed you have Tomcat 6.0.x installed on your machine and an IDE that supports Maven projects.</p>
<p>There are 2 Maven projects involved.</p>
<ul>
<li> Project 1 is the web application (deployed in Tomcat) which contains the CXF web service which accepts time in milliseconds and returns the related java.util.Date object.</li>
<li>Project 2 is the client side standalone Java code invoking this web service.</li>
</ul>
<p><a href="http://code.google.com/p/karthikeyanc/source/browse/#svn/trunk/exampleprojects/cxfwebappdateconverter" target="_blank">Please click here to browse</a>/checkout the source code of the web application is available in Google code.</p>
<p><a href="http://code.google.com/p/karthikeyanc/source/browse/#svn/trunk/exampleprojects/cxfdateconverterclient" target="_blank">Please click here to browse</a>/checkout the source code of the standalone Java client.</p>
<p>We start with the web service interface provided below which has the method to convert time in milli seconds to Date format.</p>
<pre class="brush: java;">

package com.karthik;

import javax.jws.WebParam;
import javax.jws.WebService;

@WebService
public interface DateConversionService {
 java.util.Date convertDate(@WebParam(name=&quot;timeInMilliSecs&quot;) Long timeInMilliSecs);
}
</pre>
<p>The implementation class is as below.</p>
<pre class="brush: java;">

package com.karthik;

import java.util.Date;
import javax.jws.WebService;

@WebService(endpointInterface=&quot;com.karthik.DateConversionService&quot;)
public class DateConversionServiceImpl implements DateConversionService{

 @Override
 public Date convertDate(Long timeInMilliSecs) {
 return new Date(timeInMilliSecs);
 }

}
</pre>
<p>We have to inform CXF to deploy the web service by providing the necessary details in a Spring Bean configuration file. The file name is cxf.xml and contains the following code (Few XML name spaces are not needed but provided so that we can reuse the same for future posts in CXF series).</p>
<pre class="brush: xml;">

&lt;beans xmlns=&quot;http://www.springframework.org/schema/beans&quot;
 xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot;
 xmlns:jaxws=&quot;http://cxf.apache.org/jaxws&quot;
 xmlns:cxf=&quot;http://cxf.apache.org/core&quot;
 xmlns:http-conf=&quot;http://cxf.apache.org/transports/http/configuration&quot;
 xsi:schemaLocation
 =&quot;http://www.springframework.org/schema/beans
 http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
 http://cxf.apache.org/jaxws
 http://cxf.apache.org/schemas/jaxws.xsd
 http://cxf.apache.org/core
 http://cxf.apache.org/schemas/core.xsd
 http://cxf.apache.org/transports/http/configuration
 http://cxf.apache.org/schemas/configuration/http-conf.xsd&quot;&gt;

 &lt;!-- Load CXF modules from cxf.jar --&gt;
 &lt;import resource=&quot;classpath:META-INF/cxf/cxf.xml&quot; /&gt;
 &lt;import resource=&quot;classpath:META-INF/cxf/cxf-extension-soap.xml&quot; /&gt;
 &lt;import resource=&quot;classpath:META-INF/cxf/cxf-servlet.xml&quot; /&gt;

 &lt;jaxws:endpoint id=&quot;dateconversion&quot;  address=&quot;/DateConversionWS&quot; implementor=&quot;com.karthik.DateConversionServiceImpl&quot;/&gt;

&lt;/beans&gt;
</pre>
<p>Now in web.xml we configure the URL at which CXF servlet will be listening and also inform the location of the configuration file (that is the above cxf.xml).</p>
<pre class="brush: xml;">

&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
&lt;web-app version=&quot;2.5&quot;
 xmlns=&quot;http://java.sun.com/xml/ns/javaee&quot;
 xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot;
 xsi:schemaLocation=&quot;http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd&quot;&gt;
 &lt;displayname&gt;karthikeyanc.com CXF example&lt;/displayname&gt;
 &lt;context-param&gt;
 &lt;param-name&gt;contextConfigLocation&lt;/param-name&gt;
 &lt;param-value&gt;classpath:cxf.xml&lt;/param-value&gt;
 &lt;/context-param&gt;
 &lt;listener&gt;
 &lt;listener-class&gt;
 org.springframework.web.context.ContextLoaderListener
 &lt;/listener-class&gt;
 &lt;/listener&gt;
 &lt;servlet&gt;
 &lt;servlet-name&gt;CXFServlet&lt;/servlet-name&gt;
 &lt;servlet-class&gt;
 org.apache.cxf.transport.servlet.CXFServlet
 &lt;/servlet-class&gt;
 &lt;/servlet&gt;
 &lt;servlet-mapping&gt;
 &lt;servlet-name&gt;CXFServlet&lt;/servlet-name&gt;
 &lt;url-pattern&gt;/services/*&lt;/url-pattern&gt;
 &lt;/servlet-mapping&gt;
 &lt;/web-app&gt;
</pre>
<p><strong>Note:</strong> The <a href="http://code.google.com/p/karthikeyanc/source/browse/trunk/exampleprojects/cxfwebappdateconverter/pom.xml">pom.xml</a> of this web application uses Maven assembly plugin to pack the web service interface which will  be referred as a dependency from the standalone Java client. By doing this we do not duplicate the web service interface file.</p>
<p>Please navigate to the project root folder and run <strong>mvn install</strong>. Under Tomcat_Home/conf/Catalina/localhost, create file called convertdate.xml to configure the context for this web application (As convertdate) and point to the target directory of the maven project as below. (Please change the docBase accordingly). Then start Tomcat. The WSDL can be obtained by typing the following in the URL <strong>http://localhost:8080/convertdate/services/DateConversionWS?wsdl</strong></p>
<pre class="brush: xml;">

&lt;Context path=&quot;/convertdate&quot; docBase=&quot;/home/pathtoprojectroot/cxfwebappdateconverter/target/cxfdate&quot;/&gt;
</pre>
<p><strong>Running the standalone Java client</strong>:</p>
<p>Now you may open the stand alone client project in an IDE (I use NetBeans 6.8) and run DateConversionServiceClient.java. This is the only Java file in the client project. The web service interface comes from the distribution jar ( created when running mvn install command for the web application Maven project). The source code of DateConversionServiceClient.java is as below. (Please change port number accordingly).</p>
<pre class="brush: java;">

package com.karthik.client;

import com.karthik.DateConversionService;
import org.apache.cxf.jaxws.JaxWsProxyFactoryBean;

public class DateConversionServiceClient {

 private static final String ADDRESS=&quot;http://localhost:8080/convertdate/services/DateConversionWS&quot;;
 public static void main(String[] args) {
 JaxWsProxyFactoryBean fb=new JaxWsProxyFactoryBean();
 fb.setAddress(ADDRESS);
 fb.setServiceClass(DateConversionService.class);
 DateConversionService service=(DateConversionService) fb.create();
 System.out.println(&quot;The date converted is :&quot;+service.convertDate(System.currentTimeMillis()));

 }
}
</pre>
<a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fwww.karthikeyanc.com%2Fblog%2Findex.php%2F2009%2F12%2Ftutorial-your-first-cxf-web-service-in-10-minutes%2F&amp;linkname=Tutorial%20%26%238211%3B%20Your%20first%20CXF%20web%20service%20in%2010%20minutes"><img src="http://www.karthikeyanc.com/blog/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a>
<p><a href="http://feedads.g.doubleclick.net/~a/8fY8G8VrGsDfPAa0PGXusdHvHqo/0/da"><img src="http://feedads.g.doubleclick.net/~a/8fY8G8VrGsDfPAa0PGXusdHvHqo/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/8fY8G8VrGsDfPAa0PGXusdHvHqo/1/da"><img src="http://feedads.g.doubleclick.net/~a/8fY8G8VrGsDfPAa0PGXusdHvHqo/1/di" border="0" ismap="true"></img></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.karthikeyanc.com/blog/index.php/2009/12/tutorial-your-first-cxf-web-service-in-10-minutes/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>JBoss Tricks – How to deploy WAR JAR EAR in an external folder (directory)</title>
		<link>http://www.karthikeyanc.com/blog/index.php/2009/12/jboss-tricks-how-to-deploy-war-jar-ear-in-an-external-folder-directory/</link>
		<comments>http://www.karthikeyanc.com/blog/index.php/2009/12/jboss-tricks-how-to-deploy-war-jar-ear-in-an-external-folder-directory/#comments</comments>
		<pubDate>Sat, 12 Dec 2009 05:31:04 +0000</pubDate>
		<dc:creator>Karthikeyan C</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Installation / Configuration]]></category>
		<category><![CDATA[jboss]]></category>

		<guid isPermaLink="false">http://www.karthikeyanc.com/blog/?p=144</guid>
		<description><![CDATA[With JBoss 6.0.0.M1 out to try out the new JSRs the following may be helpful in reducing time to deploy.
The usual way in which we deploy an application (war , jar or ear ) is to drop the application archive ( or in expanded mode with the folder name ending with .war or .ear) under [...]]]></description>
			<content:encoded><![CDATA[<p>With JBoss 6.0.0.M1 out to try out the new JSRs the following may be helpful in reducing time to deploy.</p>
<p>The usual way in which we deploy an application (war , jar or ear ) is to drop the application archive ( or in expanded mode with the folder name ending with .war or .ear) under deploy folder of the server.</p>
<p>But how to deploy an application archive or a folder when it is not residing under deploy folder but resides in some other external folder?</p>
<p>Let&#8217;s say the application ROOT folder is E:\javaapps\myapptodeploy\webapplication.war, then in jboss-service.xml (under <strong>conf</strong> folder of the JBoss server profile (like default, all)),  we mention the following. This is very helpful when we build the project using Maven as we can mention the target directory directly without copying the files after each build.</p>
<pre class="brush: xml;">

&lt;attribute name=&quot;URLs&quot;&gt;
 deploy/,file:///E:/javaapps/myapptodeploy
&lt;/attribute&gt;
</pre>
<a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fwww.karthikeyanc.com%2Fblog%2Findex.php%2F2009%2F12%2Fjboss-tricks-how-to-deploy-war-jar-ear-in-an-external-folder-directory%2F&amp;linkname=JBoss%20Tricks%20%26%238211%3B%20How%20to%20deploy%20WAR%20JAR%20EAR%20in%20an%20external%20folder%20%28directory%29"><img src="http://www.karthikeyanc.com/blog/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a>
<p><a href="http://feedads.g.doubleclick.net/~a/ll6dCfN_V-ssOF_T7HEr_zEJlhM/0/da"><img src="http://feedads.g.doubleclick.net/~a/ll6dCfN_V-ssOF_T7HEr_zEJlhM/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/ll6dCfN_V-ssOF_T7HEr_zEJlhM/1/da"><img src="http://feedads.g.doubleclick.net/~a/ll6dCfN_V-ssOF_T7HEr_zEJlhM/1/di" border="0" ismap="true"></img></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.karthikeyanc.com/blog/index.php/2009/12/jboss-tricks-how-to-deploy-war-jar-ear-in-an-external-folder-directory/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Step By Step Guide – Setup Seam 2.2.0.GA based Integration testing with Maven TestNG Cobertura</title>
		<link>http://www.karthikeyanc.com/blog/index.php/2009/12/step-by-step-guide-setup-seam-2-2-0-ga-based-integration-testing-with-maven-testng-cobertura/</link>
		<comments>http://www.karthikeyanc.com/blog/index.php/2009/12/step-by-step-guide-setup-seam-2-2-0-ga-based-integration-testing-with-maven-testng-cobertura/#comments</comments>
		<pubDate>Mon, 07 Dec 2009 19:27:41 +0000</pubDate>
		<dc:creator>Karthikeyan C</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Installation / Configuration]]></category>
		<category><![CDATA[Cobertura]]></category>
		<category><![CDATA[JSF]]></category>
		<category><![CDATA[maven]]></category>
		<category><![CDATA[Seam]]></category>
		<category><![CDATA[TestNG]]></category>

		<guid isPermaLink="false">http://www.karthikeyanc.com/blog/?p=140</guid>
		<description><![CDATA[This step by step guide explains / contains the following

Configure a Seam 2.2.0.GA, Hibernate (as the JPA implementation provider), RichFaces, PrimeFaces based project to be built by Maven (tested on 2.0.9 plus).
A simple Seam based web application which allows us to save (create and update) Employee details (just name and email to keep it simple) [...]]]></description>
			<content:encoded><![CDATA[<p>This step by step guide explains / contains the following</p>
<ul>
<li>Configure a Seam 2.2.0.GA, Hibernate (as the JPA implementation provider), RichFaces, PrimeFaces based project to be built by Maven (tested on 2.0.9 plus).</li>
<li>A simple Seam based web application which allows us to save (create and update) Employee details (just name and email to keep it simple) in MySQL database.</li>
<li>Write Seam based Integration test cases that run in JBoss Embedded container that run with TestNG.</li>
<li>Code coverage report generation using Cobertura.</li>
<li>The given project in this post is deployed on Tomcat 6.0.x.</li>
</ul>
<p>The executable project code is available in Google code and can be obtained by <a href="http://karthikeyanc.googlecode.com/files/seamcrudtestng.zip" target="_blank">downloading  here.</a> (Please note that I have excluded files that ship with embedded JBoss download. I have provided screen shots of the final folder structure to avoid any confusion)</p>
<ol>
<li>Choose a folder of your choice. This will be known as ROOT folder for the project. Create a folder called <strong>src</strong> under it. Also create an empty file called <strong>pom.xml</strong></li>
<li>Under this <strong>src</strong> folder, create two folders called <strong>main</strong> and <strong>test</strong>.</li>
<li>Under <strong>main</strong> folder, we will create the following folders &#8211; <strong>java</strong>, <strong>resources</strong>, <strong>sql</strong> and <strong>webapp</strong>.</li>
<li>Under <strong>test</strong> folder, we will create the following folders &#8211; <strong>java</strong>, <strong>resources</strong> and a empty file called <strong>testng.xml</strong>.</li>
</ol>
<p><em>What have we done so far ?:</em></p>
<p>- We have almost created a Seam based Maven archetype. The main folder contains files that are bundled in the deployable web application. test folder contains files used in various testing (Unit, Integration etc).</p>
<p>The final folder structure is provided as screen shots.</p>
<p><img class="alignnone size-full wp-image-141" title="mainfolder" src="http://www.karthikeyanc.com/blog/wp-content/uploads/2009/12/mainfolder.png" alt="mainfolder" width="300" height="516" /><img class="alignleft size-full wp-image-142" title="testfolder" src="http://www.karthikeyanc.com/blog/wp-content/uploads/2009/12/testfolder.png" alt="testfolder" width="263" height="499" /></p>
<p>Let us start with the employee table in database.</p>
<pre class="brush: sql;">

CREATE TABLE employee (
 id INTEGER NOT NULL AUTO_INCREMENT,
 name varchar(100) NOT NULL,
 email varchar(70) NOT NULL UNIQUE,
 PRIMARY KEY  (id)
);
</pre>
<p>The related JPA entity class is as below. The package is <strong>com.karthik.entity </strong>(full source code available in the zip file that can be downloaded).[This file is under src/main/java/com/karthik/entity]</p>
<pre class="brush: java;">

@Entity
@Table(name = &quot;employee&quot;)
@NamedQueries({
 @NamedQuery(name = &quot;Employee.findAll&quot;, query = &quot;SELECT e FROM Employee e&quot;)})
public class Employee implements Serializable {
 private static final long serialVersionUID = 1L;
 @Id
 @GeneratedValue(strategy = GenerationType.IDENTITY)
 @Basic(optional = false)
 @Column(name = &quot;id&quot;)
 private Integer id;
 @Basic(optional = false)
 @Column(name = &quot;name&quot;)
 private String name;
 @Basic(optional = false)
 @Column(name = &quot;email&quot;)
 private String email;
</pre>
<p>Now we need a Seam backing bean to save a new Employee data, update existing Employee data and retrieve all employees in database. The source code of the backing bean EmployeeSaveAction.java is provided below. [This file is under src/main/java/com/karthik/action]</p>
<pre class="brush: java;">

package com.karthik.action;

import com.karthik.entity.Employee;
import java.io.Serializable;
import java.util.List;

import javax.persistence.EntityManager;
import org.jboss.seam.ScopeType;
import org.jboss.seam.annotations.Create;
import org.jboss.seam.annotations.Factory;
import org.jboss.seam.annotations.In;
import org.jboss.seam.annotations.Name;
import org.jboss.seam.annotations.Scope;
import org.jboss.seam.annotations.datamodel.DataModel;
import org.jboss.seam.annotations.datamodel.DataModelSelection;

@Name(&quot;employeeaction&quot;)
public class EmployeeSaveAction implements Serializable{

 @In
 EntityManager em;
 private Employee employee;
 @DataModel
 List&lt;Employee&gt; employeeList;
 @DataModelSelection(&quot;employeeList&quot;)
 Employee selectedEmployee;

 @Create
 public void init() {
 employee = new Employee();
 }

 @Factory(&quot;employeeList&quot;)
 public void populateEmployeeList(){
 employeeList=em.createNamedQuery(&quot;Employee.findAll&quot;).getResultList();
 }

 public void createEmployee() {
 em.persist(employee);
 //clear UI values
 employee = new Employee();
 populateEmployeeList();
 }

 public void update(){
 selectedEmployee=em.merge(selectedEmployee);
 populateEmployeeList();
 }

 public Employee getEmployee() {
 return employee;
 }

 public void setEmployee(Employee employee) {
 this.employee = employee;
 }

}
</pre>
<p>Now we focus on configuring Seam to do the necessary injection in the above backing bean. First comes components.xml (this is under src/main/webapp/WEB-INF)</p>
<pre class="brush: xml;">

&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
&lt;components xmlns=&quot;http://jboss.com/products/seam/components&quot;
 xmlns:core=&quot;http://jboss.com/products/seam/core&quot;
 xmlns:persistence=&quot;http://jboss.com/products/seam/persistence&quot;
 xmlns:transaction=&quot;http://jboss.com/products/seam/transaction&quot;
 xmlns:web=&quot;http://jboss.com/products/seam/web&quot;
 xmlns:security=&quot;http://jboss.com/products/seam/security&quot;
 xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot;
 xmlns:ui=&quot;http://jboss.com/products/seam/ui&quot;
 xmlns:mail=&quot;http://jboss.com/products/seam/mail&quot;
 xsi:schemaLocation=
 &quot;http://jboss.com/products/seam/core http://jboss.com/products/seam/core-2.1.xsd
 http://jboss.com/products/seam/persistence http://jboss.com/products/seam/persistence-2.1.xsd
 http://jboss.com/products/seam/transaction http://jboss.com/products/seam/transaction-2.1.xsd
 http://jboss.com/products/seam/security http://jboss.com/products/seam/security-2.1.xsd
 http://jboss.com/products/seam/components http://jboss.com/products/seam/components-2.1.xsd&quot;&gt;

 &lt;core:manager conversation-timeout=&quot;120000&quot;
 concurrent-request-timeout=&quot;2000&quot;
 conversation-id-parameter=&quot;cid&quot;
 /&gt;
  &lt;transaction:entity-transaction entity-manager=&quot;#{em}&quot;/&gt;
  &lt;persistence:entity-manager-factory name=&quot;exampleDatabase&quot;/&gt;
  &lt;persistence:managed-persistence-context name=&quot;em&quot;
 auto-create=&quot;true&quot;
 entity-manager-factory=&quot;#{exampleDatabase}&quot;/&gt;
 &lt;/components&gt;
</pre>
<p>Now we need a UI to create, update values. Part of the source code of employee.xhtml is provided below [The file is under src/main/webapp]. Complete source code is provided in the zip file that can be downloaded  from Google code.</p>
<pre class="brush: xml;">

  &lt;h:form&gt;
            &lt;rich:messages/&gt;
            &lt;s:validateAll&gt;

                &lt;rich:panel id=&quot;homepanel&quot;&gt;
                    &lt;f:facet name=&quot;header&quot;&gt;
                       Seam Example
                    &lt;/f:facet&gt;
                    &lt;h:panelGrid columns=&quot;2&quot;&gt;
                        &lt;h:outputText value=&quot;Employee Name:&quot;/&gt;
                        &lt;h:inputText value=&quot;#{employeeaction.employee.name}&quot; required=&quot;true&quot;/&gt;

                        &lt;h:outputText value=&quot;Email:&quot;/&gt;
                        &lt;h:inputText value=&quot;#{employeeaction.employee.email}&quot; required=&quot;true&quot;/&gt;

                        &lt;h:commandButton action=&quot;#{employeeaction.createEmployee}&quot; value=&quot;Create Employee&quot;/&gt;
                    &lt;/h:panelGrid&gt;
                    &lt;br/&gt;
                    List of Existing Employees
                    &lt;br/&gt;
                    &lt;rich:dataTable value=&quot;#{employeeList}&quot; var=&quot;emp&quot;&gt;
                        &lt;rich:column&gt;
                            &lt;f:facet name=&quot;header&quot;&gt;
                               Name
                            &lt;/f:facet&gt;
                            &lt;h:inputText value=&quot;#{emp.name}&quot;/&gt;
                        &lt;/rich:column&gt;
                        &lt;rich:column&gt;
                            &lt;f:facet name=&quot;header&quot;&gt;
                                Email
                            &lt;/f:facet&gt;
                            &lt;h:inputText value=&quot;#{emp.email}&quot;/&gt;
                        &lt;/rich:column&gt;
                        &lt;rich:column&gt;
                            &lt;f:facet name=&quot;header&quot;&gt;
                                Update
                            &lt;/f:facet&gt;
                            &lt;h:commandButton action=&quot;#{employeeaction.update}&quot; value=&quot;Update&quot;/&gt;
                        &lt;/rich:column&gt;

                    &lt;/rich:dataTable&gt;
                &lt;/rich:panel&gt;
            &lt;/s:validateAll&gt;
        &lt;/h:form&gt;
</pre>
<p>The faces-config.xml file is provided below (File is under src/main/webapp/WEB-INF)</p>
<pre class="brush: xml;">
&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
&lt;faces-config version=&quot;1.2&quot;
   xmlns=&quot;http://java.sun.com/xml/ns/javaee&quot;
   xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot;
   xsi:schemaLocation=&quot;http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-facesconfig_1_2.xsd&quot;&gt;

    &lt;!-- Facelets support --&gt;
    &lt;application&gt;
        &lt;view-handler&gt;com.sun.facelets.FaceletViewHandler&lt;/view-handler&gt;
    &lt;/application&gt;

&lt;/faces-config&gt;
</pre>
<p>We do not utilize pages.xml defining page navigation in Seam but for the sake of completeness it is provided below. (File is under src/main/webapp/WEB-INF)</p>
<pre class="brush: xml;">
&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
&lt;pages xmlns=&quot;http://jboss.com/products/seam/pages&quot;
       xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot;
       xsi:schemaLocation=&quot;http://jboss.com/products/seam/pages http://jboss.com/products/seam/pages-2.1.xsd&quot;&gt;
&lt;/pages&gt;
</pre>
<p>And here comes web.xml (The file is under src/main/webapp/WEB-INF].</p>
<pre class="brush: xml;">
&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
&lt;web-app version=&quot;2.5&quot;
         xmlns=&quot;http://java.sun.com/xml/ns/javaee&quot;
         xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot;
         xsi:schemaLocation=&quot;http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd&quot;&gt;

    &lt;!-- Seam   --&gt;

    &lt;listener&gt;
        &lt;listener-class&gt;org.jboss.seam.servlet.SeamListener&lt;/listener-class&gt;
    &lt;/listener&gt;

    &lt;filter&gt;
        &lt;filter-name&gt;Seam Filter&lt;/filter-name&gt;
        &lt;filter-class&gt;org.jboss.seam.servlet.SeamFilter&lt;/filter-class&gt;
    &lt;/filter&gt;

    &lt;filter-mapping&gt;
        &lt;filter-name&gt;Seam Filter&lt;/filter-name&gt;
        &lt;url-pattern&gt;/*&lt;/url-pattern&gt;
    &lt;/filter-mapping&gt;

    &lt;filter&gt;
        &lt;filter-name&gt;richfaces&lt;/filter-name&gt;
        &lt;filter-class&gt;org.ajax4jsf.Filter&lt;/filter-class&gt;
        &lt;init-param&gt;
            &lt;param-name&gt;forceparser&lt;/param-name&gt;
            &lt;param-value&gt;false&lt;/param-value&gt;
        &lt;/init-param&gt;
        &lt;init-param&gt;
            &lt;param-name&gt;enable-cache&lt;/param-name&gt;
            &lt;param-value&gt;true&lt;/param-value&gt;
        &lt;/init-param&gt;
    &lt;/filter&gt;
    &lt;filter-mapping&gt;
        &lt;filter-name&gt;richfaces&lt;/filter-name&gt;
        &lt;url-pattern&gt;/*&lt;/url-pattern&gt;
    &lt;/filter-mapping&gt;
    &lt;servlet&gt;
        &lt;servlet-name&gt;Seam Resource Servlet&lt;/servlet-name&gt;
        &lt;servlet-class&gt;org.jboss.seam.servlet.SeamResourceServlet&lt;/servlet-class&gt;
    &lt;/servlet&gt;
    &lt;servlet-mapping&gt;
        &lt;servlet-name&gt;Seam Resource Servlet&lt;/servlet-name&gt;
        &lt;url-pattern&gt;/seam/resource/*&lt;/url-pattern&gt;
    &lt;/servlet-mapping&gt;
    &lt;servlet&gt;
        &lt;servlet-name&gt;Document Store Servlet&lt;/servlet-name&gt;
        &lt;servlet-class&gt;org.jboss.seam.document.DocumentStoreServlet&lt;/servlet-class&gt;
    &lt;/servlet&gt;
    &lt;servlet-mapping&gt;
        &lt;servlet-name&gt;Document Store Servlet&lt;/servlet-name&gt;
        &lt;url-pattern&gt;*.csv&lt;/url-pattern&gt;
    &lt;/servlet-mapping&gt;
    &lt;servlet-mapping&gt;
        &lt;servlet-name&gt;Document Store Servlet&lt;/servlet-name&gt;
        &lt;url-pattern&gt;*.xls&lt;/url-pattern&gt;
    &lt;/servlet-mapping&gt;
    &lt;servlet&gt;
        &lt;servlet-name&gt;Resource Servlet&lt;/servlet-name&gt;
        &lt;servlet-class&gt;org.primefaces.resource.ResourceServlet&lt;/servlet-class&gt;
        &lt;load-on-startup&gt;1&lt;/load-on-startup&gt;
    &lt;/servlet&gt;
    &lt;servlet-mapping&gt;
        &lt;servlet-name&gt;Resource Servlet&lt;/servlet-name&gt;
        &lt;url-pattern&gt;/primefaces_resource/*&lt;/url-pattern&gt;
    &lt;/servlet-mapping&gt;
     &lt;!-- Faces Servlet --&gt;
    &lt;servlet&gt;
        &lt;servlet-name&gt;Faces Servlet&lt;/servlet-name&gt;
        &lt;servlet-class&gt;javax.faces.webapp.FacesServlet&lt;/servlet-class&gt;
        &lt;load-on-startup&gt;1&lt;/load-on-startup&gt;
    &lt;/servlet&gt;
     &lt;servlet-mapping&gt;
        &lt;servlet-name&gt;Faces Servlet&lt;/servlet-name&gt;
        &lt;url-pattern&gt;*.seam&lt;/url-pattern&gt;
    &lt;/servlet-mapping&gt;
     &lt;servlet-mapping&gt;
        &lt;servlet-name&gt;Faces Servlet&lt;/servlet-name&gt;
        &lt;url-pattern&gt;*.jsf&lt;/url-pattern&gt;
    &lt;/servlet-mapping&gt;

    &lt;!-- JSF parameters --&gt;
    &lt;context-param&gt;
        &lt;param-name&gt;javax.faces.DEFAULT_SUFFIX&lt;/param-name&gt;
        &lt;param-value&gt;.xhtml&lt;/param-value&gt;
    &lt;/context-param&gt;
    &lt;context-param&gt;
        &lt;param-name&gt;facelets.DEVELOPMENT&lt;/param-name&gt;
        &lt;param-value&gt;true&lt;/param-value&gt;
    &lt;/context-param&gt;
    &lt;context-param&gt;
        &lt;param-name&gt;org.richfaces.SKIN&lt;/param-name&gt;
        &lt;param-value&gt;DEFAULT&lt;/param-value&gt;
    &lt;/context-param&gt;
    &lt;context-param&gt;
        &lt;param-name&gt;org.ajax4jsf.COMPRESS_SCRIPT&lt;/param-name&gt;
        &lt;param-value&gt;true&lt;/param-value&gt;
    &lt;/context-param&gt;
    &lt;session-config&gt;
        &lt;session-timeout&gt;20&lt;/session-timeout&gt;
    &lt;/session-config&gt;
  &lt;/web-app&gt;
</pre>
<p>Dont get bored <img src='http://www.karthikeyanc.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  , there are only two more files left under main folder that are part of our web application.<br />
We need to have a marker file called seam.properties under src/main/resources folder (that will eventually be under WEB-INF/classes of your web application).<br />
Seam will scan and register our Seam components only if this file is detected.</p>
<p>And the last one is persistence.xml (The file is under src/main/resources/META-INF)</p>
<pre class="brush: xml;">
&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
&lt;persistence version=&quot;1.0&quot; xmlns=&quot;http://java.sun.com/xml/ns/persistence&quot; xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot; xsi:schemaLocation=&quot;http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd&quot;&gt;
  &lt;persistence-unit name=&quot;exampleDatabase&quot; transaction-type=&quot;RESOURCE_LOCAL&quot;&gt;
    &lt;provider&gt;org.hibernate.ejb.HibernatePersistence&lt;/provider&gt;
    &lt;!--Uncomment the below when you use Tomcat--&gt;
   &lt;jta-data-source&gt;java:comp/env/jdbc/exampleDatabase&lt;/jta-data-source&gt;
    &lt;!--Uncomment the below when you run test cases in embedded server--&gt;
    &lt;!--&lt;non-jta-data-source&gt;java:/exampleDatabase&lt;/non-jta-data-source&gt;--&gt;

    &lt;properties&gt;
      &lt;property name=&quot;hibernate.dialect&quot; value=&quot;org.hibernate.dialect.MySQLDialect&quot;/&gt;
      &lt;property name=&quot;hibernate.hbm2ddl.auto&quot; value=&quot;validate&quot;/&gt;
      &lt;property name=&quot;hibernate.show_sql&quot; value=&quot;false&quot;/&gt;
    &lt;/properties&gt;
  &lt;/persistence-unit&gt;
&lt;/persistence&gt;
</pre>
<p>Now we shift our focus to test folder. Let us start with testng.xml (TestNG configuration file which is under src/test)</p>
<pre class="brush: xml;">
&lt;!DOCTYPE suite SYSTEM &quot;http://beust.com/testng/testng-1.0.dtd&quot; &gt;
&lt;suite name=&quot;KarthiksExampleSuite&quot;&gt;
    &lt;parameter name=&quot;datasourceJndiName&quot; value=&quot;java:/exampleDatabase&quot;/&gt;
    &lt;parameter name=&quot;database&quot; value=&quot;MySQL&quot; /&gt;
    &lt;parameter name=&quot;binaryDir&quot; value=&quot;img/&quot; /&gt;
    &lt;test name=&quot;Group Test&quot;&gt;
        &lt;packages&gt;
            &lt;package name=&quot;com.karthik.test&quot; /&gt;
        &lt;/packages&gt;
   &lt;/test&gt;
&lt;/suite&gt;
</pre>
<p>Next file is the Seam based TestNG test case which runs test cases to verify the creation of a new Employee in database. The file is under src/test/java/com/karthik/test<br />
and the source code is provided below.</p>
<pre class="brush: java;">

package com.karthik.test;

import com.karthik.entity.Employee;
import javax.faces.model.DataModel;
import org.jboss.seam.mock.DBUnitSeamTest;
import org.testng.annotations.Test;

public class EmployeeTest extends DBUnitSeamTest {

    private int numOfEmpBeforeAdd;
    private String name;
    private String email;

    @Test(groups = &quot;embeddedcontainer&quot;)
    public void testEmployee() throws Exception {

        new FacesRequest(&quot;/employee.xhtml&quot;) {

            @Override
            protected void updateModelValues() throws Exception {
                name = &quot;Name of employee&quot; + System.nanoTime();
                email = &quot;abc&quot; + System.nanoTime() + &quot;@xmail.com&quot;;

                setValue(&quot;#{employeeaction.employee.name}&quot;, name);
                setValue(&quot;#{employeeaction.employee.email}&quot;, email);
            }

            @Override
            protected void invokeApplication() {
                DataModel empList = (DataModel) getValue(&quot;#{employeeList}&quot;);
                numOfEmpBeforeAdd = empList.getRowCount();
                assert invokeAction(&quot;#{employeeaction.createEmployee}&quot;) == null;

            }

            @Override
            protected void renderResponse() {

                DataModel empList = (DataModel) getValue(&quot;#{employeeList}&quot;);
                assert empList.getRowCount() == (numOfEmpBeforeAdd + 1);
                empList.setRowIndex(numOfEmpBeforeAdd + 1);
                boolean isEmployeeAvailable = false;
                for (int ctr = 0; ctr &lt; empList.getRowCount(); ctr++) {
                    empList.setRowIndex(ctr);
                    Employee employee = (Employee) empList.getRowData();

                    if (employee.getName().equals(name) &amp;&amp; employee.getEmail().equals(email)) {
                        isEmployeeAvailable = true;
                    }

                }//for loop ends
                assert isEmployeeAvailable;
            }
        }.run();
    }

    @Override
    protected void prepareDBUnitOperations() {
    }
}
</pre>
<p>Now comes the most important part of configuring the embedded JBoss container. The configuration is involves 3 easy steps.<br />
<strong>Step 1:</strong> Please download <a href="http://sourceforge.net/projects/jboss/files/Embedded%20JBoss/" target="_blank">embedded-jboss-beta3.SP10.zip</a>. Extract it to any temporary folder and copy the content of bootstrap folder (do not<br />
copy bootstrap but only the content in it) and paste it under src/test/resources<br />
<strong>Step 2:</strong> Configure  the datasource for the embedded JBoss container. The file testmysql-ds.xml (The file is placed under src/test/resources/deploy)<br />
is as below.</p>
<pre class="brush: xml;">
&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
&lt;!DOCTYPE datasources
    PUBLIC &quot;-//JBoss//DTD JBOSS JCA Config 1.5//EN&quot;
    &quot;http://www.jboss.com/j2ee/dtd/jboss-ds_1_5.dtd&quot;&gt;
&lt;datasources&gt;
   &lt;local-tx-datasource&gt;
      &lt;jndi-name&gt;exampleDatabase&lt;/jndi-name&gt;
      &lt;connection-url&gt;jdbc:mysql://localhost:3306/ck&lt;/connection-url&gt;
      &lt;driver-class&gt;com.mysql.jdbc.Driver&lt;/driver-class&gt;
      &lt;user-name&gt;root&lt;/user-name&gt;
      &lt;password&gt;password&lt;/password&gt;
   &lt;/local-tx-datasource&gt;
&lt;/datasources&gt;
</pre>
<p><strong>Step 3:</strong> In the above testng.xml configuration we had mentioned the binary folder as img. So create a folder called img under src/test/resources<br />
and place an empty marker file called marker.txt (An empty marker file is needed so that Maven copies the empty folder also).</p>
<p>With that we complete the files under test folder. And now the most important file pom.xml which is under ROOT folder parallel to src folder.</p>
<pre class="brush: xml;">

&lt;project xmlns=&quot;http://maven.apache.org/POM/4.0.0&quot; xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot;
xsi:schemaLocation=&quot;http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd&quot;&gt;
&lt;properties&gt;
&lt;seam.version&gt;2.2.0.GA&lt;/seam.version&gt;
&lt;richfaces.version&gt;3.3.2.GA&lt;/richfaces.version&gt;
&lt;/properties&gt;
&lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
&lt;groupId&gt;com.karthik&lt;/groupId&gt;
&lt;artifactId&gt;seamtest&lt;/artifactId&gt;
&lt;packaging&gt;war&lt;/packaging&gt;
&lt;version&gt;1.0&lt;/version&gt;
&lt;name&gt;karthiks Seam TestNG Example&lt;/name&gt;
&lt;build&gt;
&lt;finalName&gt;seamtest&lt;/finalName&gt;
&lt;plugins&gt;
&lt;plugin&gt;
&lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
&lt;artifactId&gt;maven-compiler-plugin&lt;/artifactId&gt;
&lt;configuration&gt;
&lt;source&gt;1.6&lt;/source&gt;
&lt;target&gt;1.6&lt;/target&gt;
&lt;/configuration&gt;
&lt;/plugin&gt;
&lt;plugin&gt;
&lt;artifactId&gt;maven-dependency-plugin&lt;/artifactId&gt;
&lt;executions&gt;
&lt;execution&gt;
&lt;configuration&gt;
&lt;artifactItems&gt;
&lt;artifactItem&gt;
&lt;groupId&gt;javax.xml.bind&lt;/groupId&gt;
&lt;artifactId&gt;jaxb-api&lt;/artifactId&gt;
&lt;version&gt;2.1&lt;/version&gt;
&lt;/artifactItem&gt;
&lt;/artifactItems&gt;
&lt;outputDirectory&gt;${project.build.testOutputDirectory}/endorsed&lt;/outputDirectory&gt;
&lt;/configuration&gt;
&lt;id&gt;download-jaxb-api&lt;/id&gt;
&lt;phase&gt;process-test-resources&lt;/phase&gt;
&lt;goals&gt;
&lt;goal&gt;copy&lt;/goal&gt;
&lt;/goals&gt;
&lt;/execution&gt;
&lt;/executions&gt;
&lt;/plugin&gt;
&lt;plugin&gt;
&lt;artifactId&gt;maven-antrun-plugin&lt;/artifactId&gt;
&lt;executions&gt;
&lt;execution&gt;
&lt;phase&gt;process-test-resources&lt;/phase&gt;
&lt;configuration&gt;
&lt;tasks&gt;
&lt;copy todir=&quot;${project.build.testOutputDirectory}&quot;&gt;
&lt;fileset dir=&quot;${basedir}/src/main/webapp&quot;/&gt;
&lt;/copy&gt;
&lt;/tasks&gt;
&lt;/configuration&gt;
&lt;goals&gt;
&lt;goal&gt;run&lt;/goal&gt;
&lt;/goals&gt;
&lt;/execution&gt;
&lt;/executions&gt;
&lt;/plugin&gt;
&lt;plugin&gt;
&lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
&lt;artifactId&gt;maven-surefire-plugin&lt;/artifactId&gt;
&lt;version&gt;2.4&lt;/version&gt;
&lt;configuration&gt;
&lt;suiteXmlFiles&gt;
&lt;suiteXmlFile&gt;src/test/testng.xml&lt;/suiteXmlFile&gt;
&lt;/suiteXmlFiles&gt;

&lt;childDelegation&gt;true&lt;/childDelegation&gt;
&lt;useSystemClassLoader&gt;true&lt;/useSystemClassLoader&gt;
&lt;argLine&gt;-Djava.endorsed.dirs=${project.build.testOutputDirectory}/endorsed -Dsun.lang.ClassLoader.allowArraySyntax=true&lt;/argLine&gt;
&lt;/configuration&gt;
&lt;/plugin&gt;
&lt;plugin&gt;
&lt;groupId&gt;org.codehaus.mojo&lt;/groupId&gt;
&lt;artifactId&gt;cobertura-maven-plugin&lt;/artifactId&gt;
&lt;version&gt;2.1&lt;/version&gt;
&lt;configuration&gt;
&lt;check&gt;
&lt;haltOnFailure&gt;false&lt;/haltOnFailure&gt;
&lt;regexes&gt;
&lt;regex&gt;
&lt;pattern&gt;com.karthik.*&lt;/pattern&gt;
&lt;branchRate&gt;70&lt;/branchRate&gt;
&lt;lineRate&gt;70&lt;/lineRate&gt;
&lt;/regex&gt;

&lt;/regexes&gt;
&lt;/check&gt;
&lt;instrumentation&gt;
&lt;includes&gt;
&lt;include&gt;com/**/*.class&lt;/include&gt;

&lt;/includes&gt;
&lt;/instrumentation&gt;
&lt;/configuration&gt;
&lt;executions&gt;
&lt;execution&gt;
&lt;id&gt;clean&lt;/id&gt;
&lt;phase&gt;pre-site&lt;/phase&gt;
&lt;goals&gt;
&lt;goal&gt;clean&lt;/goal&gt;
&lt;/goals&gt;
&lt;/execution&gt;
&lt;execution&gt;
&lt;id&gt;instrument&lt;/id&gt;
&lt;phase&gt;site&lt;/phase&gt;
&lt;goals&gt;
&lt;goal&gt;instrument&lt;/goal&gt;
&lt;goal&gt;cobertura&lt;/goal&gt;
&lt;goal&gt;check&lt;/goal&gt;
&lt;/goals&gt;
&lt;/execution&gt;
&lt;/executions&gt;
&lt;/plugin&gt;
&lt;/plugins&gt;
&lt;/build&gt;
&lt;repositories&gt;
&lt;repository&gt;
&lt;id&gt;repository.jboss.org&lt;/id&gt;
&lt;url&gt;http://repository.jboss.org/maven2&lt;/url&gt;
&lt;snapshots&gt;
&lt;enabled&gt;true&lt;/enabled&gt;
&lt;/snapshots&gt;
&lt;/repository&gt;
&lt;repository&gt;
&lt;id&gt;repository.central.org&lt;/id&gt;
&lt;url&gt;http://repo1.maven.org/maven2&lt;/url&gt;
&lt;snapshots&gt;
&lt;enabled&gt;true&lt;/enabled&gt;
&lt;/snapshots&gt;
&lt;/repository&gt;
&lt;repository&gt;
&lt;id&gt;primefaces.repo&lt;/id&gt;
&lt;name&gt;Prime Technology Maven Repository&lt;/name&gt;
&lt;url&gt;http://repository.prime.com.tr&lt;/url&gt;
&lt;layout&gt;default&lt;/layout&gt;
&lt;/repository&gt;
&lt;/repositories&gt;
&lt;dependencies&gt;
&lt;!--Start of dependencies for embedded JBoss container required for Integration test cases--&gt;
&lt;dependency&gt;
&lt;groupId&gt;org.jboss.embedded&lt;/groupId&gt;
&lt;artifactId&gt;jboss-embedded-all&lt;/artifactId&gt;
&lt;version&gt;beta3.SP10&lt;/version&gt;
&lt;exclusions&gt;
&lt;exclusion&gt;
&lt;groupId&gt;org.jboss.embedded&lt;/groupId&gt;
&lt;artifactId&gt;jboss-embedded&lt;/artifactId&gt;
&lt;/exclusion&gt;

&lt;exclusion&gt;
&lt;groupId&gt;org.jboss.microcontainer&lt;/groupId&gt;
&lt;artifactId&gt;jboss-deployers-client-spi&lt;/artifactId&gt;
&lt;/exclusion&gt;
&lt;exclusion&gt;
&lt;groupId&gt;org.jboss.microcontainer&lt;/groupId&gt;
&lt;artifactId&gt;jboss-deployers-core-spi&lt;/artifactId&gt;
&lt;/exclusion&gt;
&lt;/exclusions&gt;
&lt;scope&gt;test&lt;/scope&gt;
&lt;/dependency&gt;
&lt;dependency&gt;
&lt;groupId&gt;org.jboss.embedded&lt;/groupId&gt;
&lt;artifactId&gt;thirdparty-all&lt;/artifactId&gt;
&lt;version&gt;beta3.SP10&lt;/version&gt;
&lt;scope&gt;test&lt;/scope&gt;
&lt;/dependency&gt;
&lt;dependency&gt;
&lt;groupId&gt;org.jboss.embedded&lt;/groupId&gt;
&lt;artifactId&gt;jboss-embedded&lt;/artifactId&gt;
&lt;version&gt;beta3.SP10&lt;/version&gt;
&lt;scope&gt;test&lt;/scope&gt;
&lt;exclusions&gt;
&lt;exclusion&gt;
&lt;groupId&gt;org.jboss.microcontainer&lt;/groupId&gt;
&lt;artifactId&gt;jboss-deployers-client-spi&lt;/artifactId&gt;
&lt;/exclusion&gt;

&lt;/exclusions&gt;
&lt;/dependency&gt;
&lt;!--End of dependencies for embedded JBoss container required for Integration test cases--&gt;

&lt;!--Start of TestNG dependency--&gt;
&lt;dependency&gt;
&lt;groupId&gt;org.testng&lt;/groupId&gt;
&lt;artifactId&gt;testng&lt;/artifactId&gt;
&lt;version&gt;5.10&lt;/version&gt;
&lt;scope&gt;test&lt;/scope&gt;
&lt;classifier&gt;jdk15&lt;/classifier&gt;
&lt;/dependency&gt;
&lt;!--el is required to parse the SeamTest setValue and invokeMethod stuff--&gt;
&lt;dependency&gt;
&lt;groupId&gt;javax.el&lt;/groupId&gt;
&lt;artifactId&gt;el-api&lt;/artifactId&gt;
&lt;version&gt;1.2&lt;/version&gt;
&lt;scope&gt;test&lt;/scope&gt;
&lt;/dependency&gt;
&lt;!-- If you use any database other than MySQL please change the below dependency accordingly--&gt;
&lt;dependency&gt;
&lt;groupId&gt;mysql&lt;/groupId&gt;
&lt;artifactId&gt;mysql-connector-java&lt;/artifactId&gt;
&lt;version&gt;5.1.6&lt;/version&gt;
&lt;scope&gt;test&lt;/scope&gt;
&lt;/dependency&gt;
&lt;dependency&gt;
&lt;groupId&gt;org.dbunit&lt;/groupId&gt;
&lt;artifactId&gt;dbunit&lt;/artifactId&gt;
&lt;version&gt;2.2&lt;/version&gt;
&lt;scope&gt;test&lt;/scope&gt;
&lt;exclusions&gt;
&lt;exclusion&gt;
&lt;groupId&gt;xerces&lt;/groupId&gt;
&lt;artifactId&gt;xercesImpl&lt;/artifactId&gt;
&lt;/exclusion&gt;
&lt;exclusion&gt;
&lt;groupId&gt;xerces&lt;/groupId&gt;
&lt;artifactId&gt;xmlParserAPIs&lt;/artifactId&gt;
&lt;/exclusion&gt;
&lt;/exclusions&gt;
&lt;/dependency&gt;
&lt;!--End of TestNG dependency--&gt;
&lt;dependency&gt;
&lt;groupId&gt;org.jboss.seam&lt;/groupId&gt;
&lt;artifactId&gt;jboss-seam&lt;/artifactId&gt;
&lt;version&gt;${seam.version}&lt;/version&gt;
&lt;exclusions&gt;
&lt;exclusion&gt;
&lt;groupId&gt;javax.el&lt;/groupId&gt;
&lt;artifactId&gt;el-api&lt;/artifactId&gt;
&lt;/exclusion&gt;
&lt;/exclusions&gt;
&lt;/dependency&gt;
&lt;dependency&gt;
&lt;groupId&gt;org.jboss.seam&lt;/groupId&gt;
&lt;artifactId&gt;jboss-seam-ui&lt;/artifactId&gt;
&lt;version&gt;${seam.version}&lt;/version&gt;
&lt;/dependency&gt;
&lt;dependency&gt;
&lt;groupId&gt;org.jboss.seam&lt;/groupId&gt;
&lt;artifactId&gt;jboss-seam-pdf&lt;/artifactId&gt;
&lt;version&gt;${seam.version}&lt;/version&gt;
&lt;/dependency&gt;
&lt;dependency&gt;
&lt;groupId&gt;org.jboss.seam&lt;/groupId&gt;
&lt;artifactId&gt;jboss-seam-mail&lt;/artifactId&gt;
&lt;version&gt;${seam.version}&lt;/version&gt;
&lt;/dependency&gt;
&lt;dependency&gt;
&lt;groupId&gt;org.jboss.seam&lt;/groupId&gt;
&lt;artifactId&gt;jboss-seam-ioc&lt;/artifactId&gt;
&lt;version&gt;${seam.version}&lt;/version&gt;
&lt;/dependency&gt;
&lt;dependency&gt;
&lt;groupId&gt;org.jboss.seam&lt;/groupId&gt;
&lt;artifactId&gt;jboss-seam-remoting&lt;/artifactId&gt;
&lt;version&gt;${seam.version}&lt;/version&gt;
&lt;/dependency&gt;
&lt;dependency&gt;
&lt;groupId&gt;org.jboss.seam&lt;/groupId&gt;
&lt;artifactId&gt;jboss-seam-rss&lt;/artifactId&gt;
&lt;version&gt;${seam.version}&lt;/version&gt;
&lt;/dependency&gt;
&lt;dependency&gt;
&lt;groupId&gt;org.jboss.seam&lt;/groupId&gt;
&lt;artifactId&gt;jboss-seam-excel&lt;/artifactId&gt;
&lt;version&gt;${seam.version}&lt;/version&gt;
&lt;/dependency&gt;

&lt;!-- Seam makes use of Hibernate which  depends on JTA and JPA--&gt;
&lt;dependency&gt;
&lt;groupId&gt;javax.transaction&lt;/groupId&gt;
&lt;artifactId&gt;jta&lt;/artifactId&gt;
&lt;version&gt;1.1&lt;/version&gt;
&lt;/dependency&gt;
&lt;dependency&gt;
&lt;groupId&gt;javax.persistence&lt;/groupId&gt;
&lt;artifactId&gt;persistence-api&lt;/artifactId&gt;
&lt;version&gt;1.0&lt;/version&gt;
&lt;/dependency&gt;
&lt;dependency&gt;
&lt;groupId&gt;org.hibernate&lt;/groupId&gt;
&lt;artifactId&gt;hibernate-validator&lt;/artifactId&gt;
&lt;version&gt;3.0.0.GA&lt;/version&gt;
&lt;/dependency&gt;
&lt;dependency&gt;
&lt;groupId&gt;org.hibernate&lt;/groupId&gt;
&lt;artifactId&gt;hibernate-commons-annotations&lt;/artifactId&gt;
&lt;version&gt;3.1.0.GA&lt;/version&gt;
&lt;/dependency&gt;
&lt;dependency&gt;
&lt;groupId&gt;org.hibernate&lt;/groupId&gt;
&lt;artifactId&gt;hibernate-entitymanager&lt;/artifactId&gt;
&lt;version&gt;3.4.0.GA&lt;/version&gt;
&lt;/dependency&gt;
&lt;dependency&gt;
&lt;groupId&gt;org.hibernate&lt;/groupId&gt;
&lt;artifactId&gt;hibernate-annotations&lt;/artifactId&gt;
&lt;version&gt;3.4.0.GA&lt;/version&gt;
&lt;/dependency&gt;
&lt;dependency&gt;
&lt;groupId&gt;org.hibernate&lt;/groupId&gt;
&lt;artifactId&gt;hibernate-search&lt;/artifactId&gt;
&lt;version&gt;3.1.0.GA&lt;/version&gt;
&lt;/dependency&gt;
&lt;dependency&gt;
&lt;groupId&gt;org.slf4j&lt;/groupId&gt;
&lt;artifactId&gt;slf4j-api&lt;/artifactId&gt;
&lt;version&gt;1.5.8&lt;/version&gt;
&lt;/dependency&gt;
&lt;dependency&gt;
&lt;groupId&gt;org.slf4j&lt;/groupId&gt;
&lt;artifactId&gt;slf4j-log4j12&lt;/artifactId&gt;
&lt;version&gt;1.5.8&lt;/version&gt;
&lt;/dependency&gt;

&lt;dependency&gt;
&lt;groupId&gt;javax.faces&lt;/groupId&gt;
&lt;artifactId&gt;jsf-api&lt;/artifactId&gt;
&lt;version&gt;1.2_12&lt;/version&gt;
&lt;/dependency&gt;
&lt;dependency&gt;
&lt;groupId&gt;javax.servlet&lt;/groupId&gt;
&lt;artifactId&gt;jstl&lt;/artifactId&gt;
&lt;version&gt;1.2&lt;/version&gt;
&lt;/dependency&gt;
&lt;dependency&gt;
&lt;groupId&gt;javax.faces&lt;/groupId&gt;
&lt;artifactId&gt;jsf-impl&lt;/artifactId&gt;
&lt;version&gt;1.2_12&lt;/version&gt;
&lt;/dependency&gt;
&lt;dependency&gt;
&lt;groupId&gt;com.sun.facelets&lt;/groupId&gt;
&lt;artifactId&gt;jsf-facelets&lt;/artifactId&gt;
&lt;version&gt;1.1.14&lt;/version&gt;
&lt;/dependency&gt;
&lt;dependency&gt;
&lt;groupId&gt;org.richfaces.framework&lt;/groupId&gt;
&lt;artifactId&gt;richfaces-api&lt;/artifactId&gt;
&lt;version&gt;${richfaces.version}&lt;/version&gt;
&lt;/dependency&gt;
&lt;dependency&gt;
&lt;groupId&gt;org.richfaces.framework&lt;/groupId&gt;
&lt;artifactId&gt;richfaces-impl&lt;/artifactId&gt;
&lt;version&gt;${richfaces.version}&lt;/version&gt;
&lt;/dependency&gt;
&lt;dependency&gt;
&lt;groupId&gt;org.hibernate&lt;/groupId&gt;
&lt;artifactId&gt;hibernate&lt;/artifactId&gt;
&lt;version&gt;3.2.6.ga&lt;/version&gt;
&lt;/dependency&gt;
&lt;dependency&gt;
&lt;groupId&gt;org.richfaces.ui&lt;/groupId&gt;
&lt;artifactId&gt;richfaces-ui&lt;/artifactId&gt;
&lt;version&gt;${richfaces.version}&lt;/version&gt;

&lt;/dependency&gt;

&lt;!--Java Mail Related dependencies--&gt;
&lt;dependency&gt;
&lt;groupId&gt;javax.mail&lt;/groupId&gt;
&lt;artifactId&gt;mail&lt;/artifactId&gt;
&lt;version&gt;1.4.1&lt;/version&gt;
&lt;/dependency&gt;

&lt;!--Log4j--&gt;
&lt;dependency&gt;
&lt;groupId&gt;apache-log4j&lt;/groupId&gt;
&lt;artifactId&gt;log4j&lt;/artifactId&gt;
&lt;version&gt;1.2.14&lt;/version&gt;
&lt;/dependency&gt;
&lt;dependency&gt;
&lt;groupId&gt;jfree&lt;/groupId&gt;
&lt;artifactId&gt;jfreechart&lt;/artifactId&gt;
&lt;version&gt;1.0.8a&lt;/version&gt;
&lt;/dependency&gt;
&lt;dependency&gt;
&lt;groupId&gt;javassist&lt;/groupId&gt;
&lt;artifactId&gt;javassist&lt;/artifactId&gt;
&lt;version&gt;3.8.0.GA&lt;/version&gt;
&lt;/dependency&gt;
&lt;dependency&gt;
&lt;groupId&gt;org.apache.tomcat&lt;/groupId&gt;
&lt;artifactId&gt;servlet-api&lt;/artifactId&gt;
&lt;version&gt;6.0.16&lt;/version&gt;
&lt;scope&gt;provided&lt;/scope&gt;
&lt;/dependency&gt;
&lt;dependency&gt;
&lt;groupId&gt;org.primefaces&lt;/groupId&gt;
&lt;artifactId&gt;primefaces&lt;/artifactId&gt;
&lt;version&gt;1.0.0.RC&lt;/version&gt;
&lt;/dependency&gt;
&lt;dependency&gt;
&lt;groupId&gt;net.sf.ehcache&lt;/groupId&gt;
&lt;artifactId&gt;ehcache&lt;/artifactId&gt;
&lt;version&gt;1.6.0&lt;/version&gt;
&lt;/dependency&gt;
&lt;/dependencies&gt;
&lt;/project&gt;
</pre>
<p><strong>Things to consider:<br />
</strong></p>
<p>To run the Integration test cases comment the Tomcat specific datasource configuration and uncomment JBoss specific datasource configuration as shown in the comment section of persistence.xml reproduced below. (You can avoid this ugly way of comment and uncomment by using Maven profiles &#8211; one profile for testing and the other for a deployable in Tomcat).</p>
<pre class="brush: xml;">

&lt;!--Uncomment the below when you use Tomcat--&gt;
&lt;!--jta-data-source&gt;java:comp/env/jdbc/exampleDatabase&lt;/jta-data-source--&gt;
&lt;!--Uncomment the below when you run test cases in embedded server--&gt;
&lt;non-jta-data-source&gt;java:/exampleDatabase&lt;/non-jta-data-source&gt;
</pre>
<p>The test cases are executed when we run a command like <strong>mvn install<br />
</strong></p>
<p>To run cobertura and generate reports, the command is <strong>mvn cobertura:cobertura </strong>(The cobertura reports will be under target/site/cobertura. Please click on the index.html to view the report.)</p>
<p><img class="alignnone size-full wp-image-143" title="coberturareport" src="http://www.karthikeyanc.com/blog/wp-content/uploads/2009/12/coberturareport.png" alt="coberturareport" width="356" height="536" /></p>
<p>To create a deployable, make the required change in persistence.xml (as explained in Things to consider) and run the command like <strong>mvn install -Dmaven.test.skip</strong> (As the test cases will not execute with a Tomcat specific data source configuration in persistence.xml. I will try to do more analysis on this and check if it is possible to pick up different files one for test and the other to be packaged in web application deployable).</p>
<p>Hope this post is of some use. Please provide your suggestions (to improve this configuration) as a comment.</p>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 2634px; width: 1px; height: 1px;">Seam Example By Karthikeyan C                                                                                                               Seam Example<br />
List of Existing Employees<br />
Name                                                                                                                                                                          Email                                                                                                                                                                          Update</div>
<a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fwww.karthikeyanc.com%2Fblog%2Findex.php%2F2009%2F12%2Fstep-by-step-guide-setup-seam-2-2-0-ga-based-integration-testing-with-maven-testng-cobertura%2F&amp;linkname=Step%20By%20Step%20Guide%20%26%238211%3B%20Setup%20Seam%202.2.0.GA%20based%20Integration%20testing%20with%20Maven%20TestNG%20Cobertura"><img src="http://www.karthikeyanc.com/blog/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a>
<p><a href="http://feedads.g.doubleclick.net/~a/e3LEk64DW6YtWMMiWWp-PlPEeiQ/0/da"><img src="http://feedads.g.doubleclick.net/~a/e3LEk64DW6YtWMMiWWp-PlPEeiQ/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/e3LEk64DW6YtWMMiWWp-PlPEeiQ/1/da"><img src="http://feedads.g.doubleclick.net/~a/e3LEk64DW6YtWMMiWWp-PlPEeiQ/1/di" border="0" ismap="true"></img></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.karthikeyanc.com/blog/index.php/2009/12/step-by-step-guide-setup-seam-2-2-0-ga-based-integration-testing-with-maven-testng-cobertura/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to uninstall NetBeans from Ubuntu</title>
		<link>http://www.karthikeyanc.com/blog/index.php/2009/12/how-to-uninstall-netbeans-from-ubuntu/</link>
		<comments>http://www.karthikeyanc.com/blog/index.php/2009/12/how-to-uninstall-netbeans-from-ubuntu/#comments</comments>
		<pubDate>Sun, 06 Dec 2009 07:38:46 +0000</pubDate>
		<dc:creator>Karthikeyan C</dc:creator>
				<category><![CDATA[Installation / Configuration]]></category>
		<category><![CDATA[netbeans]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://www.karthikeyanc.com/blog/?p=139</guid>
		<description><![CDATA[NetBeans has been releasing in short cycles (The difference between NetBeans 6.8 RC1 and RC2 was just 4 days). So how to uninstall (remove) the older installations in Ubuntu ?
There is a file uninstall.sh under the root (home) directory of NetBeans installation. Navigate to root directory and execute uninstall.sh. A window pops up and you [...]]]></description>
			<content:encoded><![CDATA[<p>NetBeans has been releasing in short cycles (The difference between NetBeans 6.8 RC1 and RC2 was just 4 days). So how to uninstall (remove) the older installations in Ubuntu ?</p>
<p>There is a file <strong>uninstall.sh</strong> under the <strong>root (home) directory </strong>of NetBeans installation. Navigate to root directory and execute uninstall.sh. A window pops up and you can proceed with the uninstallation.</p>
<a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fwww.karthikeyanc.com%2Fblog%2Findex.php%2F2009%2F12%2Fhow-to-uninstall-netbeans-from-ubuntu%2F&amp;linkname=How%20to%20uninstall%20NetBeans%20from%20Ubuntu"><img src="http://www.karthikeyanc.com/blog/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a>
<p><a href="http://feedads.g.doubleclick.net/~a/1lejcCvDquuLsB7X5JoEzBcSafw/0/da"><img src="http://feedads.g.doubleclick.net/~a/1lejcCvDquuLsB7X5JoEzBcSafw/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/1lejcCvDquuLsB7X5JoEzBcSafw/1/da"><img src="http://feedads.g.doubleclick.net/~a/1lejcCvDquuLsB7X5JoEzBcSafw/1/di" border="0" ismap="true"></img></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.karthikeyanc.com/blog/index.php/2009/12/how-to-uninstall-netbeans-from-ubuntu/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Checking memory usage of your server in Java website hosting</title>
		<link>http://www.karthikeyanc.com/blog/index.php/2009/12/checking-memory-usage-of-your-java-website-hosting/</link>
		<comments>http://www.karthikeyanc.com/blog/index.php/2009/12/checking-memory-usage-of-your-java-website-hosting/#comments</comments>
		<pubDate>Sat, 05 Dec 2009 08:33:34 +0000</pubDate>
		<dc:creator>Karthikeyan C</dc:creator>
				<category><![CDATA[Tools / Utilities]]></category>
		<category><![CDATA[javahosting]]></category>
		<category><![CDATA[JSP]]></category>

		<guid isPermaLink="false">http://www.karthikeyanc.com/blog/?p=138</guid>
		<description><![CDATA[If you host your website on a JEE web or application server on a shared hosting plan (either private or shared instance), you may use the JSP code below to check the memory usage of your server. This will help you to know if the web hosting company really provides you what they promised. This [...]]]></description>
			<content:encoded><![CDATA[<p>If you host your website on a JEE web or application server on a shared hosting plan (either private or shared instance), you may use the JSP code below to check the memory usage of your server. This will help you to know if the web hosting company really provides you what they promised. This is a simple but efficient tool.</p>
<pre class="brush: xml;">

&lt;%@page contentType=&quot;text/html&quot; pageEncoding=&quot;UTF-8&quot;%&gt;
&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.01 Transitional//EN&quot;
 &quot;http://www.w3.org/TR/html4/loose.dtd&quot;&gt;

&lt;html&gt;
 &lt;head&gt;
 &lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=UTF-8&quot;&gt;
 &lt;title&gt;Your title here&lt;/title&gt;
 &lt;/head&gt;
 &lt;body&gt;
 &lt;h3&gt;Total memory : &lt;%=Runtime.getRuntime().totalMemory()%&gt;&lt;/h3&gt;
 &lt;h3&gt;Free memory : &lt;%=Runtime.getRuntime().freeMemory()%&gt;&lt;/h3&gt;
 &lt;h3&gt;Max memory : &lt;%=Runtime.getRuntime().maxMemory()%&gt;&lt;/h3&gt;
 &lt;h3&gt;Java version : &lt;%=System.getProperties().getProperty(&quot;java.version&quot;)%&gt;&lt;/h3&gt;
 &lt;/body&gt;
&lt;/html&gt;
</pre>
<a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fwww.karthikeyanc.com%2Fblog%2Findex.php%2F2009%2F12%2Fchecking-memory-usage-of-your-java-website-hosting%2F&amp;linkname=Checking%20memory%20usage%20of%20your%20server%20in%20Java%20website%20hosting"><img src="http://www.karthikeyanc.com/blog/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a>
<p><a href="http://feedads.g.doubleclick.net/~a/AIo23bVp826-6SBLwVfGBuzTMEg/0/da"><img src="http://feedads.g.doubleclick.net/~a/AIo23bVp826-6SBLwVfGBuzTMEg/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/AIo23bVp826-6SBLwVfGBuzTMEg/1/da"><img src="http://feedads.g.doubleclick.net/~a/AIo23bVp826-6SBLwVfGBuzTMEg/1/di" border="0" ismap="true"></img></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.karthikeyanc.com/blog/index.php/2009/12/checking-memory-usage-of-your-java-website-hosting/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
