<?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>Butler Press &#187; Java</title>
	<atom:link href="http://butlerpress.com/category/programming/java/feed/" rel="self" type="application/rss+xml" />
	<link>http://butlerpress.com</link>
	<description>Scott Willson&#039;s website. Professional software development and some non-professional bits, too.</description>
	<lastBuildDate>Tue, 15 Dec 2009 19:52:46 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Obscure Oracle JDBC Exception du Jour</title>
		<link>http://butlerpress.com/2007/12/06/obscure-oracle-jdbc-exception-du-jour/</link>
		<comments>http://butlerpress.com/2007/12/06/obscure-oracle-jdbc-exception-du-jour/#comments</comments>
		<pubDate>Thu, 06 Dec 2007 20:13:32 +0000</pubDate>
		<dc:creator>scott</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[free_c_state]]></category>
		<category><![CDATA[jdbc]]></category>
		<category><![CDATA[oci]]></category>
		<category><![CDATA[oracle]]></category>
		<category><![CDATA[UnsatisfiedLinkError]]></category>

		<guid isPermaLink="false">http://butlerpress.com/2007/12/06/obscure-oracle-jdbc-exception-du-jour/</guid>
		<description><![CDATA[I ran across this exception again today, and Google didn&#8217;t anything useful until I dug in a bit. Hopefully, this will help someone else searching for UnsatisfiedLinkError and free_c_state exceptions.
Your JDBC URL syntax is wrong.
You need something like jdbc:oracle:oci:@RPTD
java.lang.UnsatisfiedLinkError: free_c_statejava.lang.UnsatisfiedLinkError: free_c_state
at oracle.jdbc.oci8.OCIDBAccess.logoff(OCIDBAccess.java:616)
at oracle.jdbc.driver.OracleConnection.(OracleConnection.java:409)
at oracle.jdbc.driver.OracleDriver.getConnectionInstance(OracleDriver.java:468)
at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:314)
...
]]></description>
			<content:encoded><![CDATA[<p>I ran across this exception again today, and Google didn&#8217;t anything useful until I dug in a bit. Hopefully, this will help someone else searching for UnsatisfiedLinkError and free_c_state exceptions.</p>
<p>Your JDBC URL syntax is wrong.</p>
<p>You need something like jdbc:oracle:oci:@RPTD</p>
<p><code>java.lang.UnsatisfiedLinkError: free_c_statejava.lang.UnsatisfiedLinkError: free_c_state<br />
at oracle.jdbc.oci8.OCIDBAccess.logoff(OCIDBAccess.java:616)<br />
at oracle.jdbc.driver.OracleConnection.(OracleConnection.java:409)<br />
at oracle.jdbc.driver.OracleDriver.getConnectionInstance(OracleDriver.java:468)<br />
at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:314)<br />
...</code></p>
]]></content:encoded>
			<wfw:commentRss>http://butlerpress.com/2007/12/06/obscure-oracle-jdbc-exception-du-jour/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Refactoring to Seam by Brian Leonard</title>
		<link>http://butlerpress.com/2007/07/27/refactoring-to-seam-by-brian-leonard/</link>
		<comments>http://butlerpress.com/2007/07/27/refactoring-to-seam-by-brian-leonard/#comments</comments>
		<pubDate>Fri, 27 Jul 2007 16:46:56 +0000</pubDate>
		<dc:creator>scott</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[OSCON]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://butlerpress.com/2007/07/27/refactoring-to-seam-by-brian-leonard/</guid>
		<description><![CDATA[The Poll:

JBoss useer: 50%
Glassfish: 0%
Websphere: didn&#8217;t ask!

The thrust of the talk: take a typical Java EE 5 application (JavaServer Faces -> managed session bean -> entity class -> database) and refactor it to Seam. This is interesting, but we don&#8217;t even have any Java EE 5 web apps to refactor, so both the Java EE [...]]]></description>
			<content:encoded><![CDATA[<p>The Poll:</p>
<ul>
<li><a href="http://www.jboss.com/" target="_top">JBoss</a> useer: 50%</li>
<li><a href="https://glassfish.dev.java.net/" target="_top">Glassfish</a>: 0%</li>
<li>Websphere: didn&#8217;t ask!</li>
</ul>
<p>The thrust of the talk: take a typical Java EE 5 application (<a href="http://java.sun.com/javaee/javaserverfaces/" target="_top">JavaServer Faces</a> -> managed session bean -> entity class -> database) and refactor it to Seam. This is interesting, but we don&#8217;t even have any Java EE 5 web apps to refactor, so both the Java EE and the Seam stuff are new to me.</p>
<p>Java EE: lots of config and the syntax looks nasty after Ruby, though a big improvement over J2EE of years past, for sure.</p>
<p>EJB 3 and EE5</p>
<ul>
<li>Dramatic simplification of all bean types</li>
<li>POJOs + annotations</li>
<li>Dependency injection</li>
</ul>
<p>You know, I looked around at the audience at this point, and noticed that the room full of big, dumb-looking people. Not a good sign. </p>
<p>OK, here&#8217;s what I learned.</p>
<p>JBoss Seam is an application framework for JSF and EJB; it brings them together. Must be good: it has AJAX! Also has improved state management. The presenter showed this at the end and, yeah, this is good.</p>
<p>Seam eliminates the managed bean, reduces the XML and provides &#8220;bijection&#8221; for stateful components: dynamic, contextual, bidirectional. What? Yeah, I couldn&#8217;t figure it out either.</p>
<p>We get a live demo where the presenter troubleshoots various problems. Never a good idea to expect that you&#8217;ll work through issues live in presentation. Buzz kill for the audience.</p>
<p>Ahhh,  a choice J2EE moment. The framework needs a blank property file, but if it&#8217;s not there, you get a cryptic error message that doesn&#8217;t mention property files.</p>
<p>We see pattern-matching to look up EJBs. Can&#8217;t recall now if that&#8217;s Java EE or Seam. </p>
<p>Seam replaces XML with annotations. Good. The more annotations the better I think. Looks like you can inject dependencies via annotations:<br />
@In private User user;</p>
]]></content:encoded>
			<wfw:commentRss>http://butlerpress.com/2007/07/27/refactoring-to-seam-by-brian-leonard/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Pimp My Build by Josh Cronemeyer, Andy Slocum</title>
		<link>http://butlerpress.com/2007/07/27/pimp-my-build-by-josh%c2%a0cronemeyer-andy%c2%a0slocum/</link>
		<comments>http://butlerpress.com/2007/07/27/pimp-my-build-by-josh%c2%a0cronemeyer-andy%c2%a0slocum/#comments</comments>
		<pubDate>Fri, 27 Jul 2007 16:24:22 +0000</pubDate>
		<dc:creator>scott</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[OSCON]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Ruby]]></category>

		<guid isPermaLink="false">http://butlerpress.com/2007/07/27/pimp-my-build-by-josh%c2%a0cronemeyer-andy%c2%a0slocum/</guid>
		<description><![CDATA[This was a talk from a couple of guys from ThoughtWorks about CruiseControl, one of the first CI (Continuous Integration) tools. Martin Fowler works at ThoughtWorks! We are not worthy.
Audience Pool
90% use CI
I&#8217;m the only one who doesn&#8217;t use CruiseControl, and the presenter wants to know what I do use. &#8220;Ruby&#8221; seems to be a [...]]]></description>
			<content:encoded><![CDATA[<p>This was a talk from a couple of guys from <a href="http://www.thoughtworks.com/" target="_top">ThoughtWorks</a> about <a href="http://cruisecontrol.sourceforge.net/" target="_top">CruiseControl</a>, one of the first CI (<a href="http://en.wikipedia.org/wiki/Continuous_Integration" target="_top">Continuous Integration</a>) tools. <a href="http://martinfowler.com/" target="_top">Martin Fowler</a> works at ThoughtWorks! We are not worthy.</p>
<h3>Audience Pool</h3>
<p>90% use CI<br />
I&#8217;m the only one who doesn&#8217;t use CruiseControl, and the presenter wants to know what I <strong>do</strong> use. &#8220;Ruby&#8221; seems to be a worthy answer. Wheh.</p>
<p>There are several implementations of CruiseControl &#8212; Java, .Net, Ruby &#8212; and it can be customized plugins. This talk is actually about customizing CruiseControl.</p>
<p>The presenters use their own ThoughtWorks project as an example. It&#8217;s a big, old Java project with 8,000 class files. So, in the ballpark of the entire Con-way application, er, application<strong>s</strong>. It takes over thirty minutes to build and test. They have about 6,000 tests, and are slightly embarrassed by how <i>light</i> their test coverage is.</p>
<p>The central problems with their CI is the volume of information and correlating it together. They solved these problems with the practical application of brute force by using <a href="http://lucene.apache.org/" target="_top">Lucene</a> to index the CruiseControl build logs (this includes source control commit comments and bug tracking numbers). It has a simple web front-end, so there&#8217;s one place to figure out which bug is fixed in which build. It was initially for developers, but business analysts like it, too.</p>
<p>We had a nice chat about build lights (build broke, light goes red). Apparently, x10.com is the place to go to buy one. You may remember them from endless, annoying banner ads. Other sources:</p>
<ul>
<li>NaBazTag</li>
<li>Ambient Orb</li>
<li>Lava</li>
</ul>
<p>I liked the presentation&#8217;s funky diagrams. Think Scooby Doo&#8217;s Mystery Machine van.</p>
<p>Suggestion: build a CI build dashboard on an old PC and monitor in your bullpen. Hey, the ARAOT is ahead of the curve!</p>
]]></content:encoded>
			<wfw:commentRss>http://butlerpress.com/2007/07/27/pimp-my-build-by-josh%c2%a0cronemeyer-andy%c2%a0slocum/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The Coming XQuery + XForms XPlosion by Kurt Cagle</title>
		<link>http://butlerpress.com/2007/07/25/the-coming-xquery-xforms-xplosion-by-kurt%c2%a0cagle/</link>
		<comments>http://butlerpress.com/2007/07/25/the-coming-xquery-xforms-xplosion-by-kurt%c2%a0cagle/#comments</comments>
		<pubDate>Wed, 25 Jul 2007 22:26:40 +0000</pubDate>
		<dc:creator>scott</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[OSCON]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://butlerpress.com/2007/07/25/the-coming-xquery-xforms-xplosion-by-kurt%c2%a0cagle/</guid>
		<description><![CDATA[Now before I pan this talk, let me say that Kurt strikes me as one of those guys whose hard work with open source and standards bodies makes things go. OK?
Things started out just fine, with some rambling and ranting about how the open source software developer crowd is faddish. &#8220;XML is staid? I&#8217;m a [...]]]></description>
			<content:encoded><![CDATA[<p>Now before I pan this talk, let me say that Kurt strikes me as one of those guys whose hard work with open source and standards bodies makes things go. OK?</p>
<p>Things started out just fine, with some rambling and ranting about how the open source software developer crowd is faddish. &#8220;XML is staid? I&#8217;m a graybeard because I work in XML? What?&#8221; Funny. True!</p>
<p>News flash: everything is more complicated now, mainly because we aren&#8217;t just running on a disconnected box under the desk.</p>
<p>Halfway through the talk, though, the presenter is still ranting! Wait, the point? Maybe we need to simplify the models we use to combat complexity.</p>
<ul>
<li>Web enforces simplicity</li>
<li>Traditional mid-tier apps break down on the web because they assume synchronous interactions</li>
<li>Simplest arch pattern is an old one &#8212; <a href="http://en.wikipedia.org/wiki/Model-view-controller">MVC</a></li>
</ul>
<p>Ten minutes later, a question from the audience: are we going to talk about XQuery? Oh, yeah, OK.</p>
<p>There are many emerging  XML standards:</p>
<ul>
<li>XHTML + XForms</li>
<li>XSLT</li>
<li>XQuery</li>
<li>Schematron</li>
<li>XBL</li>
</ul>
<p>XForms started as replacement for HTML forms, but became more. They create an XML model that uses XPath to &#8220;bind&#8221; control to various parts of model. XForm is sort of like a VB form. Did you just cringe? I did.</p>
<p>XForm implementations to watch</p>
<ul>
<li>Mozilla (presenter&#8217;s favorite)</li>
<li>Orbeon</li>
<li>Chiba</li>
<li>Formsplayer</li>
<li>PicoForm</li>
<li>OpenOffice</li>
</ul>
<p>Maybe XForms will be the Next Big Thing, but I&#8217;m not holding my breath.</p>
]]></content:encoded>
			<wfw:commentRss>http://butlerpress.com/2007/07/25/the-coming-xquery-xforms-xplosion-by-kurt%c2%a0cagle/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Performance Whack-a-Mole by Josh Berkus</title>
		<link>http://butlerpress.com/2007/07/25/performance-whack-a-mole-by-josh-berkus/</link>
		<comments>http://butlerpress.com/2007/07/25/performance-whack-a-mole-by-josh-berkus/#comments</comments>
		<pubDate>Wed, 25 Jul 2007 22:14:45 +0000</pubDate>
		<dc:creator>scott</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[OSCON]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://butlerpress.com/2007/07/25/performance-whack-a-mole-by-josh-berkus/</guid>
		<description><![CDATA[This turned out to be a good talk, chock-full of concrete practical advice.
Here&#8217;s our audience poll:
95% use DB apps
15% are consultants (like the presenter)
Clients just say: &#8220;the database is slow,&#8221; but anything in the big application stack (application, middleware, database, operating system, hardware_ can make things slow. Every layer in the stack needs do its [...]]]></description>
			<content:encoded><![CDATA[<p>This turned out to be a good talk, chock-full of concrete practical advice.</p>
<p>Here&#8217;s our audience poll:<br />
95% use DB apps<br />
15% are consultants (like the presenter)</p>
<p>Clients just say: &#8220;the database is slow,&#8221; but anything in the big application stack (application, middleware, database, operating system, hardware_ can make things slow. Every layer in the stack needs do its job to scale the application. Otherwise, we are leaving significant performance gains on the table. In fact, &#8220;database&#8221; problems are usually somewhere else &#8212; like in the middleware.</p>
<p>You have many performance problems in your application, but most aren&#8217;t significant. Performance is usually degraded by a few problems &#8212; 10% of problems cause 90% of slowdown. (And big problems mask smaller problems.)</p>
<p>Apps tune differently. The presenter uses three rough categories: web, online transaction processing, data warehouse.<br />
Web</p>
<ul>
<li>Entire database can fit in RAM</li>
<li>90% or more of database queries are simple reads</li>
<li>CPU-bound</li>
<li>Performance moles: caching, pooling, connection time</li>
</ul>
<p>OLTP</p>
<ul>
<li>Database slightly larger than RAM to 1TB</li>
<li>Many small data write queries</li>
<li>CPU or I/O bound</li>
<li>Moles: locks, cache, transactions, write speed, log</li>
</ul>
<p>Data Warehouse</p>
<ul>
<li>100GB to 100TB database</li>
<li>Large complex reporting queris</li>
<li>Large bulk loads of data</li>
<li>Also called &#8220;business intelligence&#8221;</li>
<li>Moles: Sequential scans, resources, bad queries</li>
</ul>
<p>Your first step should be to measure a baseline. Check basic setup (versions, configurations) for sanity. Then measure each layer.</p>
<p>Tools</p>
<ul>
<li>OS tools are simple, easy to use, and non-invasive</li>
<ul>
<li>ps, mpstat</li>
</ul>
<li>Benchmark. Invasive</li>
<ul>
<li>micorbenchmarkL bonnie++ for files system perf</li>
</ul>
<li>DB</li>
<ul>
<li>DBTrace</li>
</ul>
<ul>
<li>DB query log</li>
</ul>
<ul>
<li>Query analysis (troublehoot &#8220;bad&#8221; queries)</li>
</ul>
<ul>
<li>ogbench, Wisconsin, TPCB, OSDB, PolePosition</li>
</ul>
<li>Application</li>
<ul>
<li>app server tools</li>
</ul>
<ul>
<li>workload simulation and screen scraping</li>
</ul>
<li>
<li>lwp and log replay tools</li>
</ul>
<ul>
<li>bug detectors</li>
</ul>
<ul>
<li>valgrind, MDB, GDB, DTrace</li>
</ul>
</ul>
<p>OK, we&#8217;ve got the baseline, now what? What are the symptoms; when do they occur?</p>
<h3>The Performance Moles</h3>
<p>I/O</p>
<ul>
<li>Symptoms: one device saturating I/O &#8212; other resources are OK</li>
<li>heavy writes or very large DB</li>
<li>causes</li>
<ul>
<li>bad I/O hardware, software or configuration</li>
</ul>
<ul>
<li>not enough RAM</li>
</ul>
<ul>
<li>too much data requested</li>
</ul>
<ul>
<li>bad schema</li>
</ul>
</ul>
<p>CPU </p>
<ul>
<li>Symptoms: maxed-out CPU, but RAM available</li>
<li>mostly-read loads or complex calculations</li>
<li>causes</li>
<ul>
<li>too many queries</li>
</ul>
<ul>
<li>insufficient caching or pooling</li>
</ul>
<ul>
<li>too much data requested</li>
</ul>
<ul>
<li>bad queries or schema</li>
</ul>
<li>Note: most DB servers should be CPU-bound at max load</li>
</ul>
<p>Locking Mole</p>
<ul>
<li>Symptoms: Resource aren&#8217;t maxed-out</li>
<li>lots of pessimistic locking</li>
<li>causes</li>
<ul>
<li>long-running transaction or stored procedures</li>
</ul>
<ul>
<li>longly held open cursors</li>
</ul>
<ul>
<li>unneeded pessimistic locking</li>
</ul>
<ul>
<li>poor transaction management</li>
</ul>
</ul>
<p>App Mole</p>
<ul>
<li>Symptoms: DB server maxed, app server is OK</li>
<li>common in J2EE</li>
<li>causes</li>
<ul>
<li>not enough app servers</li>
</ul>
<ul>
<li>too much data/ too many queries</li>
</ul>
<ul>
<li>bad caching.pooling</li>
</ul>
<ul>
<li>driver issues</li>
</ul>
<ul>
<li>ORM frameworks</li>
</ul>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://butlerpress.com/2007/07/25/performance-whack-a-mole-by-josh-berkus/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Test Dictionary Open Sourced</title>
		<link>http://butlerpress.com/2007/05/26/test-dictionary-open-sourced/</link>
		<comments>http://butlerpress.com/2007/05/26/test-dictionary-open-sourced/#comments</comments>
		<pubDate>Sun, 27 May 2007 04:24:37 +0000</pubDate>
		<dc:creator>scott</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://butlerpress.com/2007/05/26/test-dictionary-open-sourced/</guid>
		<description><![CDATA[I finally rallied some focus and motivation, and released Test Dictionary on SourceForge. This is a very small Java lib jar that is handy for generating realistic test data:
String name = Dictionary.getRandomProperName();
	String word = Dictionary.getRandomWord();
	String word = Dictionary.getRandomWordTermCommonNameOrConnector();

]]></description>
			<content:encoded><![CDATA[<p>I finally rallied some focus and motivation, and released <a href="http://sourceforge.net/projects/test-dictionary/">Test Dictionary</a> on <a href="http://sourceforge.net">SourceForge</a>. This is a very small Java lib jar that is handy for generating realistic test data:<br />
<code>String name = Dictionary.getRandomProperName();<br />
	String word = Dictionary.getRandomWord();<br />
	String word = Dictionary.getRandomWordTermCommonNameOrConnector();<br />
</code></p>
]]></content:encoded>
			<wfw:commentRss>http://butlerpress.com/2007/05/26/test-dictionary-open-sourced/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

