<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss 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:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">

<channel>
	<title>blog.codecentric.de</title>
	
	<link>http://blog.codecentric.de/en/</link>
	<description>codecentrics Blog on Agile, Architecture, Java, Performance and Enterprise Content Management</description>
	<lastBuildDate>Thu, 02 Sep 2010 13:49:13 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/codecentric_en" /><feedburner:info uri="codecentric_en" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><item>
		<title>No time for monitoring?</title>
		<link>http://feedproxy.google.com/~r/codecentric_en/~3/m8aKp9hx8Z0/</link>
		<comments>http://blog.codecentric.de/en/2010/09/no-time-for-monitoring/#comments</comments>
		<pubDate>Thu, 02 Sep 2010 13:48:57 +0000</pubDate>
		<dc:creator>Rainer Schuppe</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Java @en]]></category>
		<category><![CDATA[Performance @en]]></category>

		<guid isPermaLink="false">http://blog.codecentric.de/?p=5164</guid>
		<description><![CDATA[Monitoring big, distributed Java landscapes helps tremendously to keep complex applications under control. But many administrators spare the effort to set up monitoring: No time. Now a timesaving solution is in sight. „We are maxed out anyway. We need a &#8230; <a href="http://blog.codecentric.de/en/2010/09/no-time-for-monitoring/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Monitoring  big, distributed Java landscapes helps tremendously to keep complex  applications under control. But many administrators spare the effort to  set up monitoring: No time. Now a timesaving solution is in sight.</p>
<blockquote><p>„We  are maxed out anyway. We need a solution that helps to make our work  more effective and not something that if we are lucky saves about as much time as it  needs to set it up and maintain it“.<br />
I  hear statements like those again and again from IT administrators. With  the effect that APM solutions are mainly used for firefighting by  experts.</p></blockquote>
<p>So,  what is needed? A solution which allows to monitor a large number of  applications with a minimum of configuration effort and identifies the  root cause of problems quickly.</p>
<p>Indeed  I found and tested a tool which fulfills those requirements. <span id="more-5164"></span> AppDynamics developed a product which is convincing not least because of  its ease of use. I was sceptical at first but haven’t been disappointed  in a couple of evaluations. Almost as easy as an iPhone- or  Android-App. Simply use it.</p>
<h3>The 3 steps towards 24&#215;7 monitoring</h3>
<p>Let’s  take a look at the steps needed to establish application monitoring and  how the AppDynamics solution adds value and saves time.</p>
<h3>1. What to measure? &#8211; Measuring Points</h3>
<p>The definition of measuring points (or sensors, probes) is the first  challenge. Most APM solutions for Java or .NET use BCI (bytecode  instrumentation) to get performance data. The measuring points need to  be determined very carefully to prevent a big influence on the results  (overhead) as additional code is executed. This usually asks for the  assistance of an expert, an architect or developer. For every application that needs to be monitored.</p>
<p>If  agile development processes are used this is an exhausting process as  classes can change daily or new frameworks are added. A  “trial-and-error” approach in production is prohibitive due to the  necessity to restart the application servers most of the times.  Additionally the overhead can be increased inadvertently to an unbearable level for the users.</p>
<p>AppDynamics  uses a patent pending technology which needs only a minimum of BCI and still is capable of delivering information on method level to identify  “loitering” components. And that without any configurations effort. The architect / developer can do his day job without being bothered by the admin.</p>
<h3>2. How to get an overview? &#8211; Visualization</h3>
<p>Dashboards  are commonly used to provide an overview over the architecture (which  component talks to whom and how often?) and the business transactions  (which transaction is behaving cumbersome and who is affected) for all  involved applications.</p>
<p>Most  vendors use “customizable dashboards” for visualization as a kind of panacea where every view can be adjusted for every type of user. And that is exactly what needs to be done for every detail and every application &#8211;  so to say “mustomizable dashboards”. Any change in the environment or the business functionalities requires additional effort.</p>
<p>AppDynamics  dashboards are created automatically and determine business transactions based on the “inner” values of an application (e.g. strus  actions, URI patterns or HTTP parameters). If the default settings are not matching they can be changed with a few clicks and the system is  ready for action.</p>
<table>
<tbody>
<tr>
<td>
<p><div id="attachment_5150" class="wp-caption alignleft" style="width: 260px"><a href="http://blog.codecentric.de/wp-content/uploads/2010/09/AD-Overview-Screenshot-klein.png" rel="lightbox"><img class="size-thumbnail wp-image-5150" src="http://blog.codecentric.de/wp-content/uploads/2010/09/AD-Overview-Screenshot-klein-150x150.png" alt="AppDynamics - Application Overview" width="250" height="200" /></a><p class="wp-caption-text">AppDynamics - Application Overview</p></div></td>
<td>
<p><div id="attachment_5149" class="wp-caption alignright" style="width: 260px"><a href="http://blog.codecentric.de/wp-content/uploads/2010/09/AD-App-Map-Screenshot-klein.png" rel="lightbox"><img class="size-thumbnail wp-image-5149" src="http://blog.codecentric.de/wp-content/uploads/2010/09/AD-App-Map-Screenshot-klein-150x150.png" alt="AppDynamics Application Flow Map" width="250" height="200" /></a><p class="wp-caption-text">AppDynamics Application Flow Map</p></div></td>
</tr>
</tbody>
</table>
<h3 id="internal-source-marker_0.9883230428126347">3. Red Alert! Something is going wrong. &#8211; Thresholds</h3>
<p>What  defines a problem in production? Usually something out of the norm,  e.g. a user login takes 3-times the time that is normal for that time of  the day or a JVM uses excessive amounts of CPU. Such abnormalities are  visible with the help of predefined thresholds where a violation thereof  results in an incident or alert.</p>
<p>Now  what I see in the real world are 100 and more applications with a  multitude of different business transactions which have very divers  “normal” response times: Sometimes 2 seconds are very good (cost  calculation for an isurance policy), sometimes 200 ms are a catastrophe  (placing a bet on an online beting patform). Or worse: There are no  non-functional requirements defined at all, so that the thresholds have  to be set using a dice initially and later adjusted. With only 50  applications with 50 transactions each we have a stunning 2500  thresholds that need to be set and checked. On a regular basis. And we  only looked at response times so far&#8230;</p>
<p>With  AppDynamics this is not needed. A slick baselining and statistical  methods like standard deviation are used to automate this work. You can  adjust each value individually if needed but 95% of all thresholds are  already covered with the default rules. This includes time of day and  weekly differences;  e.g. on monday mornings the login process takes  longer because of the load and will not raise an alert though the same  response time causes an incident 2 hours later or on tuesday morning as  it is above the norm for that timeframe.</p>
<h3>4. And what about root cause analysis? (Bonusstep)</h3>
<p>Alerting  in case of problems is nice and needed the admin knows that something  went wrong or is about to go wrong in advance but who to notify for  remedy? Triage and root cause analysis capabilities complete the  monitoring. This means identifiying the responsible person to resolve  the problem and additionally given them the details to return to  normality quickly.</p>
<p>I  stated before that AppDynamics instruments very little bytecode. How  are the necessary details retrieved then? AppDynamics uses so called  snapshots, which include a call stack with timings and details about the  transcation itself. Snapshots are taken automatically of abnormal  transactions (too slow, erroneous, etc.), on demand and time based (like  every 10 minutes or every 100th occurence). With this technology an  administrator is spared a tsunami of data but is equipped with exactly  the necessary information when he / she needs it.</p>
<p>In  the coming weeks we will publish a series of blog posts on how to  diagnose different kinds of performance problems in detail.</p>
<h3>Simple and effective</h3>
<p>In  summary:  AppDynamics created an easy to use and effective solution in  which I see the promises of the last seven years kept. A simple to use  system which was developed specifically for the monitoring of highly  distributed, business critical Java applications.</p>
<p>Revolutionary?  No, rather evolutionary. AppDynamics paid attention to the shortcomings  of existing solutions and put a lot of thought into automation.  “2-3-100” is the goal. 2 administrators take 3 days to setup 100  applications for monitoring.</p>
<p>While  the first providers of APM solutions for Java and .NET had the goal to  open the blackbox and get some data at all the second generation  expanded this to transactions in order to be able to x-ray modern  SOA/SBA based applications. What was missing was the usability and automation. How can I  effortlessly sort my data and turn it into valueable information?</p>
<h3>Let’s take a look into the next generation of APM!</h3>
<h3>Put  an agent into an application (see <a href="http://blog.codecentric.de/2010/08/einfache-performanceanalyse-mit-appdynamics-lite/">AppDynamics Lite Screencast by  Fabian</a>), let it send data to the central controller and simply wait for  the first results to reveal themselves.</h3>
<div class="dzone_button" style="float: right; margin: 10px 0;">
<iframe src="http://widgets.dzone.com/links/widgets/zoneit.html?t=2&url=http%3A%2F%2Fblog.codecentric.de%2Fen%2F2010%2F09%2Fno-time-for-monitoring%2F&title=No+time+for+monitoring%3F" height="25" width="155" scrolling="no" frameborder="0"></iframe>
</div><img src="http://feeds.feedburner.com/~r/codecentric_en/~4/m8aKp9hx8Z0" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blog.codecentric.de/en/2010/09/no-time-for-monitoring/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://blog.codecentric.de/en/2010/09/no-time-for-monitoring/</feedburner:origLink></item>
		<item>
		<title>Software Architecture Workshop with Dana Bredemeyer and Meet the Experts</title>
		<link>http://feedproxy.google.com/~r/codecentric_en/~3/OWXPLjy6dwI/</link>
		<comments>http://blog.codecentric.de/en/2010/09/architecture-workshop-with-dana-bredemeyer-and-meet-the-experts/#comments</comments>
		<pubDate>Wed, 01 Sep 2010 15:28:45 +0000</pubDate>
		<dc:creator>Uwe Friedrichsen</dc:creator>
				<category><![CDATA[Architecture]]></category>
		<category><![CDATA[Conferences]]></category>
		<category><![CDATA[meet the experts @en]]></category>
		<category><![CDATA[architecture workshop]]></category>
		<category><![CDATA[Dana Bredemeyer]]></category>
		<category><![CDATA[meet the experts]]></category>

		<guid isPermaLink="false">http://blog.codecentric.de/?p=5101</guid>
		<description><![CDATA[All right, now I&#8217;m trying to write the probably shortest post ever published in the codecentric blog &#8230; So, what&#8217;s it about? I just wanted to point out for those who do not know yet that Dana Bredemeyer will conduct &#8230; <a href="http://blog.codecentric.de/en/2010/09/architecture-workshop-with-dana-bredemeyer-and-meet-the-experts/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>All right, now I&#8217;m trying to write the probably shortest post ever published in the codecentric blog &#8230; <img src='http://blog.codecentric.de/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </p>
<p>So, what&#8217;s it about?</p>
<p>I just wanted to point out for those who do not know yet that <a href="http://www.bredemeyer.com/">Dana Bredemeyer</a> will conduct his well-known Software Architecture Workshop at codecentric from Sep-13-2010 to Sep-16-2010. Dana haven&#8217;t had an open enrollment for this workshop in Germany for almost 10 years and from all I&#8217;ve heard about it this will be a great course. So, if you are interested in that workshop and do not want to travel to the United States for that you might want to take a look at <a href="http://www.meettheexperts.de/software-architecture">http://www.meettheexperts.de/software-architecture</a>.</p>
<p>Also, I wanted to mention our &#8220;Meet the Experts&#8221; on Sep-17-2010. &#8220;New challenges in architecture today&#8221; will be the topic. Five well-known speakers, including Dana Bredemeyer, Dr. Gernot Starke and Prof. Dr. Heinz Züllighoven will share their ideas in insights with you. And, as always there will be a lot of time for discussions, networking, open space for your questions, great catering, and so on. So, if that sounds interesting for you, just have a look at <a href="http://www.meettheexperts.de/meettheexperts-architektur">http://www.meettheexperts.de/meettheexperts-architektur</a>.</p>
<p>Okay, that&#8217;s all I wanted to talk about. I think those sessions will be great stuff, I will be there for sure. And if you will be there too, I&#8217;ll be glad to meet you &#8230; and if not, maybe we&#8217;ll meet some other time &#8230;</p>
<div class="dzone_button" style="float: right; margin: 10px 0;">
<iframe src="http://widgets.dzone.com/links/widgets/zoneit.html?t=2&url=http%3A%2F%2Fblog.codecentric.de%2Fen%2F2010%2F09%2Farchitecture-workshop-with-dana-bredemeyer-and-meet-the-experts%2F&title=Software+Architecture+Workshop+with+Dana+Bredemeyer+and+Meet+the+Experts" height="25" width="155" scrolling="no" frameborder="0"></iframe>
</div><img src="http://feeds.feedburner.com/~r/codecentric_en/~4/OWXPLjy6dwI" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blog.codecentric.de/en/2010/09/architecture-workshop-with-dana-bredemeyer-and-meet-the-experts/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://blog.codecentric.de/en/2010/09/architecture-workshop-with-dana-bredemeyer-and-meet-the-experts/</feedburner:origLink></item>
		<item>
		<title>Easy Performance Analysis with AppDynamics Lite</title>
		<link>http://feedproxy.google.com/~r/codecentric_en/~3/GTwmT4Ss5h0/</link>
		<comments>http://blog.codecentric.de/en/2010/08/easy-performance-analysis-with-appdynamics-lite/#comments</comments>
		<pubDate>Tue, 31 Aug 2010 10:30:20 +0000</pubDate>
		<dc:creator>Fabian Lange</dc:creator>
				<category><![CDATA[Performance @en]]></category>

		<guid isPermaLink="false">http://blog.codecentric.de/?p=4957</guid>
		<description><![CDATA[AppDynamics is the rising star in the Application Performance Management sky. Mirko gives a really good description why AppDynamics delivers the right solutions for todays distributed architectures in his Post &#8220;Troubleshoot Java in production – introducing AppDynamics Lite&#8220;. If you &#8230; <a href="http://blog.codecentric.de/en/2010/08/easy-performance-analysis-with-appdynamics-lite/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>AppDynamics is the rising star in the <strong>Application Performance Management</strong> sky.</p>
<p>Mirko gives a really good description why AppDynamics delivers the right solutions for todays distributed architectures in his Post &#8220;<a href="http://blog.codecentric.de/en/2010/08/troubleshoot-java-in-production-introducing-appdynamics-lite/">Troubleshoot Java in production – introducing AppDynamics Lite</a>&#8220;. If you have not read it yet, head over to it now.</p>
<p>The key promise of AppDynamics is <strong>simplicity</strong>. Easy installation, easy operation and very fast results. In fact this sounds uncommon and hard to believe. But this is indeed the case, as proven by the following uncut screencasts.<br />
<span id="more-4957"></span></p>
<p>Installation of AppDynamics is fast and easy like pie. In this screencast I will be showing to you how to perform the installation in less than 3 minutes (there is a full screen mode in the lower right corner):<br/><br />
<center><object id="scPlayer" class="embeddedObject" width="574" height="393" type="application/x-shockwave-flash" data="http://content.screencast.com/users/FabianLange/folders/Default/media/2b80ef2a-3add-41da-a0dd-1638e0ad27fc/bootstrap.swf" ><param name="movie" value="http://content.screencast.com/users/FabianLange/folders/Default/media/2b80ef2a-3add-41da-a0dd-1638e0ad27fc/bootstrap.swf" /><param name="quality" value="high" /><param name="bgcolor" value="#FFFFFF" /><param name="flashVars" value="thumb=http://content.screencast.com/users/FabianLange/folders/Default/media/2b80ef2a-3add-41da-a0dd-1638e0ad27fc/FirstFrame.jpg&#038;containerwidth=574&#038;containerheight=393&#038;content=http://content.screencast.com/users/FabianLange/folders/Default/media/2b80ef2a-3add-41da-a0dd-1638e0ad27fc/appdynamics-lite-installation-english.swf&#038;blurover=false" /><param name="allowFullScreen" value="true" /><param name="scale" value="showall" /><param name="allowScriptAccess" value="always" /><param name="base" value="http://content.screencast.com/users/FabianLange/folders/Default/media/2b80ef2a-3add-41da-a0dd-1638e0ad27fc/" /></object></center></p>
<p>Directly after the installation you can start investigating your performance issues. In the following screencast I show you the basic functionality and a possible workflow for finding the root cause of a slow response (there is a full screen mode in the lower right corner):<br />
<center><br />
<object id="scPlayer" class="embeddedObject" width="586" height="366" type="application/x-shockwave-flash" data="http://content.screencast.com/users/FabianLange/folders/Default/media/3b225a6b-96d5-418d-baa4-32cb97948b95/bootstrap.swf" ><param name="movie" value="http://content.screencast.com/users/FabianLange/folders/Default/media/3b225a6b-96d5-418d-baa4-32cb97948b95/bootstrap.swf" /><param name="quality" value="high" /><param name="bgcolor" value="#FFFFFF" /><param name="flashVars" value="thumb=http://content.screencast.com/users/FabianLange/folders/Default/media/3b225a6b-96d5-418d-baa4-32cb97948b95/FirstFrame.jpg&#038;containerwidth=586&#038;containerheight=366&#038;content=http://content.screencast.com/users/FabianLange/folders/Default/media/3b225a6b-96d5-418d-baa4-32cb97948b95/appdynamics-usage-english.swf&#038;blurover=false" /><param name="allowFullScreen" value="true" /><param name="scale" value="showall" /><param name="allowScriptAccess" value="always" /><param name="base" value="http://content.screencast.com/users/FabianLange/folders/Default/media/3b225a6b-96d5-418d-baa4-32cb97948b95/" /></object><br />
</center><br />
AppDynamics Lite is suitable for Development and for Production. It can be installed in almost no time, does not require any complex configuration and delivers valuable results within the first minutes. You can download the free lite edition on <a href="http://www.appdynamics.com/free">appdynamics.com/free</a>.</p>
<div class="dzone_button" style="float: right; margin: 10px 0;">
<iframe src="http://widgets.dzone.com/links/widgets/zoneit.html?t=2&url=http%3A%2F%2Fblog.codecentric.de%2Fen%2F2010%2F08%2Feasy-performance-analysis-with-appdynamics-lite%2F&title=Easy+Performance+Analysis+with+AppDynamics+Lite" height="25" width="155" scrolling="no" frameborder="0"></iframe>
</div><img src="http://feeds.feedburner.com/~r/codecentric_en/~4/GTwmT4Ss5h0" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blog.codecentric.de/en/2010/08/easy-performance-analysis-with-appdynamics-lite/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://blog.codecentric.de/en/2010/08/easy-performance-analysis-with-appdynamics-lite/</feedburner:origLink></item>
		<item>
		<title>Troubleshoot Java in production – introducing AppDynamics Lite</title>
		<link>http://feedproxy.google.com/~r/codecentric_en/~3/nJGdSS3QWcI/</link>
		<comments>http://blog.codecentric.de/en/2010/08/troubleshoot-java-in-production-introducing-appdynamics-lite/#comments</comments>
		<pubDate>Sun, 29 Aug 2010 21:38:19 +0000</pubDate>
		<dc:creator>Mirko Novakovic</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Performance @en]]></category>
		<category><![CDATA[Java]]></category>

		<guid isPermaLink="false">http://blog.codecentric.de/?p=4838</guid>
		<description><![CDATA[The performance and stability of Java applications in production is getting more and more critical. Most (if not all) of todays businesses rely on software. More and more of these applications use web or mobile technologies to directly offer service &#8230; <a href="http://blog.codecentric.de/en/2010/08/troubleshoot-java-in-production-introducing-appdynamics-lite/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>The performance and stability of Java applications in production is getting more and more critical. Most (if not all) of todays businesses rely on software. More and more of these applications use web or mobile technologies to directly offer service to customers or integrate with partners. These applications often leverage other applications or services to deliver the expected result. The infrastructure on which these services and application run is virtualized and will move to public or private clouds in the near future.</p>
<p><span id="more-4838"></span></p>
<p>In a recent article <a href="http://www.omnisophie.com/">Gunther Dueck</a> from IBM wrote that we can try to romanticize the good old times where everything was easier and better than today, but one day we have to accept SOA, Cloud and Mobile Apps. They are there and will not go away soon.</p>
<p>As &#8220;firefighters&#8221; for enterprise applications we see also a shift in the problem areas of mainly Java based web and enterprise applications. Some years ago the problems where mainly &#8220;code problems&#8221; where Hibernate was not configured correctly or a memory leak broke the system down. These issues are still there but we see more and more architectural problems that are a result of the raising complexity and dependency of these applications and higher needs for performance and scalability. An application may handle 5.000 users &#8211; but is it designed to handle 100.000? Can it execute a request in 1 second if it aggregates 20 remote service calls? What happens if one service is not available or doesn&#8217;t reply in time?</p>
<p>These questions are mostly not answered before the application begins its life in production. And if a problem occurs the application seems to be a big monster or black box and finding the root cause of the problem can be a long and expensive process.</p>
<p>The problem gets even worth with agile development processes where we deploy new applications every 2-4 weeks. Some internet companies like Flickr even <a href="http://www.slideshare.net/jallspaw/10-deploys-per-day-dev-and-ops-cooperation-at-flickr" target="_blank">deploy more than 10 time a day</a>. So the applications can change every day or week and the half-life period of your knowledge about the application is getting shorter and shorter.</p>
<p>So how can you approach performance or stability issues that occur in production is such an environment? In general a profiler is not the right tool. It has too much overhead, normally works just for a single JVM and is designed for usage in the development environment or the developers workplace. These environments are often just small and locally deployed environments that are not even close to a highly distributed SOA and/or Cloud scenario. In addition to that problems that are a result of high load, concurrency or legacy system can not be easyly reproduced in the development environment.</p>
<p>Classical monitoring or application performance management tools are in most cases not designed to work in highly distributed and loaded environment &#8211; so they generally not provide the data we need to analyze the root cause of the problem. In addition to that they normally not respond to change automatically and need a lot of configuration and instrumentation work. (and they cost thousands of dollars per JVM even if you just want to troubleshoot your problem)</p>
<p>AppDynamics is a San Francisco based start-up that developed what they call a &#8220;next generation performance management tool&#8221;. It is designed from scratch by experienced APM engineers to support exactly these highly distributed SOA/Cloud production environments. AppDynamics can monitor a distributed Java EE application without the need of custom instrumentation or configuration. It automatically creates an application map (see screenshot) which shows the number of calls and response times of any interesting call like database-, webservice- or JMS calls. It also gives you a full call stack down to method level of any interesting business transaction. This is done by an &#8220;intelligent&#8221; rule base that utilizes statistics of your application to decide which information to show. This means you can get inside information of all of your applications in 15 minutes &#8211; this is the time to install the AppDynamics server and agent(s).</p>
<p><img class="alignnone size-medium wp-image-4999" title="appdynamics_standalone" src="http://blog.codecentric.de/wp-content/uploads/2010/08/appdynamics_standalone-600x308.png" alt="" width="580" height="308" /></p>
<p>You don&#8217;t belive this? (I didn&#8217;t either when I talked the first time to the AppDynamics team) There is a good news: AppDynamics Lite is a free edition that you can dowload to troubleshoot slow response times, SQLs, erros and stalls in production. The Lite edition has some limits, but will be in most cases sufficient to troubleshoot Java problems in (pre-) production. It is installed in less than 15 minutes &#8211; so give it a try and download it for free here: <a href="http://www.appdynamics.com/free">http://www.appdynamics.com/free</a></p>
<p>Fabian captured some really nice screencasts to demo the features of AppDynamics lite. <a href="http://blog.codecentric.de/en/2010/08/easy-performance-analysis-with-appdynamics-lite/">In his blog you find &#8220;hands on&#8221; screencast</a> on installation of AppDynamics Lite and how to find production issues.</p>
<div class="dzone_button" style="float: right; margin: 10px 0;">
<iframe src="http://widgets.dzone.com/links/widgets/zoneit.html?t=2&url=http%3A%2F%2Fblog.codecentric.de%2Fen%2F2010%2F08%2Ftroubleshoot-java-in-production-introducing-appdynamics-lite%2F&title=Troubleshoot+Java+in+production+%26%238211%3B+introducing+AppDynamics+Lite" height="25" width="155" scrolling="no" frameborder="0"></iframe>
</div><img src="http://feeds.feedburner.com/~r/codecentric_en/~4/nJGdSS3QWcI" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blog.codecentric.de/en/2010/08/troubleshoot-java-in-production-introducing-appdynamics-lite/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		<feedburner:origLink>http://blog.codecentric.de/en/2010/08/troubleshoot-java-in-production-introducing-appdynamics-lite/</feedburner:origLink></item>
		<item>
		<title>Believing in Numbers</title>
		<link>http://feedproxy.google.com/~r/codecentric_en/~3/Gdz9PwHvCFA/</link>
		<comments>http://blog.codecentric.de/en/2010/08/believing-in-numbers/#comments</comments>
		<pubDate>Fri, 27 Aug 2010 07:49:27 +0000</pubDate>
		<dc:creator>Dr. Raymond Georg Snatzke</dc:creator>
				<category><![CDATA[Mathematicians view @en]]></category>
		<category><![CDATA[Performance @en]]></category>
		<category><![CDATA[performance testing]]></category>
		<category><![CDATA[test report]]></category>

		<guid isPermaLink="false">http://blog.codecentric.de/?p=4970</guid>
		<description><![CDATA[What follows is in my view a typical scenario of one of the common curses of the performance tester. A new version of a test object finds its way into my hands. After some twiddling with it to get it &#8230; <a href="http://blog.codecentric.de/en/2010/08/believing-in-numbers/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>What follows is in my view a typical scenario of one of the common curses of the performance tester. A new version of a test object finds its way into my hands. After some twiddling with it to get it running, I do a first quick test run. Somebody – development, architecture, project management, whoever – gets wind of it and is curious about the results. Defensively, I try a delaying tactic: “It’s the very first run. The test environment wasn’t completely built up. We have to do more tests. We must at first confirm the numbers before it makes any sense to discuss them.” My counterpart is getting more inquisitive. He insists to be aware of all of my objections and that he just wants to satisfy his curiosity. I finally give in and tell the numbers. Shortly thereafter, I regret it deeply. Like an avalanche, my little piece of information has gathered a gigantic mass in no time and like a boomerang it is coming full circle, heading straight back at me.<br />
<span id="more-4970"></span><br />
What happens in cases such as this is often the result of an excessive believe in numbers. When something has been tested and quantified, there is a tendency to trust and rely on the results regardless of the circumstances.  A first quick measurement point is frequently discussed and given weight as if a complete and elaborate test series has been conducted. If the numbers are bad, this sometimes leads to hectic and strange activities like escalation, crisis meetings and maybe even management action. If they are unexpectedly good, a premature all-clear may be given.</p>
<p>Even the performance tester himself may be prone to this type of mistake. I can speak out of my own experience here&#8230; Either because he wishes for or expects a certain result or simply because of routine he might be seduced to accept his own numbers as valid too quickly. Application systems and their configuration are often very complex, so it is easy to overlook or forget little changes with possibly large effects on the performance test’s results.</p>
<p>The unshakable belief in the validity of numeric data can lead to many other inappropriate follow-ups. There is often a tendency to overanalyze a single data point, e.g. projecting possible future performance improvements or extrapolating the effects on a system n-times the size of the test system and so on. If later tests don’t confirm these projections, sometimes a frantic search for an assumed hidden cause of the “wrong” numbers is started, instead of realizing that incomparable things were compared in the first place. Also sometimes earlier numbers – correctly reported and documented – are rediscovered, but their context forgotten, resulting in similar wrong interpretations, conclusions and activities.</p>
<p>Most of the time it is very hard to argue against this firm belief in numbers, to state that other tests are necessary to confirm them and that rather large variations are typical. Performance measurements as part of QA in software development are definitely not an exact science. As “getting things done” is normally the topmost priority, the preconditions for a controlled experiment as in the academic world are rarely fulfilled. Yet the results of such experiments are often handled as if they are fulfilled.</p>
<p>As a performance tester, one has to be aware of the possible ramifications of the reported test results. Testing – especially performance testing – is done to replace uncertainty with knowledge, but careless handling of test results can easily lead to the opposite outcome. In my opinion, the foremost rule should be to only report data that one understands, can stick by and defend. One should always be aware of the reliability, scope, relevance and comparability of the numbers reported and should document these characteristics and attach them to the report. It is often a good idea to explicitly remark if a measurement is just a statement about one particular test-setup and not suitable for further projections.</p>
<p>If a misinterpretation of test results occurs, one should act swiftly, clearly and forcefully to present the tester’s view of the numbers and their context in order to contain the possible damage. Numbers, once reported, tend to acquire a life of their own. Like a genie, it’s practically impossible to get them back into the bottle. Therefore, one should be very careful what to report and when to report.</p>
<p>One final advice: As a performance tester, always remain skeptical about your own work and your own instincts. Other people should not blindly believe in test results and numbers and neither should the tester.</p>
<div class="dzone_button" style="float: right; margin: 10px 0;">
<iframe src="http://widgets.dzone.com/links/widgets/zoneit.html?t=2&url=http%3A%2F%2Fblog.codecentric.de%2Fen%2F2010%2F08%2Fbelieving-in-numbers%2F&title=Believing+in+Numbers" height="25" width="155" scrolling="no" frameborder="0"></iframe>
</div><img src="http://feeds.feedburner.com/~r/codecentric_en/~4/Gdz9PwHvCFA" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blog.codecentric.de/en/2010/08/believing-in-numbers/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://blog.codecentric.de/en/2010/08/believing-in-numbers/</feedburner:origLink></item>
		<item>
		<title>Richfaces Sessions Eating Memory – Analysis of a Memory Leak</title>
		<link>http://feedproxy.google.com/~r/codecentric_en/~3/p1bMQKct6LA/</link>
		<comments>http://blog.codecentric.de/en/2010/08/richfaces-sessions-eating-memory-analysis-of-a-memory-leak/#comments</comments>
		<pubDate>Wed, 11 Aug 2010 16:36:29 +0000</pubDate>
		<dc:creator>Fabian Lange</dc:creator>
				<category><![CDATA[Java @en]]></category>
		<category><![CDATA[Performance @en]]></category>
		<category><![CDATA[Heapdump]]></category>
		<category><![CDATA[OutOfMemoryError]]></category>
		<category><![CDATA[Performance]]></category>
		<category><![CDATA[Richfaces]]></category>

		<guid isPermaLink="false">http://blog.codecentric.de/?p=4860</guid>
		<description><![CDATA[When developing a site in JSF many people like to use the Richfaces Framework. It is a pretty solid framework that comes wit a lot of functionality and nice components. It also comes with an Ajax framework called Ajax4JSF (also &#8230; <a href="http://blog.codecentric.de/en/2010/08/richfaces-sessions-eating-memory-analysis-of-a-memory-leak/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>When developing a site in JSF many people like to use the <a href="http://www.jboss.org/richfaces">Richfaces Framework</a>. It is a pretty solid framework that comes wit a lot of functionality and nice components. It also comes with an Ajax framework called <a href="http://en.wikipedia.org/wiki/Ajax4jsf">Ajax4JSF</a> (also called a4j). When deploying this site then facing the Internet to production, many people start finding out that their applications eat a lot of memory, leading to unresponsive systems or OutOfMemoryError crashes. This is due to a design issue in JSF / A4J and cannot be easily fixed, but worked around. But lets start with an analysis of whats wrong with our otherwise nice application.<br />
<span id="more-4860"></span></p>
<p><strong>Finding the culprit</strong></p>
<p>To find out whats wrong the best is to create a heap dump at peak usage to show whats consuming all the memory.<br />
After opening that dump in the wonderful <a href="http://www.eclipse.org/mat/">Eclipse MAT</a> you might get a picture like this:</p>
<p><img class="aligncenter size-full wp-image-4863" title="richfaces-sessions" src="http://blog.codecentric.de/wp-content/uploads/2010/08/richfaces-sessions.png" alt="" width="538" height="441" /></p>
<p>Ouch. 1.8 GB out of 2GB are consumed by sessions. I usually then filter by &#8220;StandardSession&#8221; for apache sessions to be able to easily browse around the sessions that have high amount of retained heap.</p>
<p><img class="aligncenter size-full wp-image-4866" title="richfaces-sessions-per-session" src="http://blog.codecentric.de/wp-content/uploads/2010/08/richfaces-sessions-per-session.png" alt="" width="533" height="170" /></p>
<p>Ouch again&#8230; 10MB per session, this cannot scale. Now it could of course be possible that some careless programmer put in  much of our data into the session, but thats simply not true, as we can  easily find out:</p>
<p><img src="http://blog.codecentric.de/wp-content/uploads/2010/08/richfaces-session-detail.png" alt="" title="richfaces-session-detail" width="590" height="435" class="aligncenter size-full wp-image-4964" /></p>
<p>Thats interesting. Almost all of our memory is consumed by AjaxStateHolders. So what does this actually do?</p>
<p><strong>How JSF and A4J work</strong></p>
<p>I try to keep it simple. Before JSF actually renders HTML to the users browser, it builds an internal representation. For each page (or view) this internal representation (called component tree) is created and run through the lifefcycle. Any user events are processed. If there is a component where a user can select one of 3 items, those 3 items are loaded and a string representation put onto the page. The component keeps track of which item is selected.</p>
<p>Now we do not want the user to submit the whole page to select another item, which would cause the component tree to be recreated and a different item to be selected. We want Ajax! For that A4J remembers the state of the components when the page was displayed. So it knows the component tree and those 3 items, and which one was selected. On AJAX actions the component is looked up, the state modified by selecting another item and the partial HTML representation sent back. This is also called partial page rendering.</p>
<p>So how does the remembering work? Well you might have guessed it: It creates a AjaxStateHolder in the user session and attaches the component tree to it.</p>
<p><strong>How this can get big</strong></p>
<p>Ok, this might be the current page. I can have big views but it is only one. No thats unfortunately not true. A4J does store more than one view. But why? Look at your browser, you are quite likely to find a &#8220;back&#8221; button somewhat in the to-left corner. When you click that you see the last page. But the browser did not send a request, so the server does not know that you are on that page. Imagine you click AJAX functionality: Where should the server get the component tree from for that time you have been on the page? Easy answer: This is as well in the AjaxStateHolder. By default this tracks back <strong>16 views</strong>. and because you might come across the same view in your browsing history more than once there are up to <strong>16 variants</strong> of a view.</p>
<p>As you can see this can get big. And remember, this is per user.</p>
<p><strong>How to fix</strong></p>
<p>Unfortunately there is no fix. This is how JSF works, and how A4J works.</p>
<p>There is a ticket on the Richfaces bug tracker which describes this: <a href="https://jira.jboss.org/browse/RF-3878">RF-3878 &#8211; Session memory leak</a>. And the best answer is: reduce the number of views you store.</p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;context-param<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
 <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;description<span style="color: #000000; font-weight: bold;">&gt;</span></span><span style="color: #000000; font-weight: bold;">&lt;/description<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
 <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;param-name<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>com.sun.faces.numberOfViewsInSession<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/param-name<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
 <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;param-value<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>1<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/param-value<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
 <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/context-param<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;context-param<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
 <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;description<span style="color: #000000; font-weight: bold;">&gt;</span></span><span style="color: #000000; font-weight: bold;">&lt;/description<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
 <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;param-name<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>com.sun.faces.numberOfLogicalViews<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/param-name<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
 <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;param-value<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>1<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/param-value<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/context-param<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></div></div>

<p>You will loose the browser back button functionality, but gain a lot of memory. Second way to fix is to reduce the size of the component tree, which is most likely affected by big lists of data and complex structures. However this is easier said than done.</p>
<div class="dzone_button" style="float: right; margin: 10px 0;">
<iframe src="http://widgets.dzone.com/links/widgets/zoneit.html?t=2&url=http%3A%2F%2Fblog.codecentric.de%2Fen%2F2010%2F08%2Frichfaces-sessions-eating-memory-analysis-of-a-memory-leak%2F&title=Richfaces+Sessions+Eating+Memory+%26%238211%3B+Analysis+of+a+Memory+Leak" height="25" width="155" scrolling="no" frameborder="0"></iframe>
</div><img src="http://feeds.feedburner.com/~r/codecentric_en/~4/p1bMQKct6LA" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blog.codecentric.de/en/2010/08/richfaces-sessions-eating-memory-analysis-of-a-memory-leak/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		<feedburner:origLink>http://blog.codecentric.de/en/2010/08/richfaces-sessions-eating-memory-analysis-of-a-memory-leak/</feedburner:origLink></item>
		<item>
		<title>PDF Generation with iText</title>
		<link>http://feedproxy.google.com/~r/codecentric_en/~3/bvPx-odMX3U/</link>
		<comments>http://blog.codecentric.de/en/2010/08/pdf-generation-with-itext/#comments</comments>
		<pubDate>Sun, 08 Aug 2010 09:05:44 +0000</pubDate>
		<dc:creator>Daniel Reuter</dc:creator>
				<category><![CDATA[Java @en]]></category>
		<category><![CDATA[iText]]></category>
		<category><![CDATA[OpenOffice]]></category>
		<category><![CDATA[PDF]]></category>

		<guid isPermaLink="false">http://blog.codecentric.de/?p=4765</guid>
		<description><![CDATA[Review: We had to estimate a PDF generation task during our last sprint planning meeting. We received a rough layout template from our costumer and the service classes to provide the required data were also already present. Nevertheless, we estimated &#8230; <a href="http://blog.codecentric.de/en/2010/08/pdf-generation-with-itext/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Review: We had to estimate a PDF generation task during our last sprint planning meeting. We received a rough layout template from our costumer and the service classes to provide the required data were also already present. Nevertheless, we estimated the associated tickets amazingly high. No developer in the team had experience with <a href="http://www.itextpdf.com/">iText</a> before. However, everyone had heard scary stories from other developers about iText. A qoute floated in our ears: &#8220;If you work with iText, sooner or later you have to read the <a href="http://www.adobe.com/devnet/pdf/pdf_reference.html">specification of the pdf format</a>.&#8221;<br />
<span id="more-4765"></span></p>
<p>After some online research and several interviews with other project teams of codecentric I would like to describe a very simple, robust and primarily fast way to generate PDFs with iText. With this approach, the ticket mentioned above was solved in a quarter of the estimated time and the fear of iText in the team disappeared.</p>
<p>iText offers a lot of possibilities to create PDFs completly using its API, containing all lines, pictures, fixed texts and much more. But this approach may get very complex and generates a lot of error-prone code. It&#8217;s much easier to create a template with defined content-fields. This Template will be saved as a PDF with a formular and can be watched for example in the <a href="http://get.adobe.com/de/reader/">Adobe Reader</a> at any time. Another advantage is the possibility to show your customer the empty pdf and discuss the layout before implementing the logic which fills in the data.</p>
<h4>Part 1 – Creation of PDF-formulars</h4>
<p>PDF-formulars can be created very easy with <a href="http://de.openoffice.org/">OpenOffice</a>. I used OpenOffice Draw in my example, but the approach also works with OpenOffice Writer or Calc. Just create a new document and fill it with texts, colours or lines as desired. After the layout has been finished, you have to define the formular fields. Therefore it&#8217;s helpful to activate the toolbars for <em>Formular Design</em> und <em>Formular Control Elements</em> via <em>View -&gt; Toolbars</em> (Sorry &#8211; I don&#8217;t know the exact english translations, because I use the german version of Open Office). You can activate the <em>Formular Design Mode</em> using one of the new icons. After that, you can choose for example a textfield from the Formular Control Elements and insert it into your document. The properties of the textfield can be changed with a right-click. The following properties are interesting:</p>
<ul>
<li>Name : This name will be used in the Java code to reference the control element and fill it with data.</li>
<li>Border : Default is <em>3D-Look</em> – In most cases the setting <em>without Border</em> should work better.</li>
<li>Background-Colour, Alignment, Font: You can define the layout with these properties. Layout data in Java code is not necessary!</li>
<li>Text-type: Default should be <em>one-line</em>, but if you need to fill in the field with line-breaks from Java code, you have to use <em>multi-line</em>.</li>
</ul>
<p>It&#8217;s very hard to spot the formular fields as soon as they have no border. The Formular-Navigator helps to solve this problem.</p>
<p>After creating layout and formular fields the document can be exported to a PDF. This can be done by <em>File &#8211;&gt; Export as PDF</em>. Be sure to activate the checkbox <em>Create PDF-Formular</em> in the following dialog.</p>
<div id="attachment_4738" class="wp-caption aligncenter" style="width: 210px"><a href="http://blog.codecentric.de/wp-content/uploads/2010/07/openoffice.png" rel="lightbox"><img src="http://blog.codecentric.de/wp-content/uploads/2010/07/openoffice-150x150.png" alt="OpenOffice" width="150" height="150" class="size-thumbnail wp-image-4738" /></a><p class="wp-caption-text">Editing a formular in OpenOffice</p></div><br />
<div class="wp-caption aligncenter" style="width: 210px"><a href='http://blog.codecentric.de/wp-content/uploads/2010/07/pdfTemplateExample.odg'><img src="http://blog.codecentric.de/wp-content/uploads/2010/07/OpenOfficeIcon.png" alt="" width="48" height="48" class="alignnone size-full wp-image-4747" /></a><p class="wp-caption-text">OpenOffice - PDF Template</p></div><br />
<div class="wp-caption aligncenter" style="width: 210px"><a href='http://blog.codecentric.de/wp-content/uploads/2010/07/pdfTemplateExample.pdf'><img src="http://blog.codecentric.de/wp-content/uploads/2010/07/pdf-icon.png" alt="" width="50" height="50" class="alignnone size-full wp-image-4749" /></a><p class="wp-caption-text">Generated PDF Template</p></div><br />
</p>
<h4>Part 2 – Fill the PDF-Formular with iText</h4>
<p>In my example I use iText in version 2.1.7, because in later versions iText has a more strict <a href="http://itextpdf.com/terms-of-use/">license</a>.</p>
<p>First read the created PDF template&#8230;</p>

<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;">PdfReader pdfTemplate <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> PdfReader<span style="color: #009900;">&#40;</span>pdfTemplateFile<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>&#8230; and create a <em>PdfStamper</em> with a OutputStream.</p>

<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;"><span style="color: #003399;">ByteArrayOutputStream</span> out <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #003399;">ByteArrayOutputStream</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
PdfStamper stamper <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> PdfStamper<span style="color: #009900;">&#40;</span>pdfTemplate, out<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>We have to tell the PdfStamper to flatten the form, because there should be no formular fields in the created PDF.</p>

<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;">stamper.<span style="color: #006633;">setFormFlattening</span><span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">true</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>To finish the work we can just fill the fields&#8230;</p>

<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;">stamper.<span style="color: #006633;">getAcroFields</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #006633;">setField</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;name&quot;</span>, <span style="color: #0000ff;">&quot;Daniel Reuter&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
stamper.<span style="color: #006633;">getAcroFields</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #006633;">setField</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;adress&quot;</span>, <span style="color: #0000ff;">&quot;Merscheider Str.1 – 42699 Solingen&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
stamper.<span style="color: #006633;">getAcroFields</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #006633;">setField</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;dates&quot;</span>, <span style="color: #0000ff;">&quot;2008<span style="color: #000099; font-weight: bold;">\n</span>2009<span style="color: #000099; font-weight: bold;">\n</span>2010<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
stamper.<span style="color: #006633;">getAcroFields</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #006633;">setField</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;titles&quot;</span>, <span style="color: #0000ff;">&quot;JAX<span style="color: #000099; font-weight: bold;">\n</span>Devoxx<span style="color: #000099; font-weight: bold;">\n</span>JavaOne<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>&#8230;and close all the opened resources.</p>

<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;">stamper.<span style="color: #006633;">close</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
pdfTemplate.<span style="color: #006633;">close</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<h4>Conclusion</h4>
<p>From my point of view, this is a very simple and easily understandable approach to create PDFs using iText. Certainly there will be scenarios in which the described way won&#8217;t work, for example if you have to implement dynamic layouts. However, I would always try to use a PDF template as a basis.<br />
<div class="wp-caption aligncenter" style="width: 210px"><br />
<a href='http://blog.codecentric.de/wp-content/uploads/2010/07/pdfResult.pdf'><img src="http://blog.codecentric.de/wp-content/uploads/2010/07/pdf-icon.png" alt="" width="50" height="50" class="alignnone size-full wp-image-4749" /></a><br />
<p class="wp-caption-text">PDF Result</p></div>
<div class="dzone_button" style="float: right; margin: 10px 0;">
<iframe src="http://widgets.dzone.com/links/widgets/zoneit.html?t=2&url=http%3A%2F%2Fblog.codecentric.de%2Fen%2F2010%2F08%2Fpdf-generation-with-itext%2F&title=PDF+Generation+with+iText" height="25" width="155" scrolling="no" frameborder="0"></iframe>
</div><img src="http://feeds.feedburner.com/~r/codecentric_en/~4/bvPx-odMX3U" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blog.codecentric.de/en/2010/08/pdf-generation-with-itext/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		<feedburner:origLink>http://blog.codecentric.de/en/2010/08/pdf-generation-with-itext/</feedburner:origLink></item>
		<item>
		<title>Agile Enterprise – consequences for IT</title>
		<link>http://feedproxy.google.com/~r/codecentric_en/~3/J-F0mha-CQA/</link>
		<comments>http://blog.codecentric.de/en/2010/08/agile-enterprise-consequences-for-it/#comments</comments>
		<pubDate>Sat, 07 Aug 2010 18:38:35 +0000</pubDate>
		<dc:creator>Mirko Novakovic</dc:creator>
				<category><![CDATA[Agile]]></category>
		<category><![CDATA[Agile Enterprise]]></category>
		<category><![CDATA[Agile Software Development]]></category>
		<category><![CDATA[Agile Software Factory]]></category>
		<category><![CDATA[Agilität]]></category>
		<category><![CDATA[SCRUM]]></category>
		<category><![CDATA[XP]]></category>

		<guid isPermaLink="false">http://blog.codecentric.de/?p=4902</guid>
		<description><![CDATA[Recently I&#8217;ve read an article in German Computer Woche which was titled &#8216;Are ERP systems too slow for business?&#8217;. It is about complex ERP systems that are not able to adopt to the fast changing business needs. There was one &#8230; <a href="http://blog.codecentric.de/en/2010/08/agile-enterprise-consequences-for-it/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Recently I&#8217;ve read an article in German <a href="http://www.computerwoche.de/" target="_self">Computer Woche</a> which was titled &#8216;Are ERP systems too slow for business?&#8217;. It is about complex ERP systems that are not able to adopt to the fast changing business needs. There was one interesting word by an Ernst &amp; Young partner I had never heard before:  <strong>Agile Enterprise</strong>.</p>
<p>As we do agile software development for our customers I was curious what agile enterprise means. So I asked Google and read some articles about it. A good definition can be found at the <a href="http://www.businessdictionary.com/definition/agile-enterprise.html" target="_blank">Business Dictionary</a>:</p>
<p><span id="more-4902"></span></p>
<blockquote><p>Fast moving, <strong>flexible</strong> and robust firm capable of rapid response to <strong>unexpected challenges</strong>, events, and opportunities. Built on policies and processes that facilitate <strong>speed and change</strong>, it aims to achieve <strong>continuous competitive advantage</strong> in serving its customers. Agile enterprises use diffused authority and <strong>flat organizational structure</strong> to speed up information flows among different departments, and develop close, <strong>trust-based relationships</strong> with their customers and suppliers.</p></blockquote>
<p>Basicly &#8220;Agile Enterprise&#8221; means that enterprises are forced to change quicker and be more flexible as globalization has changed the way our markets work. Most of the articles I&#8217;ve found suggested to use self-organized teams and high interaction between people in an organization. But what does this mean for IT?</p>
<p>Let&#8217;s get back to the article. The article is about big ERP systems and about the problems most of the customers have with these systems if raising flexibility and speed of the business hits the IT. The reasons for these problems can be found in the high complexity of these systems, low productivity in development as a result of excessive customizing of the &#8220;standard&#8221; system. The statement of the article is: &#8220;<strong>ERP slows business down!</strong>&#8221;</p>
<p>Most of the arguements in the article are understandable for me and we see them every day in our projects. But not only with ERP systems, but with any kind of big standard software &#8220;monsters&#8221; &#8211; e.g. big insurance core systems. I have always asked myself why people first spend millions for licences and then realize that the &#8220;standard&#8221; doesn&#8217;t fit to their needs and processes. In many cases this leads to big customizing projects that run for some years and change the &#8220;standard&#8221; so much that you cannot upgrade to newer releases anymore. So every upgrade will be another midsize project. But I still forgot to tell you the best of the story: You pay 20% per year for support of the standard software &#8211; which means that you pay the intial millions again -  every 5 years!</p>
<p>Unfortunately the article doesn&#8217;t give good advices how to solve these issues. The strategy of the big ERP vendors is criticized &#8211; especially that the promices of SOA were not fullfilled.</p>
<p>A possible solution is seen in the cloud or in Software as a Service. This realy irritated me. So if I don&#8217;t operate the standard &#8220;monster&#8221; myself and put it in the cloud all my business problems are solved and the IT is flexible and fast enough to keep the new pace!? The statements of the many experts of big consultancy companies really scared me&#8230;</p>
<p>Last week I&#8217;ve thought a lot about the  &#8220;<a href="http://holykaw.alltop.com/the-real-reason-apple-is-so-innovative" target="_blank">Why</a>&#8221; for our &#8220;Agile Software Factory&#8221; and this article and the statements of the experts really helped me to find it.</p>
<p>For me the solution is obvious:</p>
<p>If &#8220;Agile Enterprise&#8221; means that the business has to be innovative  (<a href="http://de.wikipedia.org/wiki/Zeitorientierte_Wettbewerbsstrategien" target="_blank">First Mover</a>) and fast adopting (Fast Follower), than the solution cannot be a standard software. Because &#8220;standard&#8221; definitly is the opposite of innovation and the monolithic character of the software often means complexity and not flexibility.</p>
<p>In my point of view we should implement the business processes with individual software. The used components can be standard and I don&#8217;t want to tell you to write a booking system from scratch. There are many laws etc. that regulate a booking system so that there is no room for real innovation. But the processes around the booking system can be very specific to the business of a company and putting the processes into the internet and offer customers and partners direct access to it could be a competetive advantage. Also a tight integration in other systems can offer more productivity. Wouldn&#8217;t it be great to offer one clean and easy to use interface for all applications and processes to the business users?</p>
<p>If software development should be faster and more flexible and the requirments are not fully known at the beginning of a project as we have to deal with a quickly changing business, you have to use a methodology that minimizes the risk of individual software development. Agile software development offers you the needed methodology. We will not be able to deliver business value quickly with waterfall approaches and projects that run for months or years.</p>
<p>And this is exactly why we offer the Agile Software Factory: A proven approach based on Scrum and XP to develop individual software. With years of experience and lots of best practices we can develop software fast and with high quality. We call it a &#8220;factory&#8221; because we use standardized components and frameworks for our development and do not reinvent the wheel for every new customer.</p>
<p>We use Open Source components as they offer open standards and open sources. This helps us to build software that is very extendable and easy to integrate in the systems of our customers. In addition to that we are not encountered by the politics of the big vendors. <a href="http://www.alfresco.com/" target="_blank">Alfresco</a> for ECM, <a href="http://www.pentaho.com/" target="_blank">Pentaho</a> for Business Intelligence, <a href="http://www.liferay.com/">Liferay</a> for portal, <a href="http://www.opencms.org" target="_blank">OpenCms</a> for CMS  or <a href="http://www.compiere.com/" target="_blank">Compiere</a> for ERP and CRM are only examples of stable mainstream Open Source components. The individual processes and applications we develop for our customers are based on a lightweight architecture and well known Open Source frameworks like <a href="http://www.springsource.org/" target="_blank">Spring</a>, <a href="http://www.hibernate.org" target="_blank">Hibernate</a>, <a href="http://www.jboss.org/drools" target="_blank">Drools</a>, <a href="http://www.jboss.org/jbpm" target="_blank">jBpm</a> or <a href="http://www.mulesoft.org/" target="_blank">Mule</a>.</p>
<p>Our agile process gives us the flexibility to deliver running software to the business very 2-4 weeks! So they have new needed functionality very fast and in high quality. This quality is enforced by automated unit-, regression- and system tests, continuous integration, pair programming and automated code- and design reviews.</p>
<p>If this isn&#8217;t what &#8220;Agile Enterprises&#8221; need &#8211; we will move to the cloud <img src='http://blog.codecentric.de/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<div class="dzone_button" style="float: right; margin: 10px 0;">
<iframe src="http://widgets.dzone.com/links/widgets/zoneit.html?t=2&url=http%3A%2F%2Fblog.codecentric.de%2Fen%2F2010%2F08%2Fagile-enterprise-consequences-for-it%2F&title=Agile+Enterprise+%26%238211%3B+consequences+for+IT" height="25" width="155" scrolling="no" frameborder="0"></iframe>
</div><img src="http://feeds.feedburner.com/~r/codecentric_en/~4/J-F0mha-CQA" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blog.codecentric.de/en/2010/08/agile-enterprise-consequences-for-it/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://blog.codecentric.de/en/2010/08/agile-enterprise-consequences-for-it/</feedburner:origLink></item>
		<item>
		<title>A Different Take on Sprint Retrospectives</title>
		<link>http://feedproxy.google.com/~r/codecentric_en/~3/8yNMf5ZZ-Pk/</link>
		<comments>http://blog.codecentric.de/en/2010/08/a-different-take-on-sprint-retrospectives/#comments</comments>
		<pubDate>Thu, 05 Aug 2010 10:00:11 +0000</pubDate>
		<dc:creator>Fabian Lange</dc:creator>
				<category><![CDATA[Agile]]></category>
		<category><![CDATA[Scrum @en]]></category>
		<category><![CDATA[Retrospectives]]></category>
		<category><![CDATA[SCRUM]]></category>

		<guid isPermaLink="false">http://blog.codecentric.de/?p=4854</guid>
		<description><![CDATA[There are many ways to do a good sprint retrospective, so we decided to try a new one every now and then. This time we took the role of a painter, painting out impression of the last sprint into a &#8230; <a href="http://blog.codecentric.de/en/2010/08/a-different-take-on-sprint-retrospectives/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>There are many ways to do a good sprint retrospective, so we decided to try a new one every now and then.<br />
This time we took the role of a painter, painting out impression of the last sprint into a formidable piece of art.<br />
It might look strange at the beginning, but it quite nicely captures the impressions and feelings about the last iteration and provokes different thoughts than a simple list of items which could be improved. Lets see if we will use this method some time again.<br />
As an example I am going to present you my painting. The ones from my team mates are interesting as well, but I would not dare to show them without permission <img src='http://blog.codecentric.de/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /><br />
<span id="more-4854"></span><br />
<img class="aligncenter size-full wp-image-4852" title="a_different_reflection" src="http://blog.codecentric.de/wp-content/uploads/2010/08/a_different_reflection.png" alt="" width="565" height="419" /></p>
<p>You can see the long way to our goal. But we are close to it. You can see that I would like to get a reward for the fantastic sprints we did, so I painted a little cake right after the finish line.<br />
Below the path leading to the finish, I depicted our architecture and the actual goal of the project. I really like how well the architecture evolves and works our for us, and also like that our customers start to realize that their confusion was not necessary and they can realize their ideas wit it.<br />
At the top left, there is a bad test stability. It really can be improved and we actually started already addressing this. Right below that you can see our burndown for that iteration, which is not bad, but should have run below the line instead above it.<br />
It seems that I was as well pretty pleased with the amount of features we did create and the value (meaning money) it can generate for our customers. last but not least I draw the great sprint demo we did for our customers the day before.</p>
<p>So how do you like my picture (or doing this kind of retrospective at all)?</p>
<div class="dzone_button" style="float: right; margin: 10px 0;">
<iframe src="http://widgets.dzone.com/links/widgets/zoneit.html?t=2&url=http%3A%2F%2Fblog.codecentric.de%2Fen%2F2010%2F08%2Fa-different-take-on-sprint-retrospectives%2F&title=A+Different+Take+on+Sprint+Retrospectives" height="25" width="155" scrolling="no" frameborder="0"></iframe>
</div><img src="http://feeds.feedburner.com/~r/codecentric_en/~4/8yNMf5ZZ-Pk" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blog.codecentric.de/en/2010/08/a-different-take-on-sprint-retrospectives/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		<feedburner:origLink>http://blog.codecentric.de/en/2010/08/a-different-take-on-sprint-retrospectives/</feedburner:origLink></item>
		<item>
		<title>Invoking System.gc() can have serious impact</title>
		<link>http://feedproxy.google.com/~r/codecentric_en/~3/JCY6C-QnHyw/</link>
		<comments>http://blog.codecentric.de/en/2010/08/invoking-system-gc-can-have-serious-impact/#comments</comments>
		<pubDate>Mon, 02 Aug 2010 14:07:09 +0000</pubDate>
		<dc:creator>Fabian Lange</dc:creator>
				<category><![CDATA[Performance @en]]></category>
		<category><![CDATA[Garbage Collection]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[memory]]></category>

		<guid isPermaLink="false">http://blog.codecentric.de/?p=4822</guid>
		<description><![CDATA[Not taking JavaDoc seriously can easily happen to any developer. Or maybe you haven&#8217;t read that specific part of it, you should better have read. If you did and cannot see a problem locally, you might be tempted to ignore &#8230; <a href="http://blog.codecentric.de/en/2010/08/invoking-system-gc-can-have-serious-impact/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Not taking JavaDoc seriously can easily happen to any developer. Or maybe you haven&#8217;t read that specific part of it, you should better have read. If you did and cannot see a problem locally, you might be tempted to ignore it. </p>
<p>Here is an often ignored part from <em> java.text.SimpleDateFormat</em> JavaDoc:</p>

<div class="wp_syntax"><div class="code"><pre class="plain" style="font-family:monospace;"> * Date formats are not synchronized.
 * It is recommended to create separate format instances for each thread.
 * If multiple threads access a format concurrently, it must be synchronized
 * externally.</pre></div></div>

<p>Perhaps that warning isn&#8217;t strong enough, because it reads: &#8220;It is recommended&#8221;.<br />
This leads to this highly dangerous line of code I have seen in almost every project and is likely to produce hangs in concurrently accessed code.</p>

<div class="wp_syntax"><div class="code"><pre class="java5" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">private</span> <span style="color: #000000; font-weight: bold;">static</span> <span style="color: #000000; font-weight: bold;">final</span> SimpleDataFormat DATE_FORMAT = <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #003399; font-weight: bold;">SimpleDateFormat</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;yyyy.MM.dd&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>But it gets worse with <em>System.gc()</em>. <span id="more-4822"></span><br />
There is no warning in the JavaDoc:</p>

<div class="wp_syntax"><div class="code"><pre class="plain" style="font-family:monospace;">* Calling the gc method suggests that the Java Virtual
* Machine expend effort toward recycling unused objects in order to
* make the memory they currently occupy available for quick reuse.
* When control returns from the method call, the Java Virtual
* Machine has made a best effort to reclaim space from all discarded
* objects.</pre></div></div>

<p>Doesn&#8217;t sound too bad, does it? You should wonder what &#8220;suggests&#8221; and &#8220;best effert&#8221; really means. Perhaps you are tempted to use System.gc(), so you might look on the internet for other people using this, hoping for an explanation what in reality happens. You might find <a href="http://stackoverflow.com/questions/2414105/why-is-it-a-bad-practice-to-call-system-gc">good insights on Stackoverflow</a>. But what exactly this does nobody seems to know.</p>
<p>I think a picture tells more than thousand words:<br />
<img class="aligncenter size-full wp-image-4796" title="avoid_system_gc" src="http://blog.codecentric.de/wp-content/uploads/2010/07/avoid_system_gc.png" alt="" width="594" height="363" /></p>
<p>We are looking at a pretty big system of one of our customers. It has 14GB of heap and we helped them to bring down the memory consumtion so that the app ran quite well. However there were still pretty long pause times (so called stop the world time). The graph was created from a Garbage Collection log and points us to the cause of the pause times. The blue line shows Garbage Collection activity. So why are there exactly 13 spikes with up to 35 seconds? All the other activity seems to be really fast.<br />
The reason for those 13 spikes is simple: They all were caused by an invocation of <em>System.gc()</em>.</p>
<p>So what happens? Calling <em>System.gc()</em> seems to effectively stop any optimization the GC is doing, forcing a full collection to start, rather than the optimized CMS Algorithm used.</p>
<blockquote><p>Note: This system is using a Sun 1.6.0.18 64 bit HotSpot Server VM. GC is set to -XX:+UseConcMarkSweepGC and -XX:+UseParNewGC. System.gc() does not have to produce results like that. Your results might vary. However also <a href="http://stackoverflow.com/questions/2414105/why-is-it-a-bad-practice-to-call-system-gc/2415234#2415234">others have reported</a>, that when using CMS and System.gc() a Full GC is always performed.</p></blockquote>
<p>If you cannot find yourself invoking <em>System.gc()</em>, they might hide deeply in a used library. To fix this, you can use the the server argument &#8220;-XX:+DisableExplicitGC&#8221;. This argument is also recommended by the <a href="http://docs.sun.com/source/819-0084/pt_tuningjava.html#wp57022">SUN/Oracle performance tuning guide</a>.</p>
<div class="dzone_button" style="float: right; margin: 10px 0;">
<iframe src="http://widgets.dzone.com/links/widgets/zoneit.html?t=2&url=http%3A%2F%2Fblog.codecentric.de%2Fen%2F2010%2F08%2Finvoking-system-gc-can-have-serious-impact%2F&title=Invoking+System.gc%28%29+can+have+serious+impact" height="25" width="155" scrolling="no" frameborder="0"></iframe>
</div><img src="http://feeds.feedburner.com/~r/codecentric_en/~4/JCY6C-QnHyw" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blog.codecentric.de/en/2010/08/invoking-system-gc-can-have-serious-impact/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		<feedburner:origLink>http://blog.codecentric.de/en/2010/08/invoking-system-gc-can-have-serious-impact/</feedburner:origLink></item>
	</channel>
</rss>
