<?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>Java Thinking</title>
	
	<link>http://www.javathinking.com</link>
	<description>Java and software development related thoughts</description>
	<lastBuildDate>Thu, 02 Feb 2012 12:16:46 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/JavaThinking" /><feedburner:info uri="javathinking" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><item>
		<title>Solved – Trouble with the Samsung Galaxy S 1 phone</title>
		<link>http://feedproxy.google.com/~r/JavaThinking/~3/y5f_wFsnT_4/</link>
		<comments>http://www.javathinking.com/2012/02/solved-trouble-with-the-samsung-galaxy-1/#comments</comments>
		<pubDate>Thu, 02 Feb 2012 12:11:42 +0000</pubDate>
		<dc:creator>paul</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[android]]></category>
		<category><![CDATA[galaxy]]></category>
		<category><![CDATA[phone]]></category>

		<guid isPermaLink="false">http://www.javathinking.com/?p=610</guid>
		<description><![CDATA[My wife has had a Samsung Galaxy S1 Android phone for over a year now and its been great. Recently though, she&#8217;d been having terrible battery performance and had noticed that after charging the phone overnight, it was only at 50% in the morning. My first thought was to buy a new battery, but then [...]]]></description>
			<content:encoded><![CDATA[<p></p><p>My wife has had a <a href="http://www.samsung.com/au/smartphone/galaxys/">Samsung Galaxy</a> S1 Android phone for over a year now and its been great. Recently though, she&#8217;d been having terrible battery performance and had noticed that after charging the phone overnight, it was only at 50% in the morning. My first thought was to buy a new battery, but then I figured I&#8217;d try updating the firmware first.</p>
<p>Thats when I discovered that windows couldn&#8217;t recognise the device!! This was a big issue &#8211; how could I get all of her photos off the phone?</p>
<p>Solutions:</p>
<ol>
<li>Quite by accident, she plugged her phone into an iCoustic USB charger that we got with an iPod accessory pack &#8211; this fully charged the battery and now there are no battery issues. She&#8217;d been using my iPad USB charger previously and for some reason, this makes a difference.</li>
<li>I realized that when syncing the phone with Kies I wasn&#8217;t using the original USB cable that came with the phone. We&#8217;d been using a third party cable we&#8217;d bought after losing the original one. Since we&#8217;d found the original cable I tried that and there were no problems &#8211; Windows found the drivers, installed them and recognised the phone. Kies worked fine after that.</li>
</ol>
<p>So, all is good now &#8211; the phone works fine, running Android 2.3 (Gingerbread).</p>

<p><a href="http://feedads.g.doubleclick.net/~a/bNYC88ZiTQ_gUqm3Nkw__VevMzU/0/da"><img src="http://feedads.g.doubleclick.net/~a/bNYC88ZiTQ_gUqm3Nkw__VevMzU/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/bNYC88ZiTQ_gUqm3Nkw__VevMzU/1/da"><img src="http://feedads.g.doubleclick.net/~a/bNYC88ZiTQ_gUqm3Nkw__VevMzU/1/di" border="0" ismap="true"></img></a></p><img src="http://feeds.feedburner.com/~r/JavaThinking/~4/y5f_wFsnT_4" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.javathinking.com/2012/02/solved-trouble-with-the-samsung-galaxy-1/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.javathinking.com/2012/02/solved-trouble-with-the-samsung-galaxy-1/</feedburner:origLink></item>
		<item>
		<title>Grooveshark for listening to music</title>
		<link>http://feedproxy.google.com/~r/JavaThinking/~3/-UbnnwfkVuY/</link>
		<comments>http://www.javathinking.com/2012/01/grooveshark-for-listening-to-music/#comments</comments>
		<pubDate>Mon, 16 Jan 2012 21:38:43 +0000</pubDate>
		<dc:creator>paul</dc:creator>
				<category><![CDATA[Media center]]></category>
		<category><![CDATA[grooveshark]]></category>
		<category><![CDATA[music]]></category>

		<guid isPermaLink="false">http://www.javathinking.com/?p=604</guid>
		<description><![CDATA[I&#8217;ve just started using Grooveshark.com for listening to music. Running in the browser, its a great cross platform solution &#8211; no installs necessary. I&#8217;m just running the browser on my MythTV media center, with the sound via the TV. The quality seems great, even though I&#8217;ve got it on the lower quality, and I&#8217;m hoping [...]]]></description>
			<content:encoded><![CDATA[<p></p><p>I&#8217;ve just started using <a href="http://grooveshark.com/">Grooveshark.com</a> for listening to music. Running in the browser, its a great cross platform solution &#8211; no installs necessary. I&#8217;m just running the browser on my MythTV media center, with the sound via the TV. The quality seems great, even though I&#8217;ve got it on the lower quality, and I&#8217;m hoping its just what I need to find some new and interesting music.</p>

<p><a href="http://feedads.g.doubleclick.net/~a/ErrskdAGqjyaXJvmJOjzTJxEHuA/0/da"><img src="http://feedads.g.doubleclick.net/~a/ErrskdAGqjyaXJvmJOjzTJxEHuA/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/ErrskdAGqjyaXJvmJOjzTJxEHuA/1/da"><img src="http://feedads.g.doubleclick.net/~a/ErrskdAGqjyaXJvmJOjzTJxEHuA/1/di" border="0" ismap="true"></img></a></p><img src="http://feeds.feedburner.com/~r/JavaThinking/~4/-UbnnwfkVuY" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.javathinking.com/2012/01/grooveshark-for-listening-to-music/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.javathinking.com/2012/01/grooveshark-for-listening-to-music/</feedburner:origLink></item>
		<item>
		<title>Fixing browser sound on Ubuntu 11.04</title>
		<link>http://feedproxy.google.com/~r/JavaThinking/~3/Boc8Yxpg4No/</link>
		<comments>http://www.javathinking.com/2012/01/fixing-browser-sound-on-ubuntu-11-04/#comments</comments>
		<pubDate>Mon, 16 Jan 2012 21:29:29 +0000</pubDate>
		<dc:creator>paul</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[sound]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://www.javathinking.com/?p=602</guid>
		<description><![CDATA[I&#8217;ve finally fixed sound via the browser on my Ubuntu 11.04 MythTV media center. MythTV was working fine, but the browsers never even tried to play sound (the sound settings would show NO applications using sound, when Chrome or Firefox should have been).
The information I needed was here and I had no /etc/asound.conf so I [...]]]></description>
			<content:encoded><![CDATA[<p></p><p>I&#8217;ve finally fixed sound via the browser on my Ubuntu 11.04 MythTV media center. MythTV was working fine, but the browsers never even tried to play sound (the sound settings would show NO applications using sound, when Chrome or Firefox should have been).</p>
<p>The information I needed was <a href="http://ubuntuforums.org/showpost.php?p=9438109&amp;postcount=7" target="_blank">here</a> and I had no /etc/asound.conf so I had to put the following in ~/.asoundrc -</p>
<blockquote>
<pre dir="ltr">pcm.pulse { type pulse }
ctl.pulse { type pulse }
pcm.!default { type pulse }
ctl.!default { type pulse }</pre>
</blockquote>

<p><a href="http://feedads.g.doubleclick.net/~a/mMGd9X9AA4sODgrZ8QUxuNif4cw/0/da"><img src="http://feedads.g.doubleclick.net/~a/mMGd9X9AA4sODgrZ8QUxuNif4cw/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/mMGd9X9AA4sODgrZ8QUxuNif4cw/1/da"><img src="http://feedads.g.doubleclick.net/~a/mMGd9X9AA4sODgrZ8QUxuNif4cw/1/di" border="0" ismap="true"></img></a></p><img src="http://feeds.feedburner.com/~r/JavaThinking/~4/Boc8Yxpg4No" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.javathinking.com/2012/01/fixing-browser-sound-on-ubuntu-11-04/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.javathinking.com/2012/01/fixing-browser-sound-on-ubuntu-11-04/</feedburner:origLink></item>
		<item>
		<title>Could not complete schema update</title>
		<link>http://feedproxy.google.com/~r/JavaThinking/~3/cPTrhEm5ASk/</link>
		<comments>http://www.javathinking.com/2011/11/could-not-complete-schema-update/#comments</comments>
		<pubDate>Thu, 03 Nov 2011 02:34:42 +0000</pubDate>
		<dc:creator>paul</dc:creator>
				<category><![CDATA[Database]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[hibernate]]></category>
		<category><![CDATA[jpa]]></category>
		<category><![CDATA[view]]></category>

		<guid isPermaLink="false">http://www.javathinking.com/?p=598</guid>
		<description><![CDATA[I recently mapped a JPA entity to a view, and encountered this error while using hibernate to update the database schema:
ORA-01702: a view is not appropriate here
[SchemaUpdate.execute] could not complete schema update
I was using the Oracle JDBC drivers 10.1.3.3 &#8211; luckily, the solution was to upgrade the drivers &#8211; when using 11.2.0.2.0 it works fine.
Download [...]]]></description>
			<content:encoded><![CDATA[<p></p><p>I recently mapped a JPA entity to a view, and encountered this error while using hibernate to update the database schema:</p>
<blockquote><p>ORA-01702: a view is not appropriate here</p>
<p>[SchemaUpdate.execute] could not complete schema update</p></blockquote>
<p>I was using the Oracle JDBC drivers 10.1.3.3 &#8211; luckily, the solution was to upgrade the drivers &#8211; when using 11.2.0.2.0 it works fine.</p>
<div id="_mcePaste">Download ojdbc6.jar from here:</div>
<blockquote>
<div><a href="http://www.oracle.com/technetwork/database/enterprise-edition/jdbc-112010-090769.html " target="_blank"> http://www.oracle.com/technetwork/database/enterprise-edition/jdbc-112010-090769.html </a></div>
</blockquote>
<blockquote>
<div id="_mcePaste">ojdbc6.jar (2,152,051 bytes) &#8211; Classes for use with JDK 1.6. It contains the JDBC driver classes except classes for NLS support in Oracle Object and Collection types.</div>
</blockquote>

<p><a href="http://feedads.g.doubleclick.net/~a/MLKYatLUQaiLN1KrtMDZzCeYkO8/0/da"><img src="http://feedads.g.doubleclick.net/~a/MLKYatLUQaiLN1KrtMDZzCeYkO8/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/MLKYatLUQaiLN1KrtMDZzCeYkO8/1/da"><img src="http://feedads.g.doubleclick.net/~a/MLKYatLUQaiLN1KrtMDZzCeYkO8/1/di" border="0" ismap="true"></img></a></p><img src="http://feeds.feedburner.com/~r/JavaThinking/~4/cPTrhEm5ASk" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.javathinking.com/2011/11/could-not-complete-schema-update/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.javathinking.com/2011/11/could-not-complete-schema-update/</feedburner:origLink></item>
		<item>
		<title>On to some exciting stuff</title>
		<link>http://feedproxy.google.com/~r/JavaThinking/~3/LwY02qcLIDA/</link>
		<comments>http://www.javathinking.com/2011/10/on-to-some-exciting-stuff/#comments</comments>
		<pubDate>Sun, 16 Oct 2011 11:17:05 +0000</pubDate>
		<dc:creator>paul</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Software Development]]></category>
		<category><![CDATA[ddd]]></category>
		<category><![CDATA[junit]]></category>
		<category><![CDATA[wakaleo]]></category>

		<guid isPermaLink="false">http://www.javathinking.com/?p=592</guid>
		<description><![CDATA[I went to a Agile Sydney meetup recently &#8211; &#8220;Automated web tests as a team communication tool&#8221; &#8211; by John Smart of Wakaleo Consulting. It was great stuff, and the presentation is now online.
There is a  nice story here in that the project feature set is documented via
easily readable and executable tests, and the [...]]]></description>
			<content:encoded><![CDATA[<p></p><p>I went to a <a href="http://www.meetup.com/Agile-Sydney/events/25570671/">Agile Sydney meetup</a> recently &#8211; &#8220;Automated web tests as a team communication tool&#8221; &#8211; by John Smart of <a href="http://www.wakaleo.com/">Wakaleo Consulting</a>. It was great stuff, and the presentation is now <a href="http://www.slideshare.net/wakaleo/completing-the-circle-automated-web-tests-as-a-team-communication-tool">online</a>.</p>
<p>There is a  nice story here in that the project feature set is documented via<br />
easily readable and executable tests, and the reporting shows which features are<br />
implemented and which aren&#8217;t.</p>
<p>More information on the the Thucydides tool he references can be found at:</p>
<ul>
<li><a href="https://github.com/thucydides-webtests/thucydides/wiki">https://github.com/thucydides-webtests/thucydides/wiki</a></li>
</ul>
<p>While reading that presentation online, I found more gold here in some of his other presentations:</p>
<ul>
<li><a href="http://www.slideshare.net/wakaleo/junit-kung-fu-getting-more-out-of-your-unit-tests">JUnit Kung Fu: Getting More Out of Your Unit Tests</a></li>
<li><a href="http://www.slideshare.net/wakaleo/introduction-toddd">Introduction to Domain Driven Design</a></li>
</ul>
<p>They are a great read and are great pointers in the right direction to improve your software development.</p>
<p>(If you haven&#8217;t seen them before, check out <a href="http://www.wakaleo.com/training">Wakaleo&#8217;s training courses</a>. I haven&#8217;t been on them, but based on the course content, they look to be the most relevant courses I&#8217;ve come across)</p>
<p>The last couple of projects I&#8217;ve been on I&#8217;ve been frustrated by a few things about the code base that I couldn&#8217;t quite put my finger on, and the DDD presentation hit a nerve.</p>
<p>I searched around for more about DDD and found some more excellent resources:</p>
<ul>
<li><a href="http://www.infoq.com/minibooks/domain-driven-design-quickly">Domain driven design quickly</a></li>
<li><a href="http://dddsample.sourceforge.net/index.html">DDD sample application</a></li>
<li><a href="http://sourceforge.net/projects/timeandmoney/">Time and Money</a></li>
</ul>
<p>I still have to absorb all of this material and try it out but I can instantly recognise that it addresses some if not most of the code problems that have frustrated me.</p>
<p>So, exciting times are ahead. Its always refreshing to find new tricks and efficient ways of improving software development!</p>

<p><a href="http://feedads.g.doubleclick.net/~a/dpp2asyfjzrtqs-CgYeZL90gKmU/0/da"><img src="http://feedads.g.doubleclick.net/~a/dpp2asyfjzrtqs-CgYeZL90gKmU/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/dpp2asyfjzrtqs-CgYeZL90gKmU/1/da"><img src="http://feedads.g.doubleclick.net/~a/dpp2asyfjzrtqs-CgYeZL90gKmU/1/di" border="0" ismap="true"></img></a></p><img src="http://feeds.feedburner.com/~r/JavaThinking/~4/LwY02qcLIDA" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.javathinking.com/2011/10/on-to-some-exciting-stuff/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.javathinking.com/2011/10/on-to-some-exciting-stuff/</feedburner:origLink></item>
		<item>
		<title>Using the Crystal Reports Java API to generate PDF</title>
		<link>http://feedproxy.google.com/~r/JavaThinking/~3/u7bfMN2XI68/</link>
		<comments>http://www.javathinking.com/2011/09/using-the-crystal-reports-java-api-to-generate-pdf/#comments</comments>
		<pubDate>Thu, 15 Sep 2011 03:56:01 +0000</pubDate>
		<dc:creator>paul</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[businessobjects]]></category>
		<category><![CDATA[crystal]]></category>
		<category><![CDATA[report]]></category>

		<guid isPermaLink="false">http://www.javathinking.com/?p=582</guid>
		<description><![CDATA[I recently had to investigate how to generate a PDF from a Crystal Report created by another team. Without knowing anything about Crystal Reports, I had to google around for information and piece it all together. It turns out to be really simple once you know how.
We were using Business Objects 4.0, and probably the [...]]]></description>
			<content:encoded><![CDATA[<p></p><p>I recently had to investigate how to generate a PDF from a Crystal Report created by another team. Without knowing anything about Crystal Reports, I had to google around for information and piece it all together. It turns out to be really simple once you know how.</p>
<p>We were using Business Objects 4.0, and probably the most important thing was to get the Java library &#8211; download &#8216;SAP Crystal Reports for Java runtime components &#8211; Java Reporting Component (JRC)&#8217; from<br />
<a href="http://www.businessobjects.com/campaigns/forms/downloads/crystal/eclipse/datasave.asp">http://www.businessobjects.com/campaigns/forms/downloads/crystal/eclipse/datasave.asp</a></p>
<p>There are a lot of samples on the web to look at &#8211; you might find something to help here:<br />
<a href="http://wiki.sdn.sap.com/wiki/display/BOBJ/Java+Reporting+Component++SDK+Samples">http://wiki.sdn.sap.com/wiki/display/BOBJ/Java+Reporting+Component++SDK+Samples</a></p>
<p>A good example to start with is “JRC EXPORT REPORT”:<br />
<a href="http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/40d580ce-bd66-2b10-95b0-cc4d3f2dcaef">http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/40d580ce-bd66-2b10-95b0-cc4d3f2dcaef</a></p>
<p>If you have an RPT file, the java to generate the report is relatively simple &#8211; :</p>
<pre>
ReportClientDocument reportClientDoc = new ReportClientDocument();
reportClientDoc.open("My crystal report.rpt", 0);
ByteArrayInputStream byteArrayInputStream = (ByteArrayInputStream)reportClientDoc.getPrintOutputController().export(ReportExportFormat.PDF);
reportClientDoc.close();
</pre>
<p>The report I dealt with was developed by another team, and expected a data source called ‘TESTDB’ to be available. Without that data source present, I would get the following error:</p>
<pre>com.crystaldecisions.sdk.occa.report.lib.ReportSDKException: Error finding JNDI name (TESTDB)---- Error code:-2147467259 Error code name:failed</pre>
<p>Setting a data source up in Tomcat is trivial, just by adding a resource to context.xml:</p>
<pre>
&lt;Context&gt;
    &lt;WatchedResource&gt;WEB-INF/web.xml&lt;/WatchedResource&gt;

    &lt;Resource name="jdbc/TESTDB" auth="Container" type="javax.sql.DataSource"
               maxActive="100" maxIdle="30" maxWait="10000"
               username="user" password="passwd" driverClassName="oracle.jdbc.OracleDriver"
               url="jdbc:oracle:thin:@dbserver:1521:db1"/&gt;
&lt;/Context&gt;
</pre>
<p>Now the data source is set up, there’s another problem &#8211; the report expects a parameter and we get this error:</p>
<pre>com.crystaldecisions.sdk.occa.report.lib.ReportSDKParameterFieldException: InternalFormatterException---- Error code:-2147217394 Error code name:missingParameterValueError</pre>
<p>Adding the report parameter is simple once you know how:</p>
<pre>
ParameterFieldController paramController = reportClientDoc.getDataDefController().getParameterFieldController();
paramController.setCurrentValue("","MyParamName","MyParamValue");
</pre>
<p>There’s probably a lot of subtle information and detail missing here, but it works &#8211; I can generate the PDF via java code so its now at a stage where it can be integrated into our application.</p>
<p>So, the final spike test code looks like:</p>
<pre>
&lt;%@page contentType="text/html"%&gt;
&lt;%@page pageEncoding="UTF-8"%&gt;

&lt;%//Crystal Java Reporting Component (JRC) imports.%&gt;
&lt;%@page import="com.crystaldecisions.reports.sdk.*" %&gt;
&lt;%@page import="com.crystaldecisions.sdk.occa.report.lib.*" %&gt;
&lt;%@page import="com.crystaldecisions.sdk.occa.report.exportoptions.*" %&gt;

&lt;%//Java imports. %&gt;
&lt;%@page import="java.io.*" %&gt;

&lt;%

try {

	//Open report.
	ReportClientDocument reportClientDoc = new ReportClientDocument();
	reportClientDoc.open("MyReport.rpt", 0);
	ParameterFieldController paramController = reportClientDoc.getDataDefController().getParameterFieldController();
	paramController.setCurrentValue("","MyParamName","MyParamValue");
	ByteArrayInputStream byteArrayInputStream = (ByteArrayInputStream)reportClientDoc.getPrintOutputController().export(ReportExportFormat.PDF);
	reportClientDoc.close();

	writeToBrowser(byteArrayInputStream, response, "application/pdf");

} catch(Exception ex) {
	out.println(ex);
}
%&gt;

&lt;%!
   /*
	* Utility method that demonstrates how to write an input stream to the server's local file system.
	*/
	private void writeToBrowser(ByteArrayInputStream byteArrayInputStream, HttpServletResponse response, String mimetype) throws Exception {

		//Create a byte[] the same size as the exported ByteArrayInputStream.
		byte[] buffer = new byte[byteArrayInputStream.available()];
		int bytesRead = 0;

		//Set response headers to indicate mime type and inline file.
		response.reset();
		response.setHeader("Content-disposition", "inline;filename=report.pdf");
		response.setContentType(mimetype);

		//Stream the byte array to the client.
		while((bytesRead = byteArrayInputStream.read(buffer)) != -1) {
			response.getOutputStream().write(buffer, 0, bytesRead);
		}

		//Flush and close the output stream.
		response.getOutputStream().flush();
		response.getOutputStream().close();

	}
%&gt;
</pre>
<p>Note, implementing this in a JSP was just a simple and quick shortcut to investigate the API. </p>
<p>I put a simple CRConfig.xml in WEB-INF/classes:</p>
<pre>
&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;CrystalReportEngine-configuration&gt;
    &lt;reportlocation&gt;..&lt;/reportlocation&gt;
    &lt;timeout&gt;0&lt;/timeout&gt;
    &lt;ExternalFunctionLibraryClassNames&gt;
    	&lt;classname&gt;&lt;/classname&gt;
    &lt;/ExternalFunctionLibraryClassNames&gt;
&lt;/CrystalReportEngine-configuration&gt;
</pre>
<p>Note that this specified a report location of .. which meant I had to put MyReport.rpt in the WEB-INF directory of my application (i.e. [web-root]/WEB-INF/classes/.. = [web-root]/WEB-INF) &#8211; contents of the WEB-INF directory should not be available for download.</p>
<p>If the rpt file cannot be found, you’ll see an error like:</p>
<pre>com.crystaldecisions.sdk.occa.report.lib.ReportSDKException: Report file /[path-to-webapps]/webapps/cr/WEB-INF/MyReport.rpt not found---- Error code:-2147215356 Error code name:fileNotOpened</pre>

<p><a href="http://feedads.g.doubleclick.net/~a/9rJk7ZAUi2cSPTe-rBTqf-QvH_Q/0/da"><img src="http://feedads.g.doubleclick.net/~a/9rJk7ZAUi2cSPTe-rBTqf-QvH_Q/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/9rJk7ZAUi2cSPTe-rBTqf-QvH_Q/1/da"><img src="http://feedads.g.doubleclick.net/~a/9rJk7ZAUi2cSPTe-rBTqf-QvH_Q/1/di" border="0" ismap="true"></img></a></p><img src="http://feeds.feedburner.com/~r/JavaThinking/~4/u7bfMN2XI68" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.javathinking.com/2011/09/using-the-crystal-reports-java-api-to-generate-pdf/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.javathinking.com/2011/09/using-the-crystal-reports-java-api-to-generate-pdf/</feedburner:origLink></item>
		<item>
		<title>Easy classpaths with Java 6</title>
		<link>http://feedproxy.google.com/~r/JavaThinking/~3/0RPcXWTA3dQ/</link>
		<comments>http://www.javathinking.com/2011/09/easy-classpaths-with-java-6/#comments</comments>
		<pubDate>Sun, 11 Sep 2011 12:35:56 +0000</pubDate>
		<dc:creator>paul</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[classpath]]></category>

		<guid isPermaLink="false">http://www.javathinking.com/?p=569</guid>
		<description><![CDATA[Back in the day it used to be a bit more difficult than it is now to dynamically generate your java application classpath &#8211; you&#8217;d have to write a script to loop over all the jar files in a directory, appending them to your classpath variable &#8211; like this.
Since Java 6 though, its been a [...]]]></description>
			<content:encoded><![CDATA[<p></p><p>Back in the day it used to be a bit more difficult than it is now to dynamically generate your java application classpath &#8211; you&#8217;d have to write a script to loop over all the jar files in a directory, appending them to your classpath variable &#8211; like <a href="http://stackoverflow.com/questions/524081/bat-file-to-create-java-classpath">this</a>.</p>
<p>Since Java 6 though, its been a lot easier &#8211; you can use wildcards to specify all jars in a directory. See the &#8220;Understanding class path wildcards&#8221; in the <a href="http://download.oracle.com/javase/6/docs/technotes/tools/windows/classpath.html">Java SE 6 documentation</a>.</p>
<p>Now its as simple as:</p>
<pre>
java -cp /my/lib/dir/* MyClass
</pre>
<p>Simple! As it should be!</p>

<p><a href="http://feedads.g.doubleclick.net/~a/qS3afTJR5VxXhQTxS25aSBVaFQ8/0/da"><img src="http://feedads.g.doubleclick.net/~a/qS3afTJR5VxXhQTxS25aSBVaFQ8/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/qS3afTJR5VxXhQTxS25aSBVaFQ8/1/da"><img src="http://feedads.g.doubleclick.net/~a/qS3afTJR5VxXhQTxS25aSBVaFQ8/1/di" border="0" ismap="true"></img></a></p><img src="http://feeds.feedburner.com/~r/JavaThinking/~4/0RPcXWTA3dQ" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.javathinking.com/2011/09/easy-classpaths-with-java-6/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.javathinking.com/2011/09/easy-classpaths-with-java-6/</feedburner:origLink></item>
		<item>
		<title>Turning off JDK logging</title>
		<link>http://feedproxy.google.com/~r/JavaThinking/~3/_O0xzV0qsvI/</link>
		<comments>http://www.javathinking.com/2011/09/turning-off-jdk-logging/#comments</comments>
		<pubDate>Sat, 10 Sep 2011 00:12:38 +0000</pubDate>
		<dc:creator>paul</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[logging]]></category>

		<guid isPermaLink="false">http://www.javathinking.com/?p=561</guid>
		<description><![CDATA[I&#8217;ve been developing a simple little command line application and one of the libraries I&#8217;m using seems to log debug information to the console. To clean up the console output, I had to turn off the JDK by using:


        LogManager.getLogManager().reset();

This seemed to do the trick for me, but [...]]]></description>
			<content:encoded><![CDATA[<p></p><p>I&#8217;ve been developing a simple little command line application and one of the libraries I&#8217;m using seems to log debug information to the console. To clean up the console output, I had to turn off the JDK by using:</p>
<pre name="code" class="java">

        LogManager.getLogManager().reset();
</pre>
<p>This seemed to do the trick for me, but it sounds like in some cases you may need to go a bit further and turn off logging at the global logger level:</p>
<pre name="code" class="java">

        LogManager.getLogManager().reset();
        Logger globalLogger = Logger.getLogger(java.util.logging.Logger.GLOBAL_LOGGER_NAME);
        globalLogger.setLevel(java.util.logging.Level.OFF);
</pre>

<p><a href="http://feedads.g.doubleclick.net/~a/qULchfddWPjBeJprrHz9Zb3dRWY/0/da"><img src="http://feedads.g.doubleclick.net/~a/qULchfddWPjBeJprrHz9Zb3dRWY/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/qULchfddWPjBeJprrHz9Zb3dRWY/1/da"><img src="http://feedads.g.doubleclick.net/~a/qULchfddWPjBeJprrHz9Zb3dRWY/1/di" border="0" ismap="true"></img></a></p><img src="http://feeds.feedburner.com/~r/JavaThinking/~4/_O0xzV0qsvI" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.javathinking.com/2011/09/turning-off-jdk-logging/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.javathinking.com/2011/09/turning-off-jdk-logging/</feedburner:origLink></item>
		<item>
		<title>JUnit parameterized test with Spring autowiring AND transactions</title>
		<link>http://feedproxy.google.com/~r/JavaThinking/~3/W-ZX33-Jo6w/</link>
		<comments>http://www.javathinking.com/2011/09/junit-parameterized-test-with-spring-autowiring-and-transactions/#comments</comments>
		<pubDate>Thu, 08 Sep 2011 02:32:13 +0000</pubDate>
		<dc:creator>paul</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[junit]]></category>
		<category><![CDATA[spring]]></category>
		<category><![CDATA[test]]></category>
		<category><![CDATA[transaction]]></category>

		<guid isPermaLink="false">http://www.javathinking.com/?p=551</guid>
		<description><![CDATA[I&#8217;ve been writing JUnit Parameterized tests (a nice intro here &#8211; also see Theories) to do some data driven API testing. Now, when introducing Spring into the mix there are a couple of extra things to do. I came unstuck though because I was trying to do Transactional tests &#8211; since I&#8217;m now using @RunWith(Parameterized.class) and [...]]]></description>
			<content:encoded><![CDATA[<p></p><p>I&#8217;ve been writing JUnit Parameterized tests (a nice intro <a href="http://ourcraft.wordpress.com/2008/08/27/writing-a-parameterized-junit-test/" target="_blank">here</a> &#8211; also see <a href="http://blog.schauderhaft.de/2010/01/31/new-feature-of-junit-theories/" target="_blank">Theories</a>) to do some data driven API testing. Now, when introducing Spring into the mix there are a couple of <a href="http://bmocanu.ro/coding/320/combining-junit-theoriesparameterized-tests-with-spring/" target="_blank">extra things to do</a>. I came unstuck though because I was trying to do Transactional tests &#8211; since I&#8217;m now using @RunWith(Parameterized.class) and setting up my Spring TestContextManager manually the @Transaction annotations caused an exception:</p>
<pre>java.lang.IllegalArgumentException: Superclass has no null constructors but no arguments were given</pre>
<p>I couldn&#8217;t find any built in solution, so I&#8217;ve gone with manual transaction management in my test, using doInTransaction:</p>
<pre>
@RunWith(Parameterized.class)
@ContextConfiguration(locations = "classpath*:/testContext.xml")
public class MyTest {

    @Autowired
    PlatformTransactionManager transactionManager;

    private TestContextManager testContextManager;

    public MyTest (... parameters for test) {
        // store parameters in instance variables
    }

    @Before
    public void setUpSpringContext() throws Exception {
        testContextManager = new TestContextManager(getClass());
        testContextManager.prepareTestInstance(this);
    }

    @Parameterized.Parameters
    public static Collection<Object[]> generateData() throws Exception {
        ArrayList list = new ArrayList();
        // add data for each test here
        return list;
    }

    @Test
    public void validDataShouldLoadFully() throws Exception {
        new TransactionTemplate(transactionManager).execute(new TransactionCallback() {
            public Object doInTransaction(TransactionStatus status) {
                status.setRollbackOnly();
                try {
                    ... do cool stuff here

                } catch (Exception e) {
                    throw new RuntimeException(e);
                }
                return null;
            }
        });

    }</pre>

<p><a href="http://feedads.g.doubleclick.net/~a/QzThtRQoaIHjfkbUe35qJk9JLxo/0/da"><img src="http://feedads.g.doubleclick.net/~a/QzThtRQoaIHjfkbUe35qJk9JLxo/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/QzThtRQoaIHjfkbUe35qJk9JLxo/1/da"><img src="http://feedads.g.doubleclick.net/~a/QzThtRQoaIHjfkbUe35qJk9JLxo/1/di" border="0" ismap="true"></img></a></p><img src="http://feeds.feedburner.com/~r/JavaThinking/~4/W-ZX33-Jo6w" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.javathinking.com/2011/09/junit-parameterized-test-with-spring-autowiring-and-transactions/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.javathinking.com/2011/09/junit-parameterized-test-with-spring-autowiring-and-transactions/</feedburner:origLink></item>
		<item>
		<title>Week in Review – 2011-33</title>
		<link>http://feedproxy.google.com/~r/JavaThinking/~3/Sm630pTbYzY/</link>
		<comments>http://www.javathinking.com/2011/08/week-in-review-2011-33/#comments</comments>
		<pubDate>Fri, 19 Aug 2011 07:53:22 +0000</pubDate>
		<dc:creator>paul</dc:creator>
				<category><![CDATA[Week in Review]]></category>

		<guid isPermaLink="false">http://www.javathinking.com/?p=535</guid>
		<description><![CDATA[I&#8217;ve occasionally been frustrated by the output of &#8216;ps -ef&#8217; not showing the full command line for the processes. Well, it turns out that the solution is as simple as piping the output to a file &#8211; i.e. &#8216;ps -ef &#62; ps.txt&#8217; &#8211; now I can easily see the FULL command line for my java processes.
I bought [...]]]></description>
			<content:encoded><![CDATA[<p></p><p>I&#8217;ve occasionally been frustrated by the output of &#8216;ps -ef&#8217; not showing the full command line for the processes. Well,<a href="http://stackoverflow.com/questions/2159860/viewing-full-output-of-ps-command" target="_blank"> it turns out</a> that the solution is as simple as piping the output to a file &#8211; i.e. &#8216;ps -ef &gt; ps.txt&#8217; &#8211; now I can easily see the FULL command line for my java processes.</p>
<p>I bought a new WIFI router this week. My old one was getting flaky, and for some reason I&#8217;ve always had trouble with some of the url shorteners such as bit.ly and t.co &#8211; they just couldn&#8217;t be resolved. So I bought a basic <a href="http://www.netgear.com.au/service-provider/products/routers-and-gateways/fast-ethernet-routers-gateways/WNR1000.aspx" target="_blank">Netgear WNR1000</a> which satisfied all of my criteria. One of the things I like most is that it has a switch to turn off the wireless when I don&#8217;t need it. This helps with security as well as saving power.</p>
<p>I&#8217;ve almost finished porting my latest application to <a href="http://code.google.com/appengine/docs/python/gettingstarted/" target="_blank">AppEngine</a> (Python). Lucky its a small application! I&#8217;m constantly being reminded that its useful to have skills in a lightweight technology to bootstrap and test ideas quickly. If that idea takes off, then there is always the option to re-write in a more heavy weight enterprise way. Using different languages and technologies can also be refreshing and stimulating, but it does take time.</p>

<p><a href="http://feedads.g.doubleclick.net/~a/A2PgWokpcK9Lenp5s0prZ8Ygk4Q/0/da"><img src="http://feedads.g.doubleclick.net/~a/A2PgWokpcK9Lenp5s0prZ8Ygk4Q/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/A2PgWokpcK9Lenp5s0prZ8Ygk4Q/1/da"><img src="http://feedads.g.doubleclick.net/~a/A2PgWokpcK9Lenp5s0prZ8Ygk4Q/1/di" border="0" ismap="true"></img></a></p><img src="http://feeds.feedburner.com/~r/JavaThinking/~4/Sm630pTbYzY" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.javathinking.com/2011/08/week-in-review-2011-33/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.javathinking.com/2011/08/week-in-review-2011-33/</feedburner:origLink></item>
	</channel>
</rss>

