<?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'><id>tag:blogger.com,1999:blog-6689741864970777833</id><updated>2009-02-21T06:14:57.917-05:00</updated><title type='text'>I work , I blog , I learn.</title><subtitle type='html'>As I work, I blog. These are some of my experiences....</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://i-work-i-blog.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6689741864970777833/posts/default'/><link rel='alternate' type='text/html' href='http://i-work-i-blog.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Ram Gorti's Bloogle</name><uri>http://www.blogger.com/profile/12879197959501034250</uri><email>noreply@blogger.com</email></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>7</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-6689741864970777833.post-8114144043402153356</id><published>2007-12-26T16:25:00.000-05:00</published><updated>2007-12-26T16:52:18.316-05:00</updated><title type='text'>Developers and unit testing</title><content type='html'>Do developers hate testing ? Strange!&lt;br /&gt;How do developers say the code works and how do they explain about the components they developed ? &lt;br /&gt;To me 'Unit testing' is the only way. Documentation works, but is not enough.&lt;br /&gt;&lt;br /&gt;How do you measure your unit tests ?&lt;br /&gt;&lt;br /&gt;I write my unit tests for 2 reasons:&lt;br /&gt;1. Unit testing the individual components to assess the working code.&lt;br /&gt;2. As a documentation to other developers who would need to integrate other components with my developed components.&lt;br /&gt;Does it mean the unit tests follow certain order and are coded properly with proper test data. A big YES.&lt;br /&gt;&lt;br /&gt;This is 'team work'.  No unit tests or poorly coded unit tests mean 'team without work'. Chaos. &lt;br /&gt;&lt;br /&gt;One of the Projects I was working on required a lot of integration with other developers' developed components and hence required understanding of those components. How ? Well, an easy answer , bug my co-developers 10 times a day. &lt;br /&gt;&lt;br /&gt;The other answer is follow the 'unit tests for this component'. Simple.&lt;br /&gt;The unit test must be able to provide 90% of what the component is all about. It can answer - what, why, when and how. Run the unit tests for yourself and see what it does. This is what a lot of Developers miss about unit tests and unit testing.&lt;br /&gt;&lt;br /&gt;This provides a lot of information regarding the other components. The interface to such components, design issues, design patterns and the basic object oriented nature of such compoemnts.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6689741864970777833-8114144043402153356?l=i-work-i-blog.blogspot.com'/&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://i-work-i-blog.blogspot.com/feeds/8114144043402153356/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=6689741864970777833&amp;postID=8114144043402153356' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6689741864970777833/posts/default/8114144043402153356'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6689741864970777833/posts/default/8114144043402153356'/><link rel='alternate' type='text/html' href='http://i-work-i-blog.blogspot.com/2007/12/developers-and-unit-testing.html' title='Developers and unit testing'/><author><name>Ram Gorti's Bloogle</name><uri>http://www.blogger.com/profile/12879197959501034250</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='10130760253924122226'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6689741864970777833.post-2573264712196418274</id><published>2007-10-31T19:37:00.000-04:00</published><updated>2007-11-06T15:41:05.892-05:00</updated><title type='text'>Continuous builds and Continuous Smoke Tests</title><content type='html'>&lt;div align="justify"&gt;&lt;font style="FONT-WEIGHT: bold"&gt;Continuous builds and Continuous Smoke Tests - developers and testers perspective:&lt;/font&gt;&lt;br /&gt;&lt;br /&gt;&lt;font face="verdana" size="2"&gt;What is the purpose of continuous builds ?&lt;br /&gt;&lt;br /&gt;1. To check if the source files are compiling properly as they are checked in by the team of developers. This does not seem to add value to the development methodology.&lt;br /&gt;2. Is it to check if the unit tests are executing successfully ? Well certainly unit tests add a lot of value during development to test a successful integration. But consider during the initial stages of development (I will not talk about Iterations or Sprints), where developers are working on requirements and checking-in sources to the repository. This way the developers are adding functionality piece-by-piece in iterations and one is not able to complete the functionality end to end. Unit testing and coding are a developer's responsibilty.&lt;br /&gt;&lt;br /&gt;But having continous builds and tests as part of the builds isin't going to add MUCH value to the overall development methodology. Yes, it is certainly going to help the developers a lot with their code integration. We (stakeholders) keep asking to involve testers right throughout the development phases. How can this happen ?&lt;br /&gt;&lt;br /&gt;In Agile and RUP, functionality gets added in iterations and phases or in Sprints.&lt;br /&gt;Does it mean we ignore the testing of the Project or Product until some of the initial functionality has been developed and marked done by the developer ?&lt;br /&gt;Well, I am talking of the initial stages...Take for e.g (a trivial one) a login screen has been developed by developer D1 and where one has to enter a user ID, but no password is required to login into the application or product. The reason, is that the developer D1 or Developer D2 will work on the Password stuff later on in the coming iterations.&lt;br /&gt;&lt;br /&gt;So what ?&lt;br /&gt;&lt;br /&gt;Well, I do see we already started our continuous builds ( maybe three to four builds a day) and I see that the Application or the product has some working functionality as per the requirements and some shape is taking place with some other bits of functionality (NOTE: as per the requirements, well you do not throw away what you have developed so far).&lt;br /&gt;&lt;br /&gt;So what is new ?&lt;br /&gt;&lt;br /&gt;My thoughts are dragging towards the 'Smoke test(s)' that should be in place. I would recommend one smoke test a day very early in the project/product development.&lt;br /&gt;Smoke tests are by definition are correct but interpreted with a narrow mind by managers and testers. Smoke tests must be manual ( DO NOT Automate Smoke tests in first release or milestone).&lt;br /&gt;&lt;br /&gt;Why ?&lt;br /&gt;&lt;br /&gt;This is where tester(s) get a chance to understand and see visually what is being developed from on paper. Is that all ?&lt;br /&gt;&lt;br /&gt;No, testers get a chance to:&lt;/font&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;div align="justify"&gt;&lt;font face="Verdana" size="2"&gt;1. Understand the requirements and coordinate with the developers. Improved and better communcation.&lt;/font&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;div align="justify"&gt;&lt;font face="Verdana" size="2"&gt;2. Will be able to provide feedback on the developed functionality. This is a significant point where the testers get a chance to check back with the requirements if 'we are doing the right thing'. Discuss and refine the developed functionality sitting across the table with the developers.&lt;/font&gt;&lt;/div&gt;&lt;br /&gt;&lt;div align="justify"&gt; &lt;/div&gt;&lt;br /&gt;&lt;div align="justify"&gt;&lt;font face="Verdana" size="2"&gt;&lt;/font&gt;&lt;/div&gt;&lt;br /&gt;&lt;div align="justify"&gt;&lt;font face="Verdana" size="2"&gt;&lt;/font&gt;&lt;/div&gt;&lt;br /&gt;&lt;div align="justify"&gt;&lt;font face="Verdana" size="2"&gt;3. Once we are done with smoke tests , testers will benefit from the interaction while functional testing. This sort of interaction would provide the testers better insight into the functionality and the requirements.&lt;/font&gt;&lt;/div&gt;&lt;br /&gt;&lt;div align="justify"&gt;&lt;font face="Verdana" size="2"&gt;&lt;/font&gt; &lt;/div&gt;&lt;br /&gt;&lt;div align="justify"&gt;&lt;font face="Verdana" size="2"&gt;&lt;/font&gt;&lt;/div&gt;&lt;br /&gt;&lt;div align="justify"&gt;&lt;font face="Verdana" size="2"&gt;&lt;/font&gt;&lt;/div&gt;&lt;br /&gt;&lt;div align="justify"&gt;&lt;font face="Verdana" size="2"&gt;4. Testers get a chance to provide a feedback on 'future enhancements' , specially useful in case of product development.&lt;/font&gt;&lt;/div&gt;&lt;br /&gt;&lt;div align="justify"&gt;&lt;font face="Verdana" size="2"&gt;&lt;/font&gt; &lt;/div&gt;&lt;br /&gt;&lt;div align="justify"&gt;&lt;font face="Verdana" size="2"&gt;&lt;/font&gt;&lt;/div&gt;&lt;br /&gt;&lt;div align="justify"&gt;&lt;font face="Verdana" size="2"&gt;&lt;/font&gt;&lt;/div&gt;&lt;br /&gt;&lt;div align="justify"&gt;&lt;font face="Verdana" size="2"&gt;Overall this improves and adds vaue to the development methodology.&lt;/font&gt;&lt;/div&gt;&lt;br /&gt;&lt;div align="justify"&gt;&lt;font face="Verdana" size="2"&gt;&lt;/font&gt; &lt;/div&gt;&lt;br /&gt;&lt;div align="justify"&gt;&lt;/div&gt;&lt;br /&gt;&lt;div align="justify"&gt;&lt;font face="Verdana" size="2"&gt;&lt;/font&gt;&lt;/div&gt;&lt;br /&gt;&lt;div align="justify"&gt;&lt;font face="Verdana" size="2"&gt;Later and after the first milestone or even after the first major release, we can automate the smoke tests for the current release and execute these in the coming milestones, releases or phases.&lt;/font&gt;&lt;/div&gt;&lt;br /&gt;&lt;div align="justify"&gt;&lt;font face="Verdana" size="2"&gt;&lt;/font&gt;&lt;/div&gt;&lt;br /&gt;&lt;div align="justify"&gt;&lt;font face="Verdana" size="2"&gt;&lt;/font&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6689741864970777833-2573264712196418274?l=i-work-i-blog.blogspot.com'/&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://i-work-i-blog.blogspot.com/feeds/2573264712196418274/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=6689741864970777833&amp;postID=2573264712196418274' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6689741864970777833/posts/default/2573264712196418274'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6689741864970777833/posts/default/2573264712196418274'/><link rel='alternate' type='text/html' href='http://i-work-i-blog.blogspot.com/2007/10/continuous-builds-and-continuous-smoke.html' title='Continuous builds and Continuous Smoke Tests'/><author><name>Ram Gorti's Bloogle</name><uri>http://www.blogger.com/profile/12879197959501034250</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='10130760253924122226'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6689741864970777833.post-8199666686264306389</id><published>2007-06-05T17:20:00.000-04:00</published><updated>2007-06-05T17:39:00.888-04:00</updated><title type='text'>Weblogic etc..</title><content type='html'>Pre Compile Java Server Pages (JSP) using ANT :&lt;br /&gt;&lt;hr&gt;&lt;br /&gt; &lt;br /&gt;&lt;pre class="xml"&gt;&lt;span class="sc3"&gt;&lt;span class="re1"&gt;&amp;lt;java&lt;/span&gt; &lt;span class="re0"&gt;classname&lt;/span&gt;=&lt;span class="st0"&gt;&amp;quot;weblogic.jspc&amp;quot;&lt;/span&gt; &lt;span class="re0"&gt;fork&lt;/span&gt;=&lt;span class="st0"&gt;&amp;quot;true&amp;quot;&lt;/span&gt; &lt;span class="re0"&gt;failonerror&lt;/span&gt;=&lt;span class="st0"&gt;&amp;quot;true&amp;quot;&lt;/span&gt; &lt;span class="re0"&gt;dir&lt;/span&gt;=&lt;span class="st0"&gt;&amp;quot;${war.home}&amp;quot;&lt;/span&gt;&lt;span class="re2"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;          &lt;span class="sc3"&gt;&lt;span class="re1"&gt;&amp;lt;jvmarg&lt;/span&gt; &lt;span class="re0"&gt;value&lt;/span&gt;=&lt;span class="st0"&gt;&amp;quot;-Dcom.sun.xml.namespace.QName.useCompatibleSerialVersionUID=1.0&amp;quot;&lt;/span&gt;&lt;span class="re2"&gt;/&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;          &lt;span class="sc3"&gt;&lt;span class="re1"&gt;&amp;lt;jvmarg&lt;/span&gt; &lt;span class="re0"&gt;value&lt;/span&gt;=&lt;span class="st0"&gt;&amp;quot;-Dweblogic.jsp.windows.caseSensitive=true&amp;quot;&lt;/span&gt;&lt;span class="re2"&gt;/&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;          &lt;span class="sc3"&gt;&lt;span class="re1"&gt;&amp;lt;classpath&lt;span class="re2"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;            &lt;span class="sc3"&gt;&lt;span class="re1"&gt;&amp;lt;pathelement&lt;/span&gt; &lt;span class="re0"&gt;path&lt;/span&gt;=&lt;span class="st0"&gt;&amp;quot;${weblogic-related.jars}&amp;quot;&lt;/span&gt;&lt;span class="re2"&gt;/&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;            &lt;span class="sc3"&gt;&lt;span class="re1"&gt;&amp;lt;pathelement&lt;/span&gt; &lt;span class="re0"&gt;path&lt;/span&gt;=&lt;span class="st0"&gt;&amp;quot;${application-related.jars}&amp;quot;&lt;/span&gt;&lt;span class="re2"&gt;/&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;            &lt;span class="sc3"&gt;&lt;span class="re1"&gt;&amp;lt;pathelement&lt;/span&gt; &lt;span class="re0"&gt;path&lt;/span&gt;=&lt;span class="st0"&gt;&amp;quot;${java.class.path}&amp;quot;&lt;/span&gt;&lt;span class="re2"&gt;/&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;          &lt;span class="sc3"&gt;&lt;span class="re1"&gt;&amp;lt;/classpath&lt;span class="re2"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;          &lt;span class="sc3"&gt;&lt;span class="re1"&gt;&amp;lt;arg&lt;/span&gt; &lt;span class="re0"&gt;line&lt;/span&gt;=&lt;span class="st0"&gt;&amp;quot;-depend -compileAll -keepgenerated -d WEB-INF/classes .&amp;quot;&lt;/span&gt;&lt;span class="re2"&gt;/&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="sc3"&gt;&lt;span class="re1"&gt;&amp;lt;/java&lt;span class="re2"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;hr&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Weblogic.9.2 and JDK 1.5.0_011.&lt;br /&gt;Weblogic 9.2 comes with JDK 1.5.0.04 version. If you need to point to JDK version 1.5.0_011, then you need to use a parameter:&lt;br /&gt;-Dcom.sun.xml.namespace.QName.useCompatibleSerialVersionUID=1.0&lt;br /&gt;&lt;br /&gt;Make sure the domain is using the right JDK version. Make use of this parameter in startWeblogic.cmd/.sh files. Also can be used when running Ant tasks.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;hr&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6689741864970777833-8199666686264306389?l=i-work-i-blog.blogspot.com'/&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://i-work-i-blog.blogspot.com/feeds/8199666686264306389/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=6689741864970777833&amp;postID=8199666686264306389' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6689741864970777833/posts/default/8199666686264306389'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6689741864970777833/posts/default/8199666686264306389'/><link rel='alternate' type='text/html' href='http://i-work-i-blog.blogspot.com/2007/06/weblogic-etc.html' title='Weblogic etc..'/><author><name>Ram Gorti's Bloogle</name><uri>http://www.blogger.com/profile/12879197959501034250</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='10130760253924122226'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6689741864970777833.post-2994103197098049390</id><published>2007-06-05T17:06:00.000-04:00</published><updated>2007-09-23T11:52:43.113-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Java Utils'/><category scheme='http://www.blogger.com/atom/ns#' term='Checksum'/><category scheme='http://www.blogger.com/atom/ns#' term='Adler32'/><title type='text'>Java Utils</title><content type='html'>Some of my past works include the use of various JDK API:&lt;br /&gt;&lt;hr&gt;&lt;br /&gt;Adler32 API Usage:&lt;br /&gt;What is this API used for ? &lt;br /&gt;Checksum is the answer. To compute the Adler-32 checksum of a data stream.&lt;br /&gt;We need this in order to know if a data stream has changed in time.&lt;br /&gt;Set the checksum and then read the file again to see if the checksum has changed. if so , meaning file has changed.&lt;br /&gt;Check the code here.&lt;br /&gt;&lt;pre class="java"&gt;&lt;br /&gt;&lt;br /&gt; String fileContents = null;&lt;br /&gt; long adlerCheckSumValue = 0l;&lt;br /&gt; // read the file contents into fileContents as a string.&lt;br /&gt; Adler32 adlerCheckSum = new Adler32();&lt;br /&gt; checkSum.update(fileContents.getBytes());&lt;br /&gt; adlerCheckSumValue = adlerCheckSum .getValue();&lt;br /&gt;&lt;br /&gt; OR&lt;br /&gt;&lt;br /&gt; //get the check sum value from the given input stream.&lt;br /&gt;  &lt;br /&gt; CheckedInputStream cis = new CheckedInputStream(inputStream, adlerCheckSum );&lt;br /&gt;while (cis.read() != -1) {&lt;br /&gt;         //Do nothing here&lt;br /&gt;      }&lt;br /&gt;&lt;br /&gt;      adlerCheckSumValue  =  adlerCheckSum .getValue();&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;hr&gt;&lt;br /&gt;&lt;br /&gt;Simple log4j logging configuration for simple utilities:&lt;br /&gt;The Pattern logs this way :&lt;br /&gt;&lt;br /&gt;[ INFO ]:: 2007-06-26 17:42:42,001:: com.xxx.xxx.xx.XXXXX.main(XXXXX.java:147):: This is the log message...&lt;br /&gt; &lt;br /&gt;&lt;pre class="java"&gt;&lt;br /&gt;String pattern =  "[ %p ]";&lt;br /&gt;        pattern += ":: %d";        &lt;br /&gt;        pattern += ":: %l";&lt;br /&gt;        pattern += ":: %m %n"; &lt;br /&gt; &lt;br /&gt;        PatternLayout layout = new PatternLayout(pattern);&lt;br /&gt;        FileAppender appender = new FileAppender(layout, filePath);&lt;br /&gt;        Logger logger = Logger.getLogger(theClass);&lt;br /&gt;        logger.addAppender(appender); &lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;filepath is the absolute path with log file name. &lt;br /&gt;theClass is the class object.&lt;br /&gt;&lt;hr&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6689741864970777833-2994103197098049390?l=i-work-i-blog.blogspot.com'/&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://i-work-i-blog.blogspot.com/feeds/2994103197098049390/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=6689741864970777833&amp;postID=2994103197098049390' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6689741864970777833/posts/default/2994103197098049390'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6689741864970777833/posts/default/2994103197098049390'/><link rel='alternate' type='text/html' href='http://i-work-i-blog.blogspot.com/2007/06/java-utils.html' title='Java Utils'/><author><name>Ram Gorti's Bloogle</name><uri>http://www.blogger.com/profile/12879197959501034250</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='10130760253924122226'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6689741864970777833.post-5568814569045769854</id><published>2007-06-01T18:04:00.001-04:00</published><updated>2007-06-05T15:06:44.739-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Authentication using JAAS and Kerberos'/><title type='text'>Authentication using JAAS and Kerberos</title><content type='html'>&lt;hr&gt;&lt;br /&gt;&lt;div style="text-align: justify;"&gt;A lot of Organizations tend to use Kerberos for authentication and JAAS does support Kerberos for authenticating users. Well here is a step-by-step approach to Kerberos authentication with JAAS. I am not going to talk about Kerberos server or the installation. It is all about authentication. Please see the list of issues below.&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;-Djava.security.krb5.conf=krb5.conf&lt;br /&gt;-Djava.security.auth.login.config=$FILE-PATH\kerberoscontext.conf -Djava.security.krb5.realm=ABC.NET&lt;br /&gt;-Djava.security.krb5.kdc=ABC.XYZ.NET&lt;br /&gt;&lt;br /&gt;The above configurations are required and I will explain each one of them.&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: justify;"&gt;1. Create a file krb5.conf and here are the contents of the file.&lt;br /&gt;  Place this file in JAVA_HOME/jre/lib/security. This is required by this configuration here -Djava.security.krb5.conf=krb5.conf. No need of file path.&lt;br /&gt;&lt;/div&gt;&lt;hr&gt;&lt;br /&gt;[libdefaults]&lt;br /&gt;default_realm = ABC.NET&lt;br /&gt;dns_lookup_kdc = true&lt;br /&gt;&lt;br /&gt;[domain_realm]&lt;br /&gt;.abc.net = ABC.NET&lt;br /&gt;&lt;hr&gt;&lt;br /&gt;&lt;div style="text-align: justify;"&gt;You need to get this information from the Organization's Kerberos management team or administrators. You need to know Kerberos REALM and Kerberos KDC.&lt;br /&gt;&lt;br /&gt;2. Create a Kerberos login module configuration file (kerberoscontext.conf). Place this file anywhere you like, but you need to mention the absolute file path within this configuration parameter : -Djava.security.auth.login.config=$FILE-PATH&gt;\kerberoscontext.conf . This file is a JAAS requirement.&lt;br /&gt;&lt;/div&gt;&lt;hr&gt;&lt;br /&gt;&lt;div style="text-align: justify;"&gt;   Kerberos5LoginModule {&lt;br /&gt;  com.sun.security.auth.module.Krb5LoginModule required debug="true"&lt;br /&gt;};&lt;br /&gt;&lt;br /&gt;One can add more parameters depending upon the needs. This is the minimum requirements.&lt;br /&gt;&lt;br /&gt;3. Now you need to develop a Security Service or Manager which can authenticate based on the user input (user &amp; password). You can find the complete code here &lt;code&gt;&lt;a href="http://javanotes.wikispaces.com/AuthenticationService"&gt;AuthenticationService&lt;/a&gt;&lt;/code&gt;.&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;div style="text-align: justify;"&gt;4. You also need to develop a Login Module Adapter. This makes the Authentication Service decoupled from the type of Authentication(Kerberos, NT, AD, Unix etc.). This is very important even if you know what type of authentication you are going to use. This type of Design is very important when you are involved in Agile development. Agile Development warrants a developer with adding code incrementally and adding functionality incrementally. Adding functionality will certainly add code, but adding code might not add functionality to the application. Check the code for Login Module Adapter. &lt;code&gt;&lt;a href="http://javanotes.wikispaces.com/KerberosLoginModuleAdapter"&gt;KerberosLoginModuleAdapter&lt;/a&gt;&lt;/code&gt;. &lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;5. AuthenticationService is an implementation of IAuthenticationService. This interface has a method authenticate(user, password). This method needs to be implemented. Once the user is authenticated , the necessary data is captured within A User object (for e.g IUser). This object can be used within the application as per the needs.    &lt;br /&gt;&lt;br /&gt;6. Develop a test program to test authentication. Pass the above -D parameters as VM parameters to the test program.&lt;br /&gt;&lt;hr&gt;&lt;br /&gt;References:&lt;br /&gt;JAAS API&lt;br /&gt;Kerberos reference.&lt;br /&gt;&lt;br /&gt;&lt;hr&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6689741864970777833-5568814569045769854?l=i-work-i-blog.blogspot.com'/&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://i-work-i-blog.blogspot.com/feeds/5568814569045769854/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=6689741864970777833&amp;postID=5568814569045769854' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6689741864970777833/posts/default/5568814569045769854'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6689741864970777833/posts/default/5568814569045769854'/><link rel='alternate' type='text/html' href='http://i-work-i-blog.blogspot.com/2007/06/authentication-using-jaas-and-kerberos.html' title='Authentication using JAAS and Kerberos'/><author><name>Ram Gorti's Bloogle</name><uri>http://www.blogger.com/profile/12879197959501034250</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='10130760253924122226'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6689741864970777833.post-6762805247558701415</id><published>2007-06-01T11:23:00.000-04:00</published><updated>2007-06-05T15:09:23.714-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Display Tag and External Pagination'/><title type='text'>Display Tag and External Pagination with Spring and Hibernate</title><content type='html'>&lt;div style="TEXT-ALIGN: justify"&gt;&lt;a href="http://displaytag.sourceforge.net/11/"&gt;Display tag&lt;/a&gt; is a very handy tag for displaying data in a tabular format.&lt;br /&gt;I had to design and implement external pagination making use of the provided PaginatedList interface. What does it take to make it work:&lt;br /&gt;&lt;br /&gt;Display tag requires an object of type &lt;a href="http://displaytag.sourceforge.net/11/displaytag/apidocs/org/displaytag/pagination/PaginatedList.html"&gt;PaginatedList&lt;/a&gt;. PaginatedList is an Interface as provided by Display Tag. The Web page (a jsp in this case required an object of type PaginatedList).&lt;br /&gt;So I defined an Interface &lt;a href="http://javanotes.wikispaces.com/IExtendedPaginatedList"&gt;IExtendedPaginatedList&lt;/a&gt; which extended PaginatedList and added a few more methods that were required.&lt;br /&gt;&lt;br /&gt;Here is the implementation for &lt;code&gt;IExtendedPaginatedList&lt;/code&gt; &lt;a href="http://javanotes.wikispaces.com/PaginatedListImpl"&gt;PaginatedListImpl&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;One of the JSP page is paginatedList.jsp which was included in those other jsp pages which required pagination. This page was included using jsp:include page="/paginatedList.jsp"&lt;br /&gt;&lt;/div&gt;&lt;hr /&gt;&lt;br /&gt;paginatedList.jsp snippet:&lt;br /&gt;&lt;pre class="java"&gt;&lt;br /&gt;&lt;%      IExtendedPaginatedList paginatedList = null;          if(request.getAttribute("PAGINATED_LIST") != null){         paginatedList  =(IExtendedPaginatedList)request.getAttribute("PAGINATED_LIST");         request.setAttribute("paginatedList", paginatedList );        } %&gt;&lt;br /&gt;&lt;/span&gt;&lt;/pre&gt;&lt;hr /&gt;&lt;br /&gt;The display tag was used in a different jsp page displayUserList.jsp:&lt;br /&gt;&lt;pre class="java"&gt;&amp;lt;display:table name="paginatedList" sort="list"  requestURI="/searchUserAction.do?isPagination=yes"&amp;gt;&lt;br /&gt;&lt;span class="kw2"&gt;&lt;br /&gt;&lt;pre class="text"&gt;     &amp;lt;display:column property="firstName" title="First Name"  sortable="false" headerClass="sortable"/&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;display:column property="lastName" title="Last Name" sortable="false" headerClass="sortable"/&amp;gt;&lt;br /&gt;&amp;lt;display:column property="login" title="User Name" sortable="false" headerClass="sortable"/&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;display:column property="group.groupName" title="Group" sortable="false" headerClass="sortable"/&amp;gt;&lt;br /&gt;&amp;lt;display:column property="location" title="Location" sortable="false" headerClass="sortable"/&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;/display:table&amp;gt;&lt;/pre&gt;&lt;/span&gt;&lt;/pre&gt;&lt;hr /&gt;&lt;br /&gt;&lt;br /&gt;Both of these jsp pages are included within a main jsp page (for e.g searchUsers.jsp ).&lt;br /&gt;&lt;br /&gt;The Controller or the Action class is responsible for creating this object and getting back the data from the Data Access Layer(DAO). I had developed this PaginatedDAO so that the rest of the team can make use of this DAO. Much of the responsibility lies with this DAO. This DAO class could be extended by other DAOs to make use of the pagination. Here is the code for the interface &lt;a href="http://javanotes.wikispaces.com/pagination"&gt;IPaginatedDAO&lt;/a&gt; and the implementation &lt;a href="http://javanotes.wikispaces.com/PaginatedDAO"&gt;PaginatedDAO&lt;/a&gt;. This DAO at this point of time is using Spring framework and Hibernate and you can do it without Spring too. The PaginatedDAO has methods which provides different parameters and are for convenience for different usage. One method uses Hibernate Criteria and others accept a SQL Query string. In order for the pagination to work you need to execute two methods from this DAO. 1. getPaginatedListBy.....(.....) and 2. getTotalCountOfRowsBy....(...). Both of them are required. One can combine both as well.&lt;br /&gt;&lt;br /&gt;In the action or controllers you will need this code to create an instance of IExtendedPaginatedList :&lt;br /&gt;&lt;hr /&gt;&lt;br /&gt;&lt;pre class="java"&gt;&lt;span class="kw2"&gt;&lt;br /&gt;    public IExtendedPaginatedList getPaginatedListFromRequest(HttpServletRequest request){     &lt;br /&gt;        &lt;br /&gt;        IExtendedPaginatedList paginatedList = new PaginatedListImpl();&lt;br /&gt;        String sortCriterion = request.getParameter(IExtendedPaginatedList.IRequestParameters.SORT);       &lt;br /&gt;        paginatedList.setSortDirection(IExtendedPaginatedList.IRequestParameters.DESC.equals(request.getParameter(IExtendedPaginatedList.IRequestParameters.DIRECTION))? SortOrderEnum.DESCENDING : SortOrderEnum.ASCENDING);&lt;br /&gt;        paginatedList.setSortCriterion(sortCriterion);&lt;br /&gt;        int pageSize = 25; // Rows per page&lt;br /&gt;        paginatedList.setPageSize(pageSize);&lt;br /&gt;        String thePage = request.getParameter(IExtendedPaginatedList.IRequestParameters.PAGE);    &lt;br /&gt;        if(thePage != null){&lt;br /&gt;           int index = paginatedList == null? 0 : Integer.parseInt(thePage) - 1;&lt;br /&gt;           paginatedList.setIndex(index);&lt;br /&gt;        }else{&lt;br /&gt;         paginatedList.setIndex(0);&lt;br /&gt;        }&lt;br /&gt;       &lt;br /&gt;        return paginatedList;&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;hr /&gt;&lt;br /&gt;This is all is required for pagination. It is easy and simple with Display Tag.&lt;br /&gt;&lt;hr /&gt;&lt;br /&gt;&lt;a href="http://javanotes.wikispaces.com/PaginationCode"&gt;click here to get all the code&lt;/a&gt;:&lt;br /&gt;References:&lt;br /&gt;&lt;a href="http://displaytag.sourceforge.net/11/"&gt;Display Tag&lt;/a&gt;&lt;br /&gt;&lt;a href="http://displaytag.homeip.net/displaytag-examples-1.1/"&gt;Display Tag Examples&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;hr /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6689741864970777833-6762805247558701415?l=i-work-i-blog.blogspot.com'/&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://i-work-i-blog.blogspot.com/feeds/6762805247558701415/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=6689741864970777833&amp;postID=6762805247558701415' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6689741864970777833/posts/default/6762805247558701415'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6689741864970777833/posts/default/6762805247558701415'/><link rel='alternate' type='text/html' href='http://i-work-i-blog.blogspot.com/2007/06/display-tag-and-external-pagination.html' title='Display Tag and External Pagination with Spring and Hibernate'/><author><name>Ram Gorti's Bloogle</name><uri>http://www.blogger.com/profile/12879197959501034250</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='10130760253924122226'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6689741864970777833.post-7778617686020370378</id><published>2007-03-14T23:45:00.001-04:00</published><updated>2007-03-23T22:51:29.330-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Power Jython'/><title type='text'>Power Jython : Extend and Customize a Product using Jython: Part-1</title><content type='html'>&lt;span style="color: rgb(51, 0, 153);font-size:100%;" &gt;Working for one of the Start ups, I came across a way to extend and customize the Product Functionality.&lt;/span&gt;&lt;span style="font-size:100%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;div style="text-align: justify; color: rgb(51, 0, 153);"&gt;&lt;span style="color: rgb(51, 0, 153);font-size:100%;" &gt;It was a very elegant way of doing it. Extremely neat and powerful.&lt;/span&gt;&lt;span style="font-size:100%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(51, 0, 153);font-size:100%;" &gt;The Product was used to manage the IT infrastructure and Software configurations.&lt;/span&gt;&lt;span style="font-size:100%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(51, 0, 153);font-size:100%;" &gt;The so called 'Product' was completely developed in Java, Jython et al. Yes, Jython was used in a very elegant manner for the end users , Professional services group and other vendors to provide a way for the product to be customized as per the end-user needs. Instead, technically speaking, we had a core product plus the customization features.The additional features were customized on top of the base functionality, where the product users could add and enhance the product functionality using Jython scripting.&lt;/span&gt;&lt;span style="font-size:100%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt; &lt;span style="color: rgb(51, 0, 153);font-size:100%;" &gt;&lt;br /&gt;TechNikes:&lt;br /&gt;&lt;br /&gt;&lt;/span&gt; &lt;div style="text-align: justify; color: rgb(51, 0, 153);"&gt;&lt;span style="font-size:100%;"&gt;   1. Core Product had to communicate with the  extended and customized functionality using a standard API. &lt;/span&gt;&lt;span style="font-size:100%;"&gt;This standard API was developed using Jython scripting. Technically, it is the Facade to the Extension Points. Facade typically like a 'Framework' is well managed and maintained by Facade developer.&lt;/span&gt;&lt;span style="font-size:100%;"&gt; Each 'Extension Point' adds up and typically resolves in a complete customized product.&lt;br /&gt;&lt;/span&gt;&lt;/div&gt; &lt;span style="color: rgb(51, 0, 153);font-size:100%;" &gt;&lt;br /&gt;What is an Extension Point ?&lt;br /&gt;&lt;br /&gt;&lt;/span&gt; &lt;div style="text-align: justify; color: rgb(51, 0, 153);"&gt;&lt;span style="font-size:100%;"&gt;   2. A number of jython scripts executed to accomplish certain specific task. These scripts bundled together&lt;/span&gt;&lt;span style="font-size:100%;"&gt; is an Extension Point. One can drop in as many Extension Points as possible.&lt;/span&gt;&lt;span style="font-size:100%;"&gt; The core product picks up a particular 'Extension point' and executes these scripts.&lt;/span&gt;&lt;span style="font-size:100%;"&gt; Jython provides a Java Interpreter which was embedded within the core product for the scripts to be&lt;/span&gt;&lt;span style="font-size:100%;"&gt; executed and accomplish a task.&lt;/span&gt;&lt;span style="font-size:100%;"&gt; So, an Extension Point in other words is a bundled jar of Jython scripts and XML files.&lt;br /&gt;&lt;/span&gt;&lt;/div&gt; &lt;span style="color: rgb(51, 0, 153);font-size:100%;" &gt;&lt;br /&gt;&lt;br /&gt;How did it work ?&lt;br /&gt;&lt;br /&gt;&lt;/span&gt; &lt;div style="text-align: justify; color: rgb(51, 0, 153);"&gt;&lt;span style="font-size:100%;"&gt; 3. Each Extension Point was developed and bundled as a jar file. The jar file had Jython scripts and a XML configuration file. This XML file provided information about the scripts ( meta data , isn't it ?).&lt;br /&gt;&lt;/span&gt;&lt;/div&gt; &lt;span style="color: rgb(51, 0, 153);font-size:100%;" &gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(51, 0, 153);font-size:100%;" &gt;The core product could pick up this bundled jar file , explode it and load the 'meta data' into the&lt;/span&gt;&lt;span style="font-size:100%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;div style="text-align: justify; color: rgb(51, 0, 153);"&gt;&lt;span style="font-size:100%;"&gt;      core product. this way end-user of the product can make use of this meta data to execute the scripts. &lt;/span&gt;&lt;span style="font-size:100%;"&gt;The core product would come to know about the 'Extension Point' through the 'script configuration XML file within the jar. The Core product would pick up the Jar file , read the XML file to get the knowledge of the scripts.&lt;br /&gt;&lt;br /&gt;What is the content of the XML file ?&lt;br /&gt;1. Name of the jython script.&lt;br /&gt;2. Location.&lt;br /&gt;3. Display Name of the script - that needs to be displayed within the scripts menu on the core product UI.&lt;br /&gt;&lt;/span&gt;&lt;/div&gt; &lt;span style="color: rgb(51, 0, 153);font-size:100%;" &gt;&lt;br /&gt;Isn't it powerful ?&lt;br /&gt;&lt;br /&gt;Usage examples:&lt;br /&gt;&lt;/span&gt; &lt;ul style="color: rgb(51, 0, 153);"&gt;   &lt;li&gt;&lt;span style="font-size:100%;"&gt;   Execute certain Policies. Policies that keep changing. Jython scripts can add value.&lt;/span&gt;&lt;/li&gt;   &lt;li&gt;&lt;span style="font-size:100%;"&gt;   Execute certain 'Rules'. Rules that can be customized.&lt;/span&gt;&lt;/li&gt;   &lt;li&gt;&lt;span style="font-size:100%;"&gt;   Execute any other Jython scripts to manage configuration data.&lt;/span&gt;&lt;/li&gt;   &lt;li&gt;&lt;span style="font-size:100%;"&gt;   Execute reports with additional jython functionality.&lt;/span&gt;&lt;/li&gt;   &lt;li&gt;&lt;span style="font-size:100%;"&gt;   Manage application configuration data.&lt;/span&gt;&lt;/li&gt;   &lt;li&gt;&lt;span style="font-size:100%;"&gt;Provision files to different nodes (machines) from a single location using SSH or FTP&lt;br /&gt;&lt;/span&gt;&lt;/li&gt;   &lt;li&gt;&lt;span style="font-size:100%;"&gt;Execute Unix commands or Shell scripts remotely using SSH.&lt;br /&gt;&lt;/span&gt;&lt;/li&gt; &lt;/ul&gt; &lt;span style="color: rgb(51, 0, 153);font-size:100%;" &gt;These Jython scripts could enhance additional functionality, like adding encryption/decryption and checksum techniques on top of the existing ones.&lt;br /&gt;&lt;br /&gt;"Significant advantage of such a mechanism comes from the fact that these scripts can be modified or added&lt;br /&gt;without any complex deployments or compilation of the application or product".&lt;br /&gt;&lt;br /&gt;What did I do with such a framework ?&lt;br /&gt;I developed certain scripts to accomplish this:&lt;br /&gt;&lt;br /&gt;&lt;/span&gt; &lt;div style="text-align: justify; color: rgb(51, 0, 153);"&gt;&lt;span style="font-size:100%;"&gt; Discover WebSphere Application server ports within each node for a given cell. This meant that the core product was not aware of WebSphere or Weblogic. Jython scripts specific to WebSphere application server configuration automation made the product customized to fit to be used for WebSphere Administration purposes. Meaning , the product was customized for WebSphere App server needs. Similarly, customized the same product to execute certain tasks to achieve some configuration changes for Weblogic Application server. All this was done by developing the jython scripts independent of the core product and then the bundled jar of scripts were dropped in a location for the core product to pick and act.&lt;br /&gt;&lt;/span&gt;&lt;/div&gt; &lt;span style="color: rgb(51, 0, 153);font-size:100%;" &gt;&lt;br /&gt;&lt;/span&gt; &lt;div style="text-align: justify; color: rgb(51, 0, 153);"&gt;&lt;span style="font-size:100%;"&gt;Note: I am going to add some java code and jython scripts to demonstrate the above explanation in my next series of Power Jython.&lt;br /&gt;&lt;/span&gt;&lt;/div&gt; &lt;span style="font-size:85%;"&gt;   &lt;span style="font-size:100%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(51, 51, 153);font-size:100%;" &gt;Keep reading Power Jython series......&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt; &lt;div style="text-align: center;"&gt;** End **&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6689741864970777833-7778617686020370378?l=i-work-i-blog.blogspot.com'/&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://i-work-i-blog.blogspot.com/feeds/7778617686020370378/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=6689741864970777833&amp;postID=7778617686020370378' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6689741864970777833/posts/default/7778617686020370378'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6689741864970777833/posts/default/7778617686020370378'/><link rel='alternate' type='text/html' href='http://i-work-i-blog.blogspot.com/2007/03/power-jython-extend-and-customize.html' title='Power Jython : Extend and Customize a Product using Jython: Part-1'/><author><name>Ram Gorti's Bloogle</name><uri>http://www.blogger.com/profile/12879197959501034250</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='10130760253924122226'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry></feed>