<?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/"
	>

<channel>
	<title>CarbonRider</title>
	<atom:link href="http://www.carbonrider.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.carbonrider.com</link>
	<description>You make a matrix, you define the limits.</description>
	<lastBuildDate>Sun, 05 Sep 2010 14:28:48 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>ESB or Spring Integration</title>
		<link>http://articles.carbonrider.com/2010/09/05/esb-or-spring-integration/</link>
		<comments>http://articles.carbonrider.com/2010/09/05/esb-or-spring-integration/#comments</comments>
		<pubDate>Sun, 05 Sep 2010 13:33:16 +0000</pubDate>
		<dc:creator>Carbon Rider</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[EAI patterns]]></category>
		<category><![CDATA[ESB or Spring Integration]]></category>
		<category><![CDATA[Spring Integration]]></category>

		<guid isPermaLink="false">http://www.carbonrider.com/?p=345</guid>
		<description><![CDATA[With every new language and new frameworks, systems developed today are getting extremely complex to understand. Buzz words like cross cutting concerns, separation of concerns and distributed applications are just adding complexity to the problems. Over past few years, development of large scale applications required development of various subsystems and integrating those systems to achieve [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Farticles.carbonrider.com%2F2010%2F09%2F05%2Fesb-or-spring-integration%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Farticles.carbonrider.com%2F2010%2F09%2F05%2Fesb-or-spring-integration%2F&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p>With every new language and new frameworks, systems developed today are getting extremely complex to understand. Buzz words like cross cutting concerns, separation of concerns and distributed applications are just adding complexity to the problems. Over past few years, development of large scale applications required development of various subsystems and integrating those systems to achieve common organisational goal.<br />
It is always noticed that big organisations carry out their daily business operations on various systems developed and deployed on heterogeneous platforms and technology. Integration is required not for just, the in-house applications but geographically distributed business requires interfacing with subsystems spread across the globe. While it is not always possible to replace legacy systems, organisations are always looking to build new systems that can interface with old systems and carry out business process.<br />
The problem of making systems communicate with each other is always crucial for growth and to carry out business activities smoothly. Well, that is where Enterprise Integration plays vital role.<br />
A need was felt to have common language that can address enterprise level problem and help to built better software. Enterprise Integration patterns were the step towards building that common vocabulary. The patterns address most of the issues faced while building communication link between various systems.<br />
Though Enterprise Integration patterns provide theoretical solution to the enterprise level problems, there was no readymade software available to address all above concerns.</p>
<p><strong>Enterprise Service Bus</strong><br />
To address the Integration issues, a strong need was felt to have software that can help systems to communicate with each other and abstract the underlying protocol required for communication. Enterprise Service Bus was invented to address this concern and gained popularity within less time. There are many vendors providing their own ESB implementation helping business to integrate the systems.<br />
Though ESB seems to be perfect choice for implementing Enterprise Integration, it has certain drawbacks like efforts required to implement a solution, most of the ESB use XML as data format for communication – require additional overhead to process the message, high hardware configuration requirements etc. On top of all, what If I am interested only in few Integration mechanisms and don&#8217;t want to use all nice to have features of ESB. In simple terms, can I get only features I am interested in and not whole ESB?</p>
<p><span id="more-345"></span></p>
<p><strong>Any other option?</strong><br />
Well, over last few years’ communities like Mule Soft has been successful in implementing ESB that provide numerous features by keeping the complexity low.<br />
In Jan 2008, there was one more project announced by a popular community in Java World – SpringSource. The aim of this project was to use similar techniques used by the leading Java AOP Framework – Spring and extending it further in Enterprise world. The framework is known as Spring Integration.</p>
<p><strong>SPRING INTEGRATION</strong><br />
Integrating systems could be a complex task and it could be even more complex when it is developed and deployed on heterogeneous platforms. In enterprise world, system integration is typically done via messaging, file uploads, webservices etc. But using any of the means soon tend to become complex and require too much of development effort and understanding of how the connectors actually work. Developers need to understand the Integration design and should have capability to build a model which can be easily customized as per the requirements.<br />
Spring integration framework is built to simplify the Enterprise integration with minimal coding and high flexibility. With the help of Spring Integration framework one can develop components that adheres to separation of concern principle and develop integration code with low or no coupling.<br />
Let’s consider a scenario wherein two systems need to exchange a data via messaging. Following are the brief details about the scenario<br />
1. System “A” does some processing and puts messages in Message Queue “MyQueue” (Message Queue is created on Apache Active MQ Server.)<br />
2. Whenever a message is received in Queue (MyQueue) it should be transmitted to Queue “queue/C” (Message Queue is created on JBoss MQ server.)<br />
In above scenario, using J2EE one can write a Message Driven Bean and receive messages stored on Queue “MyQueue”. The messages can be later transferred to destination Queue “queue/C” by using JNDI object and messaging API. Though this sounds simple, it would certainly require some effort from development side to write Java Code.<br />
With the help of Spring Integration, there is no need to write a single line of Java code to develop above functionality. All of the above functionality can be achieved merely by writing few lines of XML. Just have a look at the next code (Don’t worry about what every line does.)</p>
<pre class="brush: xml;">
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xmlns:integration="http://www.springframework.org/schema/integration"
	xmlns:jee="http://www.springframework.org/schema/jee"
	xmlns:util="http://www.springframework.org/schema/util"
	xmlns:jms="http://www.springframework.org/schema/integration/jms"
	xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/integration http://www.springframework.org/schema/integration/spring-integration-2.0.xsd
http://www.springframework.org/schema/jee http://www.springframework.org/schema/jee/spring-jee-2.5.xsd
http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-2.5.xsd
http://www.springframework.org/schema/integration/jms http://www.springframework.org/schema/integration/jms/spring-integration-jms.xsd">

	<jee:jndi-lookup jndi-name="ConnectionFactory" id="mqConnectionFactory"
		environment-ref="activeMqProps" expected-type="javax.jms.ConnectionFactory">
            </jee:jndi-lookup>

	<jee:jndi-lookup jndi-name="ConnectionFactory" id="jbossConnectionFactory"
		environment-ref="jndiJbossProps" expected-type="javax.jms.ConnectionFactory">
             </jee:jndi-lookup>

	<jee:jndi-lookup jndi-name="MyQueue" id="activeMqQueue"
		environment-ref="activeMqProps" expected-type="javax.jms.Queue">
	</jee:jndi-lookup>	

	<jee:jndi-lookup jndi-name="queue/C" id="jBossQueueTarget"
	environment-ref="jndiJbossProps" expected-type="javax.jms.Queue">
	</jee:jndi-lookup>

	<util:properties id="activeMqProps" location="classpath:jndi.properties">
             </util:properties>

	<util:properties id="jndiJbossProps" location="classpath:jndi-jboss.properties">
             </util:properties>	

	<jms:inbound-channel-adapter destination="activeMqQueue" channel="jbossIn" connection-factory="mqConnectionFactory" >
		<integration:poller>
			<integration:interval-trigger interval="1000"></integration:interval-trigger>
		</integration:poller>
	</jms:inbound-channel-adapter>

	<jms:outbound-channel-adapter destination="jBossQueueTarget"  channel="jbossIn" connection-factory="jbossConnectionFactory">
	</jms:outbound-channel-adapter>

	<integration:channel id="jbossIn" ></integration:channel>
</beans>
</pre>
<p>That’s all you require to achieve the above functionality. Set of XML tags and you are done. (Did I just say that you don’t need to write any java code, well if you want to see the above configuration running, you should write a bootstrap class which will load this configuration file OR you can deploy this as web application and load the above configuration file through context loader provided by SPRING.)</p>
<p>To run the sample, you should have following softwares<br />
1. SPRING integration<br />
2. SPRING 2.5 or above<br />
3. Active MQ (You should create a queue as “sourceQueue”)<br />
4. JBoss (In this example we will use default queue – queue/C)</p>
<p>The point I want to bring here is not about how I achieved this task by just using XML but the level of simplicity provided by Spring Integration framework. Though this is very simple use case, the configuration can be further extended to meet real-time project requirements.</p>
<p><strong>WHAT NEXT</strong><br />
Well the example that I just explained is very simple, let’s consider following scenarios</p>
<table border="0" cellspacing="0" cellpadding="3">
<tr>
<td valign="top" bgcolor="#CCCCCC">
<p>S#</p>
</td>
<td width="87" valign="top" bgcolor="#CCCCCC">
<p>Scenario</p>
</td>
<td width="492" valign="top" bgcolor="#CCCCCC">
<p>Detailed    Requirement</p>
</td>
</tr>
<tr>
<td valign="top">
<p>1</p>
</td>
<td width="87" valign="top">
<p>Scenario1</p>
</td>
<td width="492" valign="top">
<p>ABC    Ltd has very huge customer base and maintains customer portal. Customers can    register on portal and view premium payment, maintain profile information    etc. ABC Ltd wants to add a new feature to its system, so that registered    users can retrieve payment details for a given policy without a need of login    to Portal.<br />
      A    solution was provided that customers can send an email to portal server and    mention policy number in subject line. A utility has to be developed on    server to poll messages after specific interval and reply to valid emails    after considering “From” address and policy number.</p>
</td>
</tr>
<tr>
<td valign="top">
<p>2</p>
</td>
<td width="87" valign="top">
<p>Scenario    2</p>
</td>
<td width="492" valign="top">
<p>XYZ    Ltd requires currency details to manage its business across continents. The    data should be refreshed after every one hour.<br />
      PQR    Ltd provides currency information in flat file format. The file is available    over FTP. To update currency information in system, XYZ Ltd has developed a    Webservice.<br />
      A    utility has to be developed which will poll FTP server, parse information and    invoke webservice after a specific interval.</p>
</td>
</tr>
<tr>
<td valign="top">
<p>&nbsp;</p>
</td>
<td width="87" valign="top">
<p>&nbsp;</p>
</td>
<td width="492" valign="top">
<p>&nbsp;</p>
</td>
</tr>
</table>
<p>Let’s evaluate above scenarios<br />
1. To achieve functionality described in scenario 1, developer would require writing a component which checks if there is new email available in the mailbox. Developer need not have to worry about the scheduling activity as it is the built in feature available in Spring Integration framework (poller).<br />
The additional functionality of retrieving policy details and sending new email with details can be coded in different components leading to loosely coupled design.<br />
The component responsible for sending email with policy details would simply act on a logical channel. Also the component performing authorisation need not have to be aware of email sending component. Its primary responsibility is to just perform authentication of the given data (In this case it would be policy no and sender email address.)<br />
2. For scenario 2, a component similar to what explained in scenario 1 can be implemented and by making use of poller feature, the new feed can be checked after specific interval. As and when the feed data is available the component has to just return value object holding data, the Spring integration framework will transmit data to a channel. This activity will lead to execution of one more component which would receive data as an input and can invoke webservice. Remember you can trigger multiple actions as and when any data is transferred to a channel and it can be easily configured using XML.</p>
<p>Let’s have a look at the following diagrams to understand the flow of operations for example 1.</p>
<p><img src="http://www.carbonrider.com/wp-content/uploads/2010/09/spring_integration_email_example.jpg" alt="Spring Integration Email Example" /></p>
<p>The diagram indicates that the two components “Authentication” &amp; “Email Sender” are invoked as soon as the data is available on the channels they are associated with. Note that the association between the components and channel is done through configuration and there is no hardcoded reference within components. (In this example any Java class capable of performing application specific operations are considered as component.)<br />
Poller pings Email server at specific intervals to check if any email has arrived. If email contents matches to the criteria, required data is posted on channel1. Since Channel 1 is configured as input channel for Authentication component, the Authentication component will begin its execution. After the processing is complete, data returned by Authentication component can then be transferred to channel 2. There is no need to call any API from Authentication component to transfer data to channel 2. On receipt of data on channel 2 will lead to execution of Email Sender component. Following diagram shows logical flow of execution.</p>
<p><img src="http://www.carbonrider.com/wp-content/uploads/2010/09/spring_integration_email_example_flow.jpg" alt="Spring Integration Email Example Components" /></p>
<p>Components would be invoked only when there is appropriate message is available on channel. With patterns like “Transformer” and spring features like dependency injection, components would be never aware of the environment under which they are executed and would mostly work with POJO objects (Spring Integration framework can make use of all the Core-Spring framework features).<br />
One of the advantage using Spring integration would be the solution can be built in quick time, without a need of application server, no need of high configuration hardware. Also the configuration is pretty simple and less painful. Developer doesn’t have to learn anything specific to application server or go through the process of wizard based configuration.<br />
Let’s compare Spring integration with JEE to find out how it could be still a better choice.<br />
To begin with, consider following set of questions and evaluate what both frameworks offer</p>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td valign="top" bgcolor="#CCCCCC">S#</td>
<td width="135" valign="top" bgcolor="#CCCCCC">&nbsp;</td>
<td width="222" valign="top" bgcolor="#CCCCCC">JEE</td>
<td width="239" valign="top" bgcolor="#CCCCCC">Spring Integration</td>
</tr>
<tr>
<td valign="top">
<p>1</p>
</td>
<td width="135" valign="top">
<p>What    built-in scheduling mechanism?</p>
</td>
<td width="222" valign="top">
<p> JEE doesn&#8217;t offer any scheduling mechanism. Though some may argue that using java.util.Timer one can simulate    scheduling activities, it would require hours of efforts on developer part.</p>
</td>
<td width="239" valign="top">
<p>Comes    with built-in poller feature.</p>
</td>
</tr>
<tr>
<td valign="top">
<p>2</p>
</td>
<td width="135" valign="top">
<p>Messaging    based component execution?</p>
</td>
<td width="222" valign="top">
<p>JEE    does offer JMS, through which one can write message listener bean and process    certain business logic. The major drawback of JMS is that it is tied up with    only Topic, Queue type of messaging and doesn’t offer any solution for other    channels. (FTP, email, webservice etc)</p>
</td>
<td width="239" valign="top">
<p>The    channel concept used in Spring for information interchange is not tied up    with underlying messaging system, rather the channels are logical entities    and they do not exist physically.</p>
</td>
</tr>
<tr>
<td valign="top">
<p>3</p>
</td>
<td width="135" valign="top">
<p>SOA    or Enterprise Integration pattern support</p>
</td>
<td width="222" valign="top">
<p>No    answer. JEE mostly talks about different technology that it offers and    doesn’t offer any out of box solution to SOA or Enterprise patterns.</p>
</td>
<td width="239" valign="top">
<p>Spring    integration implements various SOA or Enterprise Integration patterns.</p>
</td>
</tr>
<tr>
<td valign="top">
<p>4</p>
</td>
<td width="135" valign="top">
<p>Cost</p>
</td>
<td width="222" valign="top">
<p>Commercially    available Application servers are costly and require heavy investment. One    may also choose open source / freeware implementation.</p>
</td>
<td width="239" valign="top">
<p>Sponsored    by Spring and hence available as open source, freeware.</p>
</td>
</tr>
<tr>
<td valign="top">
<p>5</p>
</td>
<td width="135" valign="top">
<p>Feasibility</p>
</td>
<td width="222" valign="top">
<p>While    one may be interested only in messaging and webserver functionality of    Application Server, but still has pay for entire suite.</p>
</td>
<td width="239" valign="top">
<p>Spring    projects are available as modules and hence can be configured as per    requirement, Spring Integration is developed as one of the Spring module.</p>
</td>
</tr>
<tr>
<td valign="top">
<p>6</p>
</td>
<td width="135" valign="top">
<p>Interoperability</p>
</td>
<td width="222" valign="top">
<p>While    JEE components are based on JSR standards, it’s not always possible to    migrate applications as is from one Application Server to another. Due to the confusions    between vendors while implementing specifications, sometime components behave    differently when ported from one platform to another.</p>
</td>
<td width="239" valign="top">
<p>No    specific standards but due to abstraction offered by Integration framework,    application is easily portable from one framework to another.</p>
</td>
</tr>
<tr>
<td valign="top">
<p>7</p>
</td>
<td width="135" valign="top">
<p>Coupling</p>
</td>
<td width="222" valign="top">
<p>Though    JEE defines various components like Servlet, Message Bean, EJB etc to reduce    coupling, most of the time code ends up using JEE specific API and gets    coupled with JEE. Though off late Java EE 6 offers resource injection    features, it seems like Java is actually following what Spring has been    providing for many years. </p>
</td>
<td width="239" valign="top">
<p>Most    of the time there is no need to implement any interface or extend class    specific to Spring Integration framework. It follows usual philosophy of Spring    framework of writing code in Spring which can be run even without Spring.</p>
</td>
</tr>
<tr>
<td valign="top">
<p>&nbsp;</p>
</td>
<td width="135" valign="top">
<p>&nbsp;</p>
</td>
<td width="222" valign="top">
<p>&nbsp;</p>
</td>
<td width="239" valign="top">
<p>&nbsp;</p>
</td>
</tr>
</table>
<p><strong>WHAT’S INSIDE?</strong><br />
SPRING integration is messaging based framework and heavily uses “channel” as a base for transportation. Well though it is messaging based framework it is not tied to JMS. SPRING provides adapters for following<br />
1. FTP<br />
2. File<br />
3. JMS<br />
4. Webservices<br />
5. Email<br />
6. HTTP<br />
7. Stream<br />
8. RMI<br />
Having support for all above connectors ensures that Spring integration framework can be used to connect to legacy as well as cutting edge technologies. Also both ends will never be aware of existence of each other.<br />
Well SPRING integration is not just about transmitting data from one channel to another but it also provides implementation following patterns</p>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td valign="top" bgcolor="#CCCCCC">
<p>S#</p>
</td>
<td width="87" valign="top" bgcolor="#CCCCCC">
<p>&nbsp;</p>
</td>
<td width="492" valign="top" bgcolor="#CCCCCC">
<p>Description</p>
</td>
</tr>
<tr>
<td valign="top">
<p>1</p>
</td>
<td width="87" valign="top">
<p>Router</p>
</td>
<td width="492" valign="top">
<p>Routes    messages to a channel depending upon the type of payload. For e.g. if type of    message is String or Long it can be transmitted to a specific channel.<br />
      This    can be useful if a specific business logic should be executed based on the    type of message.</p>
</td>
</tr>
<tr>
<td valign="top">
<p>2</p>
</td>
<td width="87" valign="top">
<p>Filter</p>
</td>
<td width="492" valign="top">
<p>Filters    messages sent to input channel and sends it to output channel if filter    criteria matches.<br />
      Consider    an online ecommerce application which can accept orders greater than $150,    rest of the orders should be discarded or redirected to another channel.</p>
</td>
</tr>
<tr>
<td valign="top">
<p>3</p>
</td>
<td width="87" valign="top">
<p>Transformer</p>
</td>
<td width="492" valign="top">
<p>To    create loose coupling between message consumers and message producers.    Provide convenient way to transform messages from one form to another. (There    are some transformers available out of the box like object-to-string,    payload-serializing-transformer and payload-deserializing-transformer.)</p>
</td>
</tr>
<tr>
<td valign="top">
<p>4</p>
</td>
<td width="87" valign="top">
<p>Splitter</p>
</td>
<td width="492" valign="top">
<p>This    is useful when payload has to be broken into multiple parts. For e.g. Order    object need to be splitted into multiple line items.</p>
</td>
</tr>
<tr>
<td valign="top">
<p>5</p>
</td>
<td width="87" valign="top">
<p>Aggregator</p>
</td>
<td width="492" valign="top">
<p>Works    exactly opposite to Splitter, but somewhat complex as it must identify the    logical point where all the splitted messages need to be combined.</p>
</td>
</tr>
<tr>
<td valign="top">
<p>6</p>
</td>
<td width="87" valign="top">
<p>Resequencer</p>
</td>
<td width="492" valign="top">
<p>Works    exactly like aggregator but doesn’t process the messages. Resequencer simply    resends messages as per the sequence number defined for the message. Messages    can be sent as soon as the valid sequence criteria are satisfied or after    timeout.</p>
</td>
</tr>
<tr>
<td valign="top">
<p>7</p>
</td>
<td width="87" valign="top">
<p>Delayer</p>
</td>
<td width="492" valign="top">
<p>A    simple utility to delay message transmission from input channel to output    channel by specific time interval.</p>
</td>
</tr>
<tr>
<td valign="top">
<p>&nbsp;</p>
</td>
<td width="87" valign="top">
<p>&nbsp;</p>
</td>
<td width="492" valign="top">
<p>&nbsp;</p>
</td>
</tr>
</table>
<p>Most of the above patterns are meant for Enterprise level integration and also considered as SOA patterns.<br />
Most of you must have implemented solutions that require any of the above functionality. With SPRING integration it’s very easy to develop software that requires any of the above listed functionality.</p>
<p>Well there are few more utilities available in SPRING integration but this article would not be able to describe all of them.</p>
<p><strong>CONCLUSION</strong><br />
<strong>Why SPRING Integration?</strong><br />
Anyone looking for integrating two or more systems which use different protocol for communication, SPRING integration looks better choice for development. Following can be attributed as basic reasons for same<br />
1. SPRING integration can be extended and customized adapters can be built as per the requirements. (E.g. SFTP, SSH) Due to its open source nature, the chances of one already available on internet are high.<br />
2. Like SPRING framework, SPRING integration doesn’t require any specific application server rather it can be executed as standalone application. Even if one uses application server, the Spring framework gives benefits of using platform specific features like transaction management.<br />
3. There is also no need of any specific hardware requirement; SPRING integration is lightweight framework that can be deployed on any platform.<br />
4. One can develop a set of components which are loosely coupled and can be executed on demand. (Invocation of component only when a data is available on specific channel. Components need not be aware of channels and can simply deal with POJO objects.)<br />
5. Components can be individually tested and validated. No need of application server would also save great amount of development time spent on frequent stop/start of server. Developers can test the components right from their IDE of choice as standalone application.</p>
<p><strong>REFERENCES</strong><br />
Impressed by SPRING integration project and want to explore more about it, well then here are the resources that helped me to gain knowledge about SPRING integration framework.<br />
• <a target="_blank" href="http://www.springsource.org/spring-integration">http://www.springsource.org/spring-integration</a> (You can download SPRING integration framework from this site.)<br />
• <a target="_blank" href="http://blog.springsource.com/2009/02/13/982/">http://blog.springsource.com/2009/02/13/982/</a><br />
• <a target="_blank" href="http://www.parleys.com/display/PARLEYS/Home#slide=2;talk=29523990;title=Enterprise Integration Patterns with Spring">http://www.parleys.com/display/PARLEYS/Home#slide=2;talk=29523990;title=Enterprise Integration Patterns with Spring</a> (Well this site has plethora of information available in visual format. Do visit this site, you will always find something useful.)</p>
]]></content:encoded>
			<wfw:commentRss>http://articles.carbonrider.com/2010/09/05/esb-or-spring-integration/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>BlazeDS – SSL – IBM Websphere</title>
		<link>http://flex.carbonrider.com/2010/08/28/blazeds-ssl-ibm-websphere/</link>
		<comments>http://flex.carbonrider.com/2010/08/28/blazeds-ssl-ibm-websphere/#comments</comments>
		<pubDate>Sat, 28 Aug 2010 07:22:59 +0000</pubDate>
		<dc:creator>Carbon Rider</dc:creator>
				<category><![CDATA[Flex]]></category>
		<category><![CDATA[BlazeDS]]></category>
		<category><![CDATA[SSL on IBM websphere]]></category>

		<guid isPermaLink="false">http://www.carbonrider.com/?p=332</guid>
		<description><![CDATA[No it&#8217;s not one more hate post against IBM websphere, but this time the target is BlazeDS. Few days back, we were facing problem while deploying Flex application on SSL. The environment used for the deployment was IBM websphere 6.1 with IBM JDK and windows 2008. As per BlazeDS documentation, there are very minimal configuration [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fflex.carbonrider.com%2F2010%2F08%2F28%2Fblazeds-ssl-ibm-websphere%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fflex.carbonrider.com%2F2010%2F08%2F28%2Fblazeds-ssl-ibm-websphere%2F&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p>No it&#8217;s not one more hate post against IBM websphere, but this time the target is BlazeDS. Few days back, we were facing problem while deploying Flex application on SSL. The environment used for the deployment was IBM websphere 6.1 with IBM JDK and windows 2008. As per BlazeDS documentation, there are very minimal configuration changes required to be done in services-config.xml and other XXX-config.xml files to use secure-amf channel.<br />
<span id="more-332"></span><br />
As per the instruction the configuration was modified to use secure amf channel and the SWF files were recompiled with modified configuration settings. No error messages were displayed at the time of deployment and application startup, but we found strange error message after accessing the application URL. The browser was able to load the SWF and wrapper html file, but it was throwing an error message indicating that SunX509 trust manager is not available.<br />
After enabling BlazeDS logging and careful observation of java stacktrace we found that the actual problem was with the TrustManager implementation of BlazeDS. The default implementation available with BlazeDS is &#8211; EasyX509TrustManager and have a look at the code defined for its constructor</p>
<pre class="brush:java;">
public EasyX509TrustManager(KeyStore keystore)
    throws NoSuchAlgorithmException, KeyStoreException
  {
    <strong>TrustManagerFactory factory = TrustManagerFactory.getInstance("SunX509");</strong>
    factory.init(keystore);
    TrustManager[] trustmanagers = factory.getTrustManagers();
    if (trustmanagers.length == 0)
    {
      throw new NoSuchAlgorithmException("SunX509 trust manager not supported");
    }
    this.standardTrustManager = ((X509TrustManager)trustmanagers[0]);
    this.trustStore = (System.getProperty("flex.trustStore") != null);
  }
</pre>
<p>From above code it is quite clear that above code assumes that whole world uses only Sun JVM. While we found the culprit, the next step was to find a fix, so I simply googled &#8220;EasyX509TrustManager IBMX509&#8243; and Voila, google returned only one entry with link to a java code</p>
<pre class="brush:java;">
public EasyX509TrustManager(KeyStore keystore) throws NoSuchAlgorithmException, KeyStoreException
    {
        super();
        TrustManagerFactory factory = null;
        try
        {
            factory = TrustManagerFactory.getInstance("SunX509");
        }
        catch (NoSuchAlgorithmException nsae)
        {
            // Fallback attempt - try for an IbmX509 factory in case we're running in WAS with no Sun providers registered.
            try
            {
                factory = TrustManagerFactory.getInstance("IbmX509");
            }
            catch (NoSuchAlgorithmException nsae2)
            {
                throw new NoSuchAlgorithmException("Neither SunX509 nor IbmX509 trust manager supported.");
            }
        }
</pre>
<p>This code is part of latest BlazeDS distribution, so anyone facing above problem make sure that you upgrade the BlazeDS project to latest version. Hope this helps!</p>
]]></content:encoded>
			<wfw:commentRss>http://flex.carbonrider.com/2010/08/28/blazeds-ssl-ibm-websphere/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Flex DataGrid &#8211; Data updates not reflected</title>
		<link>http://flex.carbonrider.com/2010/08/24/flex-datagrid-data-updates-not-reflected/</link>
		<comments>http://flex.carbonrider.com/2010/08/24/flex-datagrid-data-updates-not-reflected/#comments</comments>
		<pubDate>Tue, 24 Aug 2010 16:03:14 +0000</pubDate>
		<dc:creator>Carbon Rider</dc:creator>
				<category><![CDATA[Flex]]></category>
		<category><![CDATA[Advanced Datagrid]]></category>
		<category><![CDATA[DataGrid]]></category>
		<category><![CDATA[Flex collection update]]></category>
		<category><![CDATA[Flex DataGrid]]></category>
		<category><![CDATA[ItemEditor Collection Update]]></category>

		<guid isPermaLink="false">http://www.carbonrider.com/?p=324</guid>
		<description><![CDATA[Flex datagrid is nice option to display data in tabular format and with built-in features like sort, rearrange column position and customize each columns with renderers/editors, it makes developers life easy to built user friendly application in quick time.  But most of the time, those who have coded in Flex, must have noticed that the datagrid [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fflex.carbonrider.com%2F2010%2F08%2F24%2Fflex-datagrid-data-updates-not-reflected%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fflex.carbonrider.com%2F2010%2F08%2F24%2Fflex-datagrid-data-updates-not-reflected%2F&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p>Flex datagrid is nice option to display data in tabular format and with built-in features like sort, rearrange column position and customize each columns with renderers/editors, it makes developers life easy to built user friendly application in quick time.  But most of the time, those who have coded in Flex, must have noticed that the datagrid just doesnt work properly when row information is updated. Consider following scenario.</p>
<p>1. Datagrid uses ItemEditor to update Collection bound as dataprovider.<br />
2. A change in value of one of the column, involves updates to values displayed in other columns.</p>
<p>In 2nd step, user may change value in one of the column, which will internally result in change in value displayed in other columns. One can easily achieve that using itemEditEnd event but most of the time the updates are not reflected. Consider following code</p>
<pre class="brush: xml;">
<mx:ArrayCollection id="dgArr">
		<mx:Array>
			<mx:Object firstName="Jake" lastName="Tyler" gross="" commPer="" comm="" net="" markAsReadOnly=""/>
			<mx:Object firstName="Ryan" lastName="McCarthy" gross="" commPer="" comm="" net=""  markAsReadOnly=""/>
			<mx:Object firstName="Jill" lastName="Miller" gross="" commPer="" comm="" net=""  markAsReadOnly=""/>
			<mx:Object firstName="John" lastName="Rico" gross="" commPer="" comm="" net=""  markAsReadOnly=""/>
			<mx:Object firstName="Diz" lastName="Watson" gross="" commPer="" comm="" net=""  markAsReadOnly=""/>
			<mx:Object firstName="Lolo" lastName="Hurley" gross="" commPer="" comm="" net=""  markAsReadOnly=""/>
		</mx:Array>
	</mx:ArrayCollection>

	<mx:AdvancedDataGrid dataProvider="{dgArr}" x="100" y="100"
		editable="true" rowCount="5" id="dg"
		itemEditEnd="calculateCommission(event)">
		<mx:groupedColumns>
			<mx:AdvancedDataGridColumn headerText="Read Only" dataField="markAsReadOnly" headerWordWrap="true" editorDataField="selected" editable="true" itemRenderer="mx.controls.CheckBox" rendererIsEditor="true"/>
			<mx:AdvancedDataGridColumn headerText="First Name" dataField="firstName" editable="false"/>
			<mx:AdvancedDataGridColumn headerText="Last Name" dataField="lastName" editable="false"/>
			<mx:AdvancedDataGridColumnGroup headerText="Commission Calculation">
				<mx:AdvancedDataGridColumn dataField="gross" headerText="Gross" itemRenderer="mx.controls.TextInput" rendererIsEditor="true"/>
				<mx:AdvancedDataGridColumn dataField="commPer" headerText="Comm %" itemRenderer="mx.controls.TextInput" rendererIsEditor="true"/>
				<mx:AdvancedDataGridColumn dataField="comm" headerText="Comm" itemRenderer="mx.controls.TextInput" rendererIsEditor="true"/>
				<mx:AdvancedDataGridColumn dataField="net" headerText="Net" itemRenderer="mx.controls.TextInput" rendererIsEditor="true"/>
			</mx:AdvancedDataGridColumnGroup>
		</mx:groupedColumns>
	</mx:AdvancedDataGrid>
</pre>
<p><span id="more-324"></span><br />
Above code just binds one ArrayCollection to datagrid and editable values are displayed in textboxes. The basic requirement is that whenever user enters &#8220;Gross&#8221; and &#8220;Commission %&#8221;, the &#8220;Commission&#8221; and &#8220;Net&#8221; column should be updated. The logic to achieve this is defined in following function</p>
<pre class="brush: javascript;">
private function calculateCommission(evt:AdvancedDataGridEvent):void
{
	if(evt.reason == DataGridEventReason.CANCELLED)
		return;
	var dtIndex:int = evt.currentTarget.selectedIndex;
	var dtField:String = evt.dataField;

	var gross:*, commPer:*, comm:*, net:*;
	var dataGross:* = evt.itemRenderer.data.gross;
	var dataCommPer:* = evt.itemRenderer.data.commPer;
	var dataComm:* = evt.itemRenderer.data.comm;
	var dataNet:* = evt.itemRenderer.data.net;
	switch(dtField)
	{
		case "gross":
			trace("gross column edited.");
			gross = evt.currentTarget.itemEditorInstance.text;
			if( (dataCommPer != null) &#038;&#038; (dataCommPer!="") )
			{
				comm = (gross * dataCommPer) / 100;
				net = gross - comm;
			}else if( (dataComm != null) &#038;&#038; (dataComm!=""))
			{
				commPer = (dataComm * 100) / gross;
				net = gross - dataComm;
			}else{
				net = gross;
			}
			break;
		case "commPer":
			trace("comm % column edited.");
			commPer = evt.currentTarget.itemEditorInstance.text;
			if( (dataGross != null) &#038;&#038; (dataGross!="") )
			{
				comm = dataGross * (commPer / 100);
				net = dataGross - comm;
			}
			break;
		case "comm":
			trace("comm column edited.");
			comm = evt.currentTarget.itemEditorInstance.text;
			if( (dataGross != null) &#038;&#038; (dataGross!="") )
			{
				commPer = (100 * comm) / dataGross;
				net = dataGross - comm;
			}
			break;
		case "net":
			trace("net column edited.");
			net = evt.currentTarget.itemEditorInstance.text;
			break;
		}

		var item:Object = evt.currentTarget.dataProvider.getItemAt(dtIndex);

		if(gross!=null)
			item.gross = gross;
		if(commPer!=null)
			item.commPer = commPer;
		if(comm!=null)
			item.comm = comm;
		if(net!=null)
			item.net = net;
		evt.currentTarget.dataProvider.itemUpdated(item);
		}
</pre>
<p>(Note that above code is not completed but used for illustration purpose). Above code updates values in respective properties of given item and invokes itemUpdated function on underlying ArrayCollection. If you run the application, you might notice that the application behaves unexpectadly. Sometimes the values are updated and sometimes it wont update value. To resolve this issue, comment &#8220;itemUpdated&#8221; function call and add following code.</p>
<pre class="brush: javascript;">
var colEvent:CollectionEvent = new CollectionEvent(CollectionEvent.COLLECTION_CHANGE,
true,false, CollectionEventKind.UPDATE);
colEvent.items = [item];
colEvent.location =  dtIndex;
(evt.currentTarget.dataProvider as ArrayCollection).dispatchEvent(colEvent);
</pre>
<p>You will now notice that everytime you update the column values, the changes are reflected properly. Above code will work in all scenarios, except one. To simulate that issue, perform following steps</p>
<p>1. Enter some values in all the rows.<br />
2. Click on textbox displayed for &#8220;Commission&#8221; column of 1st row.<br />
3. Without changing any value, now select &#8220;Gross&#8221; column textbox of 2nd row with left button of mouse.<br />
4. Change the value displayed in &#8220;Gross&#8221; textbox of 2nd row and tab out. You will notice that tab will focus on 1st row rather than moving to next textbox.</p>
<p>The reason behind such unexpected behavior is that when user directly selects the value in any of the editable column, the datagrid controls is not able to track the event and hence the itemEditedPosition property is not set.<br />
To make above code work, you should modify the itemRenderer attribute in above code and create one mxml renderer component. Refer to following code.</p>
<pre class="brush: xml;">
<mx:TextInput xmlns:mx="http://www.adobe.com/2006/mxml" focusIn="setItemEditedPosition(event)">
	<mx:Script>
		<![CDATA[
			import mx.controls.AdvancedDataGrid;
			import mx.controls.listClasses.IListItemRenderer;
			import mx.controls.DataGrid;
			private function setItemEditedPosition(evt:FocusEvent):void
			{
				var dg:AdvancedDataGrid = this.listData.owner as AdvancedDataGrid;

				dg.editedItemPosition = {rowIndex: this.listData.rowIndex,columnIndex:this.listData.columnIndex};
			}
		]]&gt;
	</mx:Script>
</mx:TextInput>
</pre>
<p>I would name this file as &#8220;AmountInput.mxml&#8221; and change itemRenderer Attribute of the datagridcolumn to point this new component.<br />
Build the project and run it. Now you would notice that the data updations are reflected properly.</p>
<p>Hope this helps !</p>
<p>Updated : Thought of putting source code for this example, to download the source code just <a href="http://www.carbonrider.com/wp-content/uploads/2010/09/src.zip">click here</a>. I am using Flex SDK 3.4 with target flash player version as 10.0.0.</p>
]]></content:encoded>
			<wfw:commentRss>http://flex.carbonrider.com/2010/08/24/flex-datagrid-data-updates-not-reflected/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Back to Basics &#8211; Fresh new start</title>
		<link>http://articles.carbonrider.com/2010/08/14/back-to-basics-fresh-new-start/</link>
		<comments>http://articles.carbonrider.com/2010/08/14/back-to-basics-fresh-new-start/#comments</comments>
		<pubDate>Sat, 14 Aug 2010 13:48:23 +0000</pubDate>
		<dc:creator>Carbon Rider</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[.Net]]></category>

		<guid isPermaLink="false">http://www.carbonrider.com/?p=321</guid>
		<description><![CDATA[I remember almost 5-6 years back when I started learning many programming languages, .Net (1.1) was one of my favourite framework and C# was the language of choice. The event based programming model, readymade suite of components with ASP.Net was definitely an interesting way to develop web applications. The ease of development and powerful Visual Studio IDE [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Farticles.carbonrider.com%2F2010%2F08%2F14%2Fback-to-basics-fresh-new-start%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Farticles.carbonrider.com%2F2010%2F08%2F14%2Fback-to-basics-fresh-new-start%2F&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p>I remember almost 5-6 years back when I started learning many programming languages, .Net (1.1) was one of my favourite framework and C# was the language of choice. The event based programming model, readymade suite of components with ASP.Net was definitely an interesting way to develop web applications. The ease of development and powerful Visual Studio IDE had really impressed me. In fact, I was quite comfortable with Visual Studio much before .Net came into market, the reason was &#8211; Visual Basic. No one could have ever imagined that the language like Basic can become so powerful and provide so many functionalities.</p>
<p><span id="more-321"></span></p>
<p>But as the time passed and I spent more and more time with Java, I started to loose touch with .Net. Few weeks back when I came to know about release of Microsoft .Net framework 4.0 &amp; Visual Studio 2010, suddenly everything just flashed in my brain. I have been hearing buzzwords like WCF, WPF from a long time, but due to constant focus on Java I simply had no clue what was going on in .Net world.</p>
<p>The curiousity has just began again and I felt need to get back to the language and framework, I liked most.</p>
]]></content:encoded>
			<wfw:commentRss>http://articles.carbonrider.com/2010/08/14/back-to-basics-fresh-new-start/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>I am not addicted to Coffee</title>
		<link>http://articles.carbonrider.com/2010/07/11/i-am-not-addicted-to-coffee/</link>
		<comments>http://articles.carbonrider.com/2010/07/11/i-am-not-addicted-to-coffee/#comments</comments>
		<pubDate>Sun, 11 Jul 2010 16:03:24 +0000</pubDate>
		<dc:creator>Carbon Rider</dc:creator>
				<category><![CDATA[Articles]]></category>

		<guid isPermaLink="false">http://www.carbonrider.com/?p=313</guid>
		<description><![CDATA[Almost 7 years back when, I joined first organisation, inspite the fact of knowing languages like Visual Basic 6.0, ASP, Java 1.2, PHP 4, C, Shell Script, Oracle PL/SQL, MySQL [and little bit .Net] etc., I started working on HTML and JavaScript. The goal was to understand how online shopping sitess actually work [and the most important [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Farticles.carbonrider.com%2F2010%2F07%2F11%2Fi-am-not-addicted-to-coffee%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Farticles.carbonrider.com%2F2010%2F07%2F11%2Fi-am-not-addicted-to-coffee%2F&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p>Almost 7 years back when, I joined first organisation, inspite the fact of knowing languages like Visual Basic 6.0, ASP, Java 1.2, PHP 4, C, Shell Script, Oracle PL/SQL, MySQL [and little bit .Net] etc., I started working on HTML and JavaScript. The goal was to understand how online shopping sitess actually work [and the most important getting breakthrough in IT industry <img src='http://www.carbonrider.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  ]. The things were quite simple as apart from Web page designing there was no much responsibility and there was less headache in terms of banging head on fixing bugs. After few days, there was one of the Perl programmer working on some implementation got stuck in one of the implementation and was not able to resolve it. Being curious to know, what was the problem, I just thought of having a look at the Perl code. Well having a little bit idea of shell scripting and knowledge of PHP proved bit of help here. The Perl code look somewhat familiar to me and the problem (generation of some JavaScript logic using Perl Script) was resolved within few minutes.</p>
<p><span id="more-313"></span></p>
<p>One day I came across a situation where I saw a solution which was initially thought to be implemented in Java, failed miserably due to performance issues. The similar requirement was then implemented using .Net framework and it worked pretty well. Well the fact was, the decision of implementing the requirement using Java was incorrect. The language was not suitable for the kind of native integration and had serious performance bottlnecks.</p>
<p>The point, I want to bring here is that we see so called &#8220;Technical Specialist&#8221; &amp; &#8220;Architects&#8221; who always focus on one vertical and try to be specialist in one technology - ignore the features offerred by other languages/platforms. Though Its not possible to be a master of each and every platform, there is need for every technical guy to gain knowledge of other platforms and urge to find out options available in competing platforms. Well sometimes it is purely managerial decision to choose the technology, the efforts need to be put by people (quoted above) by listing alternatives with evidences. The other option is that, at organisation level a group of such experts (obviously with different flavors of technology) should be created and high solutions/design review should be done by such team.</p>
<p>For a long time, the customers were concerned for getting business done, are now also look into the platform on which the application/product is running. The changing attitude of customers demands serious need of  Techies with the ability to understand multiple technology and its application for a business need. Sadly most of the people, I came across are sticked to one platform and trying to be specialist/expert :( not even realising the threat it might create.</p>
]]></content:encoded>
			<wfw:commentRss>http://articles.carbonrider.com/2010/07/11/i-am-not-addicted-to-coffee/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Codemodel &#8211; Java Code generation library</title>
		<link>http://articles.carbonrider.com/2010/07/08/codemodel-java-code-generation-library/</link>
		<comments>http://articles.carbonrider.com/2010/07/08/codemodel-java-code-generation-library/#comments</comments>
		<pubDate>Thu, 08 Jul 2010 17:34:42 +0000</pubDate>
		<dc:creator>Carbon Rider</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[code generator]]></category>
		<category><![CDATA[java code generation library]]></category>
		<category><![CDATA[java source code generator]]></category>

		<guid isPermaLink="false">http://www.carbonrider.com/?p=310</guid>
		<description><![CDATA[I was looking out for a utility/library which can be used to generate Java Source code. Initially I thought of using source code templates and generate Java Files from it. But fortunately I came across an interesting library CodeModel. This library is used by most of the popular code generators including JAXB. The library provides [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Farticles.carbonrider.com%2F2010%2F07%2F08%2Fcodemodel-java-code-generation-library%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Farticles.carbonrider.com%2F2010%2F07%2F08%2Fcodemodel-java-code-generation-library%2F&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p>I was looking out for a utility/library which can be used to generate Java Source code. Initially I thought of using source code templates and generate Java Files from it. But fortunately I came across an interesting library <a title="Codemodel" href="https://codemodel.dev.java.net/" target="_blank">CodeModel</a>.</p>
<p>This library is used by most of the popular code generators including JAXB. The library provides set of API classes which can be used to generate Java Source code (supports Java 5 generics, annotations etc.). The only downside of this library is that, it is not well documented. Worst part is, there are no tutorials available. So If you want to find out more details about how this library works, you better fold your sleeves and start writing some code which uses API. Good Luck.</p>
]]></content:encoded>
			<wfw:commentRss>http://articles.carbonrider.com/2010/07/08/codemodel-java-code-generation-library/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>IBM Websphere &#8211; Address Already in use : NET_Bind</title>
		<link>http://articles.carbonrider.com/2010/07/05/ibm-websphere-address-already-in-use-net_bind/</link>
		<comments>http://articles.carbonrider.com/2010/07/05/ibm-websphere-address-already-in-use-net_bind/#comments</comments>
		<pubDate>Mon, 05 Jul 2010 17:49:13 +0000</pubDate>
		<dc:creator>Carbon Rider</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[address already in use]]></category>
		<category><![CDATA[NET_Bind]]></category>
		<category><![CDATA[websphere]]></category>
		<category><![CDATA[websphere 6.1]]></category>

		<guid isPermaLink="false">http://www.carbonrider.com/?p=306</guid>
		<description><![CDATA[I was recently trying to fix one error and after installing patch 31 on IBM websphere 6.1.0.25, I came across a weird problem &#8211; My application was trying to connect to database using DBCP common pool and it suddenly stopped working after applying patch. The error message logged in file was &#8220;Network adapter could not [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Farticles.carbonrider.com%2F2010%2F07%2F05%2Fibm-websphere-address-already-in-use-net_bind%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Farticles.carbonrider.com%2F2010%2F07%2F05%2Fibm-websphere-address-already-in-use-net_bind%2F&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p>I was recently trying to fix one error and after installing patch 31 on IBM websphere 6.1.0.25, I came across a weird problem &#8211; My application was trying to connect to database using DBCP common pool and it suddenly stopped working after applying patch. The error message logged in file was &#8220;Network adapter could not establish connection&#8221;.</p>
<p><span id="more-306"></span></p>
<p>It was quite unexpected to see this error as I could easily able to connect database from other machine. So I thought of writing simple JDBC code and tried to connect to the database from Websphere machine. To my surprise, this code was working as expected and could able to connect the database. It was quite frustrating as we couldn&#8217;t able to figure out why DBCP pool stopped working after installing patch 31. After googling on this problem, I found that using ojdcb5.jar would reveal more details about error and it worked for me. This time, rather than just saying &#8220;Network adapter&#8230;&#8221;, it also logged an error message as &#8220;Address already in use : NET_Bind&#8221;. Well this was obviously more confusing than the earlier one, as it wasn&#8217;t quite clear what was the cause of the error. The error continued to show up after restarting Websphere and even after restarting whole machine.</p>
<p>After reading patch 31 readme notes, I found that it is also necessary to update IBM JVM fix compatible for patch 31.  The JVM patch is not bundled with Websphere patch and should be applied separately.</p>
<p>Yippee, after installing the JVM patch the &#8220;Address Already in use&#8230;&#8221; error got whooshh&#8230; Hence I would like to advice Websphere users to carefully go through the readme notes of any patch and make sure that dependent patches are applied correctly OR else you might get caught in trap of errors.</p>
]]></content:encoded>
			<wfw:commentRss>http://articles.carbonrider.com/2010/07/05/ibm-websphere-address-already-in-use-net_bind/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>IBM Websphere – Worst NiGhTmArE (NoClassDefFoundError – com.sun.org.apache.xerces.internal.dom.DocumentImpl)</title>
		<link>http://articles.carbonrider.com/2010/07/04/ibm-websphere-worst-nightmare-noclassdeffounderror-com-sun-org-apache-xerces-internal-dom-documentimpl/</link>
		<comments>http://articles.carbonrider.com/2010/07/04/ibm-websphere-worst-nightmare-noclassdeffounderror-com-sun-org-apache-xerces-internal-dom-documentimpl/#comments</comments>
		<pubDate>Sun, 04 Jul 2010 05:08:33 +0000</pubDate>
		<dc:creator>Carbon Rider</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[CXF with websphere 6.1]]></category>
		<category><![CDATA[websphere]]></category>

		<guid isPermaLink="false">http://www.carbonrider.com/?p=300</guid>
		<description><![CDATA[Last week, I was trying to deploy CXF 2.X webservice application on Websphere 6.1.0.X. Everything worked well and no error at the time of deployment. But while invoking webservices, we were getting an error java.lang.NoClassDefFoundError: com.sun.org.apache.xerces.internal.dom.DocumentImpl After googling, we found that this class is integral to JDK 1.5 and ships along with it. We were bit [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Farticles.carbonrider.com%2F2010%2F07%2F04%2Fibm-websphere-worst-nightmare-noclassdeffounderror-com-sun-org-apache-xerces-internal-dom-documentimpl%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Farticles.carbonrider.com%2F2010%2F07%2F04%2Fibm-websphere-worst-nightmare-noclassdeffounderror-com-sun-org-apache-xerces-internal-dom-documentimpl%2F&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p>Last week, I was trying to deploy CXF 2.X webservice application on Websphere 6.1.0.X. Everything worked well and no error at the time of deployment. But while invoking webservices, we were getting an error</p>
<p>java.lang.NoClassDefFoundError: com.sun.org.apache.xerces.internal.dom.DocumentImpl</p>
<p>After googling, we found that this class is integral to JDK 1.5 and ships along with it. We were bit confused as the application was working fine on development machines with no errors. After googling more, the same problem was reported on most of the forums by Websphere users.</p>
<p><span id="more-300"></span></p>
<p>Well there was definitely difference between the development environment and testing environment. Developers were using Sun JDK 1.5.0_16 + Jboss 4.2.2 GA, while the testing environment had IBM JDK 1.5 SR 2 + IBM Websphere 6.1.0.25.</p>
<p>The class mentioned above is already available in rt.jar of SUN JRE but it is missing from IBM JDK (what a <a href="mailto:X@#$">X@#$</a>). The solution to this problem is to download JAXP library from <a href="https://jaxp.dev.java.net/">https://jaxp.dev.java.net/</a>. It is downloadable as .class file. To get the jar files from the class, you need to execute the .class file using &#8220;java&#8221; command. It will extract JAR files, copy xercesImpl.jar file to WEB-INF/lib folder of the application &amp; restart the server.</p>
<p>If the application still gives the same error, make sure the classloader policy is changed to load application classes first.</p>
]]></content:encoded>
			<wfw:commentRss>http://articles.carbonrider.com/2010/07/04/ibm-websphere-worst-nightmare-noclassdeffounderror-com-sun-org-apache-xerces-internal-dom-documentimpl/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Sun Certified Enterprise Architect</title>
		<link>http://personal.carbonrider.com/2010/06/23/sun-certified-enterprise-architect/</link>
		<comments>http://personal.carbonrider.com/2010/06/23/sun-certified-enterprise-architect/#comments</comments>
		<pubDate>Wed, 23 Jun 2010 18:17:06 +0000</pubDate>
		<dc:creator>Carbon Rider</dc:creator>
				<category><![CDATA[personal]]></category>

		<guid isPermaLink="false">http://www.carbonrider.com/?p=295</guid>
		<description><![CDATA[Finally, completed Sun Certified Enterprise Architect certification.]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fpersonal.carbonrider.com%2F2010%2F06%2F23%2Fsun-certified-enterprise-architect%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fpersonal.carbonrider.com%2F2010%2F06%2F23%2Fsun-certified-enterprise-architect%2F&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p>Finally, completed Sun Certified Enterprise Architect certification.</p>
<p><a href="http://www.carbonrider.com/wp-content/uploads/2010/06/java_cert_ent_arch_cmyk1.png"><img class="alignnone size-full wp-image-296" title="SCEA" src="http://www.carbonrider.com/wp-content/uploads/2010/06/java_cert_ent_arch_cmyk1.png" alt="SCEA" width="300" height="207" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://personal.carbonrider.com/2010/06/23/sun-certified-enterprise-architect/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Enterprise Application &#8211; What it demands?</title>
		<link>http://articles.carbonrider.com/2010/05/30/enterprise-application-what-it-demands/</link>
		<comments>http://articles.carbonrider.com/2010/05/30/enterprise-application-what-it-demands/#comments</comments>
		<pubDate>Sun, 30 May 2010 13:34:06 +0000</pubDate>
		<dc:creator>Carbon Rider</dc:creator>
				<category><![CDATA[Articles]]></category>

		<guid isPermaLink="false">http://articles.carbonrider.com/?p=291</guid>
		<description><![CDATA[Scalability, performance etc are all required to good build softwares. Before starting development, majority of the firms do come up with well designed Software Architecture and address customer needs in efficient way. Selecting right technology, infrastructure and placing frameworks at right place are all required to build robust applications. While we can see there are [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Farticles.carbonrider.com%2F2010%2F05%2F30%2Fenterprise-application-what-it-demands%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Farticles.carbonrider.com%2F2010%2F05%2F30%2Fenterprise-application-what-it-demands%2F&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p>Scalability, performance etc are all required to good build softwares. Before starting development, majority of the firms do come up with well designed Software Architecture and address customer needs in efficient way. Selecting right technology, infrastructure and placing frameworks at right place are all required to build robust applications.<br />
While we can see there are new frameworks/languages coming in the market with the capability to address modern day problems, the customers are also concertrating more on how the application can help them to quickly address business problems and tap market opportunities.<br />
<span id="more-291"></span><br />
Once the application is built and it goes in to the production mode, the customer starts demanding new changes into the application to meet certain requirements. The changes could range from adding new field on screen to building new report or developing webservices, defining workflows etc. Finally all this comes back to the development company as a Change Request and developers start modifying existing code to meet the requirements. This is what a typical development/maintainance cycle that we normally experience at the work.<br />
While most of the designers/architects/developers feel that it is the technology which matters alot while developing application, the end users/customers are interested in how well the requirements are implemented and the capability of system to accommodate new changes. As said earlier the changes could be simple like adding field or could be complex like building new webservice, today&#8217;s customers don&#8217;t just prefer it to be developed in less time but demand to have their own control over such development.<br />
Few days back while attending one of the pre-sales demo, I observed that the prospect was continuosly emphasizing on how application can be managed by its own IT staff and how easy is to modify the application screen to meet the requirements. The simple reason for asking such reason was, there is a product in the market (developed almost 8-9 years back) which has integrated environment giving an end user the control to add/modify screens, build workflows, build webservices, maintain source repository, build test cases etc without writing a single line of code. (Sorry, I can&#8217;t mention the name of the product and its not an ERP system). It was the first time I heard of such software which allows to do everything from its IDE without a need of experties in any specific computer language. The business analysts can easily modify the application as per the business needs without  having dependency on the developers to make changes in code. The biggest advantage of such application is the time spent in accomodating new requirement by customer IT team VERSUS time spent in following entire software life cycle, if implemented by development company.  Definitely such software relieves customer from being dependent on a Software vendor. Customers don&#8217;t have to fallback on software vendors for majority of its requirement, saving lot of money that could be otherwise invested in strengthening its market position.<br />
While I am pretty much impressed with this software, I could see lot of designers/architects are still thinking about making use of new frameworks/languages to build good software and not even aware of such software that do exist and slowly becoming threat for majority of Software companies. How many of them have really thought about/developed such a design giving full control to the customer?</p>
]]></content:encoded>
			<wfw:commentRss>http://articles.carbonrider.com/2010/05/30/enterprise-application-what-it-demands/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
