<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments for CK&#039;s Developer Blog</title>
	<atom:link href="http://www.karthikeyanc.com/blog/index.php/comments/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.karthikeyanc.com/blog</link>
	<description>My Code Notes (mostly JavaEE or JEE)</description>
	<lastBuildDate>Sun, 02 May 2010 18:29:30 -0500</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.5</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>Comment on Step By Step Guide &#8211; Setup Seam 2.2.0.GA based Integration testing with Maven TestNG Cobertura by Karthikeyan C</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/comment-page-1/#comment-243</link>
		<dc:creator>Karthikeyan C</dc:creator>
		<pubDate>Sun, 02 May 2010 18:29:30 +0000</pubDate>
		<guid isPermaLink="false">http://www.karthikeyanc.com/blog/?p=140#comment-243</guid>
		<description>&lt;a href=&quot;#comment-242&quot; rel=&quot;nofollow&quot;&gt;@Jasper Vandaele &lt;/a&gt; 
Sorry to reply and approve your comments late. Thanks for your comments as it would be helpful for me as well as other readers of this post (to be specific the exclusion of main persistence.xml)</description>
		<content:encoded><![CDATA[<p><a href="#comment-242" rel="nofollow">@Jasper Vandaele </a><br />
Sorry to reply and approve your comments late. Thanks for your comments as it would be helpful for me as well as other readers of this post (to be specific the exclusion of main persistence.xml)</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Step By Step Guide &#8211; Setup Seam 2.2.0.GA based Integration testing with Maven TestNG Cobertura by Jasper Vandaele</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/comment-page-1/#comment-242</link>
		<dc:creator>Jasper Vandaele</dc:creator>
		<pubDate>Sun, 02 May 2010 18:07:21 +0000</pubDate>
		<guid isPermaLink="false">http://www.karthikeyanc.com/blog/?p=140#comment-242</guid>
		<description>I found a solution to override the main persistence.xml with a test one.  (Google is still my friend :).

The thing is that the embedded Jboss does not simply load the first persistence.xml in the classpath. I haven&#039;t found out what happens exactly, but the mvn test work and can deploy the app without touching a file or skipping tests.

So I have a persistence.xml in src/main/resources with the tomcat jndi name and one in src/test/resources with the jndi name for jboss.
The first thing to do is to exclude the main persistence.xml from the main resources:
&lt;resources&gt;
  &lt;resource&gt;
    &lt;directory&gt;${basedir}/src/main/resources&lt;/directory&gt;
    &lt;excludes&gt;
	&lt;exclude&gt;META-INF/persistence*&lt;/exclude&gt;
    &lt;/excludes&gt;
  &lt;/resource&gt;
&lt;/resources&gt;

Now the persistence.xml in the main resources got invisible and the tests pass.

To have the right persistence.xml in the final app, I use the ant plugin in the prepare-package phase:

&lt;plugin&gt;
    &lt;artifactId&gt;maven-antrun-plugin&lt;/artifactId&gt;
    &lt;executions&gt;
		&lt;execution&gt;
                  &lt;phase&gt;prepare-package&lt;/phase&gt;
		  &lt;configuration&gt;
				&lt;tasks&gt;
					&lt;copy todir=&quot;${project.build.outputDirectory}&quot;&gt;
						&lt;fileset dir=&quot;${basedir}/src/main/resources&quot;&gt;
							&lt;include name=&quot;META-INF&quot; /&gt;
						&lt;/fileset&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;


I must add that I had some unexplainable &quot;unknown entity&quot; errors in the tests. I solved this by explicitly adding the entity classes in the test persistence.xml with &lt;class&gt; tags.

Hope this can help.</description>
		<content:encoded><![CDATA[<p>I found a solution to override the main persistence.xml with a test one.  (Google is still my friend <img src='http://www.karthikeyanc.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> .</p>
<p>The thing is that the embedded Jboss does not simply load the first persistence.xml in the classpath. I haven&#8217;t found out what happens exactly, but the mvn test work and can deploy the app without touching a file or skipping tests.</p>
<p>So I have a persistence.xml in src/main/resources with the tomcat jndi name and one in src/test/resources with the jndi name for jboss.<br />
The first thing to do is to exclude the main persistence.xml from the main resources:<br />
&lt;resources&gt;<br />
  &lt;resource&gt;<br />
    &lt;directory&gt;${basedir}/src/main/resources&lt;/directory&gt;<br />
    &lt;excludes&gt;<br />
	&lt;exclude&gt;META-INF/persistence*&lt;/exclude&gt;<br />
    &lt;/excludes&gt;<br />
  &lt;/resource&gt;<br />
&lt;/resources&gt;</p>
<p>Now the persistence.xml in the main resources got invisible and the tests pass.</p>
<p>To have the right persistence.xml in the final app, I use the ant plugin in the prepare-package phase:</p>
<p>&lt;plugin&gt;<br />
    &lt;artifactId&gt;maven-antrun-plugin&lt;/artifactId&gt;<br />
    &lt;executions&gt;<br />
		&lt;execution&gt;<br />
                  &lt;phase&gt;prepare-package&lt;/phase&gt;<br />
		  &lt;configuration&gt;<br />
				&lt;tasks&gt;<br />
					&lt;copy todir=&quot;${project.build.outputDirectory}&quot;&gt;<br />
						&lt;fileset dir=&quot;${basedir}/src/main/resources&quot;&gt;<br />
							&lt;include name=&quot;META-INF&quot; /&gt;<br />
						&lt;/fileset&gt;<br />
					&lt;/copy&gt;<br />
				&lt;/tasks&gt;<br />
		  &lt;/configuration&gt;<br />
		  &lt;goals&gt;<br />
				&lt;goal&gt;run&lt;/goal&gt;<br />
		  &lt;/goals&gt;<br />
		&lt;/execution&gt;<br />
    &lt;/executions&gt;<br />
&lt;/plugin&gt;</p>
<p>I must add that I had some unexplainable &#8220;unknown entity&#8221; errors in the tests. I solved this by explicitly adding the entity classes in the test persistence.xml with &lt;class&gt; tags.</p>
<p>Hope this can help.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Step By Step Guide &#8211; Setup Seam 2.2.0.GA based Integration testing with Maven TestNG Cobertura by Jasper Vandaele</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/comment-page-1/#comment-240</link>
		<dc:creator>Jasper Vandaele</dc:creator>
		<pubDate>Thu, 29 Apr 2010 21:38:24 +0000</pubDate>
		<guid isPermaLink="false">http://www.karthikeyanc.com/blog/?p=140#comment-240</guid>
		<description>OK,

Second try to post the pom.xml parts:

&lt;code&gt;
&lt;plugin&gt;
		        &lt;groupId&gt;org.codehaus.mojo&lt;/groupId&gt;
		        &lt;artifactId&gt;tomcat-maven-plugin&lt;/artifactId&gt;
		        &lt;version&gt;1.0-SNAPSHOT&lt;/version&gt;
		        &lt;configuration&gt;
		        	&lt;update&gt;true&lt;/update&gt;
		        	&lt;mode&gt;both&lt;/mode&gt;
		        	&lt;contextFile&gt;src/main/resources/META-INF/context.xml&lt;/contextFile&gt;
		        	&lt;username&gt;jasper&lt;/username&gt;
		        	&lt;password&gt;tomcat&lt;/password&gt;
		        &lt;/configuration&gt;
		    &lt;/plugin&gt;
&lt;!-- ... --&gt;

&lt;pluginRepositories&gt;
		&lt;pluginRepository&gt;
			&lt;id&gt;mojo.snapshots&lt;/id&gt;
			&lt;url&gt;http://snapshots.repository.codehaus.org/&lt;/url&gt;
			&lt;releases&gt;
				&lt;enabled&gt;false&lt;/enabled&gt;
			&lt;/releases&gt;
			&lt;snapshots&gt;
				&lt;updatePolicy&gt;daily&lt;/updatePolicy&gt;
			&lt;/snapshots&gt;
		&lt;/pluginRepository&gt;
	&lt;/pluginRepositories&gt;
&lt;/code&gt;</description>
		<content:encoded><![CDATA[<p>OK,</p>
<p>Second try to post the pom.xml parts:</p>
<p>&lt;code&gt;<br />
&lt;plugin&gt;<br />
		        &lt;groupId&gt;org.codehaus.mojo&lt;/groupId&gt;<br />
		        &lt;artifactId&gt;tomcat-maven-plugin&lt;/artifactId&gt;<br />
		        &lt;version&gt;1.0-SNAPSHOT&lt;/version&gt;<br />
		        &lt;configuration&gt;<br />
		        	&lt;update&gt;true&lt;/update&gt;<br />
		        	&lt;mode&gt;both&lt;/mode&gt;<br />
		        	&lt;contextFile&gt;src/main/resources/META-INF/context.xml&lt;/contextFile&gt;<br />
		        	&lt;username&gt;jasper&lt;/username&gt;<br />
		        	&lt;password&gt;tomcat&lt;/password&gt;<br />
		        &lt;/configuration&gt;<br />
		    &lt;/plugin&gt;<br />
&lt;!&#8211; &#8230; &#8211;&gt;</p>
<p>&lt;pluginRepositories&gt;<br />
		&lt;pluginRepository&gt;<br />
			&lt;id&gt;mojo.snapshots&lt;/id&gt;<br />
			&lt;url&gt;http://snapshots.repository.codehaus.org/&lt;/url&gt;<br />
			&lt;releases&gt;<br />
				&lt;enabled&gt;false&lt;/enabled&gt;<br />
			&lt;/releases&gt;<br />
			&lt;snapshots&gt;<br />
				&lt;updatePolicy&gt;daily&lt;/updatePolicy&gt;<br />
			&lt;/snapshots&gt;<br />
		&lt;/pluginRepository&gt;<br />
	&lt;/pluginRepositories&gt;<br />
&lt;/code&gt;</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Step By Step Guide &#8211; Setup Seam 2.2.0.GA based Integration testing with Maven TestNG Cobertura by Jasper Vandaele</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/comment-page-1/#comment-239</link>
		<dc:creator>Jasper Vandaele</dc:creator>
		<pubDate>Thu, 29 Apr 2010 21:12:54 +0000</pubDate>
		<guid isPermaLink="false">http://www.karthikeyanc.com/blog/?p=140#comment-239</guid>
		<description>Great article!

This is the only clear explanation that I could find of how to run SeamTests with m2 that actually works.

What I normally do to use a different configuration for testing than for the main code, is the put the a file on the same location in the src/test/resources. If you use a maven version &gt; 2.0.8 and surefire &gt;= 2.4.3 the test resources are loaded first in the classpath. There were some bugs in previous version of maven and surefire where the classpath was inversed.

So, I tried to put a persistence.xml in src/test/resources/META-INF/persistence.xml
But for some reason, the one under src/main/resources is used in the test phase :( If some one knows why my theory is not working, or knows another way to solve the difference in the JNDI names,  your thoughts on this are always welcome.

I also use the maven-tomcat plugin to deploy the app. Here goes the plugin config:


		        org.codehaus.mojo
		        tomcat-maven-plugin
		        1.0-SNAPSHOT
		        
		        	true
		        	both
		        	src/main/resources/META-INF/context.xml
		        	configure.this.user.in.tomcat-users.xml.with.role.manager
		        	thepassword
		        
		    

With this plugin you can deploy the war on a running tomcat with mvn tomcat:deploy . I have to skip the tests due to the JNDI name problem.

To download the plugin, you can use this repository:


		
			mojo.snapshots
			http://snapshots.repository.codehaus.org/
			
				false
			
			
				daily
			
		
	

Enjoy</description>
		<content:encoded><![CDATA[<p>Great article!</p>
<p>This is the only clear explanation that I could find of how to run SeamTests with m2 that actually works.</p>
<p>What I normally do to use a different configuration for testing than for the main code, is the put the a file on the same location in the src/test/resources. If you use a maven version &gt; 2.0.8 and surefire &gt;= 2.4.3 the test resources are loaded first in the classpath. There were some bugs in previous version of maven and surefire where the classpath was inversed.</p>
<p>So, I tried to put a persistence.xml in src/test/resources/META-INF/persistence.xml<br />
But for some reason, the one under src/main/resources is used in the test phase <img src='http://www.karthikeyanc.com/blog/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' />  If some one knows why my theory is not working, or knows another way to solve the difference in the JNDI names,  your thoughts on this are always welcome.</p>
<p>I also use the maven-tomcat plugin to deploy the app. Here goes the plugin config:</p>
<p>		        org.codehaus.mojo<br />
		        tomcat-maven-plugin<br />
		        1.0-SNAPSHOT</p>
<p>		        	true<br />
		        	both<br />
		        	src/main/resources/META-INF/context.xml<br />
		        	configure.this.user.in.tomcat-users.xml.with.role.manager<br />
		        	thepassword</p>
<p>With this plugin you can deploy the war on a running tomcat with mvn tomcat:deploy . I have to skip the tests due to the JNDI name problem.</p>
<p>To download the plugin, you can use this repository:</p>
<p>			mojo.snapshots<br />
			<a href="http://snapshots.repository.codehaus.org/" rel="nofollow">http://snapshots.repository.codehaus.org/</a></p>
<p>				false</p>
<p>				daily</p>
<p>Enjoy</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on PrimeFaces File Upload component hack by Cagatay Civici</title>
		<link>http://www.karthikeyanc.com/blog/index.php/2009/11/primefaces-file-upload-component-hacks/comment-page-1/#comment-231</link>
		<dc:creator>Cagatay Civici</dc:creator>
		<pubDate>Sat, 27 Mar 2010 22:37:03 +0000</pubDate>
		<guid isPermaLink="false">http://www.karthikeyanc.com/blog/?p=109#comment-231</guid>
		<description>This is fixed in 1.0.1 and 2.0.1</description>
		<content:encoded><![CDATA[<p>This is fixed in 1.0.1 and 2.0.1</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Tutorial &#8211; Your first CXF web service in 10 minutes by venkatesh</title>
		<link>http://www.karthikeyanc.com/blog/index.php/2009/12/tutorial-your-first-cxf-web-service-in-10-minutes/comment-page-1/#comment-182</link>
		<dc:creator>venkatesh</dc:creator>
		<pubDate>Fri, 22 Jan 2010 11:24:37 +0000</pubDate>
		<guid isPermaLink="false">http://www.karthikeyanc.com/blog/?p=146#comment-182</guid>
		<description>Hi Karthik,

I think you have missed this dependency, without which the war is having deploy time issues.
		
			javax.xml.stream
			stax-api
			1.0-2
		

Thanks
Venki</description>
		<content:encoded><![CDATA[<p>Hi Karthik,</p>
<p>I think you have missed this dependency, without which the war is having deploy time issues.</p>
<p>			javax.xml.stream<br />
			stax-api<br />
			1.0-2</p>
<p>Thanks<br />
Venki</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on MySQL database schema browser and SQL executor in Ubuntu 9.10 by Shrihari</title>
		<link>http://www.karthikeyanc.com/blog/index.php/2009/11/mysql-database-schema-browser-and-sql-executor-in-ubuntu-9-10/comment-page-1/#comment-175</link>
		<dc:creator>Shrihari</dc:creator>
		<pubDate>Thu, 21 Jan 2010 11:45:01 +0000</pubDate>
		<guid isPermaLink="false">http://www.karthikeyanc.com/blog/?p=113#comment-175</guid>
		<description>Cool post. For Fedora its the following command:

&lt;i&gt;sudo yum -y install mysql-query-browser mysql-administrator&lt;/i&gt;</description>
		<content:encoded><![CDATA[<p>Cool post. For Fedora its the following command:</p>
<p><i>sudo yum -y install mysql-query-browser mysql-administrator</i></p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on How To ReRender PrimeFaces growl after Ajax request from RichFaces component by Karthikeyan C</title>
		<link>http://www.karthikeyanc.com/blog/index.php/2010/01/how-to-rerender-primefaces-growl-after-ajax-request-from-richfaces-component/comment-page-1/#comment-162</link>
		<dc:creator>Karthikeyan C</dc:creator>
		<pubDate>Sun, 17 Jan 2010 17:04:42 +0000</pubDate>
		<guid isPermaLink="false">http://www.karthikeyanc.com/blog/?p=152#comment-162</guid>
		<description>&lt;a href=&quot;#comment-161&quot; rel=&quot;nofollow&quot;&gt;@Cagatay Civici &lt;/a&gt; 
You are right. Just documented this as a generic rule when we initiate an AJAX request from a RichFaces component which may not have an equivalent PrimeFaces component.</description>
		<content:encoded><![CDATA[<p><a href="#comment-161" rel="nofollow">@Cagatay Civici </a><br />
You are right. Just documented this as a generic rule when we initiate an AJAX request from a RichFaces component which may not have an equivalent PrimeFaces component.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on How To ReRender PrimeFaces growl after Ajax request from RichFaces component by Cagatay Civici</title>
		<link>http://www.karthikeyanc.com/blog/index.php/2010/01/how-to-rerender-primefaces-growl-after-ajax-request-from-richfaces-component/comment-page-1/#comment-161</link>
		<dc:creator>Cagatay Civici</dc:creator>
		<pubDate>Sun, 17 Jan 2010 16:50:03 +0000</pubDate>
		<guid isPermaLink="false">http://www.karthikeyanc.com/blog/?p=152#comment-161</guid>
		<description>p:commandButton can directly update p:growl without this hack.</description>
		<content:encoded><![CDATA[<p>p:commandButton can directly update p:growl without this hack.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on How to improve performance of Seam based RichFaces JSF application by Karthikeyan C</title>
		<link>http://www.karthikeyanc.com/blog/index.php/2009/12/how-to-improve-performance-of-seam-based-jsf-application/comment-page-1/#comment-44</link>
		<dc:creator>Karthikeyan C</dc:creator>
		<pubDate>Tue, 08 Dec 2009 02:20:40 +0000</pubDate>
		<guid isPermaLink="false">http://www.karthikeyanc.com/blog/?p=128#comment-44</guid>
		<description>&lt;a href=&quot;#comment-43&quot; rel=&quot;nofollow&quot;&gt;@Kito Mann &lt;/a&gt; 
I have already mentioned Dan Allen&#039;s article in the post as a link to one of my post which is http://www.karthikeyanc.com/blog/index.php/2009/11/jsf-and-richfaces-optimization-links/ . Thanks for your comment.</description>
		<content:encoded><![CDATA[<p><a href="#comment-43" rel="nofollow">@Kito Mann </a><br />
I have already mentioned Dan Allen&#8217;s article in the post as a link to one of my post which is <a href="http://www.karthikeyanc.com/blog/index.php/2009/11/jsf-and-richfaces-optimization-links/" rel="nofollow">http://www.karthikeyanc.com/blog/index.php/2009/11/jsf-and-richfaces-optimization-links/</a> . Thanks for your comment.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
