<?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-16500981</id><updated>2012-02-16T21:13:37.496+07:00</updated><category term='javascript'/><category term='generic'/><category term='debugger'/><category term='singleton'/><category term='recursive'/><category term='hash'/><category term='beanutils'/><category term='headless'/><category term='date'/><category term='template'/><category term='grails'/><category term='excel'/><category term='agile'/><category term='tips'/><category term='eclipse'/><category term='redirect'/><category term='toshiba'/><category term='database'/><category term='linux'/><category term='apache'/><category term='ethernet'/><category term='serial'/><category term='hibernate'/><category term='jsf'/><category term='java'/><category term='alfresco'/><category term='seam'/><category term='schedule'/><category term='grinder'/><category term='Opera'/><category term='jstl'/><category term='software design'/><category term='dashlet'/><category term='remote debug'/><category term='apache timeout'/><category term='wireshark'/><category term='subclipse'/><category term='oracle'/><category term='jxls'/><category term='web script'/><category term='spring-security-core'/><category term='jsp java'/><category term='load balancing'/><category term='jpa'/><category term='aspire 4741z'/><category term='usb modem'/><category term='jboss'/><category term='remote desktop'/><category term='framework'/><category term='ubuntu'/><category term='password'/><category term='management'/><title type='text'>living in java</title><subtitle type='html'>It's about me make a living by developing using Java and me actually living in Java (literally) :)</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://livinginjava.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/16500981/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://livinginjava.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Santoso</name><uri>http://www.blogger.com/profile/01534214022898572802</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='32' src='http://photos1.blogger.com/img/243/7914/640/Me.jpg'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>68</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-16500981.post-6413545962926435087</id><published>2011-09-07T00:39:00.000+07:00</published><updated>2011-09-07T00:40:05.030+07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='java'/><category scheme='http://www.blogger.com/atom/ns#' term='hibernate'/><title type='text'>Tracking Hibernate SQL query and parameters</title><content type='html'>Every developer using Hibernate might need to know the SQL it generates  and the parameters being sent. Normally to have the sql printed out to  console, one only have to configure hibernate property show_sql to true.  However the parameters are not printed out.&lt;br /&gt;&lt;br /&gt;Luckily for me, I found this &lt;a href="http://robertmaldon.blogspot.com/2006/04/getting-sql-out-of-hibernate.html"&gt;post&lt;/a&gt; on configuring the necessary log level to be able to print out the sql and parameters. Here are the configuration that I used:&lt;br /&gt;&lt;br /&gt;   &amp;lt;logger name="org.hibernate.sql"&amp;gt;&lt;br /&gt;       &amp;lt;level value="debug" /&amp;gt;&lt;br /&gt;       &amp;lt;appender-ref ref="console"/&amp;gt;&lt;br /&gt;   &amp;lt;/logger&amp;gt;&lt;br /&gt; &lt;br /&gt;   &amp;lt;logger name="org.hibernate.impl.SessionImpl"&amp;gt;&lt;br /&gt;       &amp;lt;level value="debug" /&amp;gt;&lt;br /&gt;       &amp;lt;appender-ref ref="console"/&amp;gt;&lt;br /&gt;   &amp;lt;/logger&amp;gt;&lt;br /&gt; &lt;br /&gt;   &amp;lt;logger name="org.hibernate.engine.QueryParameters"&amp;gt;&lt;br /&gt;       &amp;lt;level value="debug" /&amp;gt;&lt;br /&gt;       &amp;lt;appender-ref ref="console"/&amp;gt;&lt;br /&gt;   &amp;lt;/logger&amp;gt;&lt;br /&gt; &lt;br /&gt;   &amp;lt;logger name="org.hibernate.type"&amp;gt;&lt;br /&gt;       &amp;lt;level value="debug" /&amp;gt;&lt;br /&gt;       &amp;lt;appender-ref ref="console"/&amp;gt;&lt;br /&gt;   &amp;lt;/logger&amp;gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;For the moment, I think these satisfy my need :)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/16500981-6413545962926435087?l=livinginjava.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='related' href='http://robertmaldon.blogspot.com/2006/04/getting-sql-out-of-hibernate.html' title='Tracking Hibernate SQL query and parameters'/><link rel='replies' type='application/atom+xml' href='http://livinginjava.blogspot.com/feeds/6413545962926435087/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=16500981&amp;postID=6413545962926435087&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/16500981/posts/default/6413545962926435087'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/16500981/posts/default/6413545962926435087'/><link rel='alternate' type='text/html' href='http://livinginjava.blogspot.com/2011/09/tracking-hibernate-sql-query-and.html' title='Tracking Hibernate SQL query and parameters'/><author><name>Santoso</name><uri>http://www.blogger.com/profile/01534214022898572802</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='32' src='http://photos1.blogger.com/img/243/7914/640/Me.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-16500981.post-2853730390375684884</id><published>2011-09-06T10:33:00.007+07:00</published><updated>2011-09-06T17:12:00.408+07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='remote desktop'/><title type='text'>Expiring remote desktop certificate</title><content type='html'>Recently each time I need to connect remotely to one of the servers in my office, I always get certificate expired kind of error. As my curiosity drove me and based on the keyword "expired", I went to the server and accessed the console to check the server's date. It turned out that somehow the date and time of the server went back to 2002 (hey, I write this on 2011 :).&lt;br /&gt;At first, I thought a simple update of the time on the server will fix this. Unfortunately the result was still the same. Googling around and found this &lt;a href="http://technet.microsoft.com/en-us/library/ee890902%28WS.10%29.aspx"&gt;link&lt;/a&gt; which helped me fixing the issue. Below are the steps which I executed on my computer along with some screenshots:&lt;br /&gt;&lt;br /&gt;1. Open mmc.exe&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/-3IF9qhlkVEw/TmXuL8rk-TI/AAAAAAAAAjQ/ROMar8n3wSM/s1600/mmc.jpg"&gt;&lt;img style="cursor:pointer; cursor:hand;width: 400px; height: 223px;" src="http://3.bp.blogspot.com/-3IF9qhlkVEw/TmXuL8rk-TI/AAAAAAAAAjQ/ROMar8n3wSM/s400/mmc.jpg" alt="" id="BLOGGER_PHOTO_ID_5649183196641032498" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;2. On the file menu, click Add/remove snap-in&lt;br /&gt;3. Click certificates, and then click add&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/-gAgX3nJ5x_E/TmXuivwiCAI/AAAAAAAAAjo/Myz9KaYEOEM/s1600/add%2Bcertificate.jpg"&gt;&lt;img style="cursor:pointer; cursor:hand;width: 400px; height: 280px;" src="http://4.bp.blogspot.com/-gAgX3nJ5x_E/TmXuivwiCAI/AAAAAAAAAjo/Myz9KaYEOEM/s400/add%2Bcertificate.jpg" alt="" id="BLOGGER_PHOTO_ID_5649183588309141506" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;4. Choose computer account and click Next&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/-nUquA5Ulcn4/TmXuiVHdZDI/AAAAAAAAAjY/7Sgl3oPPlE8/s1600/mmc%2B-%2Badd%2Bcertificate.jpg"&gt;&lt;img style="cursor:pointer; cursor:hand;width: 400px; height: 294px;" src="http://2.bp.blogspot.com/-nUquA5Ulcn4/TmXuiVHdZDI/AAAAAAAAAjY/7Sgl3oPPlE8/s400/mmc%2B-%2Badd%2Bcertificate.jpg" alt="" id="BLOGGER_PHOTO_ID_5649183581157549106" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;5. On the following dialog, as in my case, I choose another computer and put in the server name. Click Finish to continue&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/-_Bv_T5kvQJY/TmXuiX3k8NI/AAAAAAAAAjg/Hc5SFdawocI/s1600/mmc-select%2Bcomputer.jpg"&gt;&lt;img style="cursor:pointer; cursor:hand;width: 400px; height: 294px;" src="http://1.bp.blogspot.com/-_Bv_T5kvQJY/TmXuiX3k8NI/AAAAAAAAAjg/Hc5SFdawocI/s400/mmc-select%2Bcomputer.jpg" alt="" id="BLOGGER_PHOTO_ID_5649183581896241362" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;5. Back on the main window, expand the certificate node and choose Remote Desktop certificates.&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/-4Kv7FiD5I9M/TmXwmXLTQ9I/AAAAAAAAAkA/SVDxAnWt7Vo/s1600/browse%2Bcertificate.jpg"&gt;&lt;img style="cursor:pointer; cursor:hand;width: 400px; height: 223px;" src="http://4.bp.blogspot.com/-4Kv7FiD5I9M/TmXwmXLTQ9I/AAAAAAAAAkA/SVDxAnWt7Vo/s400/browse%2Bcertificate.jpg" alt="" id="BLOGGER_PHOTO_ID_5649185849453265874" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;6. On the middle section, the certificate which expired is displayed. Just delete it by right clicking and choose delete.&lt;br /&gt;&lt;br /&gt;In short, we need to *renew* the certificate simply by deleting it and let windows recreate it later.&lt;br /&gt;&lt;br /&gt;In case you cannot do it from your computer, you can always go to the server's console and do it there :) .... if you have the permission.....&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/16500981-2853730390375684884?l=livinginjava.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://livinginjava.blogspot.com/feeds/2853730390375684884/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=16500981&amp;postID=2853730390375684884&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/16500981/posts/default/2853730390375684884'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/16500981/posts/default/2853730390375684884'/><link rel='alternate' type='text/html' href='http://livinginjava.blogspot.com/2011/09/expiring-remote-desktop-certificate.html' title='Expiring remote desktop certificate'/><author><name>Santoso</name><uri>http://www.blogger.com/profile/01534214022898572802</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='32' src='http://photos1.blogger.com/img/243/7914/640/Me.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/-3IF9qhlkVEw/TmXuL8rk-TI/AAAAAAAAAjQ/ROMar8n3wSM/s72-c/mmc.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-16500981.post-6366240941099781598</id><published>2011-07-20T14:27:00.002+07:00</published><updated>2011-07-20T16:32:48.292+07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='oracle'/><title type='text'>Oracle query to find out table basic information</title><content type='html'>Query below helped me to know the current status of my tables and their places in the oracle db. So that I could further decide whether I should move it or not, notwithstanding that I must understand the undergoing code accessing those tables.&lt;br /&gt;&lt;br /&gt;select tbl.OWNER || '.' ||  tbl.TABLE_NAME table_name, tbl.TABLESPACE_NAME, trunc(ds.BYTES/1024/1024) || ' Mb'  table_size, tbl.NUM_ROWS,  tbl.LAST_ANALYZED from SYS.ALL_TABLES tbl&lt;br /&gt;join SYS.dba_segments ds on ds.SEGMENT_NAME = tbl.TABLE_NAME&lt;br /&gt;where ds.SEGMENT_TYPE = 'TABLE'&lt;br /&gt;&lt;br /&gt;The output of the query will have:&lt;br /&gt;- Table name&lt;br /&gt;- Tablespace where the table is stored&lt;br /&gt;- The size of the table in Mb&lt;br /&gt;- Number of rows&lt;br /&gt;- Last analyzed&lt;br /&gt;&lt;br /&gt;The above query could be expanded further just as needed.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/16500981-6366240941099781598?l=livinginjava.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='related' href='http://www.razorsql.com/articles/oracle_system_queries.html' title='Oracle query to find out table basic information'/><link rel='replies' type='application/atom+xml' href='http://livinginjava.blogspot.com/feeds/6366240941099781598/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=16500981&amp;postID=6366240941099781598&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/16500981/posts/default/6366240941099781598'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/16500981/posts/default/6366240941099781598'/><link rel='alternate' type='text/html' href='http://livinginjava.blogspot.com/2011/07/oracle-query-to-find-out-table-basic.html' title='Oracle query to find out table basic information'/><author><name>Santoso</name><uri>http://www.blogger.com/profile/01534214022898572802</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='32' src='http://photos1.blogger.com/img/243/7914/640/Me.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-16500981.post-1434328330346429626</id><published>2011-03-19T14:45:00.005+07:00</published><updated>2011-03-19T15:04:32.179+07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='java'/><title type='text'>How to configure the way BeanUtils converts null value</title><content type='html'>By default BeanUtils.setProperty always assign a default value for null. For an instance, if the property's type being set is Integer then you will get 0. This could be the behavior that many do not expect, for example you use Struts and you have an entry form with a number field. And you're expecting that if the user leave it empty, you would like to display it as empty later on.&lt;br /&gt;BeanUtils utilized by Struts will fill the field as 0 instead of leaving it null.&lt;br /&gt;&lt;br /&gt;Underneath BeanUtils is utilizing a ConverterUtils to convert the value before setting it to the property. Therefore to change this behavior all we need to do is to register a new IntegerConverter to ConverterUtils, thereby overriding the default converter used.&lt;br /&gt;&lt;br /&gt;e.g.&lt;br /&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:courier new;"&gt;ConvertUtils.register(new IntegerConverter(null), Integer.class);&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;The same thing you should do for other types as needed.&lt;br /&gt;&lt;br /&gt;If you indeed configure the converter, you might want to read &lt;a href="http://livinginjava.blogspot.com/2011/03/beware-of-customizing-beanutils.html"&gt;this&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/16500981-1434328330346429626?l=livinginjava.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://livinginjava.blogspot.com/feeds/1434328330346429626/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=16500981&amp;postID=1434328330346429626&amp;isPopup=true' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/16500981/posts/default/1434328330346429626'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/16500981/posts/default/1434328330346429626'/><link rel='alternate' type='text/html' href='http://livinginjava.blogspot.com/2011/03/how-to-configure-way-beanutils-converts.html' title='How to configure the way BeanUtils converts null value'/><author><name>Santoso</name><uri>http://www.blogger.com/profile/01534214022898572802</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='32' src='http://photos1.blogger.com/img/243/7914/640/Me.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-16500981.post-1732810335802386229</id><published>2011-03-15T00:17:00.006+07:00</published><updated>2011-03-15T01:03:12.570+07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='java'/><category scheme='http://www.blogger.com/atom/ns#' term='seam'/><title type='text'>Understanding seam's persistence context configuration</title><content type='html'>Actually this post is a note for myself regarding how seam could be configured in the web application. The facts are:&lt;br /&gt;- The application is running on JBoss 5.1&lt;br /&gt;- Seam is used to manage the lifecycle of EntityManager instances&lt;br /&gt;&lt;br /&gt;Here's the configuration:&lt;br /&gt;&lt;ol&gt;&lt;li&gt;Datasource configuration file placed in {server}/deploy&lt;br /&gt;JNDI name is &lt;span style="font-weight: bold; font-style: italic;"&gt;Datasource&lt;/span&gt;&lt;/li&gt;&lt;li&gt;Persistence unit configuration in persistence.xml&lt;br /&gt;&lt;persistence-unit name="PersistenceUnit" type="JTA"&gt;&amp;lt;persistence-unit name="&lt;span style="font-weight: bold; font-style: italic;"&gt;PersistenceUnit&lt;/span&gt;" transaction-type="JTA"&amp;gt;&lt;br /&gt;&amp;lt;provider&lt;/persistence-unit&gt;&amp;gt;&lt;persistence-unit name="PersistenceUnit" type="JTA"&gt;org.hibernate.ejb.HibernatePersistence&lt;/persistence-unit&gt;&amp;lt;&lt;persistence-unit name="PersistenceUnit" type="JTA"&gt;/provider&lt;/persistence-unit&gt;&amp;gt;&lt;br /&gt;&amp;lt;&lt;persistence-unit name="PersistenceUnit" type="JTA"&gt;jta-data-source&lt;/persistence-unit&gt;&amp;gt;&lt;persistence-unit style="font-weight: bold; font-style: italic;" name="PersistenceUnit" type="JTA"&gt;Datasource&lt;/persistence-unit&gt;&amp;lt;&lt;persistence-unit name="PersistenceUnit" type="JTA"&gt;/jta-data-source&lt;/persistence-unit&gt;&amp;gt;&lt;br /&gt;&lt;persistence-unit name="PersistenceUnit" type="JTA"&gt;     ......&lt;br /&gt;    &lt;properties&gt;&amp;lt;properties&lt;/properties&gt;&lt;/persistence-unit&gt;&amp;gt;&lt;br /&gt;&lt;persistence-unit name="PersistenceUnit" type="JTA"&gt;&lt;properties&gt;         ........&lt;br /&gt;        &lt;/properties&gt;&lt;/persistence-unit&gt;&amp;lt;&lt;persistence-unit name="PersistenceUnit" type="JTA"&gt;&lt;properties&gt;property name="jboss.entity.manager.factory.jndi.name" value="java:/EntityManagerFactory"/&lt;/properties&gt;&lt;/persistence-unit&gt;&amp;gt;&lt;br /&gt;&lt;persistence-unit name="PersistenceUnit" type="JTA"&gt;&lt;properties&gt;      &lt;/properties&gt;&lt;/persistence-unit&gt;&amp;lt;&lt;persistence-unit name="PersistenceUnit" type="JTA"&gt;&lt;properties&gt;/properties&lt;/properties&gt;&lt;/persistence-unit&gt;&amp;gt;&lt;persistence-unit name="PersistenceUnit" type="JTA"&gt;&lt;properties&gt;&lt;property name="jboss.entity.manager.factory.jndi.name" value="java:/MyEntityManagerFactory"&gt;&lt;br /&gt;    &lt;/property&gt;&lt;/properties&gt;&lt;br /&gt;&lt;/persistence-unit&gt;&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Declaration of persistence-unit-ref element in web.xml&lt;br /&gt;&lt;persistence-unit-ref&gt;&amp;lt;persistence-unit-ref&amp;gt;&lt;br /&gt;   &amp;lt;persistence-unit-ref-name&amp;gt;&lt;span style="font-weight: bold; font-style: italic;"&gt;PersistenceUnit/pu&lt;/span&gt;&amp;lt;/persistence-unit-ref-name&amp;gt;&lt;br /&gt;   &amp;lt;persistence-unit-name&amp;gt;&lt;span style="font-weight: bold; font-style: italic;"&gt;PersistenceUnit&lt;/span&gt;&amp;lt;/persistence-unit-name&amp;gt;&lt;br /&gt; &amp;lt;/persistence-unit-ref&amp;gt;&lt;/persistence-unit-ref&gt;&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Configuration in component.properties&lt;br /&gt;seamBootstrapsPu=false&lt;br /&gt;seamEmfRef=#{null}&lt;br /&gt;puJndiName=java:comp/env/&lt;span style="font-weight: bold; font-style: italic;"&gt;PersistenceUnit/pu&lt;/span&gt;&lt;/li&gt;&lt;li&gt;Configuration of persistence managed context in components.xml&lt;br /&gt;&amp;lt;persistence:managed-persistence-context name="entityManager" auto-create="true"&lt;br /&gt;                         entity-manager-factory="@seamEmfRef@"&lt;br /&gt;                     persistence-unit-jndi-name="@puJndiName@"/&amp;gt;&lt;br /&gt;&lt;br /&gt;&lt;persistence:managed-persistence-context name="entityManager" create="true" factory="@seamEmfRef@"&gt;&lt;/persistence:managed-persistence-context&gt;&lt;/li&gt;&lt;/ol&gt;&lt;br /&gt;Here's the short explanation:&lt;br /&gt;&lt;ol&gt;&lt;li&gt;A new datasource is deployed (step 1)&lt;/li&gt;&lt;li&gt;The datasource is referred to in persistence.xml (step 2)&lt;/li&gt;&lt;li&gt;Add reference to the new persistence unit name in web.xml (step 3)&lt;/li&gt;&lt;li&gt;Add new property in component.properties which refers to the persistence-unit-ref-name declared in web.xml (step 4)&lt;/li&gt;&lt;li&gt;The values configured in component.properties is used to configure the managed-persistence-context (step 5)&lt;/li&gt;&lt;/ol&gt;&lt;br /&gt;Note: The entity manager factory is bound to the global JNDI thru "jboss.entity.manager.factory.jndi.name" property configured during step 2, however it is not used... yet :)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/16500981-1732810335802386229?l=livinginjava.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://livinginjava.blogspot.com/feeds/1732810335802386229/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=16500981&amp;postID=1732810335802386229&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/16500981/posts/default/1732810335802386229'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/16500981/posts/default/1732810335802386229'/><link rel='alternate' type='text/html' href='http://livinginjava.blogspot.com/2011/03/understanding-seams-persistence-context.html' title='Understanding seam&apos;s persistence context configuration'/><author><name>Santoso</name><uri>http://www.blogger.com/profile/01534214022898572802</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='32' src='http://photos1.blogger.com/img/243/7914/640/Me.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-16500981.post-5068290746807336999</id><published>2011-03-10T15:43:00.004+07:00</published><updated>2011-03-10T16:43:02.703+07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='java'/><category scheme='http://www.blogger.com/atom/ns#' term='jxls'/><category scheme='http://www.blogger.com/atom/ns#' term='beanutils'/><title type='text'>Beware of customizing BeanUtils converter</title><content type='html'>If you ever have to customize BeanUtils converter just like I did, one thing that should be of your concern and that is BeanUtils is also utilized by many open source libraries. And some of the libraries might happened to have the same need as yours to customize the converters. If in any case you are using one of those libraries, it just might override your converters.&lt;br /&gt;&lt;br /&gt;In my case, I was using jXLS . It is a great tool and it's my fault that I didn't read the documentation thoroughly. The documentation says:&lt;br /&gt;&lt;br /&gt;"&lt;span style="font-style: italic;"&gt;jXLS integrates with Jakarta BeanUtils conversion utilities to perform  actual conversion from Excel cell values into bean properties...... BeanUtils Converters for primitive types return a default value when a conversion error occurs. jXLS overrides this behaviour             in &lt;/span&gt;&lt;code style="font-style: italic;"&gt;ReaderConfig&lt;/code&gt;&lt;span style="font-style: italic;"&gt; class registering these classes to throw a ConversionException.&lt;/span&gt;"&lt;br /&gt;&lt;br /&gt;And what I configured for my application is for BeanUtils to return null for empty string instead of the default value.&lt;br /&gt;&lt;br /&gt;Now, here's a short story on what truly happened to my application due to the conflict described above:&lt;br /&gt;At first, an empty text field (for number input) in the form is converted to null and after some operations performed on the application "suddenly" it throws NumberFormatException for empty text field in the form. I'm lucky to know the steps to reproduce it and it turns out that things started to act strange after jXLS is utilized (to create/read excel file).&lt;br /&gt;&lt;br /&gt;At this point, I'm grateful to have jXLS and BeanUtils source code. I could just debug into the source code and analyze it. And I found out that jXLS overrides BeanUtils's converter configuration as the documentation said. Now all I can do is after every invocation of jXLS I have to reconfigure BeanUtils as my application need it.&lt;br /&gt;&lt;br /&gt;One more thing still disturb me, how to handle concurrent processes where one process is still working on jXLS and the other one need to convert the value from the form. And both are utilizing BeanUtils. I guessed at this moment I have to accept that I will get NumberFormatException and tell the user to try to submit the form again (and hoping that the jXLS process is already finished).&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/16500981-5068290746807336999?l=livinginjava.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://livinginjava.blogspot.com/feeds/5068290746807336999/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=16500981&amp;postID=5068290746807336999&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/16500981/posts/default/5068290746807336999'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/16500981/posts/default/5068290746807336999'/><link rel='alternate' type='text/html' href='http://livinginjava.blogspot.com/2011/03/beware-of-customizing-beanutils.html' title='Beware of customizing BeanUtils converter'/><author><name>Santoso</name><uri>http://www.blogger.com/profile/01534214022898572802</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='32' src='http://photos1.blogger.com/img/243/7914/640/Me.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-16500981.post-5362595233357519705</id><published>2010-12-07T12:57:00.007+07:00</published><updated>2010-12-07T13:50:59.475+07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='usb modem'/><category scheme='http://www.blogger.com/atom/ns#' term='ubuntu'/><title type='text'>Setting up usb modem for ubuntu 10.10</title><content type='html'>If you want to setup the drivers for your usb modem, firstly check out this &lt;a href="https://wiki.ubuntu.com/NetworkManager/Hardware/3G"&gt;link&lt;/a&gt;. It shows the list of 3G hardware and the test result along with the necessary information.&lt;br /&gt;In my case, I have  Option Wireless iCON 225 (HSDPA) and I'm quite lucky to have mine listed as working and there's enough information for preparing the drivers.&lt;br /&gt;&lt;br /&gt;Here's the summary of how I prepare the drivers:&lt;br /&gt;1. Download and compile ozerocdoff --&gt; udev.tar.gz (http://www.pharscape.org/ozerocdoff.html)&lt;br /&gt;2. Skip installing hso driver kernel module since my kernel version is 2.6.35 (which is above or equal 2.6.31) --&gt; http://www.pharscape.org/hso.html&lt;br /&gt;3. Install HSOConnect (http://www.pharscape.org/hsoconnect.html) which requires hsolinkcontrol (http://www.peck.org.uk/hsolinkcontrol.html). And it turns out it just didn't work for me and I opt to use the default Network Manager.&lt;br /&gt;4. Check if all works fine:&lt;br /&gt;  - Make sure hso module is already installed&lt;br /&gt;    find /lib/modules/`uname -r` -name 'hso.ko'&lt;br /&gt;  - Plug in the usb modem device and execute command below&lt;br /&gt;    lsmod | grep hso&lt;br /&gt;    If you see that hso is listed that's a good sign for you&lt;br /&gt;  - Check if the ports have been created&lt;br /&gt;    ls /dev/ttyHS*&lt;br /&gt;    My output is: /dev/ttyHS0  /dev/ttyHS1  /dev/ttyHS2&lt;br /&gt;    If you can see the output that also means ozerocdoff is already working&lt;br /&gt;5. Go to my Network Manager, edit connections and add a new Mobile broadband connection.&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_BXcpGuDAEO4/TP3X6Z3qRmI/AAAAAAAAAh8/LuQHtxA8eNI/s1600/mobile%2Bbroadband%2Bsetting.png"&gt;&lt;img style="cursor: pointer; width: 400px; height: 247px;" src="http://3.bp.blogspot.com/_BXcpGuDAEO4/TP3X6Z3qRmI/AAAAAAAAAh8/LuQHtxA8eNI/s400/mobile%2Bbroadband%2Bsetting.png" alt="" id="BLOGGER_PHOTO_ID_5547827714367047266" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;6. Go online with my new broadband connection :)&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;References:&lt;br /&gt;&lt;ol&gt;&lt;li&gt;Network Manager - Hardware 3G (https://wiki.ubuntu.com/NetworkManager/Hardware/3G)&lt;/li&gt;&lt;li&gt;PHARscape iCon 255 (http://www.pharscape.org/icon225.html)&lt;/li&gt;&lt;li&gt;ozerocdoff (http://www.pharscape.org/forum/index.php?topic=545.0)&lt;/li&gt;&lt;li&gt;HSOConnect (http://www.pharscape.org/forum/index.php/topic,743.0.html)&lt;/li&gt;&lt;li&gt;Using Network Manager (http://www.pharscape.org/networkmanager-0.7.0-and-3g-wwan-modems.html)&lt;br /&gt;&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/16500981-5362595233357519705?l=livinginjava.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='related' href='https://wiki.ubuntu.com/NetworkManager/Hardware/3G' title='Setting up usb modem for ubuntu 10.10'/><link rel='replies' type='application/atom+xml' href='http://livinginjava.blogspot.com/feeds/5362595233357519705/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=16500981&amp;postID=5362595233357519705&amp;isPopup=true' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/16500981/posts/default/5362595233357519705'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/16500981/posts/default/5362595233357519705'/><link rel='alternate' type='text/html' href='http://livinginjava.blogspot.com/2010/12/setting-up-usb-modem-for-ubuntu.html' title='Setting up usb modem for ubuntu 10.10'/><author><name>Santoso</name><uri>http://www.blogger.com/profile/01534214022898572802</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='32' src='http://photos1.blogger.com/img/243/7914/640/Me.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_BXcpGuDAEO4/TP3X6Z3qRmI/AAAAAAAAAh8/LuQHtxA8eNI/s72-c/mobile%2Bbroadband%2Bsetting.png' height='72' width='72'/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-16500981.post-9149999858569004602</id><published>2010-12-04T01:53:00.003+07:00</published><updated>2010-12-07T12:56:56.899+07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='aspire 4741z'/><title type='text'>Aspire 4741z battery is not charging</title><content type='html'>If a battery is not charging then the cause is either the battery is broken or the charging module needs replacement or could be BIOS problem. In my case the cause is neither above, apparently after taking out my battery I just realized that somehow I left the lock switch to unlock position. And indeed that's the cause of the battery is not charging.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_BXcpGuDAEO4/TPk_-GcKMSI/AAAAAAAAAh0/YiW_8NxDuL4/s1600/battery%2Block%2Bswitch.jpg"&gt;&lt;img style="cursor: pointer; width: 400px; height: 300px;" src="http://2.bp.blogspot.com/_BXcpGuDAEO4/TPk_-GcKMSI/AAAAAAAAAh0/YiW_8NxDuL4/s400/battery%2Block%2Bswitch.jpg" alt="" id="BLOGGER_PHOTO_ID_5546534752196636962" border="0" /&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/16500981-9149999858569004602?l=livinginjava.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://livinginjava.blogspot.com/feeds/9149999858569004602/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=16500981&amp;postID=9149999858569004602&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/16500981/posts/default/9149999858569004602'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/16500981/posts/default/9149999858569004602'/><link rel='alternate' type='text/html' href='http://livinginjava.blogspot.com/2010/12/aspire-4741z-battery-is-not-charging.html' title='Aspire 4741z battery is not charging'/><author><name>Santoso</name><uri>http://www.blogger.com/profile/01534214022898572802</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='32' src='http://photos1.blogger.com/img/243/7914/640/Me.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_BXcpGuDAEO4/TPk_-GcKMSI/AAAAAAAAAh0/YiW_8NxDuL4/s72-c/battery%2Block%2Bswitch.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-16500981.post-4286085401236260003</id><published>2010-12-03T00:10:00.004+07:00</published><updated>2010-12-03T00:25:23.458+07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='linux'/><category scheme='http://www.blogger.com/atom/ns#' term='ubuntu'/><title type='text'>Configuring mic in aspire 4741z - ubuntu 10.10</title><content type='html'>Luckily for me, my installed alsa is already the latest one. All that is needed is just to add 2 lines below to /etc/modprobe.d/alsa-base.conf&lt;br /&gt;&lt;br /&gt;alias snd-card-0 snd-hda-intel&lt;br /&gt;options snd-hda-intel model=acer&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;My mic works now but it seems a bit quiet. Hopefully I can find the way to boost the mic.&lt;br /&gt;&lt;br /&gt;A nice tool that might help is alsamixer, run it from a terminal.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/16500981-4286085401236260003?l=livinginjava.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='related' href='http://ubuntuforums.org/showthread.php?t=927270' title='Configuring mic in aspire 4741z - ubuntu 10.10'/><link rel='replies' type='application/atom+xml' href='http://livinginjava.blogspot.com/feeds/4286085401236260003/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=16500981&amp;postID=4286085401236260003&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/16500981/posts/default/4286085401236260003'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/16500981/posts/default/4286085401236260003'/><link rel='alternate' type='text/html' href='http://livinginjava.blogspot.com/2010/12/configuring-mic-in-aspire-4741z-ubuntu.html' title='Configuring mic in aspire 4741z - ubuntu 10.10'/><author><name>Santoso</name><uri>http://www.blogger.com/profile/01534214022898572802</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='32' src='http://photos1.blogger.com/img/243/7914/640/Me.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-16500981.post-6785214982873790181</id><published>2010-11-30T13:38:00.003+07:00</published><updated>2010-11-30T13:59:50.129+07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='linux'/><category scheme='http://www.blogger.com/atom/ns#' term='ubuntu'/><title type='text'>Ubuntu 10.10 brightness problem in Acer Aspire 4741</title><content type='html'>To those who have problem with brightness configuration after installing Ubuntu 10.10 and you are using Acer Aspire 4741, here's a solution for you:&lt;br /&gt;&lt;ol&gt;&lt;li&gt;&lt;span style="font-family:courier new;"&gt;sudo gedit /etc/default/grub&lt;/span&gt;&lt;/li&gt;&lt;li&gt;Change the line &lt;span style="font-family:courier new;"&gt;GRUB_CMDLINE_LINUX="" &lt;/span&gt;into&lt;br /&gt;&lt;span style="font-family:arial;"&gt;GRUB_CMDLINE_LINUX="acpi_osi=Linux"&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-family:courier new;"&gt;sudo update-grub&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-family:courier new;"&gt;Restart your linux&lt;br /&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ol&gt;&lt;br /&gt;Hopefully it helps.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/16500981-6785214982873790181?l=livinginjava.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='related' href='http://ubuntuforums.org/showpost.php?p=9291657&amp;postcount=1' title='Ubuntu 10.10 brightness problem in Acer Aspire 4741'/><link rel='replies' type='application/atom+xml' href='http://livinginjava.blogspot.com/feeds/6785214982873790181/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=16500981&amp;postID=6785214982873790181&amp;isPopup=true' title='25 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/16500981/posts/default/6785214982873790181'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/16500981/posts/default/6785214982873790181'/><link rel='alternate' type='text/html' href='http://livinginjava.blogspot.com/2010/11/ubuntu-1010-brightness-problem-in-acer.html' title='Ubuntu 10.10 brightness problem in Acer Aspire 4741'/><author><name>Santoso</name><uri>http://www.blogger.com/profile/01534214022898572802</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='32' src='http://photos1.blogger.com/img/243/7914/640/Me.jpg'/></author><thr:total>25</thr:total></entry><entry><id>tag:blogger.com,1999:blog-16500981.post-7057728787461632936</id><published>2010-10-19T01:11:00.004+07:00</published><updated>2010-10-19T01:47:00.266+07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='grails'/><category scheme='http://www.blogger.com/atom/ns#' term='spring-security-core'/><title type='text'>Spring security core build path problem</title><content type='html'>First time trying Grails 1.3.5, creating a new test project. Installing spring-security-core plugin (following the tutorial) and then importing the project to STS 2.5M1 and letting STS know that it's a Grail project (Configure-&gt;Convert to a Grails project... something like this). I was hoping for an easy ride here, expecting no errors since I haven't add anything, all are auto generated.&lt;br /&gt;&lt;br /&gt;But as usual, with programming world, there ain't no such things as a bug/error free codes. I got compile errors like this in my LoginController.groovy.&lt;br /&gt;&lt;br /&gt;&lt;img style="cursor: pointer; width: 612px; height: 114px;" src="http://lh3.ggpht.com/_BXcpGuDAEO4/TLyRSY15RpI/AAAAAAAAAhc/RfSVUldXrHI/s576/blog-spring-security-error.JPG" alt="" id="BLOGGER_PHOTO_ID_5529453101677531202" border="0" /&gt;&lt;br /&gt;&lt;br /&gt;I know that I'm missing org.springframework.security.core-3.0.3.RELEASE.jar release in this case and the shortcut to solve this is just to add the jar to the project build path. But, is this going to happen for each plugin jar that I'm going to use? and anyway I don't like the solution to put the jar manually on the build path, it does look an ugly solution.&lt;br /&gt;&lt;br /&gt;Fortunately I find a menu to refresh Grails' dependencies and the good news is it works for me, no more compile errors. Here's the context menu that pops up when I right click on my project:&lt;br /&gt;&lt;br /&gt;&lt;img style="cursor: pointer; width: 612px; height: 114px;" src="http://lh4.ggpht.com/_BXcpGuDAEO4/TLySpxI8YBI/AAAAAAAAAhg/9oZqPBeykQI/s576/blog-grails-refresh-dependencies.jpg" alt="" border="0" /&gt;&lt;br /&gt;&lt;br /&gt;I think this is caused by me adding the plugin from command prompt and then importing the project in STS. Imho, if the plugin is added thru STS' grails command prompt it should works without refreshing.&lt;br /&gt;&lt;br /&gt;Hmm... just remember that this is similar to when I add a new file to my project using my file manager. Eclipse can't see the file, until I refresh the project.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/16500981-7057728787461632936?l=livinginjava.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://livinginjava.blogspot.com/feeds/7057728787461632936/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=16500981&amp;postID=7057728787461632936&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/16500981/posts/default/7057728787461632936'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/16500981/posts/default/7057728787461632936'/><link rel='alternate' type='text/html' href='http://livinginjava.blogspot.com/2010/10/spring-security-core-build-path-problem.html' title='Spring security core build path problem'/><author><name>Santoso</name><uri>http://www.blogger.com/profile/01534214022898572802</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='32' src='http://photos1.blogger.com/img/243/7914/640/Me.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh3.ggpht.com/_BXcpGuDAEO4/TLyRSY15RpI/AAAAAAAAAhc/RfSVUldXrHI/s72-c/blog-spring-security-error.JPG' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-16500981.post-3242961261874687055</id><published>2010-09-14T22:21:00.003+07:00</published><updated>2011-03-15T01:04:57.492+07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='java'/><category scheme='http://www.blogger.com/atom/ns#' term='jsf'/><title type='text'>Using hibernate generated collection in h:dataTable</title><content type='html'>It's a bit difficult to pick the correct title for the thing that I'm going to write :) It's about having your POJO generated by hibernate and then feed it to h:dataTable.&lt;br /&gt;&lt;br /&gt;When your object has a collection properties and the elements contained are unique within the collection, hibernate will create a Set to contains it. The thing with a Set is h:dataTable just can't accept it. The simplest solution is to change Set to Collection object and h:dataTable can accept it and Hibernate won't complain about it :)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/16500981-3242961261874687055?l=livinginjava.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://livinginjava.blogspot.com/feeds/3242961261874687055/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=16500981&amp;postID=3242961261874687055&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/16500981/posts/default/3242961261874687055'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/16500981/posts/default/3242961261874687055'/><link rel='alternate' type='text/html' href='http://livinginjava.blogspot.com/2010/09/using-hibernate-generated-collection-in.html' title='Using hibernate generated collection in h:dataTable'/><author><name>Santoso</name><uri>http://www.blogger.com/profile/01534214022898572802</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='32' src='http://photos1.blogger.com/img/243/7914/640/Me.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-16500981.post-9131815475754229598</id><published>2010-09-14T18:01:00.003+07:00</published><updated>2011-03-15T00:16:58.126+07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='java'/><category scheme='http://www.blogger.com/atom/ns#' term='seam'/><title type='text'>Rolling back transaction (Seam managed transaction)</title><content type='html'>JSF+Seam is what I'm learning at the moment. And the case is I need to rollback the transaction due to business exception but I don't want to not catch the transaction (when a runtime exception is uncaught the transaction will be rollback automatically). The business exception here is a new exception class extending &lt;span style="font-family:courier new;"&gt;RuntimeException&lt;/span&gt;.&lt;br /&gt;&lt;br /&gt;At first try, I add &lt;span style="font-family:courier new;"&gt;ApplicationException &lt;/span&gt;annotation with rollback = true in my &lt;span style="font-family:courier new;"&gt;BusinessException &lt;/span&gt;class. The controller class which invokes the business service class and under certain condition an exception of &lt;span style="font-family:courier new;"&gt;BusinessException &lt;/span&gt;type is thrown. In my scenario my transaction should be rolled back, the thing is... it was not rolled back.&lt;br /&gt;&lt;br /&gt;This forced me to dive into seam's code (that's why I love open source) and find out how to handle the transaction. And I came into Transaction class, which I can use to do what I want.&lt;br /&gt;Here's how to use it to mark the transaction as rollback:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;Transaction.instance().rollback();&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Actually all I wish is when the exception is thrown by the service class (already registered to seam) the transaction will be rolled back automatically, unfortunately for me it doesn't work :(&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/16500981-9131815475754229598?l=livinginjava.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://livinginjava.blogspot.com/feeds/9131815475754229598/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=16500981&amp;postID=9131815475754229598&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/16500981/posts/default/9131815475754229598'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/16500981/posts/default/9131815475754229598'/><link rel='alternate' type='text/html' href='http://livinginjava.blogspot.com/2010/09/rolling-back-transaction-seam-managed.html' title='Rolling back transaction (Seam managed transaction)'/><author><name>Santoso</name><uri>http://www.blogger.com/profile/01534214022898572802</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='32' src='http://photos1.blogger.com/img/243/7914/640/Me.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-16500981.post-3299977514898146497</id><published>2010-09-14T17:05:00.011+07:00</published><updated>2011-03-15T01:04:20.142+07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='java'/><category scheme='http://www.blogger.com/atom/ns#' term='jpa'/><title type='text'>Entity inheritance-single table per class hierarchy strategy with JPA + Hibernate</title><content type='html'>I happened to have the chance to implement entity inheritance using single table per class hierarchy strategy. At first I though I would sail smooth and arrive at the promised land easily :) but as usual with programming, it is a rare thing a code would sail smooth at the first time.&lt;br /&gt;Persisting entity works like charm, retrieving it makes me speechless. Here's an example:&lt;br /&gt;&lt;br /&gt;The base class (ItemReference)&lt;br /&gt;&lt;a href="http://3.bp.blogspot.com/_BXcpGuDAEO4/TI9QG2sKFRI/AAAAAAAAAgY/9RvkqxNqcN4/s1600/single+table.JPG"&gt;&lt;img style="cursor: pointer; width: 400px; height: 68px;" src="http://3.bp.blogspot.com/_BXcpGuDAEO4/TI9QG2sKFRI/AAAAAAAAAgY/9RvkqxNqcN4/s400/single+table.JPG" alt="" id="BLOGGER_PHOTO_ID_5516716147242308882" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Subclass#1 (ItemReferenceAge)&lt;br /&gt;&lt;a href="http://4.bp.blogspot.com/_BXcpGuDAEO4/TI9N70-nUlI/AAAAAAAAAgI/1H0pH3Lt_NY/s1600/single+table+extend.JPG"&gt;&lt;img style="cursor: pointer; width: 400px; height: 56px;" src="http://4.bp.blogspot.com/_BXcpGuDAEO4/TI9N70-nUlI/AAAAAAAAAgI/1H0pH3Lt_NY/s400/single+table+extend.JPG" alt="" id="BLOGGER_PHOTO_ID_5516713758781035090" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Subclass#2 (ItemReferenceSex)&lt;br /&gt;&lt;a href="http://3.bp.blogspot.com/_BXcpGuDAEO4/TI9QS76yrcI/AAAAAAAAAgg/-99UScpIpCA/s1600/single+table+extend+2.JPG"&gt;&lt;img style="cursor: pointer; width: 400px; height: 63px;" src="http://3.bp.blogspot.com/_BXcpGuDAEO4/TI9QS76yrcI/AAAAAAAAAgg/-99UScpIpCA/s400/single+table+extend+2.JPG" alt="" id="BLOGGER_PHOTO_ID_5516716354804297154" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;DDL&lt;br /&gt;&lt;a href="http://1.bp.blogspot.com/_BXcpGuDAEO4/TI9RG1E0xTI/AAAAAAAAAgo/zJEIobX2IA8/s1600/single+table+-+table.JPG"&gt;&lt;img style="cursor: pointer; width: 288px; height: 152px;" src="http://1.bp.blogspot.com/_BXcpGuDAEO4/TI9RG1E0xTI/AAAAAAAAAgo/zJEIobX2IA8/s400/single+table+-+table.JPG" alt="" id="BLOGGER_PHOTO_ID_5516717246320526642" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;One class that I don't include here is the class which has a collection of ItemReferenceSex and a collection of ItemReferenceAge, let's call this class Wrapper.&lt;br /&gt;&lt;br /&gt;The scenario is I add 2 instances of ItemReferenceAge to wrapper collection and persisted it. What happened when I try to load the same wrapper instance is both collections are having elements in them. Remember, I only add ItemReferenceAge instance which means the collection of ItemReferenceSex should be empty.&lt;br /&gt;Looking at the query generated shows that the discriminator column is not used in the where clause of the select query. What I can think of the design reasoning is that it is assumed that there will not be two or more type of instances loaded in the same parent object which in my case it is.&lt;br /&gt;Luckily for me, there's a solution for this and unfortunately it's hibernate specific annotation (is it maybe because of JPA doesn't state how to handle my case or is it hibernate implementation?). All I need to do is to add &lt;span style="font-family:courier new;"&gt;ForceDiscriminator&lt;/span&gt; annotation in my base class and the problem is solved!&lt;br /&gt;&lt;br /&gt;&lt;a href="http://4.bp.blogspot.com/_BXcpGuDAEO4/TI9UwztvWLI/AAAAAAAAAgw/0UzpXc75jeM/s1600/single+table+-+fixed.JPG"&gt;&lt;img style="cursor: pointer; width: 497px; height: 60px;" src="http://4.bp.blogspot.com/_BXcpGuDAEO4/TI9UwztvWLI/AAAAAAAAAgw/0UzpXc75jeM/s400/single+table+-+fixed.JPG" alt="" id="BLOGGER_PHOTO_ID_5516721266044655794" border="0" /&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/16500981-3299977514898146497?l=livinginjava.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://livinginjava.blogspot.com/feeds/3299977514898146497/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=16500981&amp;postID=3299977514898146497&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/16500981/posts/default/3299977514898146497'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/16500981/posts/default/3299977514898146497'/><link rel='alternate' type='text/html' href='http://livinginjava.blogspot.com/2010/09/entity-inheritance-single-table-per.html' title='Entity inheritance-single table per class hierarchy strategy with JPA + Hibernate'/><author><name>Santoso</name><uri>http://www.blogger.com/profile/01534214022898572802</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='32' src='http://photos1.blogger.com/img/243/7914/640/Me.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_BXcpGuDAEO4/TI9QG2sKFRI/AAAAAAAAAgY/9RvkqxNqcN4/s72-c/single+table.JPG' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-16500981.post-8459463378371454425</id><published>2010-08-19T23:56:00.003+07:00</published><updated>2011-03-15T01:05:40.346+07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='java'/><category scheme='http://www.blogger.com/atom/ns#' term='eclipse'/><title type='text'>Eclipse fails to start?</title><content type='html'>Your eclipse fails to start? actually we could say your workspace fails to start. I've gone through it several times and my solution was to create a new workspace and import the existing projects into the new workspace.&lt;br /&gt;However, this time I'm trying to solve it once for all (as though it's possible :). Googled around and I found, imho, a rough solution that works for me. It's as simple as deleting org.eclipse.core.resources folder inside {workspace}/.metadata/.plugins and then run eclipse -clean.&lt;br /&gt;The result is eclipse is working but I still have to import the existing projects back. The good thing is I don't lost all the preferences and server setting (though I could just import the preferences file I once exported).&lt;br /&gt;&lt;br /&gt;Check the link on the title and also this &lt;a href="http://www.eclipse.org/eclipse/platform-core/downloads.php"&gt;one&lt;/a&gt;, tools from eclipse team that maybe could help with the broken workspace (I never tried it yet... my workspace already fixed :)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/16500981-8459463378371454425?l=livinginjava.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='related' href='http://ahtik.com/blog/2008/01/15/eclipse-workspace-fails-to-start-after-crash-quick-fix/' title='Eclipse fails to start?'/><link rel='replies' type='application/atom+xml' href='http://livinginjava.blogspot.com/feeds/8459463378371454425/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=16500981&amp;postID=8459463378371454425&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/16500981/posts/default/8459463378371454425'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/16500981/posts/default/8459463378371454425'/><link rel='alternate' type='text/html' href='http://livinginjava.blogspot.com/2010/08/eclipse-fails-to-start.html' title='Eclipse fails to start?'/><author><name>Santoso</name><uri>http://www.blogger.com/profile/01534214022898572802</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='32' src='http://photos1.blogger.com/img/243/7914/640/Me.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-16500981.post-4865111098798430814</id><published>2010-08-17T01:58:00.004+07:00</published><updated>2010-08-17T02:26:22.535+07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='java'/><title type='text'>A bit on classloader</title><content type='html'>At first glance, I thought java could face the same problem as dll was (&lt;a href="http://en.wikipedia.org/wiki/DLL_hell"&gt;dll hell&lt;/a&gt;). But then classloader scoping comes to the rescue. And by the way, I won't explain the theory of classloading here. By having classloader scope set to the application, it will allow each application to bring their own libraries without worrying of library conflict.&lt;br /&gt;&lt;br /&gt;For example, I built a library of common utilities and there are already 2 versions of it. And 2 of my web applications are using the library, however each with a different versions from the other. If the flat classloading is used, only one of the 2 versions of the library will be used and the impact is the web application which used the version not loaded will have strange errors such as ClassCastException, IllegalAccessErrors and possibly many others. Having classloader scoping will allow each of my web application to use its respective library.&lt;br /&gt;&lt;br /&gt;One thing cross my mind, how could I have a smaller deployment size for a web application and still having the classloader scoping. Smaller deployment size here refers to my classes only without the whole bunch of libraries. Usually when people delivers a patch for the web application, all is packed in war file which size is quite large. On my case, the library size are around 80% of the war file size. Up to now, all I can do is to deploy the application as exploded. Thus allowing me to deploy patches by replacing the content/libraries. Not an elegant solution but still  a viable one, until I can find a nicer solution.....&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/16500981-4865111098798430814?l=livinginjava.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='related' href='http://docs.jboss.org/jbossweb/latest/class-loader-howto.html' title='A bit on classloader'/><link rel='replies' type='application/atom+xml' href='http://livinginjava.blogspot.com/feeds/4865111098798430814/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=16500981&amp;postID=4865111098798430814&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/16500981/posts/default/4865111098798430814'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/16500981/posts/default/4865111098798430814'/><link rel='alternate' type='text/html' href='http://livinginjava.blogspot.com/2010/08/bit-on-classloader.html' title='A bit on classloader'/><author><name>Santoso</name><uri>http://www.blogger.com/profile/01534214022898572802</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='32' src='http://photos1.blogger.com/img/243/7914/640/Me.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-16500981.post-9072174805646773366</id><published>2010-08-15T16:53:00.003+07:00</published><updated>2010-08-15T17:03:04.261+07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='java'/><title type='text'>Initialize static List and Map</title><content type='html'>If you intend to create a List or Map for your constants, here's how you do it.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;List&lt;/span&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;public static String CONSTANT_1 = "1";&lt;br /&gt;public static String CONSTANT_2 = "2";&lt;br /&gt;&lt;br /&gt;public static List&lt;string&gt; CONSTANTS = new ArrayList&lt;string&gt;() { {&lt;br /&gt;        add(CONSTANT_1);&lt;br /&gt;        add(CONSTANT_2);&lt;br /&gt;}};&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Map&lt;/span&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;&lt;br /&gt;public static Map&lt;string,&gt; CONSTANTS = new HashMap&lt;string,&gt;() { {&lt;br /&gt;        put("key1", "value1");&lt;br /&gt;        put("key2", "value2");&lt;br /&gt;}};&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;Even better is to wrap the ArrayList/HashMap by passing them to Collections.unmodifiableList or Collections.unmodifiableMap. Thus making sure that it is truly a constant list/map.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/16500981-9072174805646773366?l=livinginjava.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://livinginjava.blogspot.com/feeds/9072174805646773366/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=16500981&amp;postID=9072174805646773366&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/16500981/posts/default/9072174805646773366'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/16500981/posts/default/9072174805646773366'/><link rel='alternate' type='text/html' href='http://livinginjava.blogspot.com/2010/08/initialize-static-list-and-map.html' title='Initialize static List and Map'/><author><name>Santoso</name><uri>http://www.blogger.com/profile/01534214022898572802</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='32' src='http://photos1.blogger.com/img/243/7914/640/Me.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-16500981.post-5955965403008882944</id><published>2010-07-28T14:22:00.005+07:00</published><updated>2010-07-28T15:13:29.195+07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='oracle'/><title type='text'>How to search for column reference in oracle</title><content type='html'>Imagine that you need to find out which code update a column in a table. Some developer tools could point out who refers to the table but so far I couldn't find the one that could answer my need.&lt;br /&gt;&lt;br /&gt;All_source comes to the rescue, I'd say that it is a special view that holds all the database objects accessible by the user.&lt;br /&gt;&lt;br /&gt;Here is the description on the view's columns:&lt;br /&gt;&lt;table class="InformalWideMax" title="ALL_SOURCE" summary="This table is described in the preceding text" dir="ltr" frame="hsides" rules="groups" border="1" cellpadding="3" cellspacing="0" width="100%"&gt;&lt;tbody&gt;&lt;tr align="left" valign="top"&gt;&lt;td id="r2c1-t102" headers="r1c1-t102" align="left"&gt;&lt;code&gt;OWNER&lt;/code&gt;&lt;/td&gt; &lt;td headers="r2c1-t102 r1c2-t102" align="left"&gt;&lt;code&gt;VARCHAR2(30)&lt;/code&gt;&lt;/td&gt; &lt;td headers="r2c1-t102 r1c3-t102" align="left"&gt;&lt;code&gt;NOT NULL&lt;/code&gt;&lt;/td&gt; &lt;td headers="r2c1-t102 r1c4-t102" align="left"&gt;Owner of the object&lt;/td&gt; &lt;/tr&gt; &lt;tr align="left" valign="top"&gt; &lt;td id="r3c1-t102" headers="r1c1-t102" align="left"&gt;&lt;code&gt;NAME&lt;/code&gt;&lt;/td&gt; &lt;td headers="r3c1-t102 r1c2-t102" align="left"&gt;&lt;code&gt;VARCHAR2(30)&lt;/code&gt;&lt;/td&gt; &lt;td headers="r3c1-t102 r1c3-t102" align="left"&gt;&lt;code&gt;NOT NULL&lt;/code&gt;&lt;/td&gt; &lt;td headers="r3c1-t102 r1c4-t102" align="left"&gt;Name of the object&lt;/td&gt; &lt;/tr&gt; &lt;tr align="left" valign="top"&gt; &lt;td id="r4c1-t102" headers="r1c1-t102" align="left"&gt;&lt;code&gt;TYPE&lt;/code&gt;&lt;/td&gt; &lt;td headers="r4c1-t102 r1c2-t102" align="left"&gt;&lt;code&gt;VARCHAR2(12)&lt;/code&gt;&lt;/td&gt; &lt;td headers="r4c1-t102 r1c3-t102" align="left"&gt;&lt;br /&gt;&lt;/td&gt; &lt;td headers="r4c1-t102 r1c4-t102" align="left"&gt;Type of object: &lt;code&gt;FUNCTION&lt;/code&gt;, &lt;code&gt;JAVA SOURCE&lt;/code&gt;, &lt;code&gt;PACKAGE&lt;/code&gt;, &lt;code&gt;PACKAGE BODY&lt;/code&gt;, &lt;code&gt;PROCEDURE&lt;/code&gt;, &lt;code&gt;TRIGGER&lt;/code&gt;, &lt;code&gt;TYPE&lt;/code&gt;, &lt;code&gt;TYPE BODY&lt;/code&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr align="left" valign="top"&gt; &lt;td id="r5c1-t102" headers="r1c1-t102" align="left"&gt;&lt;code&gt;LINE&lt;/code&gt;&lt;/td&gt; &lt;td headers="r5c1-t102 r1c2-t102" align="left"&gt;&lt;code&gt;NUMBER&lt;/code&gt;&lt;/td&gt; &lt;td headers="r5c1-t102 r1c3-t102" align="left"&gt;&lt;code&gt;NOT NULL&lt;/code&gt;&lt;/td&gt; &lt;td headers="r5c1-t102 r1c4-t102" align="left"&gt;Line number of this line of source&lt;/td&gt; &lt;/tr&gt; &lt;tr align="left" valign="top"&gt; &lt;td id="r6c1-t102" headers="r1c1-t102" align="left"&gt;&lt;code&gt;TEXT&lt;/code&gt;&lt;/td&gt; &lt;td headers="r6c1-t102 r1c2-t102" align="left"&gt;&lt;code&gt;VARCHAR2(4000)&lt;/code&gt;&lt;/td&gt; &lt;td headers="r6c1-t102 r1c3-t102" align="left"&gt;&lt;br /&gt;&lt;/td&gt; &lt;td headers="r6c1-t102 r1c4-t102" align="left"&gt;Text source of the stored object&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;Example:&lt;br /&gt;I need to find out who refers to column FK_USER.&lt;br /&gt;&lt;br /&gt;select * from all_source where text like '%FK_USER%'&lt;br /&gt;&lt;br /&gt;And I will get all the places which have reference to FK_USER.&lt;br /&gt;&lt;br /&gt;If you would take it further, you could utilize it for searching almost anything (e.g. comments in the code, TODO tag, exception).&lt;br /&gt;&lt;br /&gt;... wondering if there're more "magical" view like this.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/16500981-5955965403008882944?l=livinginjava.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='related' href='http://download.oracle.com/docs/cd/B19306_01/server.102/b14237/statviews_2063.htm' title='How to search for column reference in oracle'/><link rel='replies' type='application/atom+xml' href='http://livinginjava.blogspot.com/feeds/5955965403008882944/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=16500981&amp;postID=5955965403008882944&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/16500981/posts/default/5955965403008882944'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/16500981/posts/default/5955965403008882944'/><link rel='alternate' type='text/html' href='http://livinginjava.blogspot.com/2010/07/how-to-search-for-column-reference-in.html' title='How to search for column reference in oracle'/><author><name>Santoso</name><uri>http://www.blogger.com/profile/01534214022898572802</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='32' src='http://photos1.blogger.com/img/243/7914/640/Me.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-16500981.post-4057005885372383228</id><published>2010-07-24T21:43:00.006+07:00</published><updated>2011-03-15T01:03:49.269+07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='java'/><category scheme='http://www.blogger.com/atom/ns#' term='generic'/><title type='text'>Retrieving generic's Class type</title><content type='html'>Quite few times I've been using generic and I needed the Class type. I found out that I've to pass the class type instead of extracting the class type from the type parameter. This story comes to an end when I found out a way to extract the type, thanks to Type interface :)&lt;br /&gt;&lt;br /&gt;Here's the recipe:&lt;br /&gt;- First extract the genericSuperclass&lt;br /&gt;- Retrieve the actual type arguments&lt;br /&gt;&lt;br /&gt;.. and the code is:&lt;br /&gt;ParameterizedType type = (ParameterizedType) getClass().getGenericSuperclass();&lt;br /&gt;Class&lt;t&gt; classType = (Class&lt;t&gt;) type.getActualTypeArguments()[0];&lt;br /&gt;&lt;br /&gt;ParameterizedType represents an invocation of a generic class or interface, better explanation could be read in the javadoc.&lt;br /&gt;&lt;br /&gt;That's all... :)&lt;br /&gt;&lt;/t&gt;&lt;/t&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/16500981-4057005885372383228?l=livinginjava.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://livinginjava.blogspot.com/feeds/4057005885372383228/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=16500981&amp;postID=4057005885372383228&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/16500981/posts/default/4057005885372383228'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/16500981/posts/default/4057005885372383228'/><link rel='alternate' type='text/html' href='http://livinginjava.blogspot.com/2010/07/retrieving-generics-class-type.html' title='Retrieving generic&apos;s Class type'/><author><name>Santoso</name><uri>http://www.blogger.com/profile/01534214022898572802</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='32' src='http://photos1.blogger.com/img/243/7914/640/Me.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-16500981.post-5993930490002130847</id><published>2010-06-12T01:08:00.002+07:00</published><updated>2010-06-12T01:22:04.349+07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='jsp java'/><title type='text'>Knowing the exact location of error in your jsp</title><content type='html'>Actually it's been several times I have to deal with error happening during jsp rendering. To be more exact, the error doesn't lie in the jsp page but in the content prepared before rendering the jsp. Usually what I do is just removing part by part of the jsp page until I can locate the part that caused the rendering error. I keep on doing it until I remember that during page rendering a buffer is used and the buffer size itself is configurable.&lt;br /&gt;&lt;br /&gt;Here's in short of how to do it:&lt;br /&gt;- Insert the following page direction to the top of the jsp page&lt;br /&gt;  &lt;span style="font-family: courier new;"&gt;&lt;%@ page buffer="none" %&gt;&lt;/span&gt;&lt;br /&gt;- Try to open the page again in the browser and view the source&lt;br /&gt;- The last position of the source page will show exactly the position of the error, i.e. the position before the source of the error&lt;br /&gt;- After you've managed to fix the error, don't forget to remove the page directive. It will certainly degrade the performance if you leave it there&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/16500981-5993930490002130847?l=livinginjava.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://livinginjava.blogspot.com/feeds/5993930490002130847/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=16500981&amp;postID=5993930490002130847&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/16500981/posts/default/5993930490002130847'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/16500981/posts/default/5993930490002130847'/><link rel='alternate' type='text/html' href='http://livinginjava.blogspot.com/2010/06/knowing-exact-location-of-error-in-your.html' title='Knowing the exact location of error in your jsp'/><author><name>Santoso</name><uri>http://www.blogger.com/profile/01534214022898572802</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='32' src='http://photos1.blogger.com/img/243/7914/640/Me.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-16500981.post-1044602206676648444</id><published>2010-04-27T15:27:00.004+07:00</published><updated>2010-04-27T16:17:09.062+07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ethernet'/><category scheme='http://www.blogger.com/atom/ns#' term='linux'/><title type='text'>Configuring static IP in Fedora</title><content type='html'>If all you have is a CLI, then you might find this to be of benefit. Otherwise you could just use the Network Device Control GUI.&lt;br /&gt;&lt;br /&gt;Here are the steps:&lt;br /&gt;&lt;ol&gt;&lt;li&gt;Execute ifconfig and find out your ethernet configuration name (e.g. eth0)&lt;/li&gt;&lt;li&gt;Go to /etc/sysconfig/network-script&lt;/li&gt;&lt;li&gt;edit ifcfg-eth0 (depends on your ethernet)&lt;/li&gt;&lt;li&gt;Update the file as follow (set the IPADDR, BROADCAST according to your desired configuration)&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_BXcpGuDAEO4/S9aqbLQhl5I/AAAAAAAAAfo/BUAIMxctPLQ/s1600/ifcfg-eth0.jpg"&gt;&lt;img style="cursor: pointer; width: 320px; height: 75px;" src="http://2.bp.blogspot.com/_BXcpGuDAEO4/S9aqbLQhl5I/AAAAAAAAAfo/BUAIMxctPLQ/s320/ifcfg-eth0.jpg" alt="" id="BLOGGER_PHOTO_ID_5464742581715965842" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Restart the network service&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;service network restart&lt;/span&gt;&lt;br /&gt;&lt;/li&gt;&lt;/ol&gt;&lt;br /&gt;Here's a brief explanation on the configuration:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;BOOTPROTO : telling the network that we're configuring it as static ip&lt;/li&gt;&lt;li&gt;ONBOOT : the configuration will be set at boot time&lt;/li&gt;&lt;li&gt;BROADCAST : your gateway&lt;/li&gt;&lt;li&gt;NETMASK : your netmask&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;br /&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/16500981-1044602206676648444?l=livinginjava.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://livinginjava.blogspot.com/feeds/1044602206676648444/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=16500981&amp;postID=1044602206676648444&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/16500981/posts/default/1044602206676648444'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/16500981/posts/default/1044602206676648444'/><link rel='alternate' type='text/html' href='http://livinginjava.blogspot.com/2010/04/configuring-static-ip-in-fedora.html' title='Configuring static IP in Fedora'/><author><name>Santoso</name><uri>http://www.blogger.com/profile/01534214022898572802</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='32' src='http://photos1.blogger.com/img/243/7914/640/Me.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_BXcpGuDAEO4/S9aqbLQhl5I/AAAAAAAAAfo/BUAIMxctPLQ/s72-c/ifcfg-eth0.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-16500981.post-4528698998484707902</id><published>2009-12-12T14:37:00.006+07:00</published><updated>2009-12-12T22:57:14.890+07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Opera'/><title type='text'>Opera Turbo</title><content type='html'>Someone asks me if is it safe browsing with Opera mini (which defaulted to use Turbo)? The safe here mentioned refer to the data sent being stored by Opera Turbo (remember, all data traffic goes thru Opera Turbo so that it could compressed the content and sent the result to the browser). This question is answered on the following link:&lt;br /&gt;&lt;a href="http://labs.opera.com/news/2009/03/13/"&gt;http://labs.opera.com/news/2009/03/13/&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;If you are using ssl, Opera Turbo is bypassed and we're communicating with the SSL site directly. Which implies that turbo is turned "off" and you're back to the old way of browsing. Opera Turbo also declares that it doesn't store any user's information.&lt;br /&gt;&lt;br /&gt;The conclusion is if we're looking for a cheaper way to browse, which is the case where the price mostly depends on the data being transferred (usually per KB), Opera Mini will be a great choice. Bear in mind, the statement declares that no user's data is stored. If you don't trust it then it simply mean don't use Opera.&lt;br /&gt;&lt;br /&gt;Before I finished, I read one of the comments on this &lt;a href="http://www.mnot.net/blog/2009/06/05/opera_turbo"&gt;blog&lt;/a&gt;. It mentioned that Opera is a Norwegian company, which means that it follow the Personal Data Act (&lt;a href="http://www.datatilsynet.no/templates/Page____194.aspx"&gt;http://www.datatilsynet.no/templates/Page____194.aspx&lt;/a&gt;). And it is extremely strict.&lt;a href="http://www.mnot.net/blog/2009/06/05/opera_turbo"&gt; &lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/16500981-4528698998484707902?l=livinginjava.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='related' href='http://labs.opera.com/news/2009/03/13/' title='Opera Turbo'/><link rel='replies' type='application/atom+xml' href='http://livinginjava.blogspot.com/feeds/4528698998484707902/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=16500981&amp;postID=4528698998484707902&amp;isPopup=true' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/16500981/posts/default/4528698998484707902'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/16500981/posts/default/4528698998484707902'/><link rel='alternate' type='text/html' href='http://livinginjava.blogspot.com/2009/12/opera-turbo.html' title='Opera Turbo'/><author><name>Santoso</name><uri>http://www.blogger.com/profile/01534214022898572802</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='32' src='http://photos1.blogger.com/img/243/7914/640/Me.jpg'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-16500981.post-4501068634343740712</id><published>2009-12-09T22:28:00.002+07:00</published><updated>2009-12-09T22:58:38.853+07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='agile'/><title type='text'>Agile Manifesto</title><content type='html'>The thought of using agile methodology started about 3 years ago. Never been involved in a project using agile, I was looking for one to be involved in or have "my" project using it.&lt;br /&gt;It seems to be challenging enough to use it, to know the advantage and of course the weaknesses. To find out the know how-when to use agile or waterfall. I'm not all for agile, but I have to admit agile excites me more. Adopting one of agile practice in one of the projects I'm involved in, which is daily meeting (face to face communication), opened my eyes to realize that the team starts to become more alive. Everyone starts to involve themselves more, discussion on the requirements become more often. As opposed to developer works only as they're told to.&lt;br /&gt;&lt;br /&gt;Reading on agile manifesto, quoted below&lt;br /&gt;&lt;p style="font-family: georgia; color: rgb(51, 102, 255);"&gt;We are uncovering better ways of developing software by doing it and helping others do it. Through this work we have come to value:&lt;/p&gt; &lt;ul style="font-family: georgia; color: rgb(51, 102, 255);"&gt;&lt;li&gt;&lt;b&gt;Individuals and interactions&lt;/b&gt; over processes and tools&lt;/li&gt;&lt;li&gt;&lt;b&gt;Working software&lt;/b&gt; over comprehensive documentation&lt;/li&gt;&lt;li&gt;&lt;b&gt;Customer collaboration&lt;/b&gt; over contract negotiation&lt;/li&gt;&lt;li&gt;&lt;b&gt;Responding to change&lt;/b&gt; over following a plan&lt;/li&gt;&lt;/ul&gt;&lt;span style="font-family: georgia; color: rgb(51, 102, 255);"&gt; That is, while there is value in the items on the right, we value the items on the left more.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;quite confirms that agile might be the one we should use for the development. But still I'm not all for agile, there're still some factors that drives me to choose the old methodology. Such as large complex projects, the number of developers involved. Maybe it's me not knowing in depth on how agile methodology really works.&lt;br /&gt;&lt;br /&gt;After all, it fall back to one step at a time. Welcome agile, I'm looking forward to really understand you more :)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/16500981-4501068634343740712?l=livinginjava.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='related' href='http://agilemanifesto.org/' title='Agile Manifesto'/><link rel='replies' type='application/atom+xml' href='http://livinginjava.blogspot.com/feeds/4501068634343740712/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=16500981&amp;postID=4501068634343740712&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/16500981/posts/default/4501068634343740712'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/16500981/posts/default/4501068634343740712'/><link rel='alternate' type='text/html' href='http://livinginjava.blogspot.com/2009/12/agile-manifesto.html' title='Agile Manifesto'/><author><name>Santoso</name><uri>http://www.blogger.com/profile/01534214022898572802</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='32' src='http://photos1.blogger.com/img/243/7914/640/Me.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-16500981.post-1530246946834231593</id><published>2009-07-07T22:09:00.003+07:00</published><updated>2009-07-07T23:18:53.691+07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='tips'/><title type='text'>Connect to wireless network using netsh</title><content type='html'>If you kinda tired of constantly changing your wireless network when you're at home or office, batch file could be a great help for you. A single click is enough to setup your wireless connection. I was using Net Profiles and I'm a satisfied user, but this single click idea beats Net Profiles.&lt;br /&gt;Of course you've to create a batch file for each connection you want to setup, but that's not too much to do (imho).&lt;br /&gt;&lt;br /&gt;FYI, I'm using Vista. For XP, the command could be a bit different but the idea is still the same (c'mon improvise).&lt;br /&gt;&lt;br /&gt;Now, here's the simple command line to connect to a wireless lan:&lt;br /&gt;netsh wlan connect name="network name" interface="Connection name under Manage Network Connection" ssid="the ssid"&lt;br /&gt;&lt;br /&gt;example:&lt;br /&gt;netsh wlan connect name="hpsetup" interface="Wireless Network Connection" ssid="hpsetup"&lt;br /&gt;&lt;br /&gt;in case you use static ip in your office or home, the command goes like this:&lt;br /&gt;netsh interface ipv4 set address "Connection name under Manage Network Connection" static the_static_ip mask the_gateway&lt;br /&gt;&lt;br /&gt;example:&lt;br /&gt;netsh interface ipv4 set address "Wireless Network Connection" static 192.168.1.102 255.255.255.0 192.168.1.103&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;One more thing, running under Vista you need to run the batch file as administrator.&lt;br /&gt;&lt;br /&gt;After all, it's only one click away.....&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/16500981-1530246946834231593?l=livinginjava.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://livinginjava.blogspot.com/feeds/1530246946834231593/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=16500981&amp;postID=1530246946834231593&amp;isPopup=true' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/16500981/posts/default/1530246946834231593'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/16500981/posts/default/1530246946834231593'/><link rel='alternate' type='text/html' href='http://livinginjava.blogspot.com/2009/07/connect-to-wireless-network-using-netsh.html' title='Connect to wireless network using netsh'/><author><name>Santoso</name><uri>http://www.blogger.com/profile/01534214022898572802</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='32' src='http://photos1.blogger.com/img/243/7914/640/Me.jpg'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-16500981.post-4834620016193957320</id><published>2009-06-16T21:34:00.006+07:00</published><updated>2009-06-16T21:53:54.900+07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='serial'/><title type='text'>Virtual Serial Port</title><content type='html'>How did I start to play around with it? It all began when a friend of mine was asking me for a favour to help him develop a simple software to communicate to another software thru serial port. My laptop doesn't have a serial port (of course, unless it was a very very old laptop) and I only have one usb to serial converter.&lt;br /&gt;&lt;br /&gt;My first idea is to buy another usb to serial converter and a null modem cable to connect 2 laptops, thereby I can test the serial communication. Another idea is to use my old desktop (I have one and lent it to someone and actually forgot about it until I need it) but I don't think it is easy to do.&lt;br /&gt;Then today at the office, asking my friend and he gave me one brilliant solution called VIRTUAL SERIAL PORT. I never heard it until today and my oh my... it is the solution to my problem (Thanks Adhi).&lt;br /&gt;&lt;br /&gt;Googling around and I found one free driver (http://com0com.sourceforge.net/). Easy to install and I think I don't need to setup anything more, unless I need to configure another serial port pair. One thing lacking is the GUI to configure the ports. Anyway, it's free and open source, I couldn't be happier.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/16500981-4834620016193957320?l=livinginjava.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='related' href='http://com0com.sourceforge.net/' title='Virtual Serial Port'/><link rel='replies' type='application/atom+xml' href='http://livinginjava.blogspot.com/feeds/4834620016193957320/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=16500981&amp;postID=4834620016193957320&amp;isPopup=true' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/16500981/posts/default/4834620016193957320'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/16500981/posts/default/4834620016193957320'/><link rel='alternate' type='text/html' href='http://livinginjava.blogspot.com/2009/06/virtual-serial-port.html' title='Virtual Serial Port'/><author><name>Santoso</name><uri>http://www.blogger.com/profile/01534214022898572802</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='32' src='http://photos1.blogger.com/img/243/7914/640/Me.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-16500981.post-4851340920328335953</id><published>2009-06-05T16:22:00.002+07:00</published><updated>2009-06-05T16:55:26.402+07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='toshiba'/><title type='text'>Turning Toshiba Satellite illumination led off</title><content type='html'>The first time I got my Toshiba M300 (actually it's not mine, it's my office's), I love to see all the LEDs light up the laptop.&lt;br /&gt;&lt;br /&gt;&lt;img src="http://lh6.ggpht.com/_BXcpGuDAEO4/SijjuvAvFZI/AAAAAAAAAbs/XXmWnKvZUvc/s288/blog-satellite.JPG" /&gt; &lt;img src="http://lh4.ggpht.com/_BXcpGuDAEO4/Sijjuv0hTiI/AAAAAAAAAbw/l8-zph728-M/s288/blog-satellite-2.JPG" /&gt;&lt;br /&gt;&lt;br /&gt;Not until a week that it already bored me to see my laptop lights up as if it was a festival. Then to my dismay, I found out that turning off the LEDs wasn't easy (I did manage to turn it off though).&lt;br /&gt;My colleague buying the same laptop as mine, also find it difficult and he did ask me how.&lt;br /&gt;&lt;br /&gt;Today, someone asked me (she's using toshiba also) how to turn the LED off and gladly I told her and write in this post on the how to.&lt;br /&gt;&lt;br /&gt;1. Press fn button and click on the rightmost button&lt;br /&gt;&lt;img src="http://lh5.ggpht.com/_BXcpGuDAEO4/SijjuvfuoAI/AAAAAAAAAb0/6vTQ8oBYY0M/s400/blog-toshiba1.jpg" /&gt;&lt;br /&gt;&lt;br /&gt;2. Click on the HWSetup button&lt;br /&gt;&lt;img src="http://lh6.ggpht.com/_BXcpGuDAEO4/Sijju1_KOFI/AAAAAAAAAb4/k2urOhnHD0M/s400/blog-toshiba2.jpg" /&gt;&lt;br /&gt;&lt;br /&gt;3. Go to Illumination tab and select Off and click OK. You're done.&lt;br /&gt;&lt;img src="http://lh4.ggpht.com/_BXcpGuDAEO4/Sijju9EMBlI/AAAAAAAAAb8/Rq7Z8Y3piTM/s400/blog-toshiba3.jpg" /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/16500981-4851340920328335953?l=livinginjava.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://livinginjava.blogspot.com/feeds/4851340920328335953/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=16500981&amp;postID=4851340920328335953&amp;isPopup=true' title='23 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/16500981/posts/default/4851340920328335953'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/16500981/posts/default/4851340920328335953'/><link rel='alternate' type='text/html' href='http://livinginjava.blogspot.com/2009/06/turning-toshiba-satellite-illumination.html' title='Turning Toshiba Satellite illumination led off'/><author><name>Santoso</name><uri>http://www.blogger.com/profile/01534214022898572802</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='32' src='http://photos1.blogger.com/img/243/7914/640/Me.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh6.ggpht.com/_BXcpGuDAEO4/SijjuvAvFZI/AAAAAAAAAbs/XXmWnKvZUvc/s72-c/blog-satellite.JPG' height='72' width='72'/><thr:total>23</thr:total></entry><entry><id>tag:blogger.com,1999:blog-16500981.post-4692510915450881483</id><published>2009-06-05T10:50:00.009+07:00</published><updated>2011-03-15T01:06:17.027+07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='java'/><category scheme='http://www.blogger.com/atom/ns#' term='password'/><category scheme='http://www.blogger.com/atom/ns#' term='hash'/><title type='text'>MD5 hash</title><content type='html'>This morning I read a blog discussing about how to keep a secure password. The usual way to store a password is first to hash it using MD5 hash and store it in a db. The benefit of using MD5 is you cannot do a reverse-hash.&lt;br /&gt;&lt;br /&gt;Here's how you code it in Java :&lt;br /&gt;&lt;code&gt;&lt;br /&gt;MessageDigest md = java.security.MessageDigest.getInstance("MD5");&lt;br /&gt;md.update("your password here");&lt;br /&gt;byte[] hashed= md.digest();&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;To convert it in hex, here's the code (actually I got it from &lt;a href="http://www.anyexample.com/programming/java/java_simple_class_to_compute_md5_hash.xml"&gt;here&lt;/a&gt;):&lt;br /&gt;&lt;br /&gt;&lt;img src="http://lh3.ggpht.com/_BXcpGuDAEO4/SijRt953MXI/AAAAAAAAAbo/aBHKUPVCLww/s800/blog-converttohex.jpg" style="border: 1px none ;" /&gt;&lt;br /&gt;&lt;br /&gt;One more tips, for better security, you might consider to add salt before hashing the password to make it less vulnerable. The changes looks like this :&lt;br /&gt;&lt;br /&gt;&lt;code&gt;md.update("The salt" + "your password here");&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;"The salt" here should be created dynamically and stored it along with the hashed password to be used later.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;An excellent post on secure password scheme could be found &lt;a href="http://www.matasano.com/log/958/enough-with-the-rainbow-tables-what-you-need-to-know-about-secure-password-schemes/"&gt;here&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/16500981-4692510915450881483?l=livinginjava.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='related' href='http://www.matasano.com/log/958/enough-with-the-rainbow-tables-what-you-need-to-know-about-secure-password-schemes/' title='MD5 hash'/><link rel='replies' type='application/atom+xml' href='http://livinginjava.blogspot.com/feeds/4692510915450881483/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=16500981&amp;postID=4692510915450881483&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/16500981/posts/default/4692510915450881483'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/16500981/posts/default/4692510915450881483'/><link rel='alternate' type='text/html' href='http://livinginjava.blogspot.com/2009/06/md5-hash.html' title='MD5 hash'/><author><name>Santoso</name><uri>http://www.blogger.com/profile/01534214022898572802</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='32' src='http://photos1.blogger.com/img/243/7914/640/Me.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh3.ggpht.com/_BXcpGuDAEO4/SijRt953MXI/AAAAAAAAAbo/aBHKUPVCLww/s72-c/blog-converttohex.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-16500981.post-9141599508495380465</id><published>2009-05-22T16:01:00.005+07:00</published><updated>2009-05-22T16:38:02.629+07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='management'/><title type='text'>Being critical with your own capacity</title><content type='html'>This post I think only relates to small company where employees are less than 30 ppl or where there're no strict structure applied.&lt;br /&gt;It's about how people responses when they're given task while they're still working on one.&lt;br /&gt;&lt;br /&gt;By far,  I've seen 3 ways of ppl managing their capacity:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;"Yes man" (or "can do guy")&lt;br /&gt;This guy will say yes and confidently say I can to all the tasks given to him. Usually this type of guy is a smart guy, able to work everything fast and done as it seems.  This guy is willing to sacrifice everything for the sake of finishing all the tasks. One thing I notice though, shortcuts were applied everywhere to get things done. The simple reason for this is there are a lot of tasks in hand, and as quickly as possible he wants to get rid of them all one by one.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Rational guy&lt;br /&gt;This type of guy is the rational thinking one, when given a new task he will look at his capacity first and dare to say "I can't" if he's asked to finish the task using the time allocated for other task. Mostly guys with this type are a bit perfectionist, they have their argument that task should be finished in a right way, with few shortcuts (or none if possible).&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Quiet guy&lt;br /&gt;Given tasks beyond his capacity, he will keep quiet. He will keep on working on the tasks one by one, sadly without minding the time limit he has. The result is this guy will work overtime at most and doesn't meet the schedule. The quality of his work might not matter for him, he will keep on working and someday when he is tired enough, he will resign and start over in other place.&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;So which type is the best?&lt;br /&gt;I would say a small company only needs 1 or 2 "Yes man" and a lot of "rational guy".&lt;br /&gt;There are times where resources are limited and adding more resource is not the best solution. This is where "Yes man" is very helpful, however having too many "Yes man" won't be good either considering the quality of the work.&lt;br /&gt;A growing company is a company which also learn to realize quality does come with price.&lt;br /&gt;&lt;br /&gt;One caution for "rational guy", sometimes he might become too rational that he start to reject the task for the sake of task dislike using the current task as an excuse.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/16500981-9141599508495380465?l=livinginjava.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://livinginjava.blogspot.com/feeds/9141599508495380465/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=16500981&amp;postID=9141599508495380465&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/16500981/posts/default/9141599508495380465'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/16500981/posts/default/9141599508495380465'/><link rel='alternate' type='text/html' href='http://livinginjava.blogspot.com/2009/05/being-critical-with-your-own-capacity.html' title='Being critical with your own capacity'/><author><name>Santoso</name><uri>http://www.blogger.com/profile/01534214022898572802</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='32' src='http://photos1.blogger.com/img/243/7914/640/Me.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-16500981.post-326025978264223883</id><published>2009-03-19T21:52:00.007+07:00</published><updated>2009-03-19T23:06:20.707+07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='schedule'/><title type='text'>Scheduling a project correctly? Almost impossible!</title><content type='html'>Scheduling a software project, I can't say that it's enjoyable. To say that it's complicated, risky and very unreliable task is agreeable for me. All the task durations set are all guestimate, basically based on hunches. After all, who can measure software development correctly. And to imagine that everything would go smooth is one thought that should never cross your mind.&lt;br /&gt;&lt;br /&gt;The latest schedule that I arranged was a schedule for documentation project, actually it was a product reverse engineereed and documented. We have a client bought the product and they're interested in buying the source code along with the complete documentation.&lt;br /&gt;&lt;br /&gt;At first, I thought for this project I was a bit lucky, no development needed. The thought that I forbid to cross my mind actually entered in. Thinking that documentation are all measureable, I began to arrange the schedule. The project started and after a month passed by, I begin to notice that problems start to creep in along with their surprises :&lt;br /&gt;&lt;ol&gt;&lt;li&gt;New things to be documented start to pop up, things that I didn't see in the first place.&lt;/li&gt;&lt;li&gt;Tools that we used sometimes stressed us up, even M$Word! The documentation has reached almost 500 pages, when my team tried to format the doc sometimes it stopped working. And still not to mention other tools we used. Are we picking a wrong tools here? Nope, I don't think so.  Problems definitely will be met whatever the tools we picked.&lt;/li&gt;&lt;li&gt;Human resources. When one member of the team quits, it left a hole that couldn't be filled straight away. &lt;/li&gt;&lt;li&gt;The skills required. Not everybody has the skill to document, create diagrams, read existing code.&lt;/li&gt;&lt;li&gt;Interrupt. I have to help other project and what can I do but to assign my time to help.&lt;br /&gt;&lt;/li&gt;&lt;/ol&gt;&lt;br /&gt;I hate the idea that working over hours is the only solution to finish the project on time. I prefer working smart, which are :&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Finding patterns repeatedly used in the documentation. I'm lucky enough to have a teammate who is also able to recognize patterns repeatedly used in the documentation. Create/automate it once and solve it for all.&lt;/li&gt;&lt;li&gt;Start measuring the time spent for a task and focus on working faster for the same task either by optimizing the way we work, finding the common things (i.e. pattern) or even using copy paste :)&lt;/li&gt;&lt;li&gt;Spend less time on the normal working hours for other things we usually do (e.g. reading mails, newspaper, etc).&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;The project is still on its way, let's see whether we could finish the project on time or not :)&lt;br /&gt;and whether the smart way will prevail over working over hours.&lt;br /&gt;&lt;br /&gt;Before I finish, some books that I read also mentioned that software projects tend to not meet it's schedule, which I hope I could disagree with. These two books I would like to recommend : Secrets of Success Software and Mythical Man Month.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/16500981-326025978264223883?l=livinginjava.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://livinginjava.blogspot.com/feeds/326025978264223883/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=16500981&amp;postID=326025978264223883&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/16500981/posts/default/326025978264223883'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/16500981/posts/default/326025978264223883'/><link rel='alternate' type='text/html' href='http://livinginjava.blogspot.com/2009/03/scheduling-project-correctly-almost.html' title='Scheduling a project correctly? Almost impossible!'/><author><name>Santoso</name><uri>http://www.blogger.com/profile/01534214022898572802</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='32' src='http://photos1.blogger.com/img/243/7914/640/Me.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-16500981.post-4503337732425481461</id><published>2009-02-17T02:01:00.007+07:00</published><updated>2009-02-17T02:14:33.179+07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='grails'/><title type='text'>Running grails app in eclipse</title><content type='html'>Running grails app in eclipse actually is quite simple if... you know how.&lt;br /&gt;&lt;br /&gt;Here's how :&lt;br /&gt;- Import your grails app as existing project in eclipse&lt;br /&gt;- Find {app-name}.launch in the project root and right click select Run As and the .launch configuration name&lt;br /&gt;&lt;img style="cursor: pointer; width: 500px; height: 207px;" src="http://lh4.ggpht.com/_BXcpGuDAEO4/SZm5wTnpHFI/AAAAAAAAAX0/u_2XBzJdpJo/s720/running-grails-app.jpg" alt="running-grails-app" border="0" /&gt;&lt;br /&gt;- There's all to it :)&lt;br /&gt;&lt;br /&gt;If you want to know how to debug grails app, see my previous &lt;a href="http://livinginjava.blogspot.com/2009/02/debugging-grails.html"&gt;post&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/16500981-4503337732425481461?l=livinginjava.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='related' href='http://grails.org/Eclipse+IDE+Integration' title='Running grails app in eclipse'/><link rel='replies' type='application/atom+xml' href='http://livinginjava.blogspot.com/feeds/4503337732425481461/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=16500981&amp;postID=4503337732425481461&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/16500981/posts/default/4503337732425481461'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/16500981/posts/default/4503337732425481461'/><link rel='alternate' type='text/html' href='http://livinginjava.blogspot.com/2009/02/running-grails-app-in-eclipse.html' title='Running grails app in eclipse'/><author><name>Santoso</name><uri>http://www.blogger.com/profile/01534214022898572802</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='32' src='http://photos1.blogger.com/img/243/7914/640/Me.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh4.ggpht.com/_BXcpGuDAEO4/SZm5wTnpHFI/AAAAAAAAAX0/u_2XBzJdpJo/s72-c/running-grails-app.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-16500981.post-629737460310359713</id><published>2009-02-17T01:53:00.003+07:00</published><updated>2009-02-17T02:00:59.232+07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='grails'/><title type='text'>Debugging Grails</title><content type='html'>Debugging grails almost got me crazy. I followed as said, trying it many times. At last google led me to this &lt;a href="http://brainflush.wordpress.com/2008/05/03/grails-and-eclipse-not-so-groovy/"&gt;link&lt;/a&gt; which shed some light.&lt;br /&gt;&lt;br /&gt;Let's get to the point, here's how to enable debugging grails (groovy) :&lt;br /&gt;- Add JDK's tools.jar to your project build path.&lt;br /&gt;&lt;br /&gt;Yep, that's all.&lt;br /&gt;Or I'll be more specific here :&lt;br /&gt;- Open your project properties, go to Java Build Path&lt;br /&gt;- On tab Libraries, Add External JARs.&lt;br /&gt;- Pick tools.jar from your {JDK_HOME}/lib&lt;br /&gt;&lt;br /&gt;Fyi, I'm using grails 1.0.4 and groovy eclipse 1.5.7.20081120_2330.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/16500981-629737460310359713?l=livinginjava.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='related' href='http://grails.org/Eclipse+IDE+Integration' title='Debugging Grails'/><link rel='replies' type='application/atom+xml' href='http://livinginjava.blogspot.com/feeds/629737460310359713/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=16500981&amp;postID=629737460310359713&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/16500981/posts/default/629737460310359713'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/16500981/posts/default/629737460310359713'/><link rel='alternate' type='text/html' href='http://livinginjava.blogspot.com/2009/02/debugging-grails.html' title='Debugging Grails'/><author><name>Santoso</name><uri>http://www.blogger.com/profile/01534214022898572802</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='32' src='http://photos1.blogger.com/img/243/7914/640/Me.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-16500981.post-5877183072864702066</id><published>2009-01-27T15:28:00.007+07:00</published><updated>2009-01-27T16:00:55.240+07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='excel'/><title type='text'>Extracting excel sheet index</title><content type='html'>First, this post has nothing to do with Java. It only serves as a reminder for me.&lt;br /&gt;I was in the middle of documenting things where I have to use Excel with many sheets. The need for me is to have automatic numbering on each sheet, where the index depends on the sheet index (fortunate for me). Excel doesn't provide a function for retrieving index, I tried to put the index on the sheet name and further extract it. It works with the 1st excel file (because the other sheets were copied from the 1st sheet and excel voluntarily add index to the new copy's name), but with the 2nd excel file I don't want to put the index on the sheet name myself. The macro below (see this &lt;a href="http://72.14.235.132/search?q=cache:ug5lxEYXIPgJ:www.vbaexpress.com/kb/getarticle.php%3Fkb_id%3D402+how+to+find+sheet+index+%2Bexcel+function&amp;amp;hl=id&amp;amp;ct=clnk&amp;amp;cd=8&amp;amp;gl=id&amp;amp;client=firefox-a"&gt;link&lt;/a&gt;) helps me on extracting the sheet index :&lt;br /&gt;&lt;br /&gt;&lt;img style="border: 1px solid ; width: 485px; height: 222px;" src="http://lh5.ggpht.com/_BXcpGuDAEO4/SX7JYjMcAoI/AAAAAAAAAWY/zxUxI2l_6IE/macro.jpg" /&gt;&lt;br /&gt;&lt;br /&gt;&lt;ol&gt;&lt;li&gt;Type above code. &lt;/li&gt;&lt;li&gt;In Excel press Alt + F11 to enter the VBE. &lt;/li&gt;&lt;li&gt;Press Ctrl + R to show the Project Explorer. &lt;/li&gt;&lt;li&gt;Right-click desired file on left (in bold). &lt;/li&gt;&lt;li&gt;Choose Insert -&gt; Module. &lt;/li&gt;&lt;li&gt;Paste code into the right pane. &lt;/li&gt;&lt;li&gt;Press Alt + Q to close the VBE. &lt;/li&gt;&lt;li&gt;Save workbook before any other changes.&lt;/li&gt;&lt;/ol&gt;To use it you could simply type "=SheetNum()".&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/16500981-5877183072864702066?l=livinginjava.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://livinginjava.blogspot.com/feeds/5877183072864702066/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=16500981&amp;postID=5877183072864702066&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/16500981/posts/default/5877183072864702066'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/16500981/posts/default/5877183072864702066'/><link rel='alternate' type='text/html' href='http://livinginjava.blogspot.com/2009/01/extracting-excel-sheet-index.html' title='Extracting excel sheet index'/><author><name>Santoso</name><uri>http://www.blogger.com/profile/01534214022898572802</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='32' src='http://photos1.blogger.com/img/243/7914/640/Me.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh5.ggpht.com/_BXcpGuDAEO4/SX7JYjMcAoI/AAAAAAAAAWY/zxUxI2l_6IE/s72-c/macro.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-16500981.post-3611195933882882254</id><published>2009-01-22T23:43:00.002+07:00</published><updated>2009-01-22T23:51:45.178+07:00</updated><title type='text'>Javascript root objects available for webscript</title><content type='html'>In this post I'm quoting the wiki content for the sake of ease to find it later.&lt;br /&gt;&lt;br /&gt;One link that might be of interest : &lt;a href="http://wiki.alfresco.com/wiki/JavaScript_API_Cookbook"&gt;Javascript API cookbook&lt;/a&gt;&lt;br /&gt;&lt;p&gt;The following JavaScript root objects are available to all Web Scripts, regardless of their hosting environment. &lt;/p&gt; &lt;dl&gt;&lt;dt&gt; args&lt;/dt&gt;&lt;dd&gt; an associative array of all URI parameters. See &lt;a href="http://wiki.alfresco.com/wiki/Web_Scripts_Examples#URL_Argument_Handling" title="Web Scripts Examples"&gt;example&lt;/a&gt;. &lt;/dd&gt;&lt;/dl&gt; &lt;dl&gt;&lt;dt&gt; argsM&lt;/dt&gt;&lt;dd&gt; an associative array of all URI parameters (where each key is an argument name and each value is an array containing all respective argument values, even if only one is supplied). See &lt;a href="http://wiki.alfresco.com/wiki/Web_Scripts_Examples#URL_Argument_Handling" title="Web Scripts Examples"&gt;example&lt;/a&gt;. &lt;/dd&gt;&lt;/dl&gt; &lt;dl&gt;&lt;dt&gt; headers&lt;/dt&gt;&lt;dd&gt; an associative array of all request headers. &lt;/dd&gt;&lt;/dl&gt; &lt;dl&gt;&lt;dt&gt; headersM&lt;/dt&gt;&lt;dd&gt; an associative array of all request headers (where each key is an header name and each value is an array containing all respective header values, even if only one is supplied). See &lt;a href="http://wiki.alfresco.com/wiki/Web_Scripts_Examples#URL_Argument_Handling" title="Web Scripts Examples"&gt;example&lt;/a&gt;. &lt;/dd&gt;&lt;/dl&gt; &lt;dl&gt;&lt;dt&gt; &lt;a href="http://wiki.alfresco.com/wiki/Web_Scripts#url" title=""&gt;url&lt;/a&gt;&lt;/dt&gt;&lt;dd&gt; provides access to the URI (or parts of the URI) that triggered the web script. &lt;/dd&gt;&lt;/dl&gt; &lt;dl&gt;&lt;dt&gt; model&lt;/dt&gt;&lt;dd&gt; An empty associative array which may be populated by the JavaScript. Values placed into this array are available as root objects in Web Script response templates. &lt;/dd&gt;&lt;/dl&gt; &lt;dl&gt;&lt;dt&gt; &lt;a href="http://wiki.alfresco.com/wiki/Web_Scripts#status" title=""&gt;status&lt;/a&gt;&lt;/dt&gt;&lt;dd&gt; provides ability to control response status codes. &lt;/dd&gt;&lt;/dl&gt; &lt;dl&gt;&lt;dt&gt; &lt;a href="http://wiki.alfresco.com/wiki/Web_Scripts#cache" title=""&gt;cache&lt;/a&gt;&lt;/dt&gt;&lt;dd&gt; provides ability to control caching of response. &lt;/dd&gt;&lt;/dl&gt; &lt;dl&gt;&lt;dt&gt; &lt;a href="http://wiki.alfresco.com/wiki/Web_Scripts#Web_Script_Configuration" title=""&gt;config&lt;/a&gt;&lt;/dt&gt;&lt;dd&gt; provides access to the Web Script configuration. &lt;/dd&gt;&lt;/dl&gt; &lt;dl&gt;&lt;dt&gt; msg&lt;/dt&gt;&lt;dd&gt; provides access to Web Script localized messages. &lt;/dd&gt;&lt;/dl&gt; &lt;dl&gt;&lt;dt&gt; &lt;a href="http://wiki.alfresco.com/wiki/Web_Scripts#format" title=""&gt;format&lt;/a&gt;&lt;/dt&gt;&lt;dd&gt; provides information on the response format to be rendered. &lt;/dd&gt;&lt;/dl&gt; &lt;dl&gt;&lt;dt&gt; guest&lt;/dt&gt;&lt;dd&gt; A boolean indicating whether the web script is executing as "Guest". &lt;/dd&gt;&lt;/dl&gt; &lt;dl&gt;&lt;dt&gt; &lt;a href="http://wiki.alfresco.com/wiki/Web_Scripts#webscript" title=""&gt;webscript&lt;/a&gt;&lt;/dt&gt;&lt;dd&gt; An associative array of meta-data properties describing the Web Script. &lt;/dd&gt;&lt;/dl&gt; &lt;dl&gt;&lt;dt&gt; &lt;a href="http://wiki.alfresco.com/wiki/Web_Scripts#server" title=""&gt;server&lt;/a&gt;&lt;/dt&gt;&lt;dd&gt; An associative array of meta-data properties describing the server hosting the Web Script. &lt;/dd&gt;&lt;/dl&gt; &lt;dl&gt;&lt;dt&gt; &lt;a href="http://wiki.alfresco.com/wiki/Web_Scripts#json" title=""&gt;jsonUtils&lt;/a&gt;&lt;/dt&gt;&lt;dd&gt; A host object for parsing and generating JSON objects. &lt;/dd&gt;&lt;/dl&gt; &lt;dl&gt;&lt;dt&gt; &lt;a href="http://wiki.alfresco.com/wiki/Web_Scripts#atom" title=""&gt;atom&lt;/a&gt;&lt;/dt&gt;&lt;dd&gt; A host object for parsing and generating Atom (Publishing) documents. &lt;/dd&gt;&lt;/dl&gt; &lt;dl&gt;&lt;dt&gt; logger&lt;/dt&gt;&lt;dd&gt; A host object providing access to console logging facilities for debugging of scripts. See the &lt;a href="http://wiki.alfresco.com/wiki/JavaScript_API#Logging_API" title="JavaScript API"&gt;Logging API&lt;/a&gt;.  &lt;/dd&gt;&lt;/dl&gt; &lt;p&gt;Web Scripts hosted within the Alfresco Repository tier also have access to the following root objects which provide direct access to Repository services and content. &lt;/p&gt; &lt;dl&gt;&lt;dt&gt; roothome&lt;/dt&gt;&lt;dd&gt; the repository root node (only available if authenticated) &lt;/dd&gt;&lt;/dl&gt; &lt;dl&gt;&lt;dt&gt; companyhome&lt;/dt&gt;&lt;dd&gt; the company home folder (only available if authenticated) &lt;/dd&gt;&lt;/dl&gt; &lt;dl&gt;&lt;dt&gt; person&lt;/dt&gt;&lt;dd&gt; the person node of the currently authenticated user (only available if authenticated) &lt;/dd&gt;&lt;/dl&gt; &lt;dl&gt;&lt;dt&gt; userhome&lt;/dt&gt;&lt;dd&gt; the user home folder (only available if authenticated) &lt;/dd&gt;&lt;/dl&gt; &lt;dl&gt;&lt;dt&gt; search&lt;/dt&gt;&lt;dd&gt; A host object providing access to Lucene and Saved Search results. See the &lt;a href="http://wiki.alfresco.com/wiki/JavaScript_API#Search_API" title="JavaScript API"&gt;Search API&lt;/a&gt;. &lt;/dd&gt;&lt;/dl&gt; &lt;dl&gt;&lt;dt&gt; people&lt;/dt&gt;&lt;dd&gt; A host object providing access to Alfresco people and groups. See the &lt;a href="http://wiki.alfresco.com/wiki/JavaScript_API#People_API" title="JavaScript API"&gt;People API&lt;/a&gt;. &lt;/dd&gt;&lt;/dl&gt; &lt;dl&gt;&lt;dt&gt; actions&lt;/dt&gt;&lt;dd&gt; A host object providing invocation of registered Alfresco Actions. See the &lt;a href="http://wiki.alfresco.com/wiki/JavaScript_API#Actions_API" title="JavaScript API"&gt;Actions API&lt;/a&gt;. &lt;/dd&gt;&lt;/dl&gt; &lt;dl&gt;&lt;dt&gt; session&lt;/dt&gt;&lt;dd&gt; Session related information such as the current authentication ticket. See the &lt;a href="http://wiki.alfresco.com/wiki/JavaScript_API#Session_API" title="JavaScript API"&gt;Session API&lt;/a&gt;. &lt;/dd&gt;&lt;/dl&gt; &lt;dl&gt;&lt;dt&gt; classification&lt;/dt&gt;&lt;dd&gt; Access to the root elements of the classification API. See the &lt;a href="http://wiki.alfresco.com/wiki/JavaScript_API#Classification_API" title="JavaScript API"&gt;Classification API&lt;/a&gt;. &lt;/dd&gt;&lt;/dl&gt; &lt;dl&gt;&lt;dt&gt; utils&lt;/dt&gt;&lt;dd&gt; Access to a library of useful helper functions not provided as part of generic JavaScript. See the &lt;a href="http://wiki.alfresco.com/wiki/JavaScript_API#Utility_Functions" title="JavaScript API"&gt;Utility Functions&lt;/a&gt;. &lt;/dd&gt;&lt;/dl&gt; &lt;dl&gt;&lt;dt&gt; avm&lt;/dt&gt;&lt;dd&gt; Access to WCM objects such as AVM paths and searching within AVM stores and web projects. See the &lt;a href="http://wiki.alfresco.com/wiki/JavaScript_API#AVM_API" title="JavaScript API"&gt;AVM API&lt;/a&gt;. &lt;/dd&gt;&lt;/dl&gt; &lt;dl&gt;&lt;dt&gt; crossRepoCopy&lt;/dt&gt;&lt;dd&gt; Cross repository copy support. See the &lt;a href="http://wiki.alfresco.com/wiki/JavaScript_API#Cross_Repository_Copy" title="JavaScript API"&gt;Cross Repository Copy&lt;/a&gt;. &lt;/dd&gt;&lt;/dl&gt; &lt;dl&gt;&lt;dt&gt; workflow&lt;/dt&gt;&lt;dd&gt; Start workflows and access, control in-flight workflows.  See the &lt;a href="http://wiki.alfresco.com/wiki/JavaScript_API#Workflow_API" title="JavaScript API"&gt;JavaScript API#Workflow API&lt;/a&gt;. &lt;/dd&gt;&lt;/dl&gt; &lt;p&gt;Web Scripts hosted within the presentation tier (i.e. within Alfresco SURF) have their own extras as described in the &lt;a href="http://wiki.alfresco.com/wiki/Surf_Platform_-_Freemarker_Template_and_JavaScript_API" title="Surf Platform - Freemarker Template and JavaScript API"&gt;Surf Platform - Freemarker Template and JavaScript API&lt;/a&gt;.  &lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/16500981-3611195933882882254?l=livinginjava.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='related' href='http://wiki.alfresco.com/wiki/Web_Scripts#Examples_and_Guidelines' title='Javascript root objects available for webscript'/><link rel='replies' type='application/atom+xml' href='http://livinginjava.blogspot.com/feeds/3611195933882882254/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=16500981&amp;postID=3611195933882882254&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/16500981/posts/default/3611195933882882254'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/16500981/posts/default/3611195933882882254'/><link rel='alternate' type='text/html' href='http://livinginjava.blogspot.com/2009/01/javascript-root-objects-available-for.html' title='Javascript root objects available for webscript'/><author><name>Santoso</name><uri>http://www.blogger.com/profile/01534214022898572802</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='32' src='http://photos1.blogger.com/img/243/7914/640/Me.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-16500981.post-5724190673624211317</id><published>2009-01-21T13:55:00.003+07:00</published><updated>2009-01-21T14:22:58.827+07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='singleton'/><title type='text'>Thread safe singleton implementation</title><content type='html'>Singleton pattern is used in many projects I've gone through and I implemented it the same way in all the projects just like others did. Luckily for me the many projects could be safely assumed as thread safe projects. Thread safe project for me is a project where no thread programming is required. Before continuing, below is how I implemented singleton pattern.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family: courier new;"&gt;public class SingletonClassic {&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;    static SingletonClassic instance;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;    public static SingletonClassic getInstance() {&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;        if (instance == null) {&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;            instance = new SingletonClassic();&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;        }&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;        return instance;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;    }&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;}&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;I guess the code above should be familiar to programmers. Now, we delve into the reason of why I spend my time writing this blog. The code above is actually not thread safe, let's consider for example we have 2 threads running. Both are trying to access the singleton above (assume that the singleton isn't accessed yet), the 1st thread already pass the "if (instance == null) {" statement and the thread scheduler thinks that it's the 2nd thread time to run so the 1st thread got paused and the 2nd thread runs. 2nd thread arrive at the "if (instance == null) {" statement, the instance isn't instantiated yet so it enters into the if clause and create an instance and returns the instance. 2nd thread sleeps and 1st thread wakes up and continue where it left before which is creating &lt;span style="font-weight: bold;"&gt;another &lt;/span&gt;instance.&lt;br /&gt;So, we have a Singleton which is not so Singleton. At this point we see no harm done but if you're a perfectionist, the problem above will annoy you :)&lt;br /&gt;To ease you, here's the solution that I read in some article which unfortunately I forgot (very very unfortunate for me not to keep the link) :&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family: courier new;"&gt;public class SingletonClass {&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;    &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;    public static SingletonClass getInstance() {&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;        return SingletonHolder.getInstance();&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;    }&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;    &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;    static class SingletonHolder {&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;        static SingletonClass instance;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;        &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;        static {&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;            instance = new SingletonClass();&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;        }&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;        &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;        static SingletonClass getInstance() {&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;            return instance;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;        }&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;    }&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;}&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;I just go straight to the point here, the reason why the new code above is thread safe is because the static initializer is guaranteed to be thread safe in the jvm specification. It will be initialized only once when the class is loaded.&lt;br /&gt;&lt;br /&gt;still confused? let me break it down :&lt;br /&gt;1. SingletonClass.getInstance() is called&lt;br /&gt;2. which in turn will call SingletonHolder.getInstance()&lt;br /&gt;3. at this point static initializer in SingletonHolder will be executed where SingletonClass instance is initialized&lt;br /&gt;4. the new SingletonClass instance is returned, the instance will not be instantiated twice. Guaranteed!&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;If I ever meet the article again, I will write the name of the guy who found this method here.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/16500981-5724190673624211317?l=livinginjava.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://livinginjava.blogspot.com/feeds/5724190673624211317/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=16500981&amp;postID=5724190673624211317&amp;isPopup=true' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/16500981/posts/default/5724190673624211317'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/16500981/posts/default/5724190673624211317'/><link rel='alternate' type='text/html' href='http://livinginjava.blogspot.com/2009/01/thread-safe-singleton-implementation.html' title='Thread safe singleton implementation'/><author><name>Santoso</name><uri>http://www.blogger.com/profile/01534214022898572802</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='32' src='http://photos1.blogger.com/img/243/7914/640/Me.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-16500981.post-1327852661499581111</id><published>2009-01-21T13:23:00.004+07:00</published><updated>2009-01-21T13:31:14.905+07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='subclipse'/><title type='text'>Problem with subclipse and tortoisesvn</title><content type='html'>If you use subclipse and tortoisesvn on the same checkout folder on your machine, you might got this exception while working with subclipse :&lt;br /&gt;&lt;br /&gt;"&lt;span style="font-weight: bold;"&gt;svn: This client is too old to work with working copy&lt;/span&gt;"&lt;br /&gt;&lt;br /&gt;The reason is your tortoisesvn is using the latest svn version to perform some actions on the checkout folder.&lt;br /&gt;The solution is to replace  libsvnjavahl-1.dll in your [eclipse-root]/plugins/org.tigris.subversion.javahl.win32_1.1.0 with the latest one found in the zip file on this &lt;a href="http://subversion.tigris.org/downloads/svn-win32-1.4.0_javahl.zip"&gt;link&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;I guess that's all that I did on my machine.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/16500981-1327852661499581111?l=livinginjava.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='related' href='http://svn.haxx.se/subusers/archive-2006-09/0154.shtml' title='Problem with subclipse and tortoisesvn'/><link rel='replies' type='application/atom+xml' href='http://livinginjava.blogspot.com/feeds/1327852661499581111/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=16500981&amp;postID=1327852661499581111&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/16500981/posts/default/1327852661499581111'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/16500981/posts/default/1327852661499581111'/><link rel='alternate' type='text/html' href='http://livinginjava.blogspot.com/2009/01/problem-with-subclipse-and-tortoisesvn.html' title='Problem with subclipse and tortoisesvn'/><author><name>Santoso</name><uri>http://www.blogger.com/profile/01534214022898572802</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='32' src='http://photos1.blogger.com/img/243/7914/640/Me.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-16500981.post-900950413526398986</id><published>2008-12-24T10:23:00.003+07:00</published><updated>2008-12-24T10:27:34.466+07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='software design'/><title type='text'>The Helicopter story</title><content type='html'>I just read a nice article (check this &lt;a href="http://www.artima.com/intv/dry3.html"&gt;link&lt;/a&gt;), it spoke about the principle of orthogonality in software design. Without further ado, here's the helicopter story.&lt;br /&gt;&lt;br /&gt;A helicopter has four main controls: foot pedals, collective pitch  lever, cyclic, and throttle. The foot pedals control the tail rotor. With the foot pedals you can  counteract the torque of the main blade and, basically, point the nose where you want the  helicopter to go. The collective pitch lever, which you hold in your left hand, controls the  pitch on the rotor blades. This lets you control the amount of lift the blades generate. The  cyclic, which you hold in your right hand, can tip one section of the blade. Move the cyclic,  and the helicopter moves in the corresponding direction. The throttle sits at the end of the  pitch lever.  &lt;p&gt; It sounds fairly simple. You can use the pedals to point the helicopter where you want it to  go. You can use the collective to move up and down. Unfortunately, though, because of the  aerodynamics and gyroscopic effects of the blades, all these controls are related. So one  small change, such as lowering the collective, causes the helicopter to dip and turn to one  side. You have to counteract every change you make with corresponding opposing forces on  the other controls. However, by doing that, you introduce more changes to the original  control. So you're constantly dancing on all the controls to keep the helicopter stable.  &lt;/p&gt;&lt;p&gt; That's kind of similar to code. We've all worked on systems where you make one small  change over here, and another problem pops out over there. So you go over there and fix it,  but two more problems pop out somewhere else. You constantly push them back—like that  Whack-a-Mole game—and you just never finish. If the system is not orthogonal, if the  pieces interact with each other more than necessary, then you'll always get that kind of  distributed bug fixing.  &lt;/p&gt;&lt;p&gt; The funny thing about the helicopter story is that I'm not a helicopter pilot. When I wrote  the helicopter story, I wanted to make sure it was accurate. I knew of a USENET group on  helicopters, so I posted the helicopter story saying, "This is what I'm intending to write  about how helicopter controls work. Is it correct? A helicopter pilot emailed me and said, "I  read what you wrote about controlling helicopters. I didn't sleep all night."  &lt;img src="http://www.artima.com/images/ic.gif" align="top" height="15" width="15" /&gt; &lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/16500981-900950413526398986?l=livinginjava.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='related' href='http://www.artima.com/intv/dry3.html' title='The Helicopter story'/><link rel='replies' type='application/atom+xml' href='http://livinginjava.blogspot.com/feeds/900950413526398986/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=16500981&amp;postID=900950413526398986&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/16500981/posts/default/900950413526398986'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/16500981/posts/default/900950413526398986'/><link rel='alternate' type='text/html' href='http://livinginjava.blogspot.com/2008/12/helicopter-story.html' title='The Helicopter story'/><author><name>Santoso</name><uri>http://www.blogger.com/profile/01534214022898572802</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='32' src='http://photos1.blogger.com/img/243/7914/640/Me.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-16500981.post-2408953215706358384</id><published>2008-12-17T00:00:00.003+07:00</published><updated>2008-12-17T00:28:30.085+07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='database'/><title type='text'>Add index to your table to speed up queries</title><content type='html'>I'm not a database expert here and I just learned this tip today.&lt;br /&gt;&lt;br /&gt;If you have a large table and one or more columns are often used in the where clause, you might want to consider setting up index for those columns.&lt;br /&gt;But one thing to note, in oracle (maybe for other database also), if you're doing a calculation on the column in the where clause, your index isn't used by the optimizer.&lt;br /&gt;e.g. where column * 12 &gt; 1000&lt;br /&gt;&lt;br /&gt;My friend today was trying to optimize a query, by introducing an index, the result was awesome, instead of doing a full table scan (the size around 60 something mb), the optimizer use the index thereby reducing the cost and the time consumed.&lt;br /&gt;&lt;br /&gt;One other option that was set is to allow the database engine to execute parallel queries on the table.&lt;br /&gt;&lt;br /&gt;But if we setup too many indices, will that make inserting record to the table much slower?&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/16500981-2408953215706358384?l=livinginjava.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://livinginjava.blogspot.com/feeds/2408953215706358384/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=16500981&amp;postID=2408953215706358384&amp;isPopup=true' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/16500981/posts/default/2408953215706358384'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/16500981/posts/default/2408953215706358384'/><link rel='alternate' type='text/html' href='http://livinginjava.blogspot.com/2008/12/add-index-to-your-table-to-speed-up.html' title='Add index to your table to speed up queries'/><author><name>Santoso</name><uri>http://www.blogger.com/profile/01534214022898572802</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='32' src='http://photos1.blogger.com/img/243/7914/640/Me.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-16500981.post-1416643525538338099</id><published>2008-12-16T23:28:00.002+07:00</published><updated>2008-12-16T23:49:10.112+07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='alfresco'/><title type='text'>Beans that you could access from your dashlet in alfresco</title><content type='html'>If you're developing a custom dashlet or any jsf page for any purpose in alfresco, you could use the beans listed in (alfresco\WEB-INF\faces-config-beans.xml).&lt;br /&gt;&lt;br /&gt;Here's the list :&lt;br /&gt;&lt;ul&gt;&lt;li&gt;MultilingualManageDialog (The bean for the Delete Category screen)&lt;br /&gt;&lt;/li&gt;&lt;li&gt;ManagePermissionsDialog (The bean for the Manage Permissions)&lt;br /&gt;&lt;/li&gt;&lt;li&gt;MakeMultilingualDialog (The bean that make a document multilingual)&lt;/li&gt;&lt;li&gt;EditMLContainerDialog (The bean that edit the multilinguals properties of a document)&lt;/li&gt;&lt;li&gt;AddTranslationWithoutContentDialog (The bean that add a new translation without content)&lt;/li&gt;&lt;li&gt;AddTranslationDialog (The bean that add a translation with a content)&lt;/li&gt;&lt;li&gt;LoginBean (The bean that backs up the Login screen)&lt;/li&gt;&lt;li&gt;NavigationBean (The bean that holds navigation state)&lt;/li&gt;&lt;li&gt;BrowseBean (The bean that holds folder browse state)&lt;/li&gt;&lt;li&gt;AboutBean (Bean that provides information for the About page)&lt;/li&gt;&lt;li&gt;DialogManager (Bean that manages the dialog framework)&lt;/li&gt;&lt;li&gt;WizardManager (Bean that manages the wizard framework)&lt;/li&gt;&lt;li&gt;CreateSpaceDialog (The bean that backs up the Create Space Dialog)&lt;/li&gt;&lt;li&gt;CreateSpaceWizard (The bean that backs up the Create Space Wizard)&lt;/li&gt;&lt;li&gt;DeleteSpaceDialog (The bean that backs up the Delete Space Dialog)&lt;/li&gt;&lt;li&gt;ClipboardBean (The bean that manages a users Clipboard state)&lt;/li&gt;&lt;li&gt;RecentSpacesBean (The bean that manages the state for the Recent Spaces Shelf component)&lt;/li&gt;&lt;li&gt;UserShortcutsBean (The bean that manages the state for the User Shortcuts Shelf component)&lt;/li&gt;&lt;li&gt;SearchProperties (The bean that holds a state for the Advanced Search screen)&lt;/li&gt;&lt;li&gt;AdvancedSearchDialog (The bean that holds a state for the Advanced Search screen)&lt;/li&gt;&lt;li&gt;UsersBeanProperties (The bean that holds state for the Users screen)&lt;/li&gt;&lt;li&gt;UsersDialog (The bean that holds state for the User Management screens)&lt;/li&gt;&lt;li&gt;GroupsDialog (The bean that holds state for the Groups Management screens)&lt;/li&gt;&lt;li&gt;CategoriesProperties (The bean that holds state for the Category Management screens)&lt;/li&gt;&lt;li&gt;CategoriesDialog (The bean that holds state for the Category Management screens)&lt;/li&gt;&lt;li&gt;EditSpaceDialog (The bean that backs up the Edit Space Dialog)&lt;/li&gt;&lt;li&gt;AddContentDialog (The bean that backs up the Add Content Dialog)&lt;/li&gt;&lt;li&gt;CreateContentWizard (The bean that backs up the Create Content Wizard)&lt;/li&gt;&lt;li&gt;EditContentWizard (The bean that backs up the Edit Content Wizard)&lt;/li&gt;&lt;li&gt;ViewContentPropertiesDialog (The bean that backs up the View Content Properties Dialog)&lt;/li&gt;&lt;li&gt;SetContentPropertiesDialog (The bean that backs up the Set Content Properties Dialog)&lt;/li&gt;&lt;li&gt;..........&lt;/li&gt;&lt;li&gt;WorkflowBean&lt;/li&gt;&lt;li&gt;and a lot more....&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;I can't believe that the list is so long that it even make me think to create a small program to load the xml file and parse it just to get this list :)&lt;br /&gt;Anyway, bottom line is these beans might help you, knowing that they're exist already a help.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/16500981-1416643525538338099?l=livinginjava.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://livinginjava.blogspot.com/feeds/1416643525538338099/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=16500981&amp;postID=1416643525538338099&amp;isPopup=true' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/16500981/posts/default/1416643525538338099'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/16500981/posts/default/1416643525538338099'/><link rel='alternate' type='text/html' href='http://livinginjava.blogspot.com/2008/12/beans-that-you-could-access-from-your.html' title='Beans that you could access from your dashlet in alfresco'/><author><name>Santoso</name><uri>http://www.blogger.com/profile/01534214022898572802</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='32' src='http://photos1.blogger.com/img/243/7914/640/Me.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-16500981.post-7124413084474554233</id><published>2008-12-15T00:28:00.007+07:00</published><updated>2008-12-16T23:27:50.817+07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='alfresco'/><title type='text'>Alfresco tips</title><content type='html'>The tips that I will write here might seem silly but it works for me and I do hope it will help someone else and... I think I'll continue to add more items on this list someday.&lt;br /&gt;&lt;br /&gt;Should we start now? :)&lt;br /&gt;&lt;br /&gt;&lt;ol&gt;&lt;li&gt;Always read the wiki thoroughly, sometimes one page won't help you, other pages might contain the information you might need (sometimes I feel they're scattered and I just have to gather them pieces by pieces).&lt;/li&gt;&lt;li&gt;Read the existing code/example, it will certainly help you. For example, if you're creating a dashlet, look at the other dashlets already available.&lt;/li&gt;&lt;li&gt;In case you need to go deep (read : debugging alfresco), you could try to download the code, build it and run it :)&lt;/li&gt;&lt;li&gt;In case the above is too difficult, you could try to at least get the source and put it in a project in eclipse (or any IDE) and remotely debug alfresco (see my &lt;a href="http://livinginjava.blogspot.com/2008/10/debugging-application-server-as-remote.html"&gt;post&lt;/a&gt;) .&lt;/li&gt;&lt;li&gt;If you need to debug the workflow, get jBPM source code and do the same thing as no 4.&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Do yourself a favour by writing down all the changes you've done in alfresco in case you need to revisit it later, I can assure you that you won't be able to remember it for long (unless you're playing with alfresco everyday :).&lt;br /&gt;&lt;/li&gt;&lt;li&gt;If you're creating a custom workflow and at some point in your workflow you need to make a branch based on some properties value, use a decision node.&lt;/li&gt;&lt;li&gt;If you're creating a custom workflow, you might need to consider reading jbpm's &lt;a href="http://docs.jboss.org/jbpm/v3/userguide/index.html"&gt;documentation&lt;/a&gt;, especially on the jpdl chapter&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Use jpdl designer (free!!) to build your workflow, it will do you a favour later when you come back to your workflow. Go to http://www.eclipse.org or download jBPM GPD.&lt;/li&gt;&lt;/ol&gt;&lt;br /&gt;This is it for the moment, more to come later.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/16500981-7124413084474554233?l=livinginjava.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://livinginjava.blogspot.com/feeds/7124413084474554233/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=16500981&amp;postID=7124413084474554233&amp;isPopup=true' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/16500981/posts/default/7124413084474554233'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/16500981/posts/default/7124413084474554233'/><link rel='alternate' type='text/html' href='http://livinginjava.blogspot.com/2008/12/alfresco-tips.html' title='Alfresco tips'/><author><name>Santoso</name><uri>http://www.blogger.com/profile/01534214022898572802</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='32' src='http://photos1.blogger.com/img/243/7914/640/Me.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-16500981.post-7089030185276262336</id><published>2008-11-24T21:15:00.002+07:00</published><updated>2008-11-24T22:31:15.810+07:00</updated><title type='text'>Alfresco workflow package actions</title><content type='html'>I'm writing this post to serve as a reminder for later need because it's a bit difficult to look for it in Alfresco documentation "jungle" :) (no offense, I'm still grateful that I could access Alfresco's documentation).&lt;br /&gt;&lt;br /&gt;Each workflow instance in Alfresco works against a document, the start task "submit" the document, the other tasks in the workflow might add another document, edit attached document, remove attached document and only allowed to read the attached document. This behaviour is set in the workflow model by overriding bpm:packageActionGroup and bpm:packageActionItemGroup.&lt;br /&gt;&lt;br /&gt;List of action groups available by default :&lt;br /&gt;&lt;ul&gt;&lt;li&gt;read_package_item_actions&lt;br /&gt;  allow viewing of package items&lt;/li&gt;&lt;li&gt;edit_package_item_actions&lt;br /&gt;  above + allow modification (edit, checkout, ...) of package items &lt;/li&gt;&lt;li&gt;edit_and_remove_package_item_actions&lt;br /&gt;  above + allow removal of package items &lt;/li&gt;&lt;li&gt;remove_package_item_actions&lt;br /&gt;  allow removal (but not modification) of package items &lt;/li&gt;&lt;li&gt;add_package_item_actions&lt;br /&gt;  allow addition of new package items &lt;/li&gt;&lt;/ul&gt;Custom action also supported but up to now I still have to find out how.&lt;br /&gt;&lt;br /&gt;Sample model definition which overrides the default action.&lt;br /&gt;&lt;pre&gt;&amp;lt;type name="mynamespace:taskname"&amp;gt;&lt;br /&gt;    &amp;lt;parent&amp;gt;bpm:workflowTask&amp;lt;/parent&amp;gt;&lt;br /&gt;    &amp;lt;overrides&amp;gt;&lt;br /&gt;       &amp;lt;property name="bpm:packageActionGroup"&amp;gt;&lt;br /&gt;          &amp;lt;default&amp;gt;add_package_item_actions&amp;lt;/default&amp;gt;&lt;br /&gt;       &amp;lt;/property&amp;gt;&lt;br /&gt;       &amp;lt;property name="bpm:packageItemActionGroup"&amp;gt;&lt;br /&gt;          &amp;lt;default&amp;gt;edit_package_item_actions&amp;lt;/default&amp;gt;&lt;br /&gt;       &amp;lt;/property&amp;gt;&lt;br /&gt;    &amp;lt;/overrides&amp;gt;&lt;br /&gt;&amp;lt;/type&amp;gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;I guess this is enough for now.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/16500981-7089030185276262336?l=livinginjava.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='related' href='http://wiki.alfresco.com/wiki/WorkflowAdministration#Workflow_Package_Actions' title='Alfresco workflow package actions'/><link rel='replies' type='application/atom+xml' href='http://livinginjava.blogspot.com/feeds/7089030185276262336/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=16500981&amp;postID=7089030185276262336&amp;isPopup=true' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/16500981/posts/default/7089030185276262336'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/16500981/posts/default/7089030185276262336'/><link rel='alternate' type='text/html' href='http://livinginjava.blogspot.com/2008/11/alfresco-workflow-package-actions.html' title='Alfresco workflow package actions'/><author><name>Santoso</name><uri>http://www.blogger.com/profile/01534214022898572802</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='32' src='http://photos1.blogger.com/img/243/7914/640/Me.jpg'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-16500981.post-2398704353593056672</id><published>2008-11-24T00:56:00.004+07:00</published><updated>2008-11-24T01:23:36.992+07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='template'/><category scheme='http://www.blogger.com/atom/ns#' term='alfresco'/><title type='text'>Passing values to your freemarker template in alfresco</title><content type='html'>This story started when my teammate needed the value of JSESSIONID from alfresco and bla bla bla... So, in short, this is how I managed to pass the session id.&lt;br /&gt;&lt;br /&gt;&lt;ol&gt;&lt;li&gt;Create a simple model (javabean class) to pass the value to the template, in the class create a method to return a Map containing the values needed, the keys used to store the values are the keys that will be accessed in the template.&lt;/li&gt;&lt;code&gt;&lt;br /&gt;public Map getTemplateModel() {&lt;br /&gt;Map&lt;string, object=""&gt; result = new HashMap&lt;string, object=""&gt;();&lt;br /&gt;&lt;br /&gt;result.put("sessionId", getSessionId());&lt;br /&gt;&lt;br /&gt;return result;&lt;br /&gt;}&lt;br /&gt;&lt;/string,&gt;&lt;/string,&gt;&lt;/code&gt;&lt;br /&gt;&lt;li&gt;Register the class as a managed bean in WEB-INF/faces-config-custom.xml (pasting the content here is a bit difficult, until I know how to easily paste an xml content to the post I might not post it). Actually it's not that difficult to register a managed bean, just look at the sample in faces-config-beans.xml.&lt;/li&gt;&lt;pre&gt;&amp;lt;managed-bean&amp;gt;&lt;br /&gt; &amp;lt;description&amp;gt;&lt;br /&gt;    Helper bean providing access to http servlet request's related properties&lt;br /&gt;            and many other things.&lt;br /&gt; &amp;lt;/description&amp;gt;&lt;br /&gt; &amp;lt;managed-bean-name&amp;gt;SanzModel&amp;lt;/managed-bean-name&amp;gt;&lt;br /&gt; &amp;lt;managed-bean-class&amp;gt;com.sanz.model.TemplateModel&amp;lt;/managed-bean-class&amp;gt;&lt;br /&gt; &amp;lt;managed-bean-scope&amp;gt;session&amp;lt;/managed-bean-scope&amp;gt;&lt;br /&gt;&amp;lt;/managed-bean&amp;gt;&lt;/pre&gt;&lt;li&gt;Use the bean name as the model passed to the template.&lt;br /&gt;&lt;/li&gt;&lt;pre&gt;&amp;lt;r:template template="/alfresco/templates/elnusa/elnusa.html.ftl" model="#{Elnusa.templateModel}"/&amp;gt;&lt;/pre&gt;&lt;li&gt;Access the value in the template, just like the way default values provided by alfresco are accessed.&lt;/li&gt;&lt;/ol&gt;&lt;br /&gt;That's all, I guess I have to sleep now, already late...&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Reference :&lt;br /&gt;&lt;ol&gt;&lt;li&gt;&lt;a href="http://wiki.alfresco.com/wiki/Template_Guide#Custom_Models"&gt;Template Guide&lt;/a&gt;&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/16500981-2398704353593056672?l=livinginjava.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://livinginjava.blogspot.com/feeds/2398704353593056672/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=16500981&amp;postID=2398704353593056672&amp;isPopup=true' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/16500981/posts/default/2398704353593056672'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/16500981/posts/default/2398704353593056672'/><link rel='alternate' type='text/html' href='http://livinginjava.blogspot.com/2008/11/passing-values-to-your-freemarker.html' title='Passing values to your freemarker template in alfresco'/><author><name>Santoso</name><uri>http://www.blogger.com/profile/01534214022898572802</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='32' src='http://photos1.blogger.com/img/243/7914/640/Me.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-16500981.post-636958095036504537</id><published>2008-11-16T21:03:00.007+07:00</published><updated>2008-12-05T18:03:48.621+07:00</updated><title type='text'>How to create a custom dashlet in Alfresco</title><content type='html'>On this post, I'll try to put in a simple example on creating a hello dashlet.&lt;br /&gt;I'm using a standalone Alfresco (apache tomcat included).&lt;br /&gt;&lt;br /&gt;Step by step on creating dashlet in Alfresco :&lt;br /&gt;&lt;ol&gt;&lt;li&gt;Create a freemarker template for the dashlet and name it filename.html.ftl (e.g. hello.html.ftl). For freemarker syntax please see http://freemarker.org/. Sample content :&lt;br /&gt;&lt;/li&gt;&lt;pre&gt;&lt;#assign name = person.properties.userName&gt;&lt;br /&gt;Hello ${name}&lt;br /&gt;&lt;/pre&gt;&lt;li&gt;Save the file in tomcat\webapps\alfresco\WEB-INF\classes\alfresco\templates\, you could also a directory inside and put your file in your directory.&lt;/li&gt;&lt;li&gt;Create a jsp file that will include the template file created on step 1. The content of the jsp file would be :&lt;/li&gt;&lt;pre&gt;&amp;lt;%@ taglib uri="/WEB-INF/repo.tld" prefix="r" %&amp;gt;&lt;br /&gt;&lt;br /&gt;&lt;%-- Note that this template is loaded from the classpath --%&gt;&lt;br /&gt;&amp;lt;r:template template="/alfresco/templates/hello.html.ftl"&amp;gt;&lt;br /&gt;&amp;lt;/r:template&amp;gt;&lt;/pre&gt;&lt;br /&gt;&lt;li&gt;Save the jsp file in tomcat\webapps\alfresco\jsp\dashboards\dashlets.&lt;/li&gt;&lt;li&gt;Open web-client-config.xml, you can find it in tomcat\webapps\alfresco\WEB-INF\classes\alfresco.&lt;/li&gt;&lt;li&gt;Register the new dashlet, find "dashlets" (without quotes) in web-client-config.xml, add the following configuration :&lt;/li&gt;&lt;pre&gt;&amp;lt;dashlet id="hello" label="Hello Dashlet"&lt;br /&gt;     description="My Hello Dashlet"&lt;br /&gt;     jsp="/jsp/dashboards/dashlets/hello.jsp"&amp;gt;&lt;br /&gt;&amp;lt;/dashlet&amp;gt;&lt;br /&gt;&lt;/pre&gt;&lt;li&gt;To see the new dashlet in action, just restart alfresco, login, configure the dashboard and pick the new dashlet.&lt;/li&gt;&lt;/ol&gt;&lt;br /&gt;That's all the steps for creating a simple dashlet, the key lies on the free marker template (besides the configuration), you could put almost anything over there to render anything you want (of course as long as it's possible :)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/16500981-636958095036504537?l=livinginjava.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://livinginjava.blogspot.com/feeds/636958095036504537/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=16500981&amp;postID=636958095036504537&amp;isPopup=true' title='22 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/16500981/posts/default/636958095036504537'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/16500981/posts/default/636958095036504537'/><link rel='alternate' type='text/html' href='http://livinginjava.blogspot.com/2008/11/how-to-create-custom-dashlet-in.html' title='How to create a custom dashlet in Alfresco'/><author><name>Santoso</name><uri>http://www.blogger.com/profile/01534214022898572802</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='32' src='http://photos1.blogger.com/img/243/7914/640/Me.jpg'/></author><thr:total>22</thr:total></entry><entry><id>tag:blogger.com,1999:blog-16500981.post-7547846783398794154</id><published>2008-10-29T21:41:00.003+07:00</published><updated>2008-10-29T21:59:28.901+07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='apache timeout'/><title type='text'>Apache ......&gt; 2 mins ...... JBoss = Timeout</title><content type='html'>The thing is when the report is prepared it might took around 2-3 minutes, and the user after 2 minutes saw a blank page on their browser, no explanation, no clue, nothing.&lt;br /&gt;&lt;br /&gt;We have Apache web server works as a proxy to JBoss and we use mod_proxy here (why not proxy_ajp/mod_jk? because we want to simulate our client's config --&gt; they won't allow us to add additional module to their server).&lt;br /&gt;&lt;br /&gt;Looking at the log, found the exception :&lt;br /&gt;ClientAbortException: java.net.SocketException: Broken pipe&lt;br /&gt;....&lt;br /&gt;&lt;br /&gt;The first idea came to my mind is it must be the browser that send the timeout signal to the server, opening about:config on the browser (Do you know the browser I'm using?) only to find that the timeout configuration is 300 (5 mins). It seems that it's not the browser to blame on the timeout.&lt;br /&gt;&lt;br /&gt;The second idea, it's broken pipe... is it possible that apache buffer is not large enough? Then other idea come up, is it possible that Apache is the one to "blame" for causing the timeout?&lt;br /&gt;Yep, indeed, the default timeout configuration (/etc/httpd/httpd.conf) is 120secs.&lt;br /&gt;&lt;br /&gt;#&lt;br /&gt;# Timeout: The number of seconds before receives and sends time out.&lt;br /&gt;#&lt;br /&gt;Timeout 120&lt;br /&gt;&lt;br /&gt;Changing it to 300 (5 mins) should be enough to allow the report to be prepared fully.&lt;br /&gt;&lt;br /&gt;One problem solved, one lesson learned and one happy customer we got.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/16500981-7547846783398794154?l=livinginjava.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://livinginjava.blogspot.com/feeds/7547846783398794154/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=16500981&amp;postID=7547846783398794154&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/16500981/posts/default/7547846783398794154'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/16500981/posts/default/7547846783398794154'/><link rel='alternate' type='text/html' href='http://livinginjava.blogspot.com/2008/10/apache-2-mins-jboss-timeout.html' title='Apache ......&gt; 2 mins ...... JBoss = Timeout'/><author><name>Santoso</name><uri>http://www.blogger.com/profile/01534214022898572802</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='32' src='http://photos1.blogger.com/img/243/7914/640/Me.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-16500981.post-8136500415963453855</id><published>2008-10-23T19:37:00.004+07:00</published><updated>2009-05-29T22:13:58.172+07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='jboss'/><title type='text'>Setting JBoss IP address</title><content type='html'>Starting jboss without configuring the ip address will set the default address for jboss to localhost which is fit for development or maybe for a production server, where apache is used as the proxy to jboss and resides in the same machine.&lt;br /&gt;&lt;br /&gt;To set the ip address for JBoss :&lt;br /&gt;&lt;ul&gt;&lt;li&gt;To a specific IP address&lt;br /&gt;&lt;/li&gt;run.sh -b 10.62.31.31&lt;br /&gt;&lt;li&gt;To localhost or the IP address assigned to the server&lt;br /&gt;&lt;/li&gt;run.sh -b 0.0.0.0&lt;br /&gt;&lt;/ul&gt;There's all to set the ip address, somehow I still wonder why JBoss prefer this way to configure the ip address :)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/16500981-8136500415963453855?l=livinginjava.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://livinginjava.blogspot.com/feeds/8136500415963453855/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=16500981&amp;postID=8136500415963453855&amp;isPopup=true' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/16500981/posts/default/8136500415963453855'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/16500981/posts/default/8136500415963453855'/><link rel='alternate' type='text/html' href='http://livinginjava.blogspot.com/2008/10/setting-jboss-ip-address.html' title='Setting JBoss IP address'/><author><name>Santoso</name><uri>http://www.blogger.com/profile/01534214022898572802</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='32' src='http://photos1.blogger.com/img/243/7914/640/Me.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-16500981.post-670046911366669415</id><published>2008-10-11T12:37:00.006+07:00</published><updated>2011-03-18T10:48:10.086+07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='java'/><category scheme='http://www.blogger.com/atom/ns#' term='remote debug'/><title type='text'>Debugging application server as remote application</title><content type='html'>The need was to debug Resin 3.1.0 in eclipse, however there's no plugin for Resin 3.1.0 in eclipse (at least until now) to my own amazement.&lt;br /&gt;Fortunately, there's still a workaround which is to debug the application server as if it is a remote java application.&lt;br /&gt;&lt;br /&gt;To do that, we need to add the parameter below before starting the server&lt;br /&gt;&lt;br /&gt;-Xdebug -Xnoagent -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=12345&lt;br /&gt;&lt;br /&gt;(-Xnoagent already deprecated, we could remove it anyway, so why do I put it there? Just to let you know that it exists and if you still use JDK1.1 then use it otherwise loose it)&lt;br /&gt;&lt;br /&gt;Adding the parameter above means that we could attach a debugger to localhost:12345 (assuming I'm debugging application server running at my computer), the address could be adjusted to a different port as long as the port is unused.&lt;br /&gt;&lt;br /&gt;Then on the IDE of your choice (I've tried eclipse and netbeans), just open a remote debug session and put localhost as the host and 12345 as the port. If your IDE successfully attaching a debugger to the server, then all you need to do is set breakpoint(s) to your application code which was deployed to the server. Access the application and the server will be suspended when it arrives at the breakpoint set before.&lt;br /&gt;&lt;br /&gt;That's all for now, any question just shoot.&lt;br /&gt;&lt;br /&gt;Note : I'm not explaining all those parameters in detail, if you're interested, please visit this &lt;a href="http://java.sun.com/j2se/1.4.2/docs/guide/jpda/conninv.html"&gt;link&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/16500981-670046911366669415?l=livinginjava.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='related' href='http://java.sun.com/j2se/1.4.2/docs/guide/jpda/conninv.html' title='Debugging application server as remote application'/><link rel='replies' type='application/atom+xml' href='http://livinginjava.blogspot.com/feeds/670046911366669415/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=16500981&amp;postID=670046911366669415&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/16500981/posts/default/670046911366669415'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/16500981/posts/default/670046911366669415'/><link rel='alternate' type='text/html' href='http://livinginjava.blogspot.com/2008/10/debugging-application-server-as-remote.html' title='Debugging application server as remote application'/><author><name>Santoso</name><uri>http://www.blogger.com/profile/01534214022898572802</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='32' src='http://photos1.blogger.com/img/243/7914/640/Me.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-16500981.post-629662666802754356</id><published>2008-10-08T00:10:00.003+07:00</published><updated>2008-10-08T00:21:44.435+07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='java'/><category scheme='http://www.blogger.com/atom/ns#' term='web script'/><category scheme='http://www.blogger.com/atom/ns#' term='alfresco'/><title type='text'>Calling webscript with no Basic authentication</title><content type='html'>My case was that I need to invoke web script without triggering the HTTP basic authenticator, 1 week of reading the wiki and googling, I almost accept that web script requires HTTP basic authentication.&lt;br /&gt;But thanks to the answer on my alfresco &lt;a href="http://forums.alfresco.com/en/viewtopic.php?f=12&amp;amp;t=14660&amp;amp;start=0&amp;amp;st=0&amp;amp;sk=t&amp;amp;sd=a"&gt;post&lt;/a&gt;, there are 3 ways of authentication for web script.&lt;br /&gt;&lt;br /&gt;&lt;ol&gt;&lt;li&gt;&lt;tt&gt;/alfresco/service&lt;/tt&gt; or &lt;tt&gt;/alfresco/s&lt;/tt&gt; (mapped to HTTP Basic Authenticator) &lt;/li&gt;&lt;li&gt;&lt;tt&gt;/alfresco/wcservice&lt;/tt&gt; or &lt;tt&gt;/alfresco/wcs&lt;/tt&gt; (mapped to Web Client Authenticator) &lt;/li&gt;&lt;li&gt;&lt;tt&gt;/alfresco/168service&lt;/tt&gt; or &lt;tt&gt;/alfresco/168s&lt;/tt&gt; (mapped to JSR-68 Authenticator) &lt;/li&gt;&lt;/ol&gt;&lt;br /&gt;I could use /alfresco/wcs to invoke my web script from my dashlet without popping up the authentication dialog box and it opens up the possibilities for me integrating other applications :)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/16500981-629662666802754356?l=livinginjava.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='related' href='http://wiki.alfresco.com/wiki/Web_Script_Runtimes#Pre-defined_web_script_URL_mappings' title='Calling webscript with no Basic authentication'/><link rel='replies' type='application/atom+xml' href='http://livinginjava.blogspot.com/feeds/629662666802754356/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=16500981&amp;postID=629662666802754356&amp;isPopup=true' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/16500981/posts/default/629662666802754356'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/16500981/posts/default/629662666802754356'/><link rel='alternate' type='text/html' href='http://livinginjava.blogspot.com/2008/10/calling-webscript-with-no-basic.html' title='Calling webscript with no Basic authentication'/><author><name>Santoso</name><uri>http://www.blogger.com/profile/01534214022898572802</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='32' src='http://photos1.blogger.com/img/243/7914/640/Me.jpg'/></author><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-16500981.post-4456019000281869878</id><published>2008-10-05T22:06:00.004+07:00</published><updated>2008-10-06T00:04:26.575+07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='dashlet'/><category scheme='http://www.blogger.com/atom/ns#' term='alfresco'/><title type='text'>Custom dashlets (alfresco again)</title><content type='html'>I couldn't believe it, is it me or is it alfresco documentation that sometimes seems to be unfriendly. Here's the case, I was thinking of having my own dashlet, I went to http://wiki.alfresco.com/wiki/User_Configurable_Dashboards#Writing_Dashboard_Components,  done creating the jsp page, I didn't know how to make my dashlet appears on the "magic list" of dashlet components.&lt;br /&gt;&lt;br /&gt;I then read from a source which told me to add my dashlet to the web-client-config.xml, tried that and it was successfull. But I was still curious where did I do wrong during reading the manual that I didn't even notice that configuration file, it turns out that the section that explain about the configuration file is "&lt;span style="font-weight: bold;"&gt;Configuring Available Components&lt;/span&gt;", and down below on the section "&lt;span style="font-weight: bold;"&gt;Writing Dashboard Components&lt;/span&gt;" doesn't put any clue that I have to add/register the new dashlet over there (at that time I just skimmed through the configuring part since it says "available" component).&lt;br /&gt;&lt;br /&gt;I guess I have to read alfresco's documentation thoroughly and carefully, but I'm not being ungrateful here, I'm really do grateful for Alfresco, but please if a nice and friendly sample could be written, please write it for people like me.&lt;br /&gt;&lt;br /&gt;Just a reminder for me on how to create a dashlet :&lt;br /&gt;&lt;ol&gt;&lt;li&gt;Prepare a template (free marker) and put it in WEB-INF/classes/alfresco/template (I believe this step is optional)&lt;/li&gt;&lt;li&gt;Prepare the jsp page that refer to the template (if you create one) and put the jsp file in jsp/dashboards/dashlets (should it always be this directory? got to find out, not now though.. I wanna sleep)&lt;/li&gt;&lt;li&gt;Add/register the newly created dashlet to web-client-config.xml in WEB-INF/classes/alfresco&lt;/li&gt;&lt;/ol&gt;&lt;br /&gt;Once again, I'm grateful for Alfresco but I'll be more grateful if there could be a friendlier documentation (or could I help?)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/16500981-4456019000281869878?l=livinginjava.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://livinginjava.blogspot.com/feeds/4456019000281869878/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=16500981&amp;postID=4456019000281869878&amp;isPopup=true' title='5 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/16500981/posts/default/4456019000281869878'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/16500981/posts/default/4456019000281869878'/><link rel='alternate' type='text/html' href='http://livinginjava.blogspot.com/2008/10/custom-dashlets-alfresco-again.html' title='Custom dashlets (alfresco again)'/><author><name>Santoso</name><uri>http://www.blogger.com/profile/01534214022898572802</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='32' src='http://photos1.blogger.com/img/243/7914/640/Me.jpg'/></author><thr:total>5</thr:total></entry><entry><id>tag:blogger.com,1999:blog-16500981.post-1812877862142655875</id><published>2008-10-04T21:23:00.003+07:00</published><updated>2008-10-06T23:01:21.359+07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='java'/><category scheme='http://www.blogger.com/atom/ns#' term='alfresco'/><title type='text'>Starting an alfresco workflow using Javascript API</title><content type='html'>The script to execute workflow is as below :&lt;br /&gt;&lt;br /&gt;var workflow = actions.create("start-workflow");&lt;br /&gt;workflow.parameters.workflowName = "jbpm$sanz:testWorkflow";&lt;br /&gt;workflow.parameters["bpm:workflowDescription"] = upload.name;&lt;br /&gt;workflow.parameters["bpm:groupAssignee"] = people.getGroup("GROUP_IT Manager");&lt;br /&gt;workflow.parameters["sanz:notifyMe"] = true;&lt;br /&gt;var futureDate = new Date();&lt;br /&gt;futureDate.setDate(futureDate.getDate() + 7);&lt;br /&gt;workflow.parameters["bpm:workflowDueDate"] = futureDate;&lt;br /&gt;workflow.execute(document);&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;A bit explanation :&lt;br /&gt;&lt;ul&gt;&lt;li&gt;"start-workflow" is the action name to create a workflow action (see Action API)&lt;/li&gt;&lt;li&gt;workflow name is prefixed by "jbpm$", the workflow name used is the name set  in the process definition along with its namespace&lt;/li&gt;&lt;li&gt;other parameters as defined in the task(inside the start-state) 's type could be set here, e.g. the "sanz:notifyMe" property in the example above&lt;/li&gt;&lt;li&gt;pass a document (Content noderef) to workflow.execute. Remember if we start a workflow from the web-client interface, we always start from a content/document&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;Tips :&lt;br /&gt;&lt;ul&gt;&lt;li&gt;if you want to pass a group as the groupAssignee, we can use people.getGroup(groupName) API, but one thing to note, the group name to pass is : GROUP_group name. You should add "GROUP_" prefix to your group name.&lt;/li&gt;&lt;li&gt;to pass assignee, use people.getPerson(assignee name)&lt;/li&gt;&lt;li&gt;to pass assigness, wrap the assigness as array, using [], e.g. [people.getPerson("me"), people.getPerson("you")]&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;I guess that's all for now. Next target, synchronize user/group to ldap (or from ldap?)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/16500981-1812877862142655875?l=livinginjava.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://livinginjava.blogspot.com/feeds/1812877862142655875/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=16500981&amp;postID=1812877862142655875&amp;isPopup=true' title='10 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/16500981/posts/default/1812877862142655875'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/16500981/posts/default/1812877862142655875'/><link rel='alternate' type='text/html' href='http://livinginjava.blogspot.com/2008/10/starting-alfresco-workflow-using.html' title='Starting an alfresco workflow using Javascript API'/><author><name>Santoso</name><uri>http://www.blogger.com/profile/01534214022898572802</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='32' src='http://photos1.blogger.com/img/243/7914/640/Me.jpg'/></author><thr:total>10</thr:total></entry><entry><id>tag:blogger.com,1999:blog-16500981.post-4244047419215736281</id><published>2008-10-04T14:15:00.010+07:00</published><updated>2009-01-22T23:05:34.580+07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='java'/><category scheme='http://www.blogger.com/atom/ns#' term='alfresco'/><title type='text'>Custom workflow in alfresco</title><content type='html'>Alfresco, at first glance it looks like just another document management system.. wait, I'm not here to talk about alfresco as a DMS, let's get back to the main topic.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:130%;"&gt;&lt;span style="font-weight: bold;"&gt;How to create a custom advance workflow in Alfresco&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;Before continuing, the main reason I'm writing this is to make life a lot simpler for developers who are told to create an advance workflow (I hope), where I'm having a hard time myself creating one.&lt;br /&gt;&lt;br /&gt;One thing to note, I'm not repeating what is already in the manual, so better to read the manual first.&lt;br /&gt;&lt;ol&gt;&lt;li&gt;Read http://wiki.alfresco.com/wiki/WorkflowAdministration first.&lt;/li&gt;&lt;li&gt;Create the process definition, things to note :&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Declare the swimlane for each actor/group of actors, one special swimlane called Initiator (which represent the initiator of the workflow)&lt;/li&gt;&lt;li&gt;Another special state is start-state, this is the point where we collect required parameters for the workflow to start, e.g. the reviewer, due date, etc (just remember this at this moment).&lt;/li&gt;&lt;li&gt;Declare task for each task-node&lt;br /&gt;&lt;/li&gt;&lt;li&gt;For each task declared, specify the swimlane (if we don't, who will handle the task?)&lt;/li&gt;&lt;li&gt;For each task declared, specify a name for the task. The task name relates to the type of model that we will use, either create a new one or use an existing, e.g. wf:submitAdhocTask&lt;/li&gt;&lt;li&gt;Deploy the new process definition, it's easier to deploy the process through JBoss jBPM Process Designer&lt;/li&gt;&lt;li&gt;Alternatively instead of using the process designer, you could put your definition file in  [Alfresco installation]\tomcat\webapps\alfresco\WEB-INF\classes\alfresco\extension, create a "workflowDeployer" spring configuration and add the spring configuration to classes/alfresco/application-context.xml&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;li&gt;Create a new model or use an existing one. To create a new model :&lt;br /&gt;&lt;ul&gt;&lt;li&gt;You can safely follow what's in the manual (step 2 : Create the task model)&lt;/li&gt;&lt;li&gt;Declare your own namespace (for those who aren't familiar with xml terms, namespace is like a package in Java, you could specify your own URI)&lt;/li&gt;&lt;li&gt;Import bpm's type, by adding the import statement specifying the bpm uri.&lt;br /&gt;&lt;pre&gt;&lt;import uri="http://www.alfresco.org/model/bpm/1.0" prefix="bpm"&gt;&lt;/import&gt;&lt;/pre&gt;&lt;/li&gt;&lt;li&gt;Create type for each task in the process definition, to be exact, the name of the type is the same name as the task's name. Don't create the type if you use an existing one in your task&lt;/li&gt;&lt;li&gt;Each type should has a parent, remember that we're creating types for process not for other purpose, the parent should be a bpm type. For type for task in start-state, the parent is bpm:startTask, for the other, we could use bpm:workflowTask&lt;/li&gt;&lt;li&gt;To view/modify content on the workflow on a specific task,  we have a workflow package operation ready for use, see the manual on http://wiki.alfresco.com/wiki/WorkflowAdministration#Workflow_Package_Actions&lt;/li&gt;&lt;li&gt;Since the new type extends bpm's type, some properties are already in place, to introduce new one just declare the properties inside the type, see the manual on http://wiki.alfresco.com/wiki/WorkflowAdministration#Step_2:_Create_the_Task_Model&lt;/li&gt;&lt;li&gt;Deploy the model&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Put your model in [Alfresco installation]\tomcat\webapps\alfresco\WEB-INF\classes\alfresco\extension&lt;/li&gt;&lt;li&gt;Create a new spring configuration file to load the model. The file name should end with context.xml (e.g. my-file-context.xml), put it in extension directory, alfresco will pick it up when it starts, see the manual for sample spring beans definition on http://wiki.alfresco.com/wiki/WorkflowAdministration#Deploying_the_Task_Model&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Restart the server&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Create web client configuration, the purpose is alfresco doesn't know how to render the "type" that we just created, it needs the so called web-client configurator. I have nothing to say about this, so just read on the available manual One thing to note, update web-client-application-context.xml to load the custom web-client-xxx-config.xml&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Prepare resource bundle for the workflow, my advice is to look at workflow-messages.properties located at ...\classes\alfresco\workflow. Look at the pattern and follow it for your process and types.&lt;/li&gt;&lt;li&gt;Behavior can be added and I'm not going to discuss about it here. One note, it's a bit difficult for me to find a documentation on Alfresco Javascript API, if you're trying to find out what are the properties that a certain root object has, use Alfresco's javascript console and browse through the root object's properties&lt;/li&gt;&lt;li&gt;Use workflow console!!! the url is /alfresco/faces/jsp/admin/workflow-console.jsp. It can undeploy definitions, just what you need when you're in a development stage and still a lot of features that you will surely need&lt;/li&gt;&lt;/ol&gt;&lt;br /&gt;In summary, list of files created :&lt;br /&gt;&lt;ol&gt;&lt;li&gt;JPDL (process definition file)&lt;/li&gt;&lt;li&gt;if we do manual deployment, we need custom spring context to deploy the jpdl (along with the model also if needed)&lt;/li&gt;&lt;li&gt;model&lt;/li&gt;&lt;li&gt;custom spring context file (to load the model)&lt;/li&gt;&lt;li&gt;web client config file to tell alfresco how to render our model&lt;/li&gt;&lt;li&gt;Message properties&lt;br /&gt;&lt;/li&gt;&lt;/ol&gt;That's all for now and I might add some other things later. Indeed, it's exciting to use Alfresco, still a lot to learn.&lt;br /&gt;&lt;br /&gt;Another source that might help : http://ecmarchitect.com/archives/2007/06/09/756&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/16500981-4244047419215736281?l=livinginjava.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='related' href='http://wiki.alfresco.com/wiki/WorkflowAdministration' title='Custom workflow in alfresco'/><link rel='replies' type='application/atom+xml' href='http://livinginjava.blogspot.com/feeds/4244047419215736281/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=16500981&amp;postID=4244047419215736281&amp;isPopup=true' title='7 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/16500981/posts/default/4244047419215736281'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/16500981/posts/default/4244047419215736281'/><link rel='alternate' type='text/html' href='http://livinginjava.blogspot.com/2008/10/custom-workflow-in-alfresco.html' title='Custom workflow in alfresco'/><author><name>Santoso</name><uri>http://www.blogger.com/profile/01534214022898572802</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='32' src='http://photos1.blogger.com/img/243/7914/640/Me.jpg'/></author><thr:total>7</thr:total></entry><entry><id>tag:blogger.com,1999:blog-16500981.post-2487099804781854585</id><published>2008-10-01T00:28:00.005+07:00</published><updated>2008-10-01T00:47:59.210+07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='java'/><category scheme='http://www.blogger.com/atom/ns#' term='headless'/><title type='text'>java.awt.headless</title><content type='html'>We were using JFreeChart at that time, on our development machine everything ran smooth, chart appeared, no error. Until we deployed it on the production server (wait, am I not mentioning any staging server here? yep, no staging server mentioned.. just another recipe for disaster), the chart was gone, error message was the only clue we had. Google here, google there and we ended up with this great remedy that saved our asses.&lt;br /&gt;&lt;br /&gt;The error message was :&lt;br /&gt;&lt;pre&gt;Can't connect to X11 window server using ':0.0' as the value of the&lt;br /&gt;          DISPLAY variable.&lt;br /&gt;   java.lang.InternalError: Can't connect to X11 window server&lt;br /&gt;          using ':0.0' as the value of the DISPLAY variable.&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;I've tried to set the DISPLAY variable in the environment to no avail, the other solution we found was to set java.awt.headless=true, indeed this was the option that we need to add before we run the server.&lt;br /&gt;The key was on the production server there was no X-server running (we used rhel), everything done thru the console (which bring to my mind, what is wrong with having a nice GUI helping you, instead of all in text... i'm not against it, I'm just looking for improvement).&lt;br /&gt;Setting headless to true, tells the jvm that it lacks either display device, keyboard or mouse. Luckily for us JFreeChart doesn't use any graphical components that requires a display device.&lt;br /&gt;&lt;br /&gt;One more thing to consider if someone is going to build a component related to displaying things on screen.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/16500981-2487099804781854585?l=livinginjava.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='related' href='http://java.sun.com/developer/technicalArticles/J2SE/Desktop/headless/' title='java.awt.headless'/><link rel='replies' type='application/atom+xml' href='http://livinginjava.blogspot.com/feeds/2487099804781854585/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=16500981&amp;postID=2487099804781854585&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/16500981/posts/default/2487099804781854585'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/16500981/posts/default/2487099804781854585'/><link rel='alternate' type='text/html' href='http://livinginjava.blogspot.com/2008/10/javaawtheadless.html' title='java.awt.headless'/><author><name>Santoso</name><uri>http://www.blogger.com/profile/01534214022898572802</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='32' src='http://photos1.blogger.com/img/243/7914/640/Me.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-16500981.post-996948950956217073</id><published>2008-08-21T00:15:00.002+07:00</published><updated>2008-08-21T00:26:49.024+07:00</updated><title type='text'>Write once run everywhere, eh??</title><content type='html'>Writing a desktop application in Java means dreaming of an application that we wish will run on any platform. One "fatal" mistake that I saw today, i.e. assuming that the file separator is "\", guess on which platform the application was developed.&lt;br /&gt;&lt;br /&gt;To avoid this kind of mistake, simply use File.pathSeparator instead of hardcoding "\" in the code.&lt;br /&gt;&lt;br /&gt;Thread, if we playing around with thread, make sure that your threads won't cause any deadlock, if it run in windows, don't you ever believe 100% that it will run in *nix. Each os has different way of scheduling threads, so beware.&lt;br /&gt;&lt;br /&gt;Drawing on canvas, handling mouse events, creating custom component, if your code does this, test it on all platforms before you claim that it runs everywhere (at least windows, linux, mac).&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;It seems the dream of having an application which runs anywhere is not yet fully realized. But still I'm grateful for what Java provides now and will look for the realization of the dream.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/16500981-996948950956217073?l=livinginjava.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://livinginjava.blogspot.com/feeds/996948950956217073/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=16500981&amp;postID=996948950956217073&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/16500981/posts/default/996948950956217073'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/16500981/posts/default/996948950956217073'/><link rel='alternate' type='text/html' href='http://livinginjava.blogspot.com/2008/08/write-once-run-everywhere-eh.html' title='Write once run everywhere, eh??'/><author><name>Santoso</name><uri>http://www.blogger.com/profile/01534214022898572802</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='32' src='http://photos1.blogger.com/img/243/7914/640/Me.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-16500981.post-6220840772288320366</id><published>2008-08-07T18:23:00.002+07:00</published><updated>2008-08-07T19:31:25.655+07:00</updated><title type='text'>Quantity Always Trumps Quality</title><content type='html'>I hate to say it but I got to admit that this &lt;a href="http://www.codinghorror.com/blog/archives/001160.html"&gt;article&lt;/a&gt; has a good argument. I always think that quality is more important than quantity, for example in coding. But I have to admit, only by experience that your quality will be improved.&lt;br /&gt;&lt;br /&gt;Mind that. No practice, no improvement on quality :)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/16500981-6220840772288320366?l=livinginjava.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='related' href='http://www.codinghorror.com/blog/archives/001160.html' title='Quantity Always Trumps Quality'/><link rel='replies' type='application/atom+xml' href='http://livinginjava.blogspot.com/feeds/6220840772288320366/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=16500981&amp;postID=6220840772288320366&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/16500981/posts/default/6220840772288320366'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/16500981/posts/default/6220840772288320366'/><link rel='alternate' type='text/html' href='http://livinginjava.blogspot.com/2008/08/quantity-always-trumps-quality.html' title='Quantity Always Trumps Quality'/><author><name>Santoso</name><uri>http://www.blogger.com/profile/01534214022898572802</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='32' src='http://photos1.blogger.com/img/243/7914/640/Me.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-16500981.post-801589531415468493</id><published>2008-08-05T23:42:00.003+07:00</published><updated>2008-08-05T23:51:17.814+07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='framework'/><title type='text'>I don't believe in a framework unless I got the source</title><content type='html'>As the title said, I don't believe in a framework unless I got the source. The sole reason is the source code is my pass out of trouble (though sometimes it doesn't).&lt;br /&gt;&lt;br /&gt;Consider this, you're picking out a framework and after some research you decide to use it in your project. Everybody happy until some weird things happen, you've follow all the procedures still you got this weird things hampering you.&lt;br /&gt;&lt;br /&gt;No code = no explanation = hoping that somebody out there also experience this and have their way out so that you could follow them and hopefully your problem will be solved too... finger crossed.&lt;br /&gt;&lt;br /&gt;I hope now you know what I mean with having the source code is my pass out of this kind of weird behavior.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Note : I just involved in .NET development, strange errors occurred and it's difficult to reproduce (it is there, 100%!!!). Staring at the code, don't know what is really going on, all that I could do is googling and trying to find a workaround.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/16500981-801589531415468493?l=livinginjava.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://livinginjava.blogspot.com/feeds/801589531415468493/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=16500981&amp;postID=801589531415468493&amp;isPopup=true' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/16500981/posts/default/801589531415468493'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/16500981/posts/default/801589531415468493'/><link rel='alternate' type='text/html' href='http://livinginjava.blogspot.com/2008/08/i-dont-believe-in-framework-unless-i.html' title='I don&apos;t believe in a framework unless I got the source'/><author><name>Santoso</name><uri>http://www.blogger.com/profile/01534214022898572802</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='32' src='http://photos1.blogger.com/img/243/7914/640/Me.jpg'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-16500981.post-2959502353500053901</id><published>2008-03-18T22:19:00.002+07:00</published><updated>2008-03-18T22:52:52.223+07:00</updated><title type='text'>You should not be alone</title><content type='html'>When you think that you're alone, you should not be alone.&lt;br /&gt;Especially if you're in a position where you should decide what to do, which way to go, how do things should be done, how do we organize things, how to we adhere to standards, etc.&lt;br /&gt;&lt;br /&gt;Remember, you have your team supporting you, talk with them (not to them) and heaven knows, they will give you input that you never think of before.&lt;br /&gt;It just a matter of gathering scattered information and from there on make the decision and learn from it.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/16500981-2959502353500053901?l=livinginjava.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://livinginjava.blogspot.com/feeds/2959502353500053901/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=16500981&amp;postID=2959502353500053901&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/16500981/posts/default/2959502353500053901'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/16500981/posts/default/2959502353500053901'/><link rel='alternate' type='text/html' href='http://livinginjava.blogspot.com/2008/03/you-should-not-be-alone.html' title='You should not be alone'/><author><name>Santoso</name><uri>http://www.blogger.com/profile/01534214022898572802</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='32' src='http://photos1.blogger.com/img/243/7914/640/Me.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-16500981.post-4757326816520641780</id><published>2008-03-10T23:36:00.002+07:00</published><updated>2008-03-10T23:44:42.449+07:00</updated><title type='text'>Many to many relationship in JPA</title><content type='html'>I'm using JPA here and I got two objects A and B, the relationship is many to many and B is the owner.&lt;br /&gt;I want to delete object A but still preserving B, the problem is I got a constraint exception since there's a record in the link table which keep a reference to the record that I intended to delete in A.&lt;br /&gt;&lt;br /&gt;The solution is to create a native query to remove the row in the link table, then I can remove A.&lt;br /&gt;Hibernate (as my friend said) doesn't have this limitation, so far I don't find the same solution in JPA.&lt;br /&gt;&lt;br /&gt;Regarding HQL, there're times where I must revert back to native query to get things done correctly and I wonder is it me that doesn't really know HQL or is it HQL's limitation? sample case I hope will follow later.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/16500981-4757326816520641780?l=livinginjava.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://livinginjava.blogspot.com/feeds/4757326816520641780/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=16500981&amp;postID=4757326816520641780&amp;isPopup=true' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/16500981/posts/default/4757326816520641780'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/16500981/posts/default/4757326816520641780'/><link rel='alternate' type='text/html' href='http://livinginjava.blogspot.com/2008/03/many-to-many-relationship-in-jpa.html' title='Many to many relationship in JPA'/><author><name>Santoso</name><uri>http://www.blogger.com/profile/01534214022898572802</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='32' src='http://photos1.blogger.com/img/243/7914/640/Me.jpg'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-16500981.post-1194327368538574889</id><published>2008-03-01T01:56:00.004+07:00</published><updated>2008-03-01T02:10:43.920+07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='javascript'/><category scheme='http://www.blogger.com/atom/ns#' term='debugger'/><title type='text'>Firebug</title><content type='html'>&lt;a href="http://www.getfirebug.com/"&gt;Firebug&lt;/a&gt;,&lt;br /&gt;&lt;br /&gt;It's amazing, I just can't stop recommending firebug to all my colleagues. It's almost like all in one package solution, so far I almost ditch WebDeveloper plugin away (almost here... :) but I'm keeping it in case I might need it.&lt;br /&gt;&lt;br /&gt;From modifying css "live", debugging javascript until modifying html element "live", all these you can do in firebug.&lt;br /&gt;&lt;br /&gt;I'm not Firebug evangelist, I'm just being a satisfied customer here :) very very satisfied one.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/16500981-1194327368538574889?l=livinginjava.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='related' href='http://www.getfirebug.com/' title='Firebug'/><link rel='replies' type='application/atom+xml' href='http://livinginjava.blogspot.com/feeds/1194327368538574889/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=16500981&amp;postID=1194327368538574889&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/16500981/posts/default/1194327368538574889'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/16500981/posts/default/1194327368538574889'/><link rel='alternate' type='text/html' href='http://livinginjava.blogspot.com/2008/03/firebug.html' title='Firebug'/><author><name>Santoso</name><uri>http://www.blogger.com/profile/01534214022898572802</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='32' src='http://photos1.blogger.com/img/243/7914/640/Me.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-16500981.post-3335444995716842511</id><published>2008-02-28T00:01:00.003+07:00</published><updated>2008-03-01T02:09:47.475+07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='load balancing'/><category scheme='http://www.blogger.com/atom/ns#' term='apache'/><title type='text'>Load balancing</title><content type='html'>,A nice &lt;a href="http://www.theserverside.com/tt/knowledgecenter/knowledgecenter.tss?l=LoadBalancingTomcatApache"&gt;article &lt;/a&gt;on load balancing with apache, somehow until now I never met someone who use load balancer (even on a big project) and this makes me think... do we really need a load balancer? What are the cases where load balancer is really required?&lt;br /&gt;It seems that upgrading the server is the preferred choice, personally I'm waiting for a chance where I can setup a load balancer :)&lt;br /&gt;&lt;br /&gt;One more thing that I'm looking forward to see is transparent failover, hopefully I'll see one sooner rather than later.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/16500981-3335444995716842511?l=livinginjava.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='related' href='http://www.theserverside.com/tt/knowledgecenter/knowledgecenter.tss?l=LoadBalancingTomcatApache' title='Load balancing'/><link rel='replies' type='application/atom+xml' href='http://livinginjava.blogspot.com/feeds/3335444995716842511/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=16500981&amp;postID=3335444995716842511&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/16500981/posts/default/3335444995716842511'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/16500981/posts/default/3335444995716842511'/><link rel='alternate' type='text/html' href='http://livinginjava.blogspot.com/2008/02/load-balancing.html' title='Load balancing'/><author><name>Santoso</name><uri>http://www.blogger.com/profile/01534214022898572802</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='32' src='http://photos1.blogger.com/img/243/7914/640/Me.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-16500981.post-5149099988862263604</id><published>2008-02-26T20:57:00.002+07:00</published><updated>2008-02-26T21:13:24.681+07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='jsf'/><title type='text'>JSF strange behaviors</title><content type='html'>Two strange behavior of JSF (at least this is what I remembered)&lt;br /&gt;1. Your backing bean only specify getter method (in my case, it returns a collection) and you're using it in h:dataTable. Submitting the form (invoking any action on the page) does nothing, no exception, no sign of anything happening... not a single clue. After one hour wasted, I found out that creating a setter method solves it. It seems that JSF try to call the setter and then fails ungracefully.&lt;br /&gt;&lt;br /&gt;2. I have a selectOneMenu and I use a getter method for the selectItems, the List of SelectItem are created whenever the getter is invoked (I know it's not good, just hear the story :). Accessing the page yields exception complaining that there is no selectItem provided (null). Strange thing is the getter method is invoked not in render phase, why? Long story short, I add a property in the backing bean holding the List of selectItem and the getter method is still the same getter method as previously, only at this time I initialize the collection once (better pattern, rite? ;). It works! No more error.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;These two strange behaviors that I remembered, are they somehow in the JSF specification?&lt;br /&gt;... I guess I have to try to find out myself.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/16500981-5149099988862263604?l=livinginjava.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://livinginjava.blogspot.com/feeds/5149099988862263604/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=16500981&amp;postID=5149099988862263604&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/16500981/posts/default/5149099988862263604'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/16500981/posts/default/5149099988862263604'/><link rel='alternate' type='text/html' href='http://livinginjava.blogspot.com/2008/02/jsf-strange-behaviors.html' title='JSF strange behaviors'/><author><name>Santoso</name><uri>http://www.blogger.com/profile/01534214022898572802</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='32' src='http://photos1.blogger.com/img/243/7914/640/Me.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-16500981.post-9084921116777847848</id><published>2007-11-16T22:12:00.000+07:00</published><updated>2007-11-16T23:25:23.027+07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='recursive'/><title type='text'>Recursive, is it good?</title><content type='html'>&lt;a href="http://www.dzone.com/links/want_a_job_reverse_a_string_the_sad_state_of_inte.html"&gt;Want a job? Reverse a string ...&lt;/a&gt;&lt;br /&gt;having read the blog above, remind me of an interview I had which exactly, asked me to write a code which reverse a string. The code I wrote was a simple for loop doing exactly what was asked, so simple a code that I'm so sure it won't have any bug.&lt;br /&gt;&lt;br /&gt;The blog I read made me think, was recursive really the code that was expected by my interviewer (which then became my boss for the shortest time of my employments' life... ever :p)&lt;br /&gt;Anyway, that's not what I'm talking about here, the point of interest is &lt;span style="font-weight: bold;"&gt;recursive.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Recursive, imho, is very useful, sometimes an undisputable way to solve a problem efficiently. &lt;span style="font-weight: bold;"&gt;BUT&lt;/span&gt;... it is not the silver bullet which will work efficiently for every problem. Yes, it will work undisputably well for layouting components (e.g. Swing, JSF), some mathematical stuffs (e.g. permutation), deleting folder and its content and many other things.&lt;br /&gt;&lt;br /&gt;Wise programmer will try to write a simple, elegant and performing code. Less bugs, easy to maintain, faster code, less memory consumed aren't those the traits we all want for our code (there are some more...).&lt;br /&gt;Only unwise programmer will try to write a recursive code for reversing a string, or maybe....&lt;br /&gt;only an interviewee who knows where this question lead to, will write it that way (and hoping that he will get the job at some high salary :p).&lt;br /&gt;&lt;br /&gt;It's really funny remembering that I've had this kind of test in my interview... If I did write a recursive code for reversing a string... was I a super programmer? or even a genius?&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/16500981-9084921116777847848?l=livinginjava.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='related' href='http://www.dzone.com/links/want_a_job_reverse_a_string_the_sad_state_of_inte.html' title='Recursive, is it good?'/><link rel='replies' type='application/atom+xml' href='http://livinginjava.blogspot.com/feeds/9084921116777847848/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=16500981&amp;postID=9084921116777847848&amp;isPopup=true' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/16500981/posts/default/9084921116777847848'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/16500981/posts/default/9084921116777847848'/><link rel='alternate' type='text/html' href='http://livinginjava.blogspot.com/2007/11/recursive-is-it-good.html' title='Recursive, is it good?'/><author><name>Santoso</name><uri>http://www.blogger.com/profile/01534214022898572802</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='32' src='http://photos1.blogger.com/img/243/7914/640/Me.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-16500981.post-2548545925666035029</id><published>2007-10-24T15:11:00.000+07:00</published><updated>2007-10-24T15:52:23.719+07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='grinder'/><category scheme='http://www.blogger.com/atom/ns#' term='wireshark'/><category scheme='http://www.blogger.com/atom/ns#' term='redirect'/><title type='text'>Sniffing your request-response data (how does server redirect?)</title><content type='html'>At first I was curious what are the data sent by the server to redirect the browser to the next page.&lt;br /&gt;&lt;br /&gt;My first try is to use &lt;a href="http://www.wireshark.org/"&gt;wireshark&lt;/a&gt; (it was ethereal before renamed to wireshark), unfortunately localhost traffic doesn't get sniffed. Then I try to install Microsoft loopback adapter, then again... wireshark doesn't detect the loopback adapter. I was thinking wireshark can do almost anything for me, unfortunately it didn't (or is it because of the os limitation? dunno).&lt;br /&gt;&lt;br /&gt;Looking up for tools, then I remembered back then I used &lt;a href="http://grinder.sourceforge.net/"&gt;Grinder&lt;/a&gt; as a proxy. Going to grinder's site, downloading the latest version (3.x), setting it up, it works! However (again), the output isn't exactly what I need.&lt;br /&gt;Going for the previous version of Grinder (2.x), got it, set it up, works like charm :) I analyze the data and here's what I found.&lt;br /&gt;&lt;br /&gt;&lt;span style=";font-family:verdana;font-size:85%;"  &gt;------ localhost:8080-&gt;localhost:4632 ------&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:verdana;font-size:85%;"  &gt;HTTP/1.1 302 Moved Temporarily&lt;/span&gt;&lt;br /&gt;&lt;span style=";font-family:verdana;font-size:85%;"  &gt;Server: Apache-Coyote/1.1&lt;/span&gt;&lt;br /&gt;&lt;span style=";font-family:verdana;font-size:85%;"  &gt;Location: http://localhost:8001/loadtracker/form/project-select.shtml?cid=1&amp;amp;clr=true&lt;/span&gt;&lt;br /&gt;&lt;span style=";font-family:verdana;font-size:85%;"  &gt;Content-Length: 0&lt;/span&gt;&lt;br /&gt;&lt;span style=";font-family:verdana;font-size:85%;"  &gt;Date: Wed, 24 Oct 2007 05:09:27 GMT&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;Interesting! HTTP/1.1 302 is the answer.&lt;br /&gt;&lt;br /&gt;I've heard that IE 7 doesn't redirect to the new location, my first guess maybe this was the cause :&lt;br /&gt;&lt;br /&gt;&lt;p  style="font-family:verdana;"&gt;&lt;span style="font-size:85%;"&gt;    If the 302 status code is received in response to a request other    than GET or HEAD, the user agent MUST NOT automatically redirect the    request unless it can be confirmed by the user, since this might    change the conditions under which the request was issued.&lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;But it said that the request is a GET/HEAD and mine is POST (after login). Probably it is the security setting in IE that blocks it, not replicated in my IE.. yet.&lt;br /&gt;&lt;br /&gt;Anyway, I'm not talking about IE here, Grinder will be quite handy for everyone who want to investigate the request-response data. FYI, having read some comments about Grinder 3, it could be an interesting tools for load testing, replacing &lt;a href="http://jakarta.apache.org/jmeter/"&gt;JMeter&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/16500981-2548545925666035029?l=livinginjava.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='related' href='http://grinder.sourceforge.net/' title='Sniffing your request-response data (how does server redirect?)'/><link rel='replies' type='application/atom+xml' href='http://livinginjava.blogspot.com/feeds/2548545925666035029/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=16500981&amp;postID=2548545925666035029&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/16500981/posts/default/2548545925666035029'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/16500981/posts/default/2548545925666035029'/><link rel='alternate' type='text/html' href='http://livinginjava.blogspot.com/2007/10/sniffing-your-request-response-data-how.html' title='Sniffing your request-response data (how does server redirect?)'/><author><name>Santoso</name><uri>http://www.blogger.com/profile/01534214022898572802</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='32' src='http://photos1.blogger.com/img/243/7914/640/Me.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-16500981.post-6687054700932559016</id><published>2007-10-23T10:48:00.000+07:00</published><updated>2007-10-23T11:17:15.294+07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='date'/><category scheme='http://www.blogger.com/atom/ns#' term='jsf'/><title type='text'>Date is displayed wrong-decrease 1 day(JSF)</title><content type='html'>Have you ever get confused because your Date is displayed wrong (i.e. decreased 1 day) when you use h:outputText?&lt;br /&gt;This might happen because JSF spec says that date converter defaults to using standard UTC timezone and you're happen to live in some other timezone, in my case it is GMT+07.&lt;br /&gt;&lt;br /&gt;My first idea was to build a date converter which use the default timezone in the server and use f:converter to specify my converter id. Somehow the date pattern can't be passed to my converter, that's sad, I don't want to force a certain pattern.&lt;br /&gt;&lt;br /&gt;My second idea is simply to create a method in my utility bean called&lt;br /&gt;public String getTimeZone() which will return the default timezone ID, and use it to specify the timezone attribute in f:convertDateTime facet.&lt;br /&gt;&lt;br /&gt;so the outcome looks like this :&lt;br /&gt;&amp;lt;h:outputText value="#{track.movedDate}"&amp;gt;&lt;br /&gt;                          &amp;lt;f:convertDateTime pattern="MM/dd/yyyy" type="date" timeZone="#{constants.timeZone}"/&amp;gt;&lt;br /&gt;                      &amp;lt;/h:outputText&amp;gt;&lt;br /&gt;&lt;br /&gt;All that needs to be done is to put the convertDateTime facet in every outputText.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/16500981-6687054700932559016?l=livinginjava.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='related' href='http://wiki.apache.org/myfaces/FAQ#Date' title='Date is displayed wrong-decrease 1 day(JSF)'/><link rel='replies' type='application/atom+xml' href='http://livinginjava.blogspot.com/feeds/6687054700932559016/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=16500981&amp;postID=6687054700932559016&amp;isPopup=true' title='9 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/16500981/posts/default/6687054700932559016'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/16500981/posts/default/6687054700932559016'/><link rel='alternate' type='text/html' href='http://livinginjava.blogspot.com/2007/10/date-is-displayed-wrong-decrease-1.html' title='Date is displayed wrong-decrease 1 day(JSF)'/><author><name>Santoso</name><uri>http://www.blogger.com/profile/01534214022898572802</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='32' src='http://photos1.blogger.com/img/243/7914/640/Me.jpg'/></author><thr:total>9</thr:total></entry><entry><id>tag:blogger.com,1999:blog-16500981.post-3645505155339304513</id><published>2007-10-22T15:56:00.000+07:00</published><updated>2007-10-22T16:05:10.248+07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='jstl'/><title type='text'>JSTL 1.0 and 1.1 URI</title><content type='html'>It's a bit confusing for some developers why EL doesn't work in JSTL tags where they think it should've work and it turns out the culprit is the taglib uri.&lt;br /&gt;&lt;br /&gt;JSTL 1.0 URI is http://java.sun.com/jstl/core&lt;br /&gt;JSTL 1.1 URI is http://java.sun.com/jsp/jstl/core&lt;br /&gt;&lt;br /&gt;So instead of using 1.0, it is better to use 1.1.&lt;br /&gt;&lt;br /&gt;Don't forget to put standard.jar and jstl.jar in your WEB-INF/lib.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/16500981-3645505155339304513?l=livinginjava.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://livinginjava.blogspot.com/feeds/3645505155339304513/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=16500981&amp;postID=3645505155339304513&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/16500981/posts/default/3645505155339304513'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/16500981/posts/default/3645505155339304513'/><link rel='alternate' type='text/html' href='http://livinginjava.blogspot.com/2007/10/jstl-10-and-11-uri.html' title='JSTL 1.0 and 1.1 URI'/><author><name>Santoso</name><uri>http://www.blogger.com/profile/01534214022898572802</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='32' src='http://photos1.blogger.com/img/243/7914/640/Me.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-16500981.post-7680649965498077263</id><published>2007-10-20T15:07:00.000+07:00</published><updated>2007-10-22T15:53:44.526+07:00</updated><title type='text'>Setting up web application using seam</title><content type='html'>Last time I used seam was in a project that was setup using maven2 and running in a tomcat with embedded ejb container from JBoss. I thought that moving the application to JBoss server (4.2.1.GA) would be easy, I was wrong (probably because I never setup a JSF project before, especially one that uses seam).&lt;br /&gt;&lt;br /&gt;My plan was to create an ear containing a jar (containing the model &amp;amp; service ejb3 beans), another jar (containing the action listener classes, which is stateless/stateful beans) and a war file. All the libraries will be put under lib directory inside the ear.&lt;br /&gt;&lt;br /&gt;Problems I got (I forgot some details, I write this around 3 weeks after):&lt;br /&gt;1. When deployed, the jars inside the lib directory can't be found.&lt;br /&gt;2. I was desperate, so I put the jars back in each jars &amp;amp; war lib. Got ClassCastException somewhere, this was due to different classloader used to load the jar. So I define a classloader repository name in the configuration file (jboss specific), then I got another exception related to the listener configured for the web app... totally desperate.&lt;br /&gt;3. Seam doesn't know my bean in the other jar file, should I include the jar in my war's lib? nope, don't want to.&lt;br /&gt;&lt;br /&gt;The point is I want to use the same jars for all the three of my jars &amp;amp; war.&lt;br /&gt;&lt;br /&gt;I just go to sleep, having enough headache and annoyance. The day after, going around the net, I found this interesting element I can use in the application.xml file, i.e. (available since JEE 5).&lt;br /&gt;&lt;br /&gt;Problems solved! All my jars &amp;amp; war use the same libraries, Seam knows all my beans in my jars, no more ClassCastException, listener related exception and other strange things unbeknown to the world of mortals.&lt;br /&gt;&lt;br /&gt;Here are my projects &amp;amp; configurations :&lt;br /&gt;1 project containing the model &amp;amp; service beans. (1 jar)&lt;br /&gt;1 project containing the jsf action listener beans (ejb3 stateless &amp;amp; stateful beans)&lt;br /&gt;1 web application project&lt;br /&gt;1 ear project&lt;br /&gt;&lt;br /&gt;My ear looks like this :&lt;br /&gt;- model.jar&lt;br /&gt;- action.jar&lt;br /&gt;- app.war&lt;br /&gt;- lib (containing libraries, i.e. jboss-seam.jar, etc)&lt;br /&gt;&lt;br /&gt;The key is in application.xml :&lt;br /&gt; &amp;lt;module&amp;gt;&lt;br /&gt;&amp;lt;ejb&amp;gt;model.jar&amp;lt;/ejb&amp;gt;&lt;br /&gt;&amp;lt;/module&amp;gt;&lt;br /&gt;&amp;lt;module&amp;gt;&lt;br /&gt;&amp;lt;ejb&amp;gt;service.jar&amp;lt;/ejb&amp;gt;&lt;br /&gt;&amp;lt;/module&amp;gt;&lt;br /&gt;&amp;lt;module&amp;gt;&lt;br /&gt;&amp;lt;web&amp;gt;&lt;br /&gt;&amp;lt;web-uri&amp;gt;app.war&amp;lt;/web-uri&amp;gt;&lt;br /&gt;&amp;lt;context-root&amp;gt;app&amp;lt;/context-root&amp;gt;&lt;br /&gt;&amp;lt;/web&amp;gt;&lt;br /&gt;&amp;lt;/module&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;library-directory&amp;gt;lib&amp;lt;/library-directory&amp;gt;&lt;br /&gt;&lt;br /&gt;At last, I can work happily ever after...... :)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/16500981-7680649965498077263?l=livinginjava.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://livinginjava.blogspot.com/feeds/7680649965498077263/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=16500981&amp;postID=7680649965498077263&amp;isPopup=true' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/16500981/posts/default/7680649965498077263'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/16500981/posts/default/7680649965498077263'/><link rel='alternate' type='text/html' href='http://livinginjava.blogspot.com/2007/10/setting-up-web-application-using-seam.html' title='Setting up web application using seam'/><author><name>Santoso</name><uri>http://www.blogger.com/profile/01534214022898572802</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='32' src='http://photos1.blogger.com/img/243/7914/640/Me.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-16500981.post-730466429590014383</id><published>2007-10-19T16:49:00.000+07:00</published><updated>2007-10-19T17:32:19.572+07:00</updated><title type='text'>Truncate date object</title><content type='html'>Unfortunately Date object doesn't provide a way to truncate a date effectively removing its time (resetting to 0) easily.&lt;br /&gt;&lt;br /&gt;My first try is to use Calendar and set the hour, minute, second and millisecond fields to 0.&lt;br /&gt;Calendar calendar = Calendar.getInstance();&lt;br /&gt;calendar.setTime(theDate);&lt;br /&gt;calendar.set(Calendar.HOUR, 0);&lt;br /&gt;.... same with min, sec, mil.&lt;br /&gt;&lt;br /&gt;Then came up DateUtils from apache common lang, interesting utility, but the javadoc doesn't explain much on how truncating the time and strangely it choose instead to pick parameter which is specified as the most  significant field to preserve(when all I want to do is to remove the time).&lt;br /&gt;Anyway after trial-error, here is the code I came up with :&lt;br /&gt;DateUtils.truncate(theDate, Calendar.DATE);&lt;br /&gt;&lt;br /&gt;I was expecting only date is preserved, month and anything else will be gone, but it works! Thanks to DateUtils.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/16500981-730466429590014383?l=livinginjava.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='related' href='http://commons.apache.org/lang/' title='Truncate date object'/><link rel='replies' type='application/atom+xml' href='http://livinginjava.blogspot.com/feeds/730466429590014383/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=16500981&amp;postID=730466429590014383&amp;isPopup=true' title='5 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/16500981/posts/default/730466429590014383'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/16500981/posts/default/730466429590014383'/><link rel='alternate' type='text/html' href='http://livinginjava.blogspot.com/2007/10/truncate-date-object.html' title='Truncate date object'/><author><name>Santoso</name><uri>http://www.blogger.com/profile/01534214022898572802</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='32' src='http://photos1.blogger.com/img/243/7914/640/Me.jpg'/></author><thr:total>5</thr:total></entry><entry><id>tag:blogger.com,1999:blog-16500981.post-112719026563771976</id><published>2005-09-20T11:12:00.000+07:00</published><updated>2005-09-20T11:24:25.663+07:00</updated><title type='text'>Web app security</title><content type='html'>I think many have realized the importance of security in the web app, but I believe there are many who didn't cope with its many aspects (or even didn't know that there are a lot :).&lt;br /&gt;&lt;br /&gt;I just read a good site which provides a minimum standard for web app security (&lt;a href="http://www.owasp.org/documentation/topten.html"&gt;OWASP&lt;/a&gt;), if you're developing a web app, it will be good for you to spend some time reading it.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;peace&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/16500981-112719026563771976?l=livinginjava.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='related' href='http://www.owasp.org/documentation/topten.html' title='Web app security'/><link rel='replies' type='application/atom+xml' href='http://livinginjava.blogspot.com/feeds/112719026563771976/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=16500981&amp;postID=112719026563771976&amp;isPopup=true' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/16500981/posts/default/112719026563771976'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/16500981/posts/default/112719026563771976'/><link rel='alternate' type='text/html' href='http://livinginjava.blogspot.com/2005/09/web-app-security.html' title='Web app security'/><author><name>Santoso</name><uri>http://www.blogger.com/profile/01534214022898572802</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='32' src='http://photos1.blogger.com/img/243/7914/640/Me.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-16500981.post-112658565821253224</id><published>2005-09-13T10:52:00.000+07:00</published><updated>2005-09-14T16:22:25.960+07:00</updated><title type='text'>Spring's IoC</title><content type='html'>well, after looking at many frameworks outta there, I decide that it is now my time to see what Spring is actually (though I never need it in my current job, at least I might learn some new ideas/pattern which maybe I could use in my code ;).&lt;br /&gt;&lt;br /&gt;Here is the point that has interest me during my Spring's introduction reading :&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;font-size:100%;" &gt;Inversion of Control / Dependency Injection&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;Why does it interest me? ... maybe because I'm somehow a design pattern freak :)&lt;br /&gt;&lt;br /&gt;ok, let's continue...&lt;br /&gt;In order to find out more about IoC, I read these links below :&lt;br /&gt;&lt;ul&gt;   &lt;li&gt;&lt;a href="http://www.martinfowler.com/articles/injection.html"&gt;http://www.martinfowler.com/articles/injection.html&lt;/a&gt; (thanks to Martin Fowler)&lt;/li&gt;   &lt;li&gt;&lt;a href="http://www.devx.com/Java/Article/27583"&gt;http://www.devx.com/Java/Article/27583&lt;/a&gt; (thanks to Mani Malarvannan)&lt;/li&gt; &lt;/ul&gt; Now, I know that Dependency Injection is an Inversion of Control, but not vice versa (at first I think that both terms refer to the same things) and I just realized that I've met with IoC since the first time I write codes in GUI environment(event based) after many years playing (read : coding) in DOS environment.&lt;br /&gt;&lt;br /&gt;btw, maybe it's surprising to see a developer using Spring which didn't understand IoC/DI clearly. They're just another "copy-paste" &amp;amp; "trial and error" developer, which sadly I believe quite many.&lt;br /&gt;I'm a believer in "you must understand what you're doing".&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;hmm... that's all for now, still a long introduction to read :)&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;peace&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/16500981-112658565821253224?l=livinginjava.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://livinginjava.blogspot.com/feeds/112658565821253224/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=16500981&amp;postID=112658565821253224&amp;isPopup=true' title='6 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/16500981/posts/default/112658565821253224'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/16500981/posts/default/112658565821253224'/><link rel='alternate' type='text/html' href='http://livinginjava.blogspot.com/2005/09/springs-ioc.html' title='Spring&apos;s IoC'/><author><name>Santoso</name><uri>http://www.blogger.com/profile/01534214022898572802</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='32' src='http://photos1.blogger.com/img/243/7914/640/Me.jpg'/></author><thr:total>6</thr:total></entry><entry><id>tag:blogger.com,1999:blog-16500981.post-112617574780522522</id><published>2005-09-08T17:26:00.000+07:00</published><updated>2005-09-08T17:35:47.806+07:00</updated><title type='text'>Are we living in an ideal "Java" world?</title><content type='html'>I just wish that "Compiled once, run anywhere" is true.... just a wish :)&lt;br /&gt;&lt;br /&gt;There won't be any patch for different OSes...&lt;br /&gt;No more testing on different platforms...&lt;br /&gt;No more pains...&lt;br /&gt;No more headaches...&lt;br /&gt;&lt;br /&gt;:)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/16500981-112617574780522522?l=livinginjava.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://livinginjava.blogspot.com/feeds/112617574780522522/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=16500981&amp;postID=112617574780522522&amp;isPopup=true' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/16500981/posts/default/112617574780522522'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/16500981/posts/default/112617574780522522'/><link rel='alternate' type='text/html' href='http://livinginjava.blogspot.com/2005/09/are-we-living-in-ideal-java-world.html' title='Are we living in an ideal &quot;Java&quot; world?'/><author><name>Santoso</name><uri>http://www.blogger.com/profile/01534214022898572802</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='32' src='http://photos1.blogger.com/img/243/7914/640/Me.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-16500981.post-112617501002617810</id><published>2005-09-08T17:17:00.000+07:00</published><updated>2005-09-08T17:23:30.030+07:00</updated><title type='text'>Listening to mouse event when the app is minimized</title><content type='html'>"Listening to mouse event when the app is minimized" ...&lt;br /&gt;&lt;br /&gt;when my friend asked me about this, it made me think alot... how do I really gonna achieve it?&lt;br /&gt;Robot comes to my mind... but Robot can't listen to mouse event, it only  generate the mouse input events.&lt;br /&gt;&lt;br /&gt;Hopefully, before long I might come up with some ideas or maybe just find it out somewhere on the net :)&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;peace&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/16500981-112617501002617810?l=livinginjava.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://livinginjava.blogspot.com/feeds/112617501002617810/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=16500981&amp;postID=112617501002617810&amp;isPopup=true' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/16500981/posts/default/112617501002617810'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/16500981/posts/default/112617501002617810'/><link rel='alternate' type='text/html' href='http://livinginjava.blogspot.com/2005/09/listening-to-mouse-event-when-app-is.html' title='Listening to mouse event when the app is minimized'/><author><name>Santoso</name><uri>http://www.blogger.com/profile/01534214022898572802</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='32' src='http://photos1.blogger.com/img/243/7914/640/Me.jpg'/></author><thr:total>3</thr:total></entry></feed>
