<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Vivek Agarwal's Portal/Java Blog &#187; Java</title>
	<atom:link href="http://vivekagarwal.wordpress.com/category/java/feed/" rel="self" type="application/rss+xml" />
	<link>http://vivekagarwal.wordpress.com</link>
	<description>An IBM Gold Consultant's weblog about IBM, Lotus, WebSphere, J2EE, IT Processes, and other IT technologies</description>
	<lastBuildDate>Tue, 27 Oct 2009 03:15:20 +0000</lastBuildDate>
	<generator>http://wordpress.com/</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<cloud domain='vivekagarwal.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://www.gravatar.com/blavatar/da8f819b3926c7922045a2bb8dda8053?s=96&#038;d=http://s.wordpress.com/i/buttonw-com.png</url>
		<title>Vivek Agarwal's Portal/Java Blog &#187; Java</title>
		<link>http://vivekagarwal.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://vivekagarwal.wordpress.com/osd.xml" title="Vivek Agarwal&#8217;s Portal/Java Blog" />
		<item>
		<title>IBM&#8217;s launches a new Information Led Transformation Initiative</title>
		<link>http://vivekagarwal.wordpress.com/2009/10/26/ibms-launches-a-new-information-led-transformation-initiative/</link>
		<comments>http://vivekagarwal.wordpress.com/2009/10/26/ibms-launches-a-new-information-led-transformation-initiative/#comments</comments>
		<pubDate>Tue, 27 Oct 2009 03:15:20 +0000</pubDate>
		<dc:creator>Vivek Agarwal</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[IBM]]></category>
		<category><![CDATA[IBM Gold Consultant]]></category>
		<category><![CDATA[Information Led Transformation]]></category>
		<category><![CDATA[IOD]]></category>
		<category><![CDATA[IOD2009]]></category>

		<guid isPermaLink="false">http://vivekagarwal.wordpress.com/?p=189</guid>
		<description><![CDATA[I am in Las Vegas for the IBM Gold Consultant Briefing 2009 that is being held in conjunction with the IBM Information On Demand (IOD) 2009 conference. I am well into the Gold Briefing (4th day), and am suffering a wee bit from information overload as part of the IBM Information Led Transformation (ILT) initiative! [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=vivekagarwal.wordpress.com&blog=929801&post=189&subd=vivekagarwal&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>I am in Las Vegas for the IBM Gold Consultant Briefing 2009 that is being held in conjunction with the IBM Information On Demand (IOD) 2009 conference. I am well into the Gold Briefing (4th day), and am suffering a wee bit from information overload as part of the IBM Information Led Transformation (ILT) initiative! <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  Today IBM announced its impressive ILT initiative which I see as another evolutionary step in the Information On Demand journey that was kicked off 4 years back. IBM certainly has made huge investments in this space over this period &#8211; $12B with $8B in some major acquisitions and $4B in organic R&amp;D. And the IM portfolio certainly looks quite comprehensive with a broad range of capabilities.</p>
<p>The Information Stack in IBM&#8217;s words has the following pieces -</p>
<ul>
<li>An <strong>Information Infrastructure</strong> comprised of software, servers, and storage that provides a foundation for your information.</li>
<li><strong>Trusted Information</strong> gives you a single view of data through offerings that enable you to transform silos of information into a trusted, strategic asset that is shared across your organization.</li>
<li><strong>Business Analytics and Performance Management</strong> enables you apply analytics to optimize your business through  better decisions by providing planning, budgeting, forecasting, measuring, monitoring, reporting and analysis capabilities.</li>
</ul>
<p>With IBM, you can never have enough brand names and enough churn in product names, to make staying on top of things a challenge! IBM has it all &#8211; the newer Optim, FileNet, InfoSphere, Cognos, SPSS, ILog solutions; the more traditional Db2, Informix, CMOD products; and the cloud and mashup buzzwords. I think technically very impressive but I sure do wish that it was easier to stay connected with all the brand/product names!</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/vivekagarwal.wordpress.com/189/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/vivekagarwal.wordpress.com/189/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/vivekagarwal.wordpress.com/189/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/vivekagarwal.wordpress.com/189/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/vivekagarwal.wordpress.com/189/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/vivekagarwal.wordpress.com/189/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/vivekagarwal.wordpress.com/189/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/vivekagarwal.wordpress.com/189/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/vivekagarwal.wordpress.com/189/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/vivekagarwal.wordpress.com/189/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=vivekagarwal.wordpress.com&blog=929801&post=189&subd=vivekagarwal&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://vivekagarwal.wordpress.com/2009/10/26/ibms-launches-a-new-information-led-transformation-initiative/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/51b07703056eac6cc06db437b8cfe663?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Vivek</media:title>
		</media:content>
	</item>
		<item>
		<title>Xtivia launches new &#8220;Virtual-WebSphereAdmin&#8221; Service Offering!</title>
		<link>http://vivekagarwal.wordpress.com/2009/09/15/xtivia-launches-virtual-websphere-admin/</link>
		<comments>http://vivekagarwal.wordpress.com/2009/09/15/xtivia-launches-virtual-websphere-admin/#comments</comments>
		<pubDate>Wed, 16 Sep 2009 02:57:28 +0000</pubDate>
		<dc:creator>Vivek Agarwal</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[WebSphere]]></category>
		<category><![CDATA[WebSpherePortal]]></category>
		<category><![CDATA[Remote WebSphere Administration]]></category>
		<category><![CDATA[Virtual-WebSphereAdmin]]></category>
		<category><![CDATA[WebSphere Consulting]]></category>
		<category><![CDATA[Xtivia]]></category>

		<guid isPermaLink="false">http://vivekagarwal.wordpress.com/?p=157</guid>
		<description><![CDATA[I am really excited about this new offering from our business unit &#8211; the official press release went out today and I could not resist blogging about it even though I am getting a bit salesy here! As Dennis said in the press release &#8211; we have been providing remote WebSphere administration and development services [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=vivekagarwal.wordpress.com&blog=929801&post=157&subd=vivekagarwal&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>I am really excited about this new offering from our business unit &#8211; the <a href="http://www.xtivia.com/virtual-websphereadmin-service" target="_blank">official press release</a> went out today and I could not resist blogging about it even though I am getting a bit <em>salesy </em>here! As Dennis said in the press release &#8211; we have been providing remote WebSphere administration and development services for various client installations that included WebSphere Application Server Network Deployment, WebSphere Portal, and IBM Web Content Management. These services ranged from complete outsourcing of all WebSphere administration and maintenance needs, to on-demand consulting and mentoring. So, in essence, we have now codified these services that we have been offering for years, into pre-packaged offerings that make it simpler for prospects and customers to understand the value proposition of Xtivia&#8217;s remote WebSphere services.</p>
<p>An excerpt from the news release -</p>
<p>Virtual-WebSphereAdmin provides a cost-effective solution for organizations seeking to optimize the  availability and performance of their critical WebSphere-based business  information systems. This is accomplished through a comprehensive remote  WebSphere Administration service designed specifically to meet the WebSphere  administration, maintenance, management and consulting needs of our clients.  Xtivia’s Virtual-WebSphereAdmin service combines a sophisticated suite of  monitoring and reporting tools with expert consulting services to deliver  complete WebSphere performance management.</p>
<p>You can find more details about this service at <a href="http://www.xtivia.com/remote-services/virtual-websphereadmin" target="_blank">http://www.xtivia.com/remote-services/virtual-websphereadmin</a> or you can go directly to <a href="http://www.xtivia.com/request-information" target="_blank">http://www.xtivia.com/request-information</a> to get in touch with the Xtivia sales team about this service. I am confident that you will find it worth your time to do so!</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/vivekagarwal.wordpress.com/157/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/vivekagarwal.wordpress.com/157/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/vivekagarwal.wordpress.com/157/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/vivekagarwal.wordpress.com/157/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/vivekagarwal.wordpress.com/157/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/vivekagarwal.wordpress.com/157/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/vivekagarwal.wordpress.com/157/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/vivekagarwal.wordpress.com/157/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/vivekagarwal.wordpress.com/157/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/vivekagarwal.wordpress.com/157/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=vivekagarwal.wordpress.com&blog=929801&post=157&subd=vivekagarwal&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://vivekagarwal.wordpress.com/2009/09/15/xtivia-launches-virtual-websphere-admin/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/51b07703056eac6cc06db437b8cfe663?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Vivek</media:title>
		</media:content>
	</item>
		<item>
		<title>Firewall dropping Oracle database connections in WebSphere connection pool?</title>
		<link>http://vivekagarwal.wordpress.com/2009/07/04/firewall-dropping-oracle-database-connections-in-websphere-connection-pool/</link>
		<comments>http://vivekagarwal.wordpress.com/2009/07/04/firewall-dropping-oracle-database-connections-in-websphere-connection-pool/#comments</comments>
		<pubDate>Sat, 04 Jul 2009 17:53:02 +0000</pubDate>
		<dc:creator>Vivek Agarwal</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Oracle]]></category>
		<category><![CDATA[WebSphere]]></category>
		<category><![CDATA[Cisco ASA 5520]]></category>
		<category><![CDATA[Cisco firewall]]></category>
		<category><![CDATA[Dropped database connections]]></category>
		<category><![CDATA[sqlnet.expire_time]]></category>

		<guid isPermaLink="false">http://vivekagarwal.wordpress.com/?p=152</guid>
		<description><![CDATA[We recently switched one of our client&#8217;s WebSphere Application Server and WebSphere Portal based infrastructure to a new physical environment. During our testing we found that we were getting stale connection exceptions in SystemOut.log and in the application logs. On digging a little deeper, our team tracked it down to the fact that the Cisco [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=vivekagarwal.wordpress.com&blog=929801&post=152&subd=vivekagarwal&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>We recently switched one of our client&#8217;s WebSphere Application Server and WebSphere Portal based infrastructure to a new physical environment. During our testing we found that we were getting stale connection exceptions in SystemOut.log and in the application logs. On digging a little deeper, our team tracked it down to the fact that the Cisco firewall was dropping our Oracle database connections after they had been inactive for a certain amount of time. When our team discussed the issue with the network team, they were essentially told that all was good with the network infrastructure. The application team tweaked some of the connection pool settings but that only helped alleviate the issue slightly and we started encountering performance issues. Eventually, we figured out a solution that works!</p>
<p><span id="more-152"></span>The solution that we ended up with was to work around this issue on the Oracle end. We modified the sqlnet.expire_time parameter in sqlnet.ora on the Oracle 10g server down from the default &#8220;30&#8243; (30 minutes) to &#8220;1&#8243; (1 minute).</p>
<p><strong>The explanation on why this worked</strong></p>
<p>The parameter <code>SQLNET.EXPIRE_TIME</code> is used to specify the time interval, in minutes, to send a probe to verify that client/server connections are active. If the probe finds a terminated connection, or a connection that is no longer in use, it returns an error, causing the server process to exit. This parameter is primarily intended for the database server so that it can free up server-side resources that are not in use.</p>
<p>A side-effect of the probe is that there is TCP-IP activity between the client and the server each time the probe is executed, and the firewall designates the link as an active one. By lowering the probe interval down to a minute, we managed to fool the firewall into leaving the database connections in the connection pool alone, and not terminate them even though the client may not execute a query using the connection for an extended period of time.</p>
<p>I am sure you can tweak the value of this parameter to determine the optimal value for your firewall and situation; dropping down the sqlnet.expire_time to a minute is probably too radical and redundant in reality. Even though the probe generated by this setting is small, it still does generate network traffic that may be meaningful in some situations.</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/vivekagarwal.wordpress.com/152/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/vivekagarwal.wordpress.com/152/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/vivekagarwal.wordpress.com/152/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/vivekagarwal.wordpress.com/152/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/vivekagarwal.wordpress.com/152/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/vivekagarwal.wordpress.com/152/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/vivekagarwal.wordpress.com/152/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/vivekagarwal.wordpress.com/152/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/vivekagarwal.wordpress.com/152/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/vivekagarwal.wordpress.com/152/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=vivekagarwal.wordpress.com&blog=929801&post=152&subd=vivekagarwal&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://vivekagarwal.wordpress.com/2009/07/04/firewall-dropping-oracle-database-connections-in-websphere-connection-pool/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/51b07703056eac6cc06db437b8cfe663?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Vivek</media:title>
		</media:content>
	</item>
		<item>
		<title>Want to test your object-oriented coding skills? Check out this code smelling exercise &#8230;</title>
		<link>http://vivekagarwal.wordpress.com/2008/06/21/code-smelling-exercise/</link>
		<comments>http://vivekagarwal.wordpress.com/2008/06/21/code-smelling-exercise/#comments</comments>
		<pubDate>Sat, 21 Jun 2008 23:12:51 +0000</pubDate>
		<dc:creator>Vivek Agarwal</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Bad smells in code]]></category>
		<category><![CDATA[Code Smelling Exercise]]></category>
		<category><![CDATA[Code Smells]]></category>
		<category><![CDATA[Interview Question]]></category>
		<category><![CDATA[Java Developer Interview]]></category>
		<category><![CDATA[Object Oriented Design]]></category>
		<category><![CDATA[Object Oriented Programming]]></category>
		<category><![CDATA[OOD]]></category>
		<category><![CDATA[OOP]]></category>
		<category><![CDATA[Refactoring]]></category>

		<guid isPermaLink="false">http://vivekagarwal.wordpress.com/?p=105</guid>
		<description><![CDATA[Sometime back, I wrote on Bad Smells in Code that were defined as &#8211; &#8220;A code smell identifies classic mistakes made in developing code. These mistakes typically result in code that is difficult to understand, maintain, debug, and extend.&#8221; In my previous blog entry, I captured some code smells that are commonly found in code [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=vivekagarwal.wordpress.com&blog=929801&post=105&subd=vivekagarwal&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Sometime back, I wrote on <a href="http://vivekagarwal.wordpress.com/2008/06/07/dusting-off-the-bad-smells-in-code-presentation/" target="_blank">Bad Smells in Code</a> that were defined as &#8211; &#8220;A code smell identifies classic mistakes made in developing code. These mistakes typically result in code that is difficult to understand, maintain, debug, and extend.&#8221; In my previous blog entry, I captured some code smells that are commonly found in code written by new (and some experienced) programmers. Sample smells include &#8220;duplicated code&#8221;, &#8220;long method&#8221;, &#8220;inappropriate intimacy&#8221;, &#8220;large classes&#8221;, &#8220;inconsistent names&#8221;, and others. I had promised to be back later with my “code smelling exercise” that I used during my presentation to make my points about code smells. Well here it is &#8230;<span id="more-105"></span></p>
<p>The exercise has 3 Java classes &#8211; &#8220;Order&#8221;, &#8220;lineitemlist&#8221;, and &#8220;lineItem&#8221;.  They were written by me ~8 years back with the express intent of embedding as many smells as possible. Attendees in the presentation were given ten minutes to mark up all the poor coding practices (in other words &#8211; smells) that they could find. Feel free to try your skills to identify the smells! <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p><span style="color:#993300;">##########################################################################<br />
<strong> Order.java</strong><br />
##########################################################################</span></p>
<pre class="brush: java;">
package com.nq.util;

import java.io.*;
import java.util.*;
import java.lang.*;
import java.sql.*;

public class Order {

	private lineitemlist lineItemList;

	public Order(lineitemlist lis) {
		lineItemList = lis;
	}

	public boolean equals(Object aThat) {
    		if ( this == aThat ) return true;
		if ( !(aThat instanceof Order) ) return false;
    		Order that = (Order)aThat;
		return this.lineItemList.equals(that.lineItemList);
	}

	// writes this order object to the specified print writer
	public void writeOrder(Order order, PrintWriter pw) {
		// get a vector of line items
		Vector lineItems = order.getLineItemList().getLineItems();

		// ------------------------------------------------------
		// calculate total
		// ------------------------------------------------------
		// create an iterator for the vector
		Iterator iter = lineItems.iterator();
		lineItem item;
		// set total to zero
		int total = 0;
        	while (iter.hasNext()) {
	        	item = (lineItem)iter.next();

	        	// calculate total for line item
	        	int unitPrice = item.getUnitPrice();
	        	int qty = item.getQuantity();
	        	int lineitemtotal = unitPrice * qty;

	        	total += lineitemtotal;
	        }
		// ------------------------------------------------------
		// END calculate total
		// ------------------------------------------------------

		// ------------------------------------------------------
		// write order
		// ------------------------------------------------------
		// create an iterator for the vector
		iter = lineItems.iterator();
        	while (iter.hasNext()) {
	        	item = (lineItem)iter.next();

	        	// calculate total for line item
	        	int unitPrice = item.getUnitPrice();
	        	int qty = item.getQuantity();
	        	int productID = item.getProductID();
	        	int imageID = item.getImageId();
	        	int lineitemtotal = unitPrice * qty;

	        	pw.println(&quot;Begin Line Item&quot;);
	        	pw.println(&quot;Product = &quot; + productID);
	        	pw.println(&quot;Image = &quot; + imageID);
	        	pw.println(&quot;Quantity = &quot; + qty);
	        	pw.println(&quot;Total = &quot; + lineitemtotal);
	        	pw.println(&quot;End Line Item&quot;);
	        }
		pw.println(&quot;Order total = &quot; + total);
	}

	public int getTotal() {
		// get a vector of line items
		Vector lineItems = lineItemList.getLineItems();
		// create an iterator for the vector
		Iterator iter = lineItems.iterator();
		lineItem item;
		// set total to zero
		int total = 0;
        	while (iter.hasNext()) {
	        	item = (lineItem)iterator.next();

	        	// calculate total for line item
	        	int unitPrice = item.getUnitPrice();
	        	int qty = item.getQuantity();
	        	int lineitemtotal = unitPrice * qty;

	        	total += lineitemtotal;
	        }
	        return total;
	}

	/** This method saves the order to the database */
	public void saveOrder()  throws SQLException
	{
		//create connection
		Connection conn = null;

		java.sql.Date date = new java.sql.Date((new java.util.Date())
		.getTime());
		PreparedStatement orderStatement = null;
		PreparedStatement getStatement = null;
		String sql = null;
		sql = new StringBuffer().append(&quot;INSERT INTO T_ORDER &quot; )
			.append(&quot;(AUTHORIZATION_CODE, &quot; )
			.append(&quot;SHIPMETHOD_ID, USER_ID, ADDRESS_ID) &quot; )
			.append(&quot;VALUES ( ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?,
			?)&quot; ).toString();
		conn = setConnection();
		orderStatement = conn.prepareStatement(sql);
		//set all parameters
		...
		//execute statement
		orderStatement.executeUpdate();
	}
}
</pre>
<p><span style="color:#993300;">##########################################################################<br />
<strong> lineitemlist.java</strong><br />
##########################################################################</span></p>
<pre class="brush: java;">
package com.nq.util;

import java.io.*;
import java.util.*;
import java.lang.*;

class lineitemlist {
	private Vector LIList;

	public void setLineItems(Vector lineItems) {
		LIList = lineItems;
	}

	Vector getLineItems() {
		return LIList;
	}
}
</pre>
<p><span style="color:#993300;">##########################################################################<br />
<strong> lineItem.java</strong><br />
##########################################################################</span></p>
<pre class="brush: java;">
package com.nq.util;

import java.io.*;
import java.util.*;
import java.lang.*;

class lineItem {
	protected int productId;
	private int ImageID;
	private int qty;
	private int Unitprice;

	public lineItem(int prodID, int ImageID, int inQty) {
		productId = prodID;
		this.ImageID = ImageID;
		qty = inQty;
	}

	public void setLineItems(Vector lineItems) {
		LineItems = lineItems;
	}

	Vector getLineItems() {
		return LineItems;
	}

	int getProductID() {
		return productId;
	}

	int getImageID() {
		return imageID;
	}

	int getQuantity() {
		return qty;
	}

	int getUnitPrice() {
		return Unitprice;
	}

	public void setProductID(int id) {
		productId = id;
	}

	public void setImageID(int ID) {
		imageID = ID;
	}

	public void setQty(int qty) {
		this.qty = qty;
	}

	public void setUnitPrice(int i) {
		Unitprice = i;
	}
}
</pre>
<p>Hope you had a fun time with identifying the smells! There are quite a few in here. I will look into writing another entry on another day that explains the smells that permeate this code sample.</p>
<p>Any comments on how reasonable this would be as an interview question for mid-to-senior level developers?</p>
<hr />Check out this poll to submit your response on this code smelling exercise &#8230;</p>
<a name="pd_a_717541"></a><div class="PDS_Poll" id="PDI_container717541" style="display:inline-block;"></div><script type="text/javascript" language="javascript" charset="utf-8" src="http://static.polldaddy.com/p/717541.js"></script>
		<noscript>
		<a href="http://answers.polldaddy.com/poll/717541/">View This Poll</a><br/><span style="font-size:10px;"><a href="http://www.polldaddy.com">online surveys</a></span>
		</noscript>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/vivekagarwal.wordpress.com/105/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/vivekagarwal.wordpress.com/105/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/vivekagarwal.wordpress.com/105/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/vivekagarwal.wordpress.com/105/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/vivekagarwal.wordpress.com/105/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/vivekagarwal.wordpress.com/105/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/vivekagarwal.wordpress.com/105/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/vivekagarwal.wordpress.com/105/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/vivekagarwal.wordpress.com/105/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/vivekagarwal.wordpress.com/105/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/vivekagarwal.wordpress.com/105/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/vivekagarwal.wordpress.com/105/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=vivekagarwal.wordpress.com&blog=929801&post=105&subd=vivekagarwal&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://vivekagarwal.wordpress.com/2008/06/21/code-smelling-exercise/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/51b07703056eac6cc06db437b8cfe663?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Vivek</media:title>
		</media:content>
	</item>
		<item>
		<title>How do you change the LDAP server name for a WebSphere Portal v6 server?</title>
		<link>http://vivekagarwal.wordpress.com/2008/06/18/how-do-you-change-the-ldap-server-name-for-a-websphere-portal-v6-server/</link>
		<comments>http://vivekagarwal.wordpress.com/2008/06/18/how-do-you-change-the-ldap-server-name-for-a-websphere-portal-v6-server/#comments</comments>
		<pubDate>Thu, 19 Jun 2008 03:46:57 +0000</pubDate>
		<dc:creator>Vivek Agarwal</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Portal]]></category>
		<category><![CDATA[WebSphere]]></category>
		<category><![CDATA[WebSpherePortal]]></category>
		<category><![CDATA[How To]]></category>
		<category><![CDATA[HowTo]]></category>
		<category><![CDATA[LDAP]]></category>
		<category><![CDATA[Rename]]></category>
		<category><![CDATA[WebSphere Portal]]></category>
		<category><![CDATA[WebSphere Portal v6]]></category>

		<guid isPermaLink="false">http://vivekagarwal.wordpress.com/?p=103</guid>
		<description><![CDATA[Today one of the portal administrators in my team was trying to reconfigure the LDAP server being used by an existing WebSphere Portal v6 install. The specific reconfiguration that he was doing was extremely simple &#8211; he was replacing one LDAP server with another identically configured LDAP server &#8211; so the only change was the [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=vivekagarwal.wordpress.com&blog=929801&post=103&subd=vivekagarwal&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Today one of the portal administrators in my team was trying to reconfigure the LDAP server being used by an existing WebSphere Portal v6 install. The specific reconfiguration that he was doing was extremely simple &#8211; he was replacing one LDAP server with another identically configured LDAP server &#8211; so the only change was the name of the LDAP server.  We were able to perform this change without disabling/re-enabling security in WebSphere Portal.<span id="more-103"></span></p>
<p>You end up changing two files to change the LDAP server name -</p>
<ul>
<li><span style="color:#0000ff;"><strong>security.xml</strong></span>: This file reconfigures the LDAP server being used by WebSphere Application Server. You can find this file in <em>${WP_PROFILE_ROOT}\config\cells\&lt;cell_name&gt;</em>. You change the LDAP server name (highlighted in red) in the following lines -</li>
</ul>
<p>&lt;userRegistries xmi:type=&#8221;security:LDAPUserRegistry&#8221; xmi:id=&#8221;LDAPUserRegistry_1&#8243; serverId=&#8221;wasadmin_dn&#8221; serverPassword=&#8221;{xor}wasadmin_pwd&#8221; realm=&#8221;<span style="color:#ff0000;">ldap_server_name</span>:389&#8243; limit=&#8221;0&#8243; ignoreCase=&#8221;true&#8221; type=&#8221;CUSTOM&#8221; sslEnabled=&#8221;true&#8221; sslConfig=&#8221;test/DefaultSSLSettings&#8221; baseDN=&#8221;dc=com&#8221; bindDN=&#8221;wpsbind_dn&#8221; bindPassword=&#8221;{xor}wpsbind_pwd&#8221; searchTimeout=&#8221;120&#8243; reuseConnection=&#8221;true&#8221;&gt;<br />
&lt;searchFilter xmi:id=&#8221;LDAPSearchFilter_1&#8243; userFilter=&#8221;(&amp;(uid=%v)(objectclass=inetOrgPerson))&#8221; groupFilter=&#8221;(&amp;(cn=%v)(objectclass=groupOfUniqueNames))&#8221; userIdMap=&#8221;*:uid&#8221; groupIdMap=&#8221;*:cn&#8221; groupMemberIdMap=&#8221;groupOfUniqueNames:uniqueMember&#8221; certificateMapMode=&#8221;EXACT_DN&#8221; certificateFilter=&#8221;"/&gt;<br />
&lt;hosts xmi:id=&#8221;EndPoint_1173225214609&#8243; host=&#8221;<span style="color:#ff0000;">ldap_server_name</span>&#8221; port=&#8221;389&#8243;/&gt;<br />
&lt;/userRegistries&gt;</p>
<ul>
<li><span style="color:#0000ff;"><strong>wmm.xml</strong></span>: This file reconfigures the LDAP server being used by WebSphere Portal WMM component. You can find this file in <em>${WP_SERVER_ROOT}\wmm. </em>You change the LDAP server name (highlighted in red) in the following XML snippet -</li>
</ul>
<p>&lt;ldapRepository name=&#8221;wmmLDAP&#8221;<br />
UUID=&#8221;LDAP1&#8243;<br />
adapterClassName=&#8221;com.ibm.ws.wmm.ldap.ibmdir.IBMDirectoryAdapterImpl&#8221;<br />
supportDynamicAttributes=&#8221;false&#8221;<br />
configurationFile=&#8221;wmmLDAPServerAttributes.xml&#8221;<br />
wmmGenerateExtId=&#8221;false&#8221;<br />
supportGetPersonByAccountName=&#8221;true&#8221;<br />
profileRepositoryForGroups=&#8221;LDAP1&#8243;<br />
supportTransactions=&#8221;false&#8221;<br />
adminId=&#8221;admin_dn&#8221;<br />
adminPassword=&#8221;admin_pwd&#8221;<br />
<span style="color:#ff0000;"><span style="color:#000000;">ldapHost=&#8221;</span>ldap_server_name<span style="color:#000000;">&#8220;</span></span><br />
ldapPort=&#8221;389&#8243;<br />
ldapTimeOut=&#8221;6000&#8243;<br />
ldapAuthentication=&#8221;SIMPLE&#8221;<br />
ldapType=&#8221;0&#8243;<br />
sslEnabled=&#8221;true&#8221;<br />
sslTrustStore=&#8221;C:\WebSphere\AppServer\etc\DummyServerTrustFile.jks&#8221;<br />
dirContextsMaxSize=&#8221;20&#8243;<br />
dirContextsMinSize=&#8221;5&#8243;<br />
dirContextTimeToLive=&#8221;-1&#8243;<br />
cacheGroups=&#8221;false&#8221;<br />
groupsCacheTimeOut=&#8221;600&#8243;<br />
cacheAttributes=&#8221;true&#8221;<br />
attributesCacheSize=&#8221;2000&#8243;<br />
attributesCacheTimeOut=&#8221;600&#8243;<br />
cacheNames=&#8221;true&#8221;<br />
namesCacheSize=&#8221;2000&#8243;<br />
namesCacheTimeOut=&#8221;600&#8243;&gt;</p>
<p>Once you have changed the LDAP server name in these two files to match the new server name, restart WebSphere Portal and you should be set to go.</p>
<p>Open up SystemOut.log in <em>${WP_SERVER_ROOT}\log </em>and look for the following line during server startup to verify that you are using the new LDAP server -</p>
<p>[6/18/08 12:10:34:690 CDT] 0000000a LdapRegistryI A   SECJ0419I: The user registry is currently connected to the LDAP server ldap://<span style="color:#ff0000;">wpsldap</span>:389.</p>
<p>In our case, the LDAP server name is &#8220;wpsldap&#8221;.</p>
<p><span style="color:#0000ff;"><strong>My Tip:</strong></span> In our test environments, we usually follow the practice of using virtual host names for the LDAP and database server. Rather than configuring the actual host names of the LDAP and database server being used by a given WebSphere Portal server, we use hosts file entries on Windows that configure wpsldap and wpsdb to point to the IP addresses of the relevant LDAP and database servers. Whenever we need to reconfigure a test WP server to use a different LDAP/database server, all we need to do is change the IP address in the hosts file to point to the new server. Simple, huh! And not exactly rocket science! <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/vivekagarwal.wordpress.com/103/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/vivekagarwal.wordpress.com/103/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/vivekagarwal.wordpress.com/103/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/vivekagarwal.wordpress.com/103/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/vivekagarwal.wordpress.com/103/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/vivekagarwal.wordpress.com/103/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/vivekagarwal.wordpress.com/103/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/vivekagarwal.wordpress.com/103/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/vivekagarwal.wordpress.com/103/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/vivekagarwal.wordpress.com/103/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/vivekagarwal.wordpress.com/103/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/vivekagarwal.wordpress.com/103/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=vivekagarwal.wordpress.com&blog=929801&post=103&subd=vivekagarwal&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://vivekagarwal.wordpress.com/2008/06/18/how-do-you-change-the-ldap-server-name-for-a-websphere-portal-v6-server/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/51b07703056eac6cc06db437b8cfe663?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Vivek</media:title>
		</media:content>
	</item>
		<item>
		<title>Dusting off the &#8220;Bad Smells in Code&#8221; presentation!</title>
		<link>http://vivekagarwal.wordpress.com/2008/06/07/dusting-off-the-bad-smells-in-code-presentation/</link>
		<comments>http://vivekagarwal.wordpress.com/2008/06/07/dusting-off-the-bad-smells-in-code-presentation/#comments</comments>
		<pubDate>Sun, 08 Jun 2008 05:19:34 +0000</pubDate>
		<dc:creator>Vivek Agarwal</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Bad smells in code]]></category>
		<category><![CDATA[Code Smells]]></category>
		<category><![CDATA[Object Oriented Design]]></category>
		<category><![CDATA[Object Oriented Programming]]></category>
		<category><![CDATA[OOD]]></category>
		<category><![CDATA[OOP]]></category>
		<category><![CDATA[Refactoring]]></category>

		<guid isPermaLink="false">http://vivekagarwal.wordpress.com/?p=99</guid>
		<description><![CDATA[Recently, I dusted off a presentation (i.e. re-skinned and reused) that I had done back in year 2000 about &#8220;Bad Smells in Code&#8221; that was derived from Martin Fowler&#8217;s book Refactoring: Improving the Design of Existing Code. While the Refactoring book itself was a little too prescription oriented for my liking, the chapter about code [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=vivekagarwal.wordpress.com&blog=929801&post=99&subd=vivekagarwal&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Recently, I dusted off a presentation (i.e. re-skinned and reused) that I had done back in year 2000 about &#8220;Bad Smells in Code&#8221; that was derived from Martin Fowler&#8217;s book <em>Refactoring: Improving the Design of Existing Code</em>. While the Refactoring book itself was a little too prescription oriented for my liking, the chapter about code smells was very good in my opinion. I look upon code smells as fairly common classic mistakes made in developing code that you are best advised to avoid &#8211; they are usually indications that something is not right in paradise and needs a closer look, and possibly some refactoring (i.e. clean-up) is in order. This blog entry focuses on object-oriented code smells.</p>
<p><span id="more-99"></span></p>
<p><strong><em>What is a code smell?</em></strong></p>
<p>A code smell identifies classic mistakes made in developing code. These mistakes typically result in code that is difficult to understand, maintain, debug, and extend.</p>
<p><strong><em>What are some common code smells in object-oriented code?</em></strong></p>
<p><em>Duplicated code<br />
</em></p>
<ul>
<li>The worst stinker of all!</li>
</ul>
<p><em>Long method<br />
</em></p>
<ul>
<li>Difficult to reuse and difficult to understand.</li>
<li>The object programs that live best and longest are those with short methods.</li>
<li>The best object programs are endless sequences of delegation. Their payoffs are explanation and sharing.</li>
</ul>
<p><em>Long parameter list<br />
</em></p>
<ul>
<li>Hard to understand, methods become inconsistent and difficult to use and more likely to require change.</li>
</ul>
<p><em>Uncommunicative name<br />
</em></p>
<ul>
<li>Does the name of the method succinctly describe what that method does?</li>
<li>Could you read the method&#8217;s name to another developer and have them explain to you what it does? If not, rename it or rewrite it.</li>
</ul>
<p><em>Inconsistent names<br />
</em></p>
<ul>
<li>Pick a set of standard terminology and stick to it throughout your methods.</li>
<li>If you use “add”, then use “add” in all relevant situations – not “create”. Another example is “delete”/”remove”.</li>
</ul>
<p><em>Inappropriate intimacy<br />
</em></p>
<ul>
<li>Classes delving into each other’s private parts.</li>
<li>Excessive use of class A’s accessors from class B.</li>
<li>Over intimate classes need to be broken up as lovers were in ancient days! </li>
</ul>
<p><em>Indecent exposure<br />
</em></p>
<ul>
<li>Beware of classes that unnecessarily expose their internals. You should have a compelling reason for every item you make public. If you don&#8217;t, hide it.</li>
</ul>
<p><em>Large Classes<br />
</em></p>
<ul>
<li>Too much code</li>
<li>Too many instance variables</li>
<li>Use layering and decomposition to avoid this problem.</li>
</ul>
<p><em>Classes with too little code <br />
</em></p>
<ul>
<li>Often data classes that can become domain classes</li>
<li>Or candidates for downsizing!</li>
</ul>
<p><em>Divergent change<br />
</em></p>
<ul>
<li>A class is commonly changed in different ways for different reasons</li>
<li>Example – database + functionality</li>
</ul>
<p><em>A large number of function classes<br />
</em></p>
<ul>
<li>Indicate that the designers are thinking upside-down, i.e.. thinking of that which can be done to an object rather than that which can done by the object.</li>
</ul>
<p><em>Feature envy<br />
</em></p>
<ul>
<li>A method that seems more interested in a class other than the one it actually is in.</li>
<li> Many messages to the same object from the same method</li>
</ul>
<p><em>Data clumps<br />
</em></p>
<ul>
<li>Data items often hang around in groups together.</li>
<li> Extracting them into a class of their own will help reduce field lists and parameter lists.</li>
</ul>
<p><em>Switch statements<br />
</em></p>
<ul>
<li>Leads to duplication which leads to shotgun surgery</li>
<li> Consider polymorphism instead.</li>
</ul>
<p><em>Speculative generality<br />
</em></p>
<ul>
<li>Planning for change that never occurs</li>
<li> Increased complexity</li>
</ul>
<p><em>Too many casts<br />
</em></p>
<ul>
<li>Over generalization</li>
</ul>
<p><em>Comments<br />
</em></p>
<ul>
<li>Often used as a deodorant for stinkers</li>
<li>Superfluous comments</li>
</ul>
<p>There are other smells too but these are the most important ones in my opinion.</p>
<p><strong><em>Summary</em></strong></p>
<p>To summarize, code smells give you an indication that there is trouble in paradise. They are only a guideline and cannot be used as absolute directives. When you realize that you are writing code that reeks of one of these smells, then STOP and ask yourself if you proceeding down the right path. If not, REFACTOR.</p>
<p>If you have the time, take a look at <a href="http://www.infoq.com/presentations/effective-api-design">How to Design a Good API &amp; Why it Matters</a> &#8211; this presentation by Joshua Bloch is relevant even if you are not into designing APIs and all you do is design/code!</p>
<p>It was good to write about OOD &#8211; a topic that is near and dear to my heart, but one that I look into much too rarely with all the things on my plate. And presenting on this topic to some new team members was good too &#8211; wanted to emphasize some of my key coding philosophy points to them, and code smells act as a good introduction. I will be back later with my &#8220;code smelling exercise&#8221; that I used during this presentation to make my points about code smells. <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/vivekagarwal.wordpress.com/99/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/vivekagarwal.wordpress.com/99/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/vivekagarwal.wordpress.com/99/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/vivekagarwal.wordpress.com/99/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/vivekagarwal.wordpress.com/99/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/vivekagarwal.wordpress.com/99/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/vivekagarwal.wordpress.com/99/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/vivekagarwal.wordpress.com/99/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/vivekagarwal.wordpress.com/99/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/vivekagarwal.wordpress.com/99/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/vivekagarwal.wordpress.com/99/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/vivekagarwal.wordpress.com/99/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=vivekagarwal.wordpress.com&blog=929801&post=99&subd=vivekagarwal&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://vivekagarwal.wordpress.com/2008/06/07/dusting-off-the-bad-smells-in-code-presentation/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/51b07703056eac6cc06db437b8cfe663?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Vivek</media:title>
		</media:content>
	</item>
		<item>
		<title>An administrator cannot always add a portlet to a Quickr place!</title>
		<link>http://vivekagarwal.wordpress.com/2008/06/04/an-administrator-cannot-always-add-a-portlet-to-a-quickr-place/</link>
		<comments>http://vivekagarwal.wordpress.com/2008/06/04/an-administrator-cannot-always-add-a-portlet-to-a-quickr-place/#comments</comments>
		<pubDate>Thu, 05 Jun 2008 02:43:08 +0000</pubDate>
		<dc:creator>Vivek Agarwal</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Lotus Quickr]]></category>
		<category><![CDATA[Quickr]]></category>

		<guid isPermaLink="false">http://vivekagarwal.wordpress.com/?p=98</guid>
		<description><![CDATA[This is an issue that flummoxes Quickr newbies, and I had a couple of new team members run into it today. Figured that others run into this issue as well. Essentially, the natural expectation for most people is that as a Quickr administrator, they would be able to add portlets/components to any place irrespective of [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=vivekagarwal.wordpress.com&blog=929801&post=98&subd=vivekagarwal&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>This is an issue that flummoxes Quickr newbies, and I had a couple of new team members run into it today. Figured that others run into this issue as well. Essentially, the natural expectation for most people is that as a Quickr administrator, they would be able to add portlets/components to any place irrespective of whether they created it themselves or whether somebody else created it. While you don&#8217;t have to be the owner of a team place, you do need to be member of the team &#8220;managers&#8221; role. If you are not in the manager role and you are not the team place owner, then you cannot add a portlet!<br />
<span id="more-98"></span></p>
<p>IBM does have a technote about this &#8211; <a href="http://www-1.ibm.com/support/docview.wss?rs=3264&amp;context=SSVGKL&amp;q1=manager+administrator&amp;uid=swg21263613&amp;loc=en_US&amp;cs=utf-8&amp;lang=en" target="_blank">Error displays when the Administrator tries to add a portlet to a new page</a>. Essentially, when you run into this issue as a Quickr administrator, you can resolve it by simply following these steps -</p>
<ul>
<li> Access the Quickr place you want to modify</li>
<li>Click on &#8220;Customize Place&#8221;</li>
<li>Click on &#8220;Users&#8221; in the div that appears</li>
<li>Click on the &#8220;Managers&#8221; tab</li>
<li>Add the Quickr administrators user group to the &#8220;Managers&#8221; role</li>
<li>Add the portlet/page that you were attempting to add earlier. <em>IT SHOULD WORK NOW</em>!</li>
</ul>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/vivekagarwal.wordpress.com/98/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/vivekagarwal.wordpress.com/98/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/vivekagarwal.wordpress.com/98/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/vivekagarwal.wordpress.com/98/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/vivekagarwal.wordpress.com/98/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/vivekagarwal.wordpress.com/98/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/vivekagarwal.wordpress.com/98/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/vivekagarwal.wordpress.com/98/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/vivekagarwal.wordpress.com/98/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/vivekagarwal.wordpress.com/98/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/vivekagarwal.wordpress.com/98/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/vivekagarwal.wordpress.com/98/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=vivekagarwal.wordpress.com&blog=929801&post=98&subd=vivekagarwal&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://vivekagarwal.wordpress.com/2008/06/04/an-administrator-cannot-always-add-a-portlet-to-a-quickr-place/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/51b07703056eac6cc06db437b8cfe663?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Vivek</media:title>
		</media:content>
	</item>
		<item>
		<title>Missing log4j log files with DailyRollingFileAppender when they should roll over?</title>
		<link>http://vivekagarwal.wordpress.com/2008/02/09/missing-log4j-log-files-with-dailyrollingfileappender-when-they-should-roll-over/</link>
		<comments>http://vivekagarwal.wordpress.com/2008/02/09/missing-log4j-log-files-with-dailyrollingfileappender-when-they-should-roll-over/#comments</comments>
		<pubDate>Sun, 10 Feb 2008 00:50:45 +0000</pubDate>
		<dc:creator>Vivek Agarwal</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[WebSphere]]></category>
		<category><![CDATA[WebSpherePortal]]></category>
		<category><![CDATA[log4j]]></category>

		<guid isPermaLink="false">http://vivekagarwal.wordpress.com/?p=94</guid>
		<description><![CDATA[Yes, I am back with a blog entry after quite a gap here! I have been knocked out sick for 5 weeks now and I am sick of being sick! Better now and hoping to be back at a 100% soon. Enough excuses &#8211; onto the subject of this blog entry. We use Log4j&#8217;s DailyRollingFileAppender [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=vivekagarwal.wordpress.com&blog=929801&post=94&subd=vivekagarwal&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Yes, I am back with a blog entry after quite a gap here! I have been knocked out sick for 5 weeks now and I am sick of being sick! Better now and hoping to be back at a 100% soon. Enough excuses &#8211; onto the subject of this blog entry. We use Log4j&#8217;s DailyRollingFileAppender in a WebSphere Portal environment to generate daily log files for various custom portlets that we have deployed. This worked just fine on some WPE v6 test servers with multiple portlets logging to the same log file, and the daily rollover occurring every midnight. However, on some other WPE v6 test servers running the exact same applications, while logging did work the daily rollover did not. Instead of us having multiple log files with date timestamps in their names, we would only have <i>today&#8217;s</i> log file &#8211; the previous log files would simply disappear! This issue results from the fact that the DailyRollingFileAppender (DRFA) tries to rename the log file during rollover. However, when the rename fails, it ends up overwriting the log file, hence losing information. On checking the application server&#8217;s SystemErr.log, we found an error each midnight similar to -</p>
<p>log4j:ERROR Failed to rename [logfilename] to logfilename.2008.01.11].</p>
<p>This appears to be a fairly common issue with log4j 1.2.x in Java application servers running on Windows. While there is no good resolution for this issue there is a workaround that works pretty well.  <span id="more-94"></span></p>
<p>We ended up getting the DatedFileAppender which is a log4j extension that is publicly available at <a href="http://minaret.biz/tips/datedFileAppender.html" target="_blank">http://minaret.biz/tips/datedFileAppender.html</a>. DatedFileAppender avoids the need for renaming the log file by simply creating the log file initially with the date in the file name &#8211; this is a simple workaround for the problem that we were experiencing. Switching from the DailyRollingFileAppender to DatedFileAppender was fairly seamless.  In addition to installing the jar in WebSphere Portal, we had to switch a few lines of our log4j configuration. We changed the following lines -</p>
<p>log4j.appender.logFileAppender=org.apache.log4j.DailyRollingFileAppender<br />
log4j.appender.logFileAppender.DatePattern=&#8217;.'yyyy-MM-dd<br />
log4j.appender.logFileAppender.File=MyApps.log</p>
<p>to</p>
<p>log4j.appender.logFileAppender=biz.minaret.log4j.DatedFileAppender<br />
log4j.appender.logFileAppender.Directory=.<br />
log4j.appender.logFileAppender.Prefix=MyApps_<br />
log4j.appender.logFileAppender.Suffix=.log<br />
log4j.appender.sametimeSyncAppender.Period=month # this line is only needed if the period is not a day</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/vivekagarwal.wordpress.com/94/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/vivekagarwal.wordpress.com/94/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/vivekagarwal.wordpress.com/94/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/vivekagarwal.wordpress.com/94/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/vivekagarwal.wordpress.com/94/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/vivekagarwal.wordpress.com/94/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/vivekagarwal.wordpress.com/94/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/vivekagarwal.wordpress.com/94/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/vivekagarwal.wordpress.com/94/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/vivekagarwal.wordpress.com/94/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/vivekagarwal.wordpress.com/94/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/vivekagarwal.wordpress.com/94/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=vivekagarwal.wordpress.com&blog=929801&post=94&subd=vivekagarwal&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://vivekagarwal.wordpress.com/2008/02/09/missing-log4j-log-files-with-dailyrollingfileappender-when-they-should-roll-over/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/51b07703056eac6cc06db437b8cfe663?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Vivek</media:title>
		</media:content>
	</item>
		<item>
		<title>Looking for a few good WebSphere Portal developers for our Austin office &#8211; do you have what it takes?</title>
		<link>http://vivekagarwal.wordpress.com/2008/01/10/looking-for-a-few-good-websphere-portal-developers-for-our-austin-office-do-you-have-what-it-takes/</link>
		<comments>http://vivekagarwal.wordpress.com/2008/01/10/looking-for-a-few-good-websphere-portal-developers-for-our-austin-office-do-you-have-what-it-takes/#comments</comments>
		<pubDate>Fri, 11 Jan 2008 04:48:48 +0000</pubDate>
		<dc:creator>Vivek Agarwal</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Portal]]></category>
		<category><![CDATA[WebSpherePortal]]></category>
		<category><![CDATA[Austin Jobs]]></category>
		<category><![CDATA[Jobs]]></category>

		<guid isPermaLink="false">http://vivekagarwal.wordpress.com/2008/01/10/looking-for-a-few-good-websphere-portal-developers-for-our-austin-office-do-you-have-what-it-takes/</guid>
		<description><![CDATA[I am looking for competent WebSphere Portal developers and a Portal administrator to join the Xtivia team in Austin. It certainly is not easy to find people that can pass our technical screens. So do apply if you think you have strong skills with WebSphere Portal and you are looking for a challenging position in [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=vivekagarwal.wordpress.com&blog=929801&post=93&subd=vivekagarwal&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>I am looking for competent WebSphere Portal developers and a Portal administrator to join the Xtivia team in Austin. It certainly is not easy to find people that can pass our technical screens. So do apply if you think you have strong skills with WebSphere Portal and you are looking for a challenging position in a growing Portal practice where you can make a difference. Team members take on responsibility for architecture, design, and development of portal and business applications built using various commercial/open-source Java technologies. The work environment is informal and requires flexibility, self-motivation, quick ramp-up, and desire to excel. As you can tell from some of my blog entries, you will be continually challenged and will require you to use your strong troubleshooting and problem-solving skills.</p>
<p>To apply send an <a href="mailto:jobs@xtivia.com" target="_blank">email to our recruiter</a> with your resume! Or email if you want more information about the job openings.</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/vivekagarwal.wordpress.com/93/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/vivekagarwal.wordpress.com/93/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/vivekagarwal.wordpress.com/93/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/vivekagarwal.wordpress.com/93/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/vivekagarwal.wordpress.com/93/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/vivekagarwal.wordpress.com/93/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/vivekagarwal.wordpress.com/93/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/vivekagarwal.wordpress.com/93/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/vivekagarwal.wordpress.com/93/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/vivekagarwal.wordpress.com/93/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/vivekagarwal.wordpress.com/93/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/vivekagarwal.wordpress.com/93/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=vivekagarwal.wordpress.com&blog=929801&post=93&subd=vivekagarwal&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://vivekagarwal.wordpress.com/2008/01/10/looking-for-a-few-good-websphere-portal-developers-for-our-austin-office-do-you-have-what-it-takes/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/51b07703056eac6cc06db437b8cfe663?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Vivek</media:title>
		</media:content>
	</item>
		<item>
		<title>WebSphere Portal Portlet Error &#8211; Unsupported major.minor version 49.0</title>
		<link>http://vivekagarwal.wordpress.com/2007/12/19/websphere-portal-portlet-error-unsupported-majorminor-version-490/</link>
		<comments>http://vivekagarwal.wordpress.com/2007/12/19/websphere-portal-portlet-error-unsupported-majorminor-version-490/#comments</comments>
		<pubDate>Thu, 20 Dec 2007 01:38:42 +0000</pubDate>
		<dc:creator>Vivek Agarwal</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[WebSpherePortal]]></category>
		<category><![CDATA[JDK Version]]></category>
		<category><![CDATA[WebSphere Portal]]></category>

		<guid isPermaLink="false">http://vivekagarwal.wordpress.com/2007/12/19/websphere-portal-portlet-error-unsupported-majorminor-version-490/</guid>
		<description><![CDATA[Today was a fun day getting the base JSR 168 polls portlet created &#8211; I actually got involved doing pair programming with a team member who is new to the Portal world. We chose to create this portlet as a basic JSR168 portlet without Struts or Faces support &#8211; the rationale being that we may [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=vivekagarwal.wordpress.com&blog=929801&post=91&subd=vivekagarwal&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Today was a fun day getting the base JSR 168 polls portlet created &#8211; I actually got involved doing pair programming with a team member who is new to the Portal world. We chose to create this portlet as a basic JSR168 portlet without Struts or Faces support &#8211; the rationale being that we may want to target this portlet at platforms other than WebSphere Portal as well that may not provide the required support for anything other than a basic JSR168 portlet. We did the development in Rational Application Developer (RAD) on my Vista laptop and today pushed me over the edge with Vista. I had RAD crash on me a few times, and now I am convinced that I need to make the time over my winter holidays to just go ahead and downgrade to XP &#8211; yes, I am ready to admit defeat on the Vista front and move on with life! Anyway I digress &#8211; back to the topic at hand. We got the portlet skeleton coded up and the war file built, and attempted to deploy the portlet on WebSphere Portal v6.0.1.1. And WebSphere Portal rejected the portlet war file with this message -</p>
<p><span class="wpsFieldInfoText">EJPAQ1316E: Could not process the selected file from the browse button as a WAR file.  Make sure it is a WAR file and try again.</span></p>
<p><span id="more-91"></span></p>
<p>The underlying error was -</p>
<p>java.lang.ClassNotFoundException: DeploymentClassLoader.findClass:  java.lang.UnsupportedClassVersionError: com/xtivia/poll/portlet/display/PollsDisplayPortlet (Unsupported major.minor version 49.0)<br />
at com.ibm.wps.pe.mgr.deployment.util.DeploymentClassLoader.findClass(DeploymentClassLoader.java:73)<br />
at com.ibm.wps.pe.mgr.deployment.util.DeploymentClassLoader.loadClass(DeploymentClassLoader.java:133)<br />
at java.lang.ClassLoader.loadClass(ClassLoader.java(Compiled Code))<br />
at com.ibm.wps.pe.mgr.deployment.std.DeploymentManagerStandardImpl.checkForResources(DeploymentManagerStandardImpl.java:1434)<br />
at com.ibm.wps.pe.mgr.deployment.std.DeploymentManagerStandardImpl.getPortletApplicationInfo(DeploymentManagerStandardImpl.java:1315)<br />
at com.ibm.wps.pe.mgr.deployment.AbstractPortletDeploymentManagerImpl.getApplicationInfo(AbstractPortletDeploymentManagerImpl.java:790)<br />
at com.ibm.wps.pe.mgr.deployment.AbstractDeploymentManagerImpl.getApplicationInfo(AbstractDeploymentManagerImpl.java:1586)<br />
at com.ibm.wps.pe.mgr.AbstractApplicationManagerImpl.getApplicationInfo(AbstractApplicationManagerImpl.java:356)<br />
at com.ibm.wps.pe.mgr.AbstractApplicationManagerImpl.getApplicationInfo(AbstractApplicationManagerImpl.java:332)</p>
<p>This is the first time that I had seen this error message. However, it was relatively easy to see from the top Google hits that this error is usually related to incompatible  versions between the compiler used to build a jar/war file and the one used by WebSphere Portal. And that certainly was the root cause for my error as well. WebSphere Portal v6.0.1.x uses JDK v1.4 while I was running RAD using JDK v1.5 and RAD had used v1.5 for the compile. Switching the RAD setting for <i>JDK Compliance-&gt;Compiler compliance level</i> to v1.4, compiling, building the new war file and redeploying the portlet resolved the issue!</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/vivekagarwal.wordpress.com/91/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/vivekagarwal.wordpress.com/91/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/vivekagarwal.wordpress.com/91/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/vivekagarwal.wordpress.com/91/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/vivekagarwal.wordpress.com/91/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/vivekagarwal.wordpress.com/91/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/vivekagarwal.wordpress.com/91/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/vivekagarwal.wordpress.com/91/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/vivekagarwal.wordpress.com/91/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/vivekagarwal.wordpress.com/91/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/vivekagarwal.wordpress.com/91/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/vivekagarwal.wordpress.com/91/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=vivekagarwal.wordpress.com&blog=929801&post=91&subd=vivekagarwal&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://vivekagarwal.wordpress.com/2007/12/19/websphere-portal-portlet-error-unsupported-majorminor-version-490/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/51b07703056eac6cc06db437b8cfe663?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Vivek</media:title>
		</media:content>
	</item>
	</channel>
</rss>