<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-598740808358796854</id><updated>2025-06-01T05:31:31.809-07:00</updated><category term="bash"/><category term="eclipse"/><category term="cygwin"/><category term="logging"/><category term="maven"/><category term="svn"/><category term=".net"/><category term="axis2"/><category term="object-oriented design"/><category term="silveright"/><category term="soap"/><category term="tdd"/><category term="test-driven-development"/><category term="testing"/><category term="xml"/><title type='text'>TruMaze</title><subtitle type='html'>This blog will be used to record my thoughts on software engineering, social issues, politics, government, etc. I hope you will find it useful.</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://trumaze.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/598740808358796854/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://trumaze.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>15</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-598740808358796854.post-685332882476857238</id><published>2020-12-28T06:44:00.011-08:00</published><updated>2020-12-28T08:22:58.113-08:00</updated><title type='text'>How to deploy a single instance SSL-enabled Tomcat application on AWS Elastic Beanstalk</title><content type='html'>&lt;h2 style=&quot;text-align: left;&quot;&gt;&lt;b&gt;The Problem&lt;/b&gt;&lt;/h2&gt;&lt;p&gt;I run a simple low-traffic website hosted on Elastic Beanstalk and I did not want to pay for the $15-$20 / month for an auto-scaled environment, which requires an elastic load balancer -- hence the higher cost. Instead, I can run a single EC2 instance and cut my costs in half from ~$30 to ~$15.&amp;nbsp;&lt;/p&gt;&lt;p&gt;The catch is that by dropping the elastic load balancer, you also lose the ability to terminate the SSL (HTTPS) connection and the ability to use Amazon&#39;s free SSL certificate service. So what do you do?&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;h2 style=&quot;text-align: left;&quot;&gt;The Solution&lt;/h2&gt;&lt;h3 style=&quot;text-align: left;&quot;&gt;Summary&lt;/h3&gt;&lt;p&gt;We can extend our Elastic Beanstalk application hosting using the EB Extensions features. The following changes will tell Elastic Beanstalk to:&lt;/p&gt;&lt;p&gt;1. get a free SSL certificate from Letsencrypt.org using one of their tools (certbot-auto) which is downloaded and executed after the instance is set up, but before Apache HTTP server is started. The SSL certificates will be stored in /etc/letsencrypt/live folder. The SSL certificate will be valid for 3 months, but you can renew it as often as you need (see step 4).&amp;nbsp;&lt;/p&gt;&lt;p&gt;2. Configure Apache to use those SSL certificates and start listening on port 443 for SSL connections.&amp;nbsp;&lt;/p&gt;&lt;p&gt;3. Updated the security group for the EC2 instance is updated to allow traffic from the internet to port 443.&amp;nbsp;&lt;/p&gt;&lt;p&gt;4. Schedule a cron job to run every month to renew the certificate&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;h3 style=&quot;text-align: left;&quot;&gt;Step 1. Create .ebextensions Folder&amp;nbsp;&lt;/h3&gt;&lt;p&gt;By including a new folder in the top level of the WAR file called .ebextensions with the following files:&lt;/p&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgK18xz-NVCavHX1cYd4lodjQtXvztAOfeeXjCMpuhG8mItsTJ7VT2DXTn7jKAC0iC29-kp7-UnoCG-dRkyG1KSZQG8ekLeuL5-1E8PnbYcYL_3E5VzwxdymYNBTD5ADsU1uyTiDa0PCjo/s308/Screen+Shot+2020-12-28+at+9.46.28+AM.png&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;123&quot; data-original-width=&quot;308&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgK18xz-NVCavHX1cYd4lodjQtXvztAOfeeXjCMpuhG8mItsTJ7VT2DXTn7jKAC0iC29-kp7-UnoCG-dRkyG1KSZQG8ekLeuL5-1E8PnbYcYL_3E5VzwxdymYNBTD5ADsU1uyTiDa0PCjo/s0/Screen+Shot+2020-12-28+at+9.46.28+AM.png&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;p&gt;&lt;/p&gt;&lt;br /&gt;If you are using maven, you need to add the following bit to your pom.xml to get the .ebextension directory to be bundled in the right place in the war:&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;h3&gt;Step 2. Configure Maven war plugin&lt;/h3&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class=&quot;p1&quot; style=&quot;color: #3f7f7f; font-size: 12px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal; margin: 0px;&quot;&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;&lt;span class=&quot;s1&quot; style=&quot;color: teal;&quot;&gt;&amp;lt;&lt;/span&gt;plugin&lt;span class=&quot;s1&quot; style=&quot;color: teal;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;p2&quot; style=&quot;font-size: 12px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal; margin: 0px;&quot;&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;&lt;span class=&quot;s1&quot; style=&quot;color: teal;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;s2&quot; style=&quot;color: #3f7f7f;&quot;&gt;groupId&lt;/span&gt;&lt;span class=&quot;s1&quot; style=&quot;color: teal;&quot;&gt;&amp;gt;&lt;/span&gt;org.apache.maven.plugins&lt;span class=&quot;s1&quot; style=&quot;color: teal;&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;s2&quot; style=&quot;color: #3f7f7f;&quot;&gt;groupId&lt;/span&gt;&lt;span class=&quot;s1&quot; style=&quot;color: teal;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;p1&quot; style=&quot;color: #3f7f7f; font-size: 12px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal; margin: 0px;&quot;&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;&lt;span class=&quot;s3&quot; style=&quot;color: black;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;s1&quot; style=&quot;color: teal;&quot;&gt;&amp;lt;&lt;/span&gt;artifactId&lt;span class=&quot;s1&quot; style=&quot;color: teal;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;s3&quot; style=&quot;color: black;&quot;&gt;maven-war-plugin&lt;/span&gt;&lt;span class=&quot;s1&quot; style=&quot;color: teal;&quot;&gt;&amp;lt;/&lt;/span&gt;artifactId&lt;span class=&quot;s1&quot; style=&quot;color: teal;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;p1&quot; style=&quot;color: #3f7f7f; font-size: 12px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal; margin: 0px;&quot;&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;&lt;span class=&quot;s3&quot; style=&quot;color: black;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;s1&quot; style=&quot;color: teal;&quot;&gt;&amp;lt;&lt;/span&gt;version&lt;span class=&quot;s1&quot; style=&quot;color: teal;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;s3&quot; style=&quot;color: black;&quot;&gt;3.3.1&lt;/span&gt;&lt;span class=&quot;s1&quot; style=&quot;color: teal;&quot;&gt;&amp;lt;/&lt;/span&gt;version&lt;span class=&quot;s1&quot; style=&quot;color: teal;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;p1&quot; style=&quot;color: #3f7f7f; font-size: 12px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal; margin: 0px;&quot;&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;&lt;span class=&quot;s3&quot; style=&quot;color: black;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;s1&quot; style=&quot;color: teal;&quot;&gt;&amp;lt;&lt;/span&gt;configuration&lt;span class=&quot;s1&quot; style=&quot;color: teal;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;p1&quot; style=&quot;color: #3f7f7f; font-size: 12px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal; margin: 0px;&quot;&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;&lt;span class=&quot;s3&quot; style=&quot;color: black;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;s1&quot; style=&quot;color: teal;&quot;&gt;&amp;lt;&lt;/span&gt;webResources&lt;span class=&quot;s1&quot; style=&quot;color: teal;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;p1&quot; style=&quot;color: #3f7f7f; font-size: 12px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal; margin: 0px;&quot;&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;&lt;span class=&quot;s3&quot; style=&quot;color: black;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;s1&quot; style=&quot;color: teal;&quot;&gt;&amp;lt;&lt;/span&gt;resource&lt;span class=&quot;s1&quot; style=&quot;color: teal;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;p2&quot; style=&quot;font-size: 12px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal; margin: 0px;&quot;&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;&lt;span class=&quot;s1&quot; style=&quot;color: teal;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;s2&quot; style=&quot;color: #3f7f7f;&quot;&gt;directory&lt;/span&gt;&lt;span class=&quot;s1&quot; style=&quot;color: teal;&quot;&gt;&amp;gt;&lt;/span&gt;src/main/ebextensions&lt;span class=&quot;s1&quot; style=&quot;color: teal;&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;s2&quot; style=&quot;color: #3f7f7f;&quot;&gt;directory&lt;/span&gt;&lt;span class=&quot;s1&quot; style=&quot;color: teal;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;p1&quot; style=&quot;color: #3f7f7f; font-size: 12px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal; margin: 0px;&quot;&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;&lt;span class=&quot;s3&quot; style=&quot;color: black;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;s1&quot; style=&quot;color: teal;&quot;&gt;&amp;lt;&lt;/span&gt;targetPath&lt;span class=&quot;s1&quot; style=&quot;color: teal;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;s3&quot; style=&quot;color: black;&quot;&gt;.ebextensions&lt;/span&gt;&lt;span class=&quot;s1&quot; style=&quot;color: teal;&quot;&gt;&amp;lt;/&lt;/span&gt;targetPath&lt;span class=&quot;s1&quot; style=&quot;color: teal;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;p1&quot; style=&quot;color: #3f7f7f; font-size: 12px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal; margin: 0px;&quot;&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;&lt;span class=&quot;s3&quot; style=&quot;color: black;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;s1&quot; style=&quot;color: teal;&quot;&gt;&amp;lt;&lt;/span&gt;filtering&lt;span class=&quot;s1&quot; style=&quot;color: teal;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;s3&quot; style=&quot;color: black;&quot;&gt;true&lt;/span&gt;&lt;span class=&quot;s1&quot; style=&quot;color: teal;&quot;&gt;&amp;lt;/&lt;/span&gt;filtering&lt;span class=&quot;s1&quot; style=&quot;color: teal;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;p1&quot; style=&quot;color: #3f7f7f; font-size: 12px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal; margin: 0px;&quot;&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;&lt;span class=&quot;s3&quot; style=&quot;color: black;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;s1&quot; style=&quot;color: teal;&quot;&gt;&amp;lt;/&lt;/span&gt;resource&lt;span class=&quot;s1&quot; style=&quot;color: teal;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;p1&quot; style=&quot;color: #3f7f7f; font-size: 12px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal; margin: 0px;&quot;&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;&lt;span class=&quot;s3&quot; style=&quot;color: black;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;s1&quot; style=&quot;color: teal;&quot;&gt;&amp;lt;/&lt;/span&gt;webResources&lt;span class=&quot;s1&quot; style=&quot;color: teal;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;p1&quot; style=&quot;color: #3f7f7f; font-size: 12px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal; margin: 0px;&quot;&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;&lt;span class=&quot;s3&quot; style=&quot;color: black;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;s1&quot; style=&quot;color: teal;&quot;&gt;&amp;lt;/&lt;/span&gt;configuration&lt;span class=&quot;s1&quot; style=&quot;color: teal;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;font-family: courier; font-size: 12px; white-space: pre;&quot;&gt;&lt;span class=&quot;s1&quot; style=&quot;color: teal;&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: #3f7f7f;&quot;&gt;plugin&lt;/span&gt;&lt;span class=&quot;s1&quot; style=&quot;color: teal;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;font-family: Monaco; font-size: 12px; white-space: pre;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;h3&gt;Step 3. Add ssl.conf File&lt;/h3&gt;This file will update the Apache configuration to look at the SSL certificates generated by letsencrypt.org. Update the domain (in red) for your domain name.&amp;nbsp;&lt;div&gt;&lt;br /&gt;&lt;p class=&quot;p1&quot; style=&quot;font-size: 12px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal; margin: 0px;&quot;&gt;&lt;span style=&quot;background-color: #eeeeee;&quot;&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;Listen 443&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;p1&quot; style=&quot;font-size: 12px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal; margin: 0px;&quot;&gt;&lt;span style=&quot;background-color: #eeeeee;&quot;&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;&amp;lt;VirtualHost *:443&amp;gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;p1&quot; style=&quot;font-size: 12px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal; margin: 0px;&quot;&gt;&lt;span style=&quot;background-color: #eeeeee;&quot;&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp; &lt;/span&gt;ServerName &lt;span style=&quot;color: red;&quot;&gt;mydomain.com&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;p1&quot; style=&quot;font-size: 12px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal; margin: 0px;&quot;&gt;&lt;span style=&quot;background-color: #eeeeee;&quot;&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp; &lt;/span&gt;SSLEngine on&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;p1&quot; style=&quot;font-size: 12px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal; margin: 0px;&quot;&gt;&lt;span style=&quot;background-color: #eeeeee;&quot;&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp; &lt;/span&gt;SSLCertificateFile&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&quot;/etc/&lt;span class=&quot;s1&quot; style=&quot;text-decoration-line: underline;&quot;&gt;letsencrypt&lt;/span&gt;/live/&lt;span style=&quot;color: red;&quot;&gt;www.mydomain.com&lt;/span&gt;/fullchain.pem&quot;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;p1&quot; style=&quot;font-size: 12px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal; margin: 0px;&quot;&gt;&lt;span style=&quot;background-color: #eeeeee;&quot;&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp; &lt;/span&gt;SSLCertificateKeyFile &quot;/etc/&lt;span class=&quot;s1&quot; style=&quot;text-decoration-line: underline;&quot;&gt;letsencrypt&lt;/span&gt;/live/&lt;span style=&quot;color: red;&quot;&gt;www.mydomain.com&lt;/span&gt;/privkey.pem&quot;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;p2&quot; style=&quot;font-size: 12px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal; margin: 0px; min-height: 16px;&quot;&gt;&lt;span style=&quot;background-color: #eeeeee;&quot;&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;p1&quot; style=&quot;font-size: 12px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal; margin: 0px;&quot;&gt;&lt;span style=&quot;background-color: #eeeeee;&quot;&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp; &lt;/span&gt;&amp;lt;Proxy *&amp;gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;p1&quot; style=&quot;font-size: 12px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal; margin: 0px;&quot;&gt;&lt;span style=&quot;background-color: #eeeeee;&quot;&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;Require all granted&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;p1&quot; style=&quot;font-size: 12px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal; margin: 0px;&quot;&gt;&lt;span style=&quot;background-color: #eeeeee;&quot;&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp; &lt;/span&gt;&amp;lt;/Proxy&amp;gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;p1&quot; style=&quot;font-size: 12px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal; margin: 0px;&quot;&gt;&lt;span style=&quot;background-color: #eeeeee;&quot;&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp; &lt;/span&gt;ProxyPass / http://localhost:8080/ retry=0&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;p1&quot; style=&quot;font-size: 12px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal; margin: 0px;&quot;&gt;&lt;span style=&quot;background-color: #eeeeee;&quot;&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp; &lt;/span&gt;ProxyPassReverse / http://localhost:8080/&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;p1&quot; style=&quot;font-size: 12px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal; margin: 0px;&quot;&gt;&lt;span style=&quot;background-color: #eeeeee;&quot;&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp; &lt;/span&gt;ProxyPreserveHost on&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;p2&quot; style=&quot;font-size: 12px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal; margin: 0px; min-height: 16px;&quot;&gt;&lt;span style=&quot;background-color: #eeeeee;&quot;&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;p1&quot; style=&quot;font-size: 12px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal; margin: 0px;&quot;&gt;&lt;span style=&quot;background-color: #eeeeee;&quot;&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp; &lt;/span&gt;ErrorLog /&lt;span class=&quot;s1&quot; style=&quot;text-decoration-line: underline;&quot;&gt;var&lt;/span&gt;/log/&lt;span class=&quot;s1&quot; style=&quot;text-decoration-line: underline;&quot;&gt;httpd&lt;/span&gt;/&lt;span class=&quot;s1&quot; style=&quot;text-decoration-line: underline;&quot;&gt;elasticbeanstalk&lt;/span&gt;-&lt;span class=&quot;s1&quot; style=&quot;text-decoration-line: underline;&quot;&gt;ssl&lt;/span&gt;-error_log&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;p2&quot; style=&quot;font-size: 12px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal; margin: 0px; min-height: 16px;&quot;&gt;&lt;span style=&quot;background-color: #eeeeee;&quot;&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;background-color: #eeeeee;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;font-family: courier; font-size: 12px; white-space: pre;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;p1&quot; style=&quot;font-size: 12px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal; margin: 0px;&quot;&gt;&lt;span style=&quot;background-color: #eeeeee;&quot;&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;&amp;lt;/VirtualHost&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;p1&quot; style=&quot;font-family: Monaco; font-size: 12px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal; margin: 0px;&quot;&gt;&lt;span style=&quot;background-color: #fcff01;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;p1&quot; style=&quot;font-family: Monaco; font-size: 12px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal; margin: 0px;&quot;&gt;&lt;span style=&quot;background-color: #fcff01;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;h3 style=&quot;text-align: left;&quot;&gt;Step 4. Add http-instance-single.config File&lt;/h3&gt;&lt;div&gt;This file will update the security group resource to allow traffic in port 443 (HTTPS Port) and it will also configure the necessary command to run to get the SSL certificates from letsencrypt.org. Make sure you update the configuration in red for your own email and domain name.&amp;nbsp;&lt;/div&gt;&lt;p class=&quot;p1&quot; style=&quot;font-size: 12px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal; margin: 0px;&quot;&gt;&lt;span style=&quot;background-color: #eeeeee;&quot;&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;p1&quot; style=&quot;font-size: 12px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal; margin: 0px;&quot;&gt;&lt;span style=&quot;background-color: #eeeeee;&quot;&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;Resources:&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;p1&quot; style=&quot;font-size: 12px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal; margin: 0px;&quot;&gt;&lt;span style=&quot;background-color: #eeeeee;&quot;&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp; &lt;/span&gt;sslSecurityGroupIngress:&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;p1&quot; style=&quot;font-size: 12px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal; margin: 0px;&quot;&gt;&lt;span style=&quot;background-color: #eeeeee;&quot;&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;Type: AWS::EC2::SecurityGroupIngress&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;p1&quot; style=&quot;font-size: 12px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal; margin: 0px;&quot;&gt;&lt;span style=&quot;background-color: #eeeeee;&quot;&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;Properties:&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;p1&quot; style=&quot;font-size: 12px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal; margin: 0px;&quot;&gt;&lt;span style=&quot;background-color: #eeeeee;&quot;&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;GroupId: {&quot;&lt;span class=&quot;s1&quot; style=&quot;text-decoration-line: underline;&quot;&gt;Fn&lt;/span&gt;::GetAtt&quot; : [&quot;AWSEBSecurityGroup&quot;, &quot;GroupId&quot;]}&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;p1&quot; style=&quot;font-size: 12px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal; margin: 0px;&quot;&gt;&lt;span style=&quot;background-color: #eeeeee;&quot;&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;IpProtocol: &lt;span class=&quot;s1&quot; style=&quot;text-decoration-line: underline;&quot;&gt;tcp&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;p1&quot; style=&quot;font-size: 12px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal; margin: 0px;&quot;&gt;&lt;span style=&quot;background-color: #eeeeee;&quot;&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;ToPort: 443&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;p1&quot; style=&quot;font-size: 12px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal; margin: 0px;&quot;&gt;&lt;span style=&quot;background-color: #eeeeee;&quot;&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;FromPort: 443&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;p1&quot; style=&quot;font-size: 12px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal; margin: 0px;&quot;&gt;&lt;span style=&quot;background-color: #eeeeee;&quot;&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;CidrIp: 0.0.0.0/0&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;p2&quot; style=&quot;font-size: 12px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal; margin: 0px; min-height: 16px;&quot;&gt;&lt;span class=&quot;Apple-converted-space&quot; style=&quot;background-color: #eeeeee;&quot;&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;p1&quot; style=&quot;font-size: 12px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal; margin: 0px;&quot;&gt;&lt;span style=&quot;background-color: #eeeeee; font-family: courier;&quot;&gt;commands:&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;p1&quot; style=&quot;font-size: 12px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal; margin: 0px;&quot;&gt;&lt;span style=&quot;background-color: #eeeeee; font-family: courier;&quot;&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp; &lt;/span&gt;00_getSSLcertificate:&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;p1&quot; style=&quot;font-size: 12px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal; margin: 0px;&quot;&gt;&lt;span style=&quot;background-color: #eeeeee; font-family: courier;&quot;&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;command: |&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;p1&quot; style=&quot;font-size: 12px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal; margin: 0px;&quot;&gt;&lt;span style=&quot;background-color: #eeeeee; font-family: courier;&quot;&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;s1&quot; style=&quot;text-decoration-line: underline;&quot;&gt;sudo&lt;/span&gt; service &lt;span class=&quot;s1&quot; style=&quot;text-decoration-line: underline;&quot;&gt;httpd&lt;/span&gt; stop&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;p1&quot; style=&quot;font-size: 12px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal; margin: 0px;&quot;&gt;&lt;span style=&quot;background-color: #eeeeee; font-family: courier;&quot;&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;s1&quot; style=&quot;text-decoration-line: underline;&quot;&gt;mkdir&lt;/span&gt; -p /opt/&lt;span class=&quot;s1&quot; style=&quot;text-decoration-line: underline;&quot;&gt;certbot&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;p1&quot; style=&quot;font-size: 12px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal; margin: 0px;&quot;&gt;&lt;span style=&quot;background-color: #eeeeee; font-family: courier;&quot;&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;s1&quot; style=&quot;text-decoration-line: underline;&quot;&gt;wget&lt;/span&gt; https://dl.eff.org/certbot-auto -O /opt/&lt;span class=&quot;s1&quot; style=&quot;text-decoration-line: underline;&quot;&gt;certbot&lt;/span&gt;/&lt;span class=&quot;s1&quot; style=&quot;text-decoration-line: underline;&quot;&gt;certbot&lt;/span&gt;-auto;&lt;span class=&quot;s1&quot; style=&quot;text-decoration-line: underline;&quot;&gt;chmod&lt;/span&gt; a+x /opt/&lt;span class=&quot;s1&quot; style=&quot;text-decoration-line: underline;&quot;&gt;certbot&lt;/span&gt;/&lt;span class=&quot;s1&quot; style=&quot;text-decoration-line: underline;&quot;&gt;certbot&lt;/span&gt;-auto&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;p1&quot; style=&quot;font-size: 12px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal; margin: 0px;&quot;&gt;&lt;span style=&quot;background-color: #eeeeee; font-family: courier;&quot;&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;s1&quot; style=&quot;text-decoration-line: underline;&quot;&gt;sudo&lt;/span&gt; &lt;span class=&quot;s1&quot; style=&quot;text-decoration-line: underline;&quot;&gt;mkdir&lt;/span&gt; -p /&lt;span class=&quot;s1&quot; style=&quot;text-decoration-line: underline;&quot;&gt;var&lt;/span&gt;/&lt;span class=&quot;s1&quot; style=&quot;text-decoration-line: underline;&quot;&gt;www&lt;/span&gt;/challenge&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;p1&quot; style=&quot;font-size: 12px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal; margin: 0px;&quot;&gt;&lt;span style=&quot;background-color: #eeeeee; font-family: courier;&quot;&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;s1&quot; style=&quot;text-decoration-line: underline;&quot;&gt;sudo&lt;/span&gt; /opt/&lt;span class=&quot;s1&quot; style=&quot;text-decoration-line: underline;&quot;&gt;certbot&lt;/span&gt;/&lt;span class=&quot;s1&quot; style=&quot;text-decoration-line: underline;&quot;&gt;certbot&lt;/span&gt;-auto &lt;span class=&quot;s1&quot; style=&quot;text-decoration-line: underline;&quot;&gt;certonly&lt;/span&gt; --debug --non-interactive --email&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background-color: #eeeeee;&quot;&gt;&lt;span style=&quot;color: red; font-family: courier;&quot;&gt;myEmail@gmail.com&lt;/span&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background-color: #eeeeee; font-family: courier;&quot;&gt;--agree-&lt;span class=&quot;s1&quot; style=&quot;text-decoration-line: underline;&quot;&gt;tos&lt;/span&gt; --&lt;span class=&quot;s1&quot; style=&quot;text-decoration-line: underline;&quot;&gt;standalone&lt;/span&gt; --domains&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background-color: #eeeeee; color: red; font-family: courier;&quot;&gt;www.mydomain.com&lt;/span&gt;&lt;span style=&quot;background-color: #eeeeee; font-family: courier;&quot;&gt;&amp;nbsp;--keep-until-expiring -w /&lt;span class=&quot;s1&quot; style=&quot;text-decoration-line: underline;&quot;&gt;var&lt;/span&gt;/&lt;span class=&quot;s1&quot; style=&quot;text-decoration-line: underline;&quot;&gt;www&lt;/span&gt;/challenge&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;p1&quot; style=&quot;font-size: 12px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal; margin: 0px;&quot;&gt;&lt;span style=&quot;background-color: #eeeeee; font-family: courier;&quot;&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp; &lt;/span&gt;10_renewSSLCertificate:&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;p1&quot; style=&quot;font-size: 12px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal; margin: 0px;&quot;&gt;&lt;span style=&quot;background-color: #eeeeee; font-family: courier;&quot;&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;command: &#39;(&lt;span class=&quot;s1&quot; style=&quot;text-decoration-line: underline;&quot;&gt;crontab&lt;/span&gt; -l ; echo &#39;&#39;0 6 * * * root /opt/&lt;span class=&quot;s1&quot; style=&quot;text-decoration-line: underline;&quot;&gt;certbot&lt;/span&gt;/&lt;span class=&quot;s1&quot; style=&quot;text-decoration-line: underline;&quot;&gt;certbot&lt;/span&gt;-auto renew --&lt;span class=&quot;s1&quot; style=&quot;text-decoration-line: underline;&quot;&gt;standalone&lt;/span&gt; --&lt;span class=&quot;s1&quot; style=&quot;text-decoration-line: underline;&quot;&gt;pre&lt;/span&gt;-hook &quot;service &lt;span class=&quot;s1&quot; style=&quot;text-decoration-line: underline;&quot;&gt;httpd&lt;/span&gt; stop&quot; --post-hook &quot;service &lt;span class=&quot;s1&quot; style=&quot;text-decoration-line: underline;&quot;&gt;httpd&lt;/span&gt; start&quot; --force-renew&#39;&#39;) | &lt;span class=&quot;s1&quot; style=&quot;text-decoration-line: underline;&quot;&gt;crontab&lt;/span&gt; -&#39;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;p1&quot; style=&quot;font-size: 12px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal; margin: 0px;&quot;&gt;&lt;span style=&quot;background-color: #eeeeee; font-family: courier;&quot;&gt;&lt;span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;p2&quot; style=&quot;font-size: 12px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal; margin: 0px; min-height: 16px;&quot;&gt;&lt;span class=&quot;Apple-converted-space&quot; style=&quot;background-color: #eeeeee;&quot;&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;p1&quot; style=&quot;font-family: Monaco; font-size: 12px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal; margin: 0px;&quot;&gt;&lt;span style=&quot;background-color: #eeeeee;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;p1&quot; style=&quot;font-family: Monaco; font-size: 12px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal; margin: 0px;&quot;&gt;&lt;span style=&quot;background-color: #eeeeee;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;h2 style=&quot;text-align: left;&quot;&gt;Troubleshooting&lt;/h2&gt;&lt;/div&gt;&lt;div&gt;1. Make sure your domain name is pointing to the Elastic beanstalk environment that you are changing with this single instance. If you don&#39;t want to experiment on your live website, you can create a test subdomain like (testssl.mydomain.com) and use that to experiment on until you know you have the right configuration in place to update your real website.&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;2. View the logs in AWS Console or SSH into the instance and view the logs in /var/log/eb-activity.log&lt;/div&gt;&lt;div&gt;tail -f /var/log/eb-activity.log&lt;/div&gt;&lt;div&gt;That log should contain the errors for both letsencrypt as well as anything specific to apache.&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;3. Execute the commands on your own. If the automated solution does not work, you can SSH insto the instance and execute the command on your own to see what may not work. If you find that you need to add a new command, add it to the commands block in the http-instance-single.config file. Then build and deploy your application again.&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;4. In order for letsencrypt utility to work, it needs to start its own HTTP web server to validate that you own the domain for which it is issuing a certificate. To do this certbot-auto will need to bind itself to port 80 and it cannot do this if something else is running on that port. In this case you will see an error like &lt;b&gt;&quot;Cannot bind to port 80 ...&quot;. &lt;/b&gt;The solution is to stop any services that run on that port.&amp;nbsp;Hence, the first command above is &lt;b&gt;sudo service httpd stop &lt;/b&gt;which stops the Apache http service. If you have another type of service (e.g. nginx) on your Elastic Beanstalk configuration, you need to make sure that service is stopped before certbot-auto is executed.&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://trumaze.blogspot.com/feeds/685332882476857238/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://trumaze.blogspot.com/2020/12/how-to-deploy-single-instance-ssl.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/598740808358796854/posts/default/685332882476857238'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/598740808358796854/posts/default/685332882476857238'/><link rel='alternate' type='text/html' href='http://trumaze.blogspot.com/2020/12/how-to-deploy-single-instance-ssl.html' title='How to deploy a single instance SSL-enabled Tomcat application on AWS Elastic Beanstalk'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgK18xz-NVCavHX1cYd4lodjQtXvztAOfeeXjCMpuhG8mItsTJ7VT2DXTn7jKAC0iC29-kp7-UnoCG-dRkyG1KSZQG8ekLeuL5-1E8PnbYcYL_3E5VzwxdymYNBTD5ADsU1uyTiDa0PCjo/s72-c/Screen+Shot+2020-12-28+at+9.46.28+AM.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-598740808358796854.post-444676293356483461</id><published>2012-12-30T05:47:00.001-08:00</published><updated>2013-01-04T05:21:31.300-08:00</updated><title type='text'>How I doubled my Internet Speed </title><content type='html'>Recently I got an email from Comcast that they have doubled my internet speed, but in order to access it, I had to get a new cable modem that supported docsis 3.0. It sounded a bit too good to be true, but I thought I would give it a try since I had been using the same cable modem for over 7 years. Before buying a new modem, I decided to test my speed at &lt;a href=&quot;http://speedtest.net/&quot;&gt;speedtest.net&lt;/a&gt; and it came out to be 20Mbps.&lt;br /&gt;
&lt;br /&gt;
Then I searched on gooogle to see if my old modem, the Motorola sb5100 supports Docsis 3.0 and sure enough Comcast was right, it did not. &lt;br /&gt;
&lt;br /&gt;
Then, I looked at the &lt;a href=&quot;http://mydeviceinfo.comcast.net/mydev.php?tier=-1&amp;amp;h=0&amp;amp;d3=0&amp;amp;s=&amp;amp;so=&amp;amp;e=0&amp;amp;sc=950&quot;&gt;Comcast approved device list&lt;/a&gt; to find a cable modem that supported the new speed tier. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
I decided to stick with motorola again and chose their sb6121 model, which supports both docsis 3.0 and IPv6. Motorola got recently acquired by Google, and I don&#39;t know if they would be providing support for cable modems anymore, but I figured that if the sb6121 is as good as my old sb5100, I won&#39;t need support anyway. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Here is the Motorola SB6121 which I bought. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;iframe frameborder=&quot;0&quot; marginheight=&quot;0&quot; marginwidth=&quot;0&quot; scrolling=&quot;no&quot; src=&quot;http://rcm.amazon.com/e/cm?t=tru0f0-20&amp;amp;o=1&amp;amp;p=8&amp;amp;l=as1&amp;amp;asins=B004XC6GJ0&amp;amp;ref=qf_sp_asin_til&amp;amp;fc1=000000&amp;amp;IS2=1&amp;amp;lt1=_blank&amp;amp;m=amazon&amp;amp;lc1=0000FF&amp;amp;bc1=000000&amp;amp;bg1=FFFFFF&amp;amp;f=ifr&quot; style=&quot;height: 240px; width: 120px;&quot;&gt;&lt;/iframe&gt;

&lt;br /&gt;
In order to activate the new modem, you have to call Comcast or chat with them online. They will ask you for the MAC address of the cable modem, which is on one of the white stickers at the bottom of the modem. After you give them the mac, you can then remove the old modem and connect the new one. After a couple of minutes, the modem will be initialized and you will be on your way.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The first list is for power and should obviously be on.&lt;br /&gt;
The second light is for incoming connection from the computer and this should be on when your computer is on. If you have connected your modem to a router, then it will be on when the router is on.&lt;br /&gt;
The third light is for the network connection to Comcast&#39;s network and this should be on as well as long as you have connected your modem with the coaxial cable.&lt;br /&gt;
The fourth light is on when you have internet connection. If it blinks, then the modem is not fully initialized and is searching for an internet Connection.&lt;br /&gt;
The fifth light looks scary because it is red, but this one shows activity -- i.e. it will blink constantly as long as you have one device connected to the internet, even if it is just the router. &lt;br /&gt;
&lt;br /&gt;
The only thing to test then is the new speed. I tested my speed again on &lt;a href=&quot;http://www.speedtest.net/&quot;&gt;http://www.speedtest.net&lt;/a&gt; and saw it jump from 20Mbps to 50Mbps with the Comcast Blast Speed tier. </content><link rel='replies' type='application/atom+xml' href='http://trumaze.blogspot.com/feeds/444676293356483461/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://trumaze.blogspot.com/2012/12/how-i-doubled-my-internet-speed.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/598740808358796854/posts/default/444676293356483461'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/598740808358796854/posts/default/444676293356483461'/><link rel='alternate' type='text/html' href='http://trumaze.blogspot.com/2012/12/how-i-doubled-my-internet-speed.html' title='How I doubled my Internet Speed '/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-598740808358796854.post-7847961217557779324</id><published>2012-09-04T13:21:00.002-07:00</published><updated>2012-09-06T08:13:38.204-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="eclipse"/><category scheme="http://www.blogger.com/atom/ns#" term="svn"/><title type='text'>Eclipse SVN bad_record_mac</title><content type='html'>If you are running eclipse and the SVN plugin (Subversive) is showing the following error, continue reading for the fix. &lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Problem:&lt;/b&gt;&lt;br /&gt;
&lt;div style=&quot;background-color: yellow; color: red;&quot;&gt;
&lt;span style=&quot;color: black;&quot;&gt;Some resources were not updated.&lt;br /&gt;svn: E175002: Received fatal alert: bad_record_mac&lt;br /&gt;svn: E175002: PROPFIND request failed on &#39;/svn/remote-remind/trunk&#39; &lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;b&gt;Fix:&lt;/b&gt;&lt;br /&gt;
1. Add the following line to the eclipse.ini file in your eclipse installation directory.&lt;br /&gt;
&lt;div style=&quot;background-color: lime; color: black;&quot;&gt;
-Dsvnkit.http.sslProtocols=SSLv3&amp;nbsp;&amp;nbsp;&lt;/div&gt;
2. Restart eclipse.&lt;br /&gt;
3. Repeat the same operation as before and it should complete without any errrors. &lt;br /&gt;
&lt;br /&gt;
The problem is caused by a bug in SVNKit which is the connecting software layer between Subversive and SVN. If you want more details about the bug, read more at&amp;nbsp;&lt;b&gt;&lt;/b&gt; &lt;br /&gt;
http://issues.tmatesoft.com/issue/SVNKIT-176</content><link rel='replies' type='application/atom+xml' href='http://trumaze.blogspot.com/feeds/7847961217557779324/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://trumaze.blogspot.com/2012/09/eclipse-svn-badrecordmac.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/598740808358796854/posts/default/7847961217557779324'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/598740808358796854/posts/default/7847961217557779324'/><link rel='alternate' type='text/html' href='http://trumaze.blogspot.com/2012/09/eclipse-svn-badrecordmac.html' title='Eclipse SVN bad_record_mac'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-598740808358796854.post-4353380085004879727</id><published>2012-06-04T11:39:00.004-07:00</published><updated>2012-12-30T06:02:18.862-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="eclipse"/><category scheme="http://www.blogger.com/atom/ns#" term="logging"/><title type='text'>Eclipse Java Template for Apache Commons Logging</title><content type='html'>If you use Eclipse and want to save some typing, here is a template 
for Eclipse to generate an Apache Commons Logging Log for the class you are currently 
working on.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;
${:import(org.apache.commons.logging.Log,org.apache.commons.logging.LogFactory)}&lt;br /&gt;
private static final Log LOG = LogFactory.getLog(${primary_type_name}.class);&lt;/div&gt;
&lt;div style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;br /&gt;
To use it, open preferences &amp;gt; java &amp;gt; editor &amp;gt;
 templates, create a new template with the name &quot;log&quot; and paste the code
 above in the Pattern field.


&lt;iframe src=&quot;http://rcm.amazon.com/e/cm?lt1=_blank&amp;bc1=000000&amp;IS2=1&amp;nou=1&amp;bg1=FFFFFF&amp;fc1=000000&amp;lc1=0000FF&amp;t=tru0f0-20&amp;o=1&amp;p=8&amp;l=as1&amp;m=amazon&amp;f=ifr&amp;ref=qf_sp_asin_til&amp;asins=B006O1J39S&quot; style=&quot;width:120px;height:240px;&quot; scrolling=&quot;no&quot; marginwidth=&quot;0&quot; marginheight=&quot;0&quot; frameborder=&quot;0&quot;&gt;&lt;/iframe&gt;
</content><link rel='replies' type='application/atom+xml' href='http://trumaze.blogspot.com/feeds/4353380085004879727/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://trumaze.blogspot.com/2012/06/eclipse-java-template-for-apache.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/598740808358796854/posts/default/4353380085004879727'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/598740808358796854/posts/default/4353380085004879727'/><link rel='alternate' type='text/html' href='http://trumaze.blogspot.com/2012/06/eclipse-java-template-for-apache.html' title='Eclipse Java Template for Apache Commons Logging'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-598740808358796854.post-8768544120557391187</id><published>2012-06-04T11:37:00.002-07:00</published><updated>2012-09-06T08:12:52.638-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="eclipse"/><category scheme="http://www.blogger.com/atom/ns#" term="logging"/><title type='text'>Eclipse Slf4j Logger Template</title><content type='html'>If you use eclipse and want to save some typing, here is a template for Eclipse to generate an Slf4j Logger for the class you are currently working on.&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; ${:import(org.slf4j.Logger,org.slf4j.LoggerFactory)}&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; private static final Logger LOG = LoggerFactory.getLogger(${primary_type_name}.class);&lt;/div&gt;
&lt;div style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;
&lt;/div&gt;
&lt;br /&gt;
To use it, open preferences &amp;gt; java &amp;gt; editor &amp;gt; templates, create a new template with the name &quot;log&quot; and paste the code above in the Pattern field.&lt;br /&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://trumaze.blogspot.com/feeds/8768544120557391187/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://trumaze.blogspot.com/2012/06/eclipse-slf4j-logger-template.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/598740808358796854/posts/default/8768544120557391187'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/598740808358796854/posts/default/8768544120557391187'/><link rel='alternate' type='text/html' href='http://trumaze.blogspot.com/2012/06/eclipse-slf4j-logger-template.html' title='Eclipse Slf4j Logger Template'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-598740808358796854.post-8218321641187826619</id><published>2012-03-29T21:08:00.004-07:00</published><updated>2012-12-30T06:02:46.135-08:00</updated><title type='text'>BodyEngine.com BMI Calculator</title><content type='html'>I use BodyEngine.com a lot and they recently added a &lt;a href=&quot;http://www.bodyengine.com/bmi.html&quot;&gt;BMI Calculator&lt;/a&gt; widget. I am adding it here for convenience. If you want to get the code for your own website, go to their &lt;a href=&quot;http://www.bodyengine.com/weight-widgets.html&quot;&gt;Free Weight Calculators&lt;/a&gt; page. &lt;br /&gt;
&lt;br /&gt;
&lt;iframe draggable=&quot;false&quot; frameborder=&quot;0&quot; id=&quot;bmiCal&quot; scrolling=&quot;no&quot; src=&quot;http://www.bodyengine.com/app/bmi/bmi.html?w=true&amp;amp;v=1&quot; style=&quot;border: 0; height: 517px; overflow: 0; width: 493px;&quot;&gt;&lt;/iframe&gt; 
&lt;br /&gt;
&lt;div style=&quot;font-family: verdana; font-size: 11px;&quot;&gt;
Powered by &lt;a href=&quot;http://www.bodyengine.com/bmi-calculator.html&quot;&gt;BMI Calculator&lt;/a&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://trumaze.blogspot.com/feeds/8218321641187826619/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://trumaze.blogspot.com/2012/03/bodyenginecom-bmi-calculator.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/598740808358796854/posts/default/8218321641187826619'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/598740808358796854/posts/default/8218321641187826619'/><link rel='alternate' type='text/html' href='http://trumaze.blogspot.com/2012/03/bodyenginecom-bmi-calculator.html' title='BodyEngine.com BMI Calculator'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-598740808358796854.post-1410233584747417772</id><published>2012-02-06T11:56:00.000-08:00</published><updated>2012-02-06T13:08:40.194-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="axis2"/><category scheme="http://www.blogger.com/atom/ns#" term="soap"/><category scheme="http://www.blogger.com/atom/ns#" term="xml"/><title type='text'>Transport error: 415 Error: Cannot process the message because the content type ...</title><content type='html'>&lt;br /&gt;
Today I ran into the following error while using an Axis2 Java Client to consume a WCF Soap Service.&lt;br /&gt;
&lt;div style=&quot;background-color: yellow;&quot;&gt;
&lt;/div&gt;
&lt;div style=&quot;background-color: yellow;&quot;&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;div style=&quot;background-color: yellow;&quot;&gt;
Caused by: org.apache.axis2.AxisFault: Transport error: 415 Error: Cannot process the message because the content type &#39;application/soap+xml; charset=UTF-8; action=&quot;http://myservice.com/mySoapService/&quot;&#39; was not the expected type &#39;text/xml; charset=utf-8&#39;. &lt;/div&gt;
&lt;br /&gt;
This problem is caused because the WCF SOAP service is using SOAP 1.1 while the Axis2 Client defaults to SOAP 1.2 &lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;The fix&lt;/b&gt; is to set the Soap Version URI in the Axis2 ServiceClient options as follows:&lt;span style=&quot;background-color: lime;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: lime;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div style=&quot;background-color: lime;&quot;&gt;
stub._getServiceClient()&lt;/div&gt;
&lt;div style=&quot;background-color: lime;&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; .getOptions()&lt;/div&gt;
&lt;div style=&quot;background-color: lime;&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; .setSoapVersionURI(&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SOAP11Constants.SOAP_ENVELOPE_NAMESPACE_URI);&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://trumaze.blogspot.com/feeds/1410233584747417772/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://trumaze.blogspot.com/2012/02/transport-error-415-error-cannot.html#comment-form' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/598740808358796854/posts/default/1410233584747417772'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/598740808358796854/posts/default/1410233584747417772'/><link rel='alternate' type='text/html' href='http://trumaze.blogspot.com/2012/02/transport-error-415-error-cannot.html' title='Transport error: 415 Error: Cannot process the message because the content type ...'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-598740808358796854.post-8659386234026929474</id><published>2011-10-26T11:10:00.000-07:00</published><updated>2011-10-26T11:10:29.241-07:00</updated><title type='text'>BodyEngine.com</title><content type='html'>Being a software developer, it is very easy to sit down in front of the computer for hours at a time and live a very sedentary lifestyle. I started looking for a way to get back into shape and a friend of mine suggested an app called &lt;a href=&quot;http://www.bodyengine.com/&quot;&gt;BodyEngine&lt;/a&gt;. The app is very slick and easy to use -- I can appreciate good software when I see it. With only a few clicks I was able to see that I am currently overweight by 5 lb. I can also see how many calories I need to eat and how much to exercise to reach my goal weight of 175 lb. The app is free, so give it a try to see in what category you fall and create your own personalized fitness plan.&amp;nbsp; &lt;a href=&quot;http://www.bodyengine.com/&quot;&gt;http://www.bodyengine.com&lt;/a&gt;</content><link rel='replies' type='application/atom+xml' href='http://trumaze.blogspot.com/feeds/8659386234026929474/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://trumaze.blogspot.com/2011/10/being-software-developer-it-is-very.html#comment-form' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/598740808358796854/posts/default/8659386234026929474'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/598740808358796854/posts/default/8659386234026929474'/><link rel='alternate' type='text/html' href='http://trumaze.blogspot.com/2011/10/being-software-developer-it-is-very.html' title='BodyEngine.com'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-598740808358796854.post-5593292498272724064</id><published>2011-08-27T17:20:00.000-07:00</published><updated>2011-10-16T06:24:44.496-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="maven"/><category scheme="http://www.blogger.com/atom/ns#" term="svn"/><title type='text'>How to ignore self-signed ssl certificate verification in maven svn scm</title><content type='html'>&lt;br /&gt;
I was trying to prepare a release for a maven project with the command&lt;br /&gt;
mvn release:prepare but the maven scm plugin could not commit the updated pom file because the certificate is self-signed.&lt;br /&gt;
&amp;nbsp; &lt;br /&gt;
My setup is Window 7, Collabnet SVN Client 1.6.6, Maven 2.2.1 but the solution is not specific to Windows or collabnet svn client. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;background-color: yellow;&quot;&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;...&lt;br /&gt;
[INFO] Checking in modified POMs...&lt;br /&gt;
[INFO] Executing: cmd.exe /X /C &quot;svn --non-interactive commit --file C:\Users\myname\AppData\Local\Temp\maven-scm-1429998188.commit --targets C:\Users\myname\AppData\Local\Temp\maven-scm-1933937231031554007-targets&quot;&lt;br /&gt;
[INFO] Working directory: G:\Projects\my-project\&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: yellow;&quot;&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;[INFO] ------------------------------------------------------------------------&lt;br /&gt;
[ERROR] BUILD FAILURE&lt;br /&gt;
[INFO] ------------------------------------------------------------------------&lt;br /&gt;
[INFO] Unable to commit files&lt;br /&gt;
Provider message:&lt;br /&gt;
The svn command failed.&lt;br /&gt;
Command output:&lt;br /&gt;
svn: Commit failed (details follow):&lt;br /&gt;
svn: OPTIONS of &#39;https://svn.mysite.com/my-project/trunk/&#39;: Server certificate &lt;span style=&quot;color: #444444;&quot;&gt;verification failed: issuer is not trusted (https:/&lt;/span&gt;&lt;span style=&quot;color: #444444;&quot;&gt;/svn.mysite.com)&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: yellow; color: #444444;&quot;&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;...&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
...read on to see how to get around this problem...&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
I tried to accept the certificate permanently through the command line  but it was not being saved. I tried to install the certificate in  Windows 7 as a trusted cert but that was not working as well.&lt;br /&gt;
&lt;br /&gt;
After looking at the maven release plugin, I finally ran into the &lt;a href=&quot;http://maven.apache.org/scm/subversion.html&quot;&gt;maven subversion page&lt;/a&gt; which talks about a configurable option called &lt;i&gt;trustServerCert .&amp;nbsp;&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;&lt;br /&gt;
&lt;/i&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;The Fix: Configure maven to ignore self-signed ssl certificates for svn&lt;/span&gt;&lt;br /&gt;
&lt;ol&gt;
&lt;li&gt;Update your pom.xml to use maven-release-plugin 2.2 or later. I used 2.2.1 as the latest at the time of this post. &lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace; font-size: x-small;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;lt;build&amp;gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;plugins&amp;gt;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace; font-size: x-small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;lt;plugin&amp;gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;artifactId&amp;gt;maven-release-plugin&amp;lt;/artifactId&amp;gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;version&amp;gt;2.2.1&amp;lt;/version&amp;gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;lt;/plugin&amp;gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/plugins&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;lt;/build&amp;gt; &lt;/span&gt;&lt;br /&gt;
&lt;/li&gt;
&lt;li&gt;Create a file called &lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;svn-settings.xml&lt;/span&gt; in your user directory &lt;span style=&quot;font-family: inherit;&quot;&gt;(e.g: &lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;C:\Users\YourUsername\.scm\svn-settings.xml&lt;/span&gt;)&lt;/span&gt; with the following content:&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace; font-size: x-small;&quot;&gt;&amp;lt;svn-settings&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;lt;trustServerCert&amp;gt;true&amp;lt;/trustServerCert&amp;gt;&lt;br /&gt;
&amp;lt;/svn-settings&amp;gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;br /&gt;
&amp;nbsp;If you run the mvn release:prepare again, you will no longer get the certificate verification error. You can see in the logs that maven adds the &lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;--trust-server-cert &lt;/span&gt;option to the svn commit command:&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote style=&quot;background-color: lime;&quot;&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;[INFO] Checking in modified POMs...&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;[INFO] Executing: cmd.exe /X /C &quot;svn --non-interactive&lt;b&gt; --trust-server-cert &lt;/b&gt;commit --file C:\Users\myname\AppData\Local\Temp\maven-scm-1453525805.commit --target&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;s C:\Users\myname\AppData\Local\Temp\maven-scm-2257909719268507538-targets&quot;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;[INFO] Working directory: G:\Projects\my-project\&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;[INFO] Release preparation complete.&lt;/span&gt;&lt;/blockquote&gt;
&lt;br /&gt;
If you want to configure hudson/jenkins, the only change is to copy the svn-settings file under your hudson/jenkins directory (e.g. c:\hudson\.scm\svn-settings.xml) &lt;br /&gt;
&lt;br /&gt;
Let me know how this works for you. Happy coding!</content><link rel='replies' type='application/atom+xml' href='http://trumaze.blogspot.com/feeds/5593292498272724064/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://trumaze.blogspot.com/2011/08/how-to-ignore-self-signed-ssl.html#comment-form' title='8 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/598740808358796854/posts/default/5593292498272724064'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/598740808358796854/posts/default/5593292498272724064'/><link rel='alternate' type='text/html' href='http://trumaze.blogspot.com/2011/08/how-to-ignore-self-signed-ssl.html' title='How to ignore self-signed ssl certificate verification in maven svn scm'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>8</thr:total></entry><entry><id>tag:blogger.com,1999:blog-598740808358796854.post-5390662529211162570</id><published>2011-05-18T21:43:00.000-07:00</published><updated>2011-06-24T22:22:49.652-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="tdd"/><category scheme="http://www.blogger.com/atom/ns#" term="test-driven-development"/><category scheme="http://www.blogger.com/atom/ns#" term="testing"/><title type='text'>Test-Driven Development - Are you doing it right?</title><content type='html'>Recently I have been doing test-driven development (TDD) exclusively in both Java and C#, and I have made great progress in doing it the right way.  I was fortunate to learn the right way from &lt;a href=&quot;http://butunclebob.com/ArticleS.UncleBob.TheThreeRulesOfTdd&quot;&gt;Uncle Bob&lt;/a&gt; who my employer invited for a TDD in-house training course for our engineering team. &lt;br /&gt;
&lt;br /&gt;
So how do you know that you are doing it right? &lt;br /&gt;
&lt;br /&gt;
Here are the signs that you are on the right path:&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;You are writing more tests than ever before&amp;nbsp;&lt;/li&gt;
&lt;li&gt;Your test coverage is creeping up to &amp;gt; 90% &lt;/li&gt;
&lt;li&gt;You create a test class before creating the class under test &lt;/li&gt;
&lt;li&gt;You write a failing unit test before making any code changes&lt;/li&gt;
&lt;li&gt;Your test classes are longer (more lines) than the class under test&lt;/li&gt;
&lt;li&gt;You start to feel itchy when you write a line of code that is not making a test pass&lt;/li&gt;
&lt;li&gt;You are more confident in the code you are writing&lt;/li&gt;
&lt;li&gt;You are refactoring your tests&lt;/li&gt;
&lt;li&gt;You are not deploying and debugging every time you change the code&lt;/li&gt;
&lt;li&gt;You are debugging tests rather than production code&lt;br /&gt;
&lt;/li&gt;
&lt;/ul&gt;Doing TTD is not easy and requires that you stop following old habits and force yourself to do it properly for a few weeks. For me it was a slow off-and-on process, but as I do more and more of it, I find that I am getting my development speed back, with an added boost of confidence provided by over 90% code coverage. Yes, I have tests to prove it!</content><link rel='replies' type='application/atom+xml' href='http://trumaze.blogspot.com/feeds/5390662529211162570/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://trumaze.blogspot.com/2011/05/test-driven-development-are-you-doing.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/598740808358796854/posts/default/5390662529211162570'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/598740808358796854/posts/default/5390662529211162570'/><link rel='alternate' type='text/html' href='http://trumaze.blogspot.com/2011/05/test-driven-development-are-you-doing.html' title='Test-Driven Development - Are you doing it right?'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-598740808358796854.post-4706781734860797704</id><published>2011-04-09T15:07:00.000-07:00</published><updated>2011-04-16T08:07:24.811-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="bash"/><category scheme="http://www.blogger.com/atom/ns#" term="cygwin"/><title type='text'>How to configure cygwin to use ctrl + arrow to move cursor forward / backward</title><content type='html'>If you have used Windows for a while, you probably feel more comfortable using &lt;b&gt;ctrl + left arrow&lt;/b&gt; and &lt;b&gt;ctrl + right arrow&lt;/b&gt; to navigate the cursor through words. The default behavior in bash however is to use alt+f and alt+b. If you don&#39;t want to train yourself to learn yet another shortcut, follow three easy steps below to configure cygwin key bindings to use ctrl + left and ctrl + right.&lt;br /&gt;
&lt;br /&gt;
&lt;ol&gt;&lt;li&gt;Modify existing or create a new file called .inputrc under your cygwin home directory&lt;br /&gt;
&lt;/li&gt;
&lt;li&gt;Add the following lines:&lt;br /&gt;
&lt;br /&gt;
&lt;pre name=&quot;code&quot; class=&quot;plain&quot;&gt;&quot;\e[1;5C&quot;: forward-word&amp;nbsp;&amp;nbsp; # ctrl + right
&quot;\e[1;5D&quot;: backward-word&amp;nbsp; # ctrl + left 
&lt;/pre&gt;&lt;br /&gt;
&lt;/li&gt;
&lt;li&gt;Save the file and restart cygwin &lt;/li&gt;
&lt;/ol&gt;</content><link rel='replies' type='application/atom+xml' href='http://trumaze.blogspot.com/feeds/4706781734860797704/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://trumaze.blogspot.com/2011/04/how-to-configure-cygwin-to-use-ctrl.html#comment-form' title='6 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/598740808358796854/posts/default/4706781734860797704'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/598740808358796854/posts/default/4706781734860797704'/><link rel='alternate' type='text/html' href='http://trumaze.blogspot.com/2011/04/how-to-configure-cygwin-to-use-ctrl.html' title='How to configure cygwin to use ctrl + arrow to move cursor forward / backward'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>6</thr:total></entry><entry><id>tag:blogger.com,1999:blog-598740808358796854.post-302696630462109786</id><published>2011-04-09T13:55:00.000-07:00</published><updated>2011-04-14T04:02:01.359-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="bash"/><category scheme="http://www.blogger.com/atom/ns#" term="cygwin"/><title type='text'>Configuring text editor in cygwin bash</title><content type='html'>In this post I will show you how to edit files with your favorite windows text editor from the cygwin bash command line. My favorite editor is &lt;a href=&quot;http://notepad-plus-plus.org/&quot;&gt;notepad++&lt;/a&gt; and to edit a file from cygwin, I type: &lt;b&gt;ed myFile.txt &lt;/b&gt;&lt;b&gt;&lt;br /&gt;
&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Here is what you need to do:&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;ol&gt;&lt;li&gt;Open ~/.bashrc. This should be under &lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;CIGWIN_DIR/home/YOUR_USERNAME/.bashrc&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;/li&gt;
&lt;li&gt;Create a variable holding the path of your favorite editor. In my case, I am calling it EDITOR. Change the path inside of double quotes to the windows explorer path. To configure notepad++ I use:&lt;br /&gt;
&lt;blockquote&gt;&lt;span style=&quot;color: blue; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;EDITOR=`cygpath -a &quot;C:\Program Files (x86)\Notepad++\notepad++.exe&quot;`&lt;/span&gt;&lt;/blockquote&gt;&lt;/li&gt;
&lt;li&gt;Add the following function to .bashrc&lt;br /&gt;
&lt;blockquote style=&quot;color: blue;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;ed () {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; FILE=`cygpath -w -a $@`&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; echo Editing: $FILE&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; `&quot;$EDITOR&quot; $FILE`&amp;amp;&lt;br /&gt;
}&lt;/span&gt;&lt;/blockquote&gt;&lt;/li&gt;
&lt;li&gt;Start a new bash session or run &lt;b&gt;source ~/.bashrc&lt;/b&gt; to reload your bashrc.&amp;nbsp; &lt;/li&gt;
&lt;/ol&gt;&lt;br /&gt;
You should now be able to edit files just by typing the function name from step 3, in this case it is &lt;b&gt;ed&lt;/b&gt; (for edit). &lt;br /&gt;
&lt;blockquote&gt;&lt;span style=&quot;color: blue;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;$ cd /tmp&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;$ &lt;b&gt;ed test.txt&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;Editing: C:\cygwin\tmp\test.txt&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;[1] 6440&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;$ &lt;/span&gt;&lt;/span&gt;&lt;/blockquote&gt;</content><link rel='replies' type='application/atom+xml' href='http://trumaze.blogspot.com/feeds/302696630462109786/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://trumaze.blogspot.com/2011/04/configuring-text-editor-in-cygwin-bash.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/598740808358796854/posts/default/302696630462109786'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/598740808358796854/posts/default/302696630462109786'/><link rel='alternate' type='text/html' href='http://trumaze.blogspot.com/2011/04/configuring-text-editor-in-cygwin-bash.html' title='Configuring text editor in cygwin bash'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-598740808358796854.post-7916580112828619239</id><published>2011-03-25T16:31:00.000-07:00</published><updated>2011-03-27T08:14:46.678-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="bash"/><category scheme="http://www.blogger.com/atom/ns#" term="maven"/><title type='text'>Maven aliases for bash</title><content type='html'>When I have to type more than 20+ characters on a command line to build an application hundreds of times a day, day after day, I look for a way to make my life easier by reducing the strain on my fingers; and at the same time increase my productivity by reducing typing time and errors.&amp;nbsp; &lt;br /&gt;
&lt;br /&gt;
My tip today will be about developers that use Apache Maven, but you can apply the same method for any command that you are tired of typing. I have shared the method below with a few of my (lazy) colleagues and because everyone enjoyed it so much, I am now sharing it with you:&lt;br /&gt;
&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;ol&gt;&lt;li&gt;Open your ~/.bashrc or ~/.bash_profile &lt;/li&gt;
&lt;li&gt;Add the following function:&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;mvnrun () {&lt;/span&gt;&lt;br style=&quot;color: blue;&quot; /&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp; echo mvn $@&lt;/span&gt;&lt;br style=&quot;color: blue;&quot; /&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp; eval mvn $@&lt;/span&gt;&lt;br style=&quot;color: blue;&quot; /&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp; echo mvn $@&lt;/span&gt;&lt;br style=&quot;color: blue;&quot; /&gt;&lt;span style=&quot;color: blue;&quot;&gt;}&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: black;&quot;&gt;The function will echo the full maven command before and after running it. I found the echos helpful to see the full command and also to help me remember the full command and not be dependent on the aliases. &lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;Add an alias referencing the mvnrun function for every command that you are tired of typing. &lt;br /&gt;
&lt;br /&gt;
For instance, when I want to run &lt;b&gt;mvn clean install&lt;/b&gt;, I can just type the alias &lt;b&gt;mci&lt;/b&gt;&lt;span style=&quot;color: blue;&quot;&gt;. &lt;span style=&quot;color: black;&quot;&gt;This is the configuration you need to add to the file:&lt;/span&gt;&lt;br /&gt;
alias mci=&#39;mvnrun clean install&#39;&lt;br /&gt;
&lt;/span&gt; &lt;/li&gt;
&lt;li&gt;Save the file and open a new bash shell to make the alias available. &lt;br /&gt;
&lt;/li&gt;
&lt;li&gt;Type the new alias and you should see maven start executing.&lt;br /&gt;
&lt;br /&gt;
For instance, this is my bash output when I type &lt;b&gt;mci&lt;/b&gt; :&lt;br /&gt;
&amp;nbsp;  &lt;span style=&quot;background-color: white; color: #999999;&quot;&gt;&lt;br /&gt;
$ mci&lt;br /&gt;
mvn clean install&lt;/span&gt;&lt;br style=&quot;background-color: white; color: #999999;&quot; /&gt;&lt;span style=&quot;background-color: white; color: #999999;&quot;&gt;[INFO] Scanning for projects...&lt;/span&gt;&lt;br style=&quot;background-color: white; color: #999999;&quot; /&gt;&lt;span style=&quot;background-color: white; color: #999999;&quot;&gt;[INFO] ------------------------------------------------------------------------&lt;/span&gt;&lt;br style=&quot;background-color: white; color: #999999;&quot; /&gt;&lt;span style=&quot;background-color: white; color: #999999;&quot;&gt;[INFO] Building My Maven Application&lt;/span&gt;&lt;br style=&quot;background-color: white; color: #999999;&quot; /&gt;&lt;span style=&quot;background-color: white; color: #999999;&quot;&gt;[INFO]&amp;nbsp;&amp;nbsp;&amp;nbsp; task-segment: [clean, install]&lt;/span&gt;&lt;br style=&quot;background-color: white; color: #999999;&quot; /&gt;&lt;span style=&quot;background-color: white; color: #999999;&quot;&gt;[INFO] ------------------------------------------------------------------------&lt;/span&gt;&lt;br style=&quot;background-color: white; color: #999999;&quot; /&gt;&lt;span style=&quot;background-color: white; color: #999999;&quot;&gt;...&lt;/span&gt;&lt;br style=&quot;background-color: white; color: #999999;&quot; /&gt;&lt;span style=&quot;background-color: white; color: #999999;&quot;&gt;[INFO] [clean:clean {execution: default-clean}]&lt;/span&gt;&lt;br style=&quot;background-color: white; color: #999999;&quot; /&gt;&lt;span style=&quot;background-color: white; color: #999999;&quot;&gt;...&lt;/span&gt;&lt;br style=&quot;background-color: white; color: #999999;&quot; /&gt;&lt;span style=&quot;background-color: white; color: #999999;&quot;&gt;[INFO] [surefire:test {execution: default-test}]&lt;/span&gt;&lt;br style=&quot;background-color: white; color: #999999;&quot; /&gt;&lt;span style=&quot;background-color: white; color: #999999;&quot;&gt;...&lt;/span&gt;&lt;br style=&quot;background-color: white; color: #999999;&quot; /&gt;&lt;span style=&quot;background-color: white; color: #999999;&quot;&gt;[INFO] ------------------------------------------------------------------------&lt;/span&gt;&lt;br style=&quot;background-color: white; color: #999999;&quot; /&gt;&lt;span style=&quot;background-color: white; color: #999999;&quot;&gt;[INFO] BUILD SUCCESSFUL&lt;/span&gt;&lt;br style=&quot;background-color: white; color: #999999;&quot; /&gt;&lt;span style=&quot;background-color: white; color: #999999;&quot;&gt;[INFO] ------------------------------------------------------------------------&lt;/span&gt;&lt;br style=&quot;background-color: white; color: #999999;&quot; /&gt;&lt;span style=&quot;background-color: white; color: #999999;&quot;&gt;mvn clean install&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;&lt;br /&gt;
Note that you can still append maven options after the alias and the mvnrun function will append them at the end of your command. For instance, if I type:&lt;br /&gt;
&lt;div style=&quot;color: blue;&quot;&gt;$ mci -P int-tests&lt;/div&gt;it will translate to:&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;$ mvn clean install  -P int-tests&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Below are the most common aliases I use. There are some conventions that I use such as ee stands for eclipse:eclipse. ec=eclipse:clean, st=skip tests, c=clean, i=install, t=test, s=skip, tc=tomcat:, dr=dependency report...you get the idea. If you don&#39;t like my conventions, feel free to add your own. &lt;br /&gt;
&lt;br /&gt;
&lt;pre&gt;alias mecee=&#39;mvnrun eclipse:clean eclipse:eclipse $@&#39;
alias meceedsdj=&#39;mvnrun eclipse:clean eclipse:eclipse -DdownloadSources=true -DdownloadJavadocs=true$@&#39;
alias mciecee=&#39;mvnrun clean install eclipse:clean eclipse:eclipse $@&#39;
alias mcistecee=&#39;mvnrun clean install -Dmaven.test.skip=true eclipse:clean eclipse:eclipse $@&#39;
alias mci=&#39;mvnrun clean install&#39;
alias mcist=&#39;mvnrun clean install -Dmaven.test.skip=true $@&#39;
alias mt=&#39;mvnrun test $@&#39;
alias mc=&#39;mvnrun clean $@&#39;
alias mct=&#39;mvnrun clean test $@&#39;
alias mist=&#39;mvnrun install -Dmaven.test.skip=true $@&#39;
alias mtd=&#39;mvnrun tomcat:deploy $@&#39;
alias msttd=&#39;mvnrun tomcat:deploy -Dmaven.test.skip=true $@&#39;
alias mtr=&#39;mvnrun tomcat:redeploy $@&#39;
alias msttr=&#39;mvnrun tomcat:redeploy -Dmaven.test.skip=true $@ &#39;
alias mtu=&#39;mvnrun tomcat:undeploy $@&#39;
alias mtcr=&#39;mvnrun tomcat:run $@&#39; 
alias mjr=&#39;mvnrun jetty:run $@&#39;
alias mdr=&#39;mvnrun project-info-reports:dependencies&#39;
alias mda=&#39;mvnrun dependency:analyze&#39;
&lt;/pre&gt;</content><link rel='replies' type='application/atom+xml' href='http://trumaze.blogspot.com/feeds/7916580112828619239/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://trumaze.blogspot.com/2011/03/maven-aliases-for-bash.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/598740808358796854/posts/default/7916580112828619239'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/598740808358796854/posts/default/7916580112828619239'/><link rel='alternate' type='text/html' href='http://trumaze.blogspot.com/2011/03/maven-aliases-for-bash.html' title='Maven aliases for bash'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-598740808358796854.post-6078858940839823144</id><published>2011-02-26T09:33:00.000-08:00</published><updated>2011-11-19T09:18:18.064-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term=".net"/><category scheme="http://www.blogger.com/atom/ns#" term="silveright"/><title type='text'>Could not load file or assembly &#39;System.ServiceModel.Web, Version=2.0.5.0</title><content type='html'>Currently I am working on a Unit Test project based on Microsoft Testing Framework for .NET 4.0 which is testing a project based on Silverlight 4.0. So far everything has been fine but today I wrote a test that was exercising the serialization of a class to JSON and ran into the following exception. The class is using System.ServiceModel library and its fields are annotated.&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;Here is the error I was getting when running the unit test in Visual Studio 2010:&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;background-color: yellow; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;System.IO.FileNotFoundException: Could not load file or assembly &#39;System.ServiceModel.Web, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e&#39; or one of its dependencies. The system cannot find the file specified.WRN: Assembly binding logging is turned OFF.&lt;/span&gt;&lt;br style=&quot;background-color: yellow; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot; /&gt;&lt;span style=&quot;background-color: yellow; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1.&lt;/span&gt;&lt;br style=&quot;background-color: yellow; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot; /&gt;&lt;span style=&quot;background-color: yellow; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;Note: There is some performance penalty associated with assembly bind failure logging.&lt;/span&gt;&lt;br style=&quot;background-color: yellow; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot; /&gt;&lt;span style=&quot;background-color: yellow; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
I tried to get both the Project Under Test, and the Test Project to use the same System.ServiceModel library but was not successful. Visual Studio would not allow the Silverlight Project to use the same libraries as the .NET 4.0 Framework and it would also not allow the Unit Test Project to use the same libraries as the Silverlight Project. After trying different options, I found a very hacky solution.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;The hacky fix is&lt;/b&gt; to specify the reference paths for the Unit Test project. Here is what you need to do:&lt;br /&gt;
&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;ol&gt;
&lt;li&gt;In Visual Studio 2010, right click on the Unit Test project and select Properties&lt;/li&gt;
&lt;li&gt;Click on Reference Paths in the menu on the left&lt;/li&gt;
&lt;li&gt;Add the Silverlight Reference path. For me this was:&amp;nbsp; &lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;lt;C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\Silverlight\v4.0\&amp;gt;.&lt;/span&gt;&lt;/span&gt; To find out your specific path, look at the path of the System.ServiceModel reference being used by the Silverlight Project.&amp;nbsp;&lt;/li&gt;
&lt;li&gt;Save and rebuild the Unit Test project.&amp;nbsp;&lt;/li&gt;
&lt;li&gt;Run the test again and this time it should run successfully. &lt;/li&gt;
&lt;/ol&gt;
Visual Studio shows a few warnings about duplicate libraries, but that&#39;s a small price to pay for getting the tests to run. If you know of a better way to fix this problem, please share your fix on a comment below.</content><link rel='replies' type='application/atom+xml' href='http://trumaze.blogspot.com/feeds/6078858940839823144/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://trumaze.blogspot.com/2011/02/could-not-load-file-or-assembly.html#comment-form' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/598740808358796854/posts/default/6078858940839823144'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/598740808358796854/posts/default/6078858940839823144'/><link rel='alternate' type='text/html' href='http://trumaze.blogspot.com/2011/02/could-not-load-file-or-assembly.html' title='Could not load file or assembly &#39;System.ServiceModel.Web, Version=2.0.5.0'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-598740808358796854.post-4655845292981039336</id><published>2011-02-23T22:27:00.001-08:00</published><updated>2011-05-19T13:19:17.808-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="object-oriented design"/><title type='text'>Object-Oriented Anti-Pattern - Data Objects with Behavior</title><content type='html'>As software engineers we are all taught about the Object-Oriented (OO) paradigm&amp;nbsp; and make every effort to design according to OO rules and patterns. Most high level languages go as far as to forbid non-OO programming. Even so, it doesn&#39;t take long for any software engineer to tell you about many applications where OO is misused. I think one very good example where OO is misused is with Data Objects. &lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;What is a Data Object?&lt;/b&gt;&lt;br /&gt;
Data Objects represent data pieces that are grouped together to form a single structure or entity. Two very good examples of Data Objects are ORM Entity Objects and Data Transfer Objects.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Attributes and Behavior&lt;/b&gt;&lt;br /&gt;
Objects are made up of attributes and behavior but Data Objects by definition represent only data and hence can have only attributes. Books, Movies, Files, even IO Streams do not have behavior. A book has a title but it does not know how to read. A movie has actors but it does not know how to play. A file has content but it does not know how to delete. A stream has content but it does not know how to open/close or stop. These are all examples of Data Objects that have attributes but do not have behavior. As such, they should be treated as dumb data objects and we as software engineers should not force behavior upon them.&lt;br /&gt;
&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;br /&gt;
&lt;b&gt;Passing Around Data Instead of Behavior&lt;/b&gt;&lt;br /&gt;
Data Objects are moved around through different execution environments but behavior should be encapsulated and is usually pertinent only to one environment. In any application data is passed around, parsed, manipulated, persisted, retrieved, serialized, deserialized, and so on. An entity for example usually passes from the hibernate layer, to the service layer, to the frontend layer, and back again. In a distributed system it might pass through several pipes, queues, caches and end up in a new execution context. Attributes can apply to all three layers, but particular behavior such as save, parse, serialize only make sense in individual layers. Therefore, adding behavior to data objects violates encapsulation, modularization and even security principles. &lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;What about File.Delete(), Stream.Close(), ...&lt;/b&gt;&lt;br /&gt;
Most developers would agree that entity objects should not have behavior, but on the other hand it would be very odd to have for instance a File object without the expected &lt;i&gt;close()&lt;/i&gt;, &lt;i&gt;delete() &lt;/i&gt;methods or a Stream without &lt;i&gt;open() &lt;/i&gt;and &lt;i&gt;close() &lt;/i&gt;methods. After all, they are so convenient and widely used that we expect them to be part of the interface.&lt;br /&gt;
&lt;br /&gt;
I would argue that any methods on the File and Stream violate the natural aspect of object-oriented design because both of them represent passive data but at the same time they also provide behavior. Why unnatural you ask? Well, can a file really delete itself? No, that behavior belongs to the FileSystemDao/Manager/Service. Imagine a Stream of water/data. Can the stream open and close itself naturally? No, it is the action of a third party that causes streams to open and close. StreamReader.read() is perfectly natural and analogous to a person taking some water out of a real stream but Stream.read() is not natural because there is no analogous action on a natural water stream (more on this in another post).&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Misnomers&lt;/b&gt;&lt;br /&gt;
A lot of the issues described above can be clarified by paying a bit more attention to the class names. If you are creating a FileSystemService, don&#39;t call it a File. If you find yourself adding behavior to Stream object, take a step back and think about giving the class a more active name, such as a StreamReader or StreamWriter. &lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Two Classes in One&lt;/b&gt; &lt;br /&gt;
A developer creates a Book class and adds data fields for &lt;i&gt;Title&lt;/i&gt;, &lt;i&gt;Author&lt;/i&gt;, &lt;i&gt;Pages[]&lt;/i&gt;. So far, so good. He then continues his progress by adding the methods&amp;nbsp; &lt;i&gt;Open(), &lt;/i&gt;&lt;i&gt;Read(), Write(), Highlight(), Bookmark()&lt;/i&gt; and so on. Before you know it, the Book has methods to &lt;i&gt;GetRelatedBooks(), Print(), Publish(), Buy()&lt;/i&gt; and the list goes on an on without any limits, the class is now a couple of thousand lines long, tied to every other class, and most importantly, no one wants to work on it. This is a maintenance nightmare and we have all run into it. A class like this is begging to be refactored. It&#39;s ok for the Book class to have a Title, Author, Pages...they are all natural properties of the book. However, &lt;i&gt;Open(), Read(), Highlight(), Bookmark()&lt;/i&gt; should be moved in a separate class, one called BookReader or Kindle. The method &lt;i&gt;Write()&lt;/i&gt; should belong to the Author class. The methods &lt;i&gt;Print() &lt;/i&gt;and &lt;i&gt;Publish()&lt;/i&gt; should be moved to a Printer/Publisher class. The method &lt;i&gt;Buy()&lt;/i&gt; should be part of the Customer class. The method &lt;i&gt;GetRelatedBooks()&lt;/i&gt; should be a method of the Librarian or RecommendationService.&lt;br /&gt;
&lt;br /&gt;
Code written like this:&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;java&quot; name=&quot;code&quot;&gt;book.Write();
book.Print(); 
book.Publish();
book.Buy();
book.Open(); 
book.Read();
book.Highlight();
book.Bookmark();
book.GetRelatedBooks(); &lt;/pre&gt;&lt;br /&gt;
can be refactored like so:&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;java&quot; name=&quot;code&quot;&gt;Book book = author.WriteBook();
printer.Print(book);
publisher.Publish(book);
customer.Buy(book);

reader = new BookReader(); 

reader.Open(Book); 

reader.Read();
reader.Highlight();
reader.Bookmark();

librarian.GetRelatedBooks(book);
&lt;/pre&gt;&lt;br /&gt;
What a difference natural object-oriented modeling can make! We went from a single monstrous Book class to six separate classes, each of them responsible for their own individual behavior.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This makes the code:&lt;br /&gt;
&lt;ul&gt;&lt;li&gt; easier to read and understand because it is more natural &lt;/li&gt;
&lt;li&gt; easier to update because the functionality is contained in smaller encapsulated classes&lt;/li&gt;
&lt;li&gt;more flexible because we can easily substitute one or more of the six individual classes with overridden versions. &lt;/li&gt;
&lt;li&gt;easier to test because the functionality is separated, and easier to mock&lt;/li&gt;
&lt;/ul&gt;</content><link rel='replies' type='application/atom+xml' href='http://trumaze.blogspot.com/feeds/4655845292981039336/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://trumaze.blogspot.com/2011/02/test-post.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/598740808358796854/posts/default/4655845292981039336'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/598740808358796854/posts/default/4655845292981039336'/><link rel='alternate' type='text/html' href='http://trumaze.blogspot.com/2011/02/test-post.html' title='Object-Oriented Anti-Pattern - Data Objects with Behavior'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry></feed>