<?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>Miracle Occurs Here</title>
	<atom:link href="http://milestoneinc.com/blogs/tech_blog/?feed=rss2" rel="self" type="application/rss+xml" />
	<link>http://milestoneinc.com/blogs/tech_blog</link>
	<description>Java- and web-based software development notes brought to you by Milestone.</description>
	<lastBuildDate>Sat, 04 Sep 2010 20:27:58 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
<image>
    <title>Miracle Occurs Here</title>
    <url>feed-logo.png</url>
    <link>http://milestoneinc.com/blogs/tech_blog</link>
    <width>143</width>
    <height>59</height>
    <description>Miracle Occurs Here - http://milestoneinc.com/blogs/tech_blog</description>
    </image>		<item>
		<title>Jetty &#8211; Auto-reload JavaScript and CSS Files</title>
		<link>http://milestoneinc.com/blogs/tech_blog/jetty-auto-reload-javascript-and-css-files</link>
		<comments>http://milestoneinc.com/blogs/tech_blog/jetty-auto-reload-javascript-and-css-files#comments</comments>
		<pubDate>Sat, 04 Sep 2010 20:27:17 +0000</pubDate>
		<dc:creator>Michael Scepaniak</dc:creator>
				<category><![CDATA[the only category]]></category>

		<guid isPermaLink="false">http://milestoneinc.com/blogs/tech_blog/?p=99</guid>
		<description><![CDATA[If you are developing a web application using Jetty via Eclipse, by default, changes made to static resources such as external JavaScript and CSS files are not picked-up on the fly by the running Jetty server. Out of the box, picking up such changes requires that Jetty be stopped and restarted, possibly with the webapp [...]]]></description>
			<content:encoded><![CDATA[<p class="dropcap-first">If you are developing a web application using Jetty via Eclipse, by default, changes made to static resources such as external JavaScript and CSS files are not picked-up on the fly by the running Jetty server. Out of the box, picking up such changes requires that Jetty be stopped and restarted, possibly with the webapp being redeployed in between. In order to enable hot deployment of such resources, modify the <code>[JETTY_ROOT]/etc/webdefault.xml</code> file like so: </p>
<p><code>&lt;init-param&gt;<br />
    &lt;param-name&gt;maxCachedFiles&lt;/param-name&gt;<br />
    &lt;param-value&gt;<strong>0</strong>&lt;/param-value&gt;<br />
&lt;/init-param&gt;</code></p>
<p>By way of colleague and friend, <a href="http://jalpino.com/new/">Justin Alpino</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://milestoneinc.com/blogs/tech_blog/jetty-auto-reload-javascript-and-css-files/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Migrating Your WordPress Permalinks</title>
		<link>http://milestoneinc.com/blogs/tech_blog/migrating-your-wordpress-permalinks</link>
		<comments>http://milestoneinc.com/blogs/tech_blog/migrating-your-wordpress-permalinks#comments</comments>
		<pubDate>Fri, 27 Aug 2010 00:53:25 +0000</pubDate>
		<dc:creator>Michael Scepaniak</dc:creator>
				<category><![CDATA[the only category]]></category>

		<guid isPermaLink="false">http://milestoneinc.com/blogs/tech_blog/?p=79</guid>
		<description><![CDATA[When I first set-up my WordPress blog, I used the default permalink structure. For example: http://milestoneinc.com/blogs/tech_blog/?p=79 I liked it because it kept the URL&#8217;s short. But, I came to understand the SEO benefits of readable URL&#8217;s. And the default structure made interpreting my Google Analytics reports a chore. So, I decided to change the structure [...]]]></description>
			<content:encoded><![CDATA[<p class="dropcap-first">When I first set-up my WordPress blog, I used the default permalink structure. For example:<br />
<small><br />
<code><a href="http://milestoneinc.com/blogs/tech_blog/?p=79">http://milestoneinc.com/blogs/tech_blog/<strong>?p=79</strong></a></code></small></p>
<p style="text-align: left;">I liked it because it kept the URL&#8217;s short. But, I came to understand the SEO benefits of readable URL&#8217;s. And the default structure made interpreting my Google Analytics reports a chore. So, I decided to change the structure to one that just used the name of the post:</p>
<p><small><code>/%postname%</code></small></p>
<p style="text-align: left;">And this works fine. You go into your Permalink Settings screen, specify the Custom Structure, save the .htaccess file, and the above URL changes:</p>
<p><small><code><a href="http://milestoneinc.com/blogs/tech_blog/migrating-your-wordpress-permalinks">http://milestoneinc.com/blogs/tech_blog/<strong>migrating-your-wordpress-permalinks</strong></a></code></small></p>
<p style="text-align: left;">But, I could still access the old URL directly. This wasn&#8217;t cool to me, because the search engines would still drive visitors to the old link structure, Google Analytics would still show the obtuse links, and my URL&#8217;s would remain search-engine hostile. What I wanted to do was migrate the old URL&#8217;s to the new URL&#8217;s. It turns out that there are lots of WordPress plugins offering to do this for you. After much investigation and reading, the one I finally settled on was the <a href="http://scott.yang.id.au/code/permalink-redirect/">Permalink Redirect WordPress Plugin</a> by <a href="http://scott.yang.id.au/">Scott Yang</a>. Why? Primarily because of this thorough <a href="http://www.michaelbubbo.com/blog/2009/best-wordpress-permalink-structure">blog post about the Permalink Redirect Plugin</a> by <a href="http://www.michaelbubbo.com/blog/">Michael Bubbo</a>.</p>
<p style="text-align: left;">I followed the instructions and everything worked as expected. And when I look in my Apache access logs, I see the 301 redirect goodness that I expected:</p>
<p><small><code>12.345.678.999 - - [26/Aug/2010:02:37:58 -0500] "GET <strong>/blogs/tech_blog/?p=76</strong> HTTP/1.1" <strong>301</strong> 4224 "-"<br />
"Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9.2.8) Gecko/20100722 Firefox/3.6.8"<br />
12.345.678.999 - - [26/Aug/2010:02:37:58 -0500] "GET <strong>/blogs/tech_blog/migrating-your-wordpress-permalinks</strong> HTTP/1.1" <strong>200</strong> 3798 "-"<br />
"Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9.2.8) Gecko/20100722 Firefox/3.6.8"</code></small></p>
<p style="text-align: left;">I hope this helps.</p>
]]></content:encoded>
			<wfw:commentRss>http://milestoneinc.com/blogs/tech_blog/migrating-your-wordpress-permalinks/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>A/Bingo Installation Tips</title>
		<link>http://milestoneinc.com/blogs/tech_blog/abingo-installation-tips</link>
		<comments>http://milestoneinc.com/blogs/tech_blog/abingo-installation-tips#comments</comments>
		<pubDate>Thu, 01 Oct 2009 23:48:07 +0000</pubDate>
		<dc:creator>Michael Scepaniak</dc:creator>
				<category><![CDATA[the only category]]></category>

		<guid isPermaLink="false">http://milestoneinc.com/blogs/tech_blog/?p=75</guid>
		<description><![CDATA[I wanted to incorporate A/B testing into a Rails project of mine. Being that I&#8217;m a fan of Patrick McKenzie and his micropreneurial pursuits, I decided to go with A/Bingo, his Ruby on Rails A/B testing framework. However, since I&#8217;m still pretty much a rookie when it comes to Ruby and Rails, I had some [...]]]></description>
			<content:encoded><![CDATA[<p class="dropcap-first">
<p style="text-align: left;">I wanted to incorporate A/B testing into a Rails project of mine. Being that I&#8217;m a fan of <a href="http://www.kalzumeus.com/">Patrick McKenzie</a> and his micropreneurial pursuits, I decided to go with <a href="http://www.bingocardcreator.com/abingo">A/Bingo</a>, his Ruby on Rails A/B testing framework. However, since I&#8217;m still pretty much a rookie when it comes to Ruby and Rails, I had some issues with the installation. Here are my tips&#8230;</p>
<p style="text-align: left;">In step #1, Patrick gives the installation options. I tried the <span><span style="margin-left: 0px;"><code>script/plugin install</code></span></span> command first, which seemed to execute fine. But I couldn&#8217;t figure out where the download got placed. So, I tried the <span><span style="margin-left: 0px;"><code>git clone</code></span></span> command, but, well, turns out I didn&#8217;t have git installed. (Remember, I is a rookie.) I quickly figured out that git can be easily installed (on OS X) using the <a href="http://code.google.com/p/git-osx-installer/">Git OS X Installer</a>. It worked great. I tried the <span><span style="margin-left: 0px;"><code>git clone</code></span></span> command again and an <code>abingo</code> directory got created in my local directory. Lovely.</p>
<p style="text-align: left;">In step #2, Patrick says to execute the <span><span style="margin-left: 0px;"><code>ruby script/generate abingo_migration</code></span></span> command. I tried, but I kept getting &#8220;<code>Couldn't find 'abingo_migration' generator</code>&#8220;. I figured that something was in the wrong place, but, me being a Rails novice, it took me a while to figure out. Do the following:</p>
<ol style="text-align: left;">
<li>Copy the <strong>contents</strong> of the <strong><code>abingo/lib</code> directory</strong> to your Rails project&#8217;s lib directory.</li>
<li>Copy the <strong><code>abingo/generators</code> directory</strong> to your Rails project&#8217;s lib directory, too. (I figured this out by reading the usage/help for the <code>script/generate</code> command.</li>
</ol>
<p style="text-align: left;">With regard to step #3, I must be using a different version of Rails (v2.3.3), because the names of the applicable files for me were <code><strong>application_controller.rb</strong></code> and <code>application_helper.rb</code>.</p>
<p style="text-align: left;">In the &#8220;Usage&#8221; -&gt; &#8220;Statistical Significance&#8221; section, the command you want is <span><span style="margin-left: 0px;"><code>experiment.describe_<strong>result</strong>_in_words</code></span></span>, not <span><span style="margin-left: 0px;"><code>experiment.describe_<strong>results</strong>_in_words</code></span></span>.</p>
<p style="text-align: left;">Hope this helps anyone having similar issues.</p>
<p style="text-align: left;">
]]></content:encoded>
			<wfw:commentRss>http://milestoneinc.com/blogs/tech_blog/abingo-installation-tips/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Maven &#8211; Install a POM-less JAR</title>
		<link>http://milestoneinc.com/blogs/tech_blog/maven-install-a-pom-less-jar</link>
		<comments>http://milestoneinc.com/blogs/tech_blog/maven-install-a-pom-less-jar#comments</comments>
		<pubDate>Mon, 12 Jan 2009 02:05:22 +0000</pubDate>
		<dc:creator>Michael Scepaniak</dc:creator>
				<category><![CDATA[the only category]]></category>

		<guid isPermaLink="false">http://milestoneinc.com/blogs/tech_blog/?p=49</guid>
		<description><![CDATA[At some point while using Maven, you&#8217;ll most likely come to a point where you need to install a POM-less artifact (probably a JAR) into your local Maven repository. This could happen for a number of reasons: The JAR has never been published to a public Maven repository. This could be the case with a [...]]]></description>
			<content:encoded><![CDATA[<p class="dropcap-first">At some point while using <a href="http://maven.apache.org/">Maven</a>, you&#8217;ll most likely come to a point where you need to install a POM-less artifact (probably a <a href="http://en.wikipedia.org/wiki/JAR_(file_format)">JAR</a>) into your local Maven repository. This could happen for a number of reasons:</p>
<ul>
<li>The JAR has never been published to a public Maven repository. This could be the case with a small, niche library.</li>
<li>You need to compile against JAR&#8217;s included in your runtime environment, which might be closed-source (e.g., WebSphere).</li>
<li>You might have some third-party JAR&#8217;s which you know work and are Maven-accessible, but you&#8217;re having difficulty determining their versions.</li>
</ul>
<p>To install, run the following command (I think against any arbitrary pom.xml file):</p>
<pre style="padding-left: 30px;">mvn install:install-file -Dfile=[path/to/jar] -DgroupId=[group.id] \n
 -DartifactId=[package-id] -Dpackaging=jar -Dversion=[version] \n
 -DgeneratePom=true</pre>
<p>So, for example, at one point in recent history, I needed to compile against some internal JBoss JAR&#8217;s. This is the command I used to install one of the JAR&#8217;s into my local Maven repository:</p>
<pre style="padding-left: 30px;">mvn install:install-file -Dfile=jboss-api-lib.jar \n
 -DgroupId=jboss.jboss-api -DartifactId=jboss-api-lib -Dpackaging=jar \n
 -Dversion=2.6.4 -DgeneratePom=true</pre>
]]></content:encoded>
			<wfw:commentRss>http://milestoneinc.com/blogs/tech_blog/maven-install-a-pom-less-jar/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Confluence Install &#8211; Datasource &#8220;Access denied for user&#8221; Error</title>
		<link>http://milestoneinc.com/blogs/tech_blog/confluence-install-datasource-access-denied-for-user-error</link>
		<comments>http://milestoneinc.com/blogs/tech_blog/confluence-install-datasource-access-denied-for-user-error#comments</comments>
		<pubDate>Mon, 22 Dec 2008 01:50:02 +0000</pubDate>
		<dc:creator>Michael Scepaniak</dc:creator>
				<category><![CDATA[the only category]]></category>

		<guid isPermaLink="false">http://milestoneinc.com/blogs/tech_blog/?p=59</guid>
		<description><![CDATA[I was trying to install a Confluence instance in my hosting account. I had gone through the install and setup successfully locally on my Mac. But the setup on the host was failing: 2008-12-21 13:07:28,087 ERROR [TP-Processor8] [atlassian.config.bootstrap.DefaultAtlassianBootstrapManager] getTestDatasourceConnection Couldn&#8217;t open a connection on Datasource (java:comp/env/jdbc/confluence): org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory (Server connection failure during transaction. [...]]]></description>
			<content:encoded><![CDATA[<p class="dropcap-first">I was trying to install a <a href="http://www.atlassian.com/software/confluence/">Confluence</a> instance in my hosting account. I had gone through the install and setup successfully locally on my Mac. But the setup on the host was failing: </p>
<p><textarea cols="75" rows="20">2008-12-21 13:07:28,087 ERROR [TP-Processor8] [atlassian.config.bootstrap.DefaultAtlassianBootstrapManager] getTestDatasourceConnection Couldn&#8217;t open a connection on Datasource (java:comp/env/jdbc/confluence): org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory (Server connection failure during transaction. Due to underlying exception: &#8216;java.sql.SQLException: Access denied for user &#8216;foo_user&#8217;@'dz64.dailyrazor.com&#8217; (using password: YES)&#8217;.</p>
<p>** BEGIN NESTED EXCEPTION ** </p>
<p>java.sql.SQLException<br />
MESSAGE: Access denied for user &#8216;foo_user&#8217;@'dz64.dailyrazor.com&#8217; (using password: YES)</p>
<p>STACKTRACE:</p>
<p>java.sql.SQLException: Access denied for user &#8216;foo_user&#8217;@'dz64.dailyrazor.com&#8217; (using password: YES)<br />
	at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1056)<br />
	at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:957)<br />
	at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3376)<br />
	at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3308)<br />
	at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:894)<br />
	at com.mysql.jdbc.MysqlIO.secureAuth411(MysqlIO.java:3808)<br />
	at com.mysql.jdbc.MysqlIO.doHandshake(MysqlIO.java:1256)<br />
	at com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2182)<br />
	at com.mysql.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:729)<br />
	at com.mysql.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:298)<br />
	at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:283)<br />
	at org.apache.tomcat.dbcp.dbcp.DriverConnectionFactory.createConnection(DriverConnectionFactory.java:38)<br />
	at org.apache.tomcat.dbcp.dbcp.PoolableConnectionFactory.makeObject(PoolableConnectionFactory.java:294)<br />
	at org.apache.tomcat.dbcp.dbcp.BasicDataSource.validateConnectionFactory(BasicDataSource.java:1247)<br />
	at org.apache.tomcat.dbcp.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:1221)<br />
	at org.apache.tomcat.dbcp.dbcp.BasicDataSource.getConnection(BasicDataSource.java:880)<br />
	at com.atlassian.config.bootstrap.DefaultAtlassianBootstrapManager.getTestDatasourceConnection(DefaultAtlassianBootstrapManager.java:403)<br />
	at com.atlassian.confluence.setup.actions.SetupDatasourceAction.execute(SetupDatasourceAction.java:50)<br />
</textarea></p>
<p>I kept receiving some sort of access error:<br />
<code>Access denied for user 'foo_user'@'dz64.dailyrazor.com' (using password: YES)</code></p>
<p>I tried establishing the database connection manually through <a href="http://www.minq.se/products/dbvis/">DbVisualizer</a>, which worked fine:</p>
<p><code>jdbc:mysql://domain.com:3306/db_name?autoReconnect=true</code></p>
<p>I looked more closely at the error and realized that something was appending the username with the individual server my account was being hosted on (i.e., dz64.dailyrazor.com). I had a hard time figuring out who was at fault &#8211; Confluence, <a href="http://tomcat.apache.org/">Tomcat</a>, <a href="http://commons.apache.org/dbcp/">DBCP</a>, or <a href="http://dev.mysql.com/usingmysql/get_started.html">MySQL</a>. </p>
<p>The source of the problem appeared to be my Tomcat resource definition: </p>
<p><textarea cols="75" rows="10"><Context path="/wiki" docBase="/path/to/tomcat/confluence-2.10-std/confluence" debug="0" reloadable="true"><br />
	<Resource name="jdbc/confluence" auth="Container" type="javax.sql.DataSource"<br />
			 username="foo_user"<br />
			 password="password"<br />
			 driverClassName="com.mysql.jdbc.Driver"<br />
			 url="jdbc:mysql://domain.com:3306/db_name?autoReconnect=true"<br />
			 maxActive="15"<br />
			 maxIdle="7"<br />
			 validationQuery="Select 1" /><br />
</Context><br />
</textarea></p>
<p>Googling around didn&#8217;t provide me any answers. I tried replacing &#8220;domain.com&#8221; in the &#8220;url&#8221; attribute with &#8220;dz64.dailyrazor.com&#8221;, but this didn&#8217;t achieve anything. In the end, I figured out that specifying &#8220;localhost&#8221; was the answer: </p>
<p><code>url="jdbc:mysql://localhost:3306/db_name?autoReconnect=true"</code></p>
<p>This is what I was doing on my Mac, but it took me a while to figure out that the same had to be done on my host.</p>
]]></content:encoded>
			<wfw:commentRss>http://milestoneinc.com/blogs/tech_blog/confluence-install-datasource-access-denied-for-user-error/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Confluence Upgrade &#8211; Duplicate Entry Error</title>
		<link>http://milestoneinc.com/blogs/tech_blog/confluence-upgrade-duplicate-entry-error</link>
		<comments>http://milestoneinc.com/blogs/tech_blog/confluence-upgrade-duplicate-entry-error#comments</comments>
		<pubDate>Mon, 22 Dec 2008 01:22:52 +0000</pubDate>
		<dc:creator>Michael Scepaniak</dc:creator>
				<category><![CDATA[the only category]]></category>

		<guid isPermaLink="false">http://milestoneinc.com/blogs/tech_blog/?p=56</guid>
		<description><![CDATA[I&#8217;ve been running a Confluence installation (using a personal license) for a couple years. Recently, I&#8217;ve been experiencing some issues with it, and figured that it might be time to upgrade (from version 2.2.5, which is from July 2006, I&#8217;m guessing). At the time of this writing, the current version (and the version to which [...]]]></description>
			<content:encoded><![CDATA[<p class="dropcap-first">I&#8217;ve been running a <a href="http://www.atlassian.com/software/confluence/">Confluence</a> installation (using a <a href="http://www.atlassian.com/software/confluence/personal-wiki.jsp">personal license</a>) for a couple years. Recently, I&#8217;ve been experiencing some issues with it, and figured that it might be time to upgrade (from version 2.2.5, which is from July 2006, I&#8217;m guessing). At the time of this writing, the current version (and the version to which I wanted to upgrade), is version 2.10.</p>
<p>My upgrade process consisted of performing a clean install of version 2.10 and importing a backup of the content from my version 2.2.5 installation. According to the documentation, this is an expected and supported operation for these version numbers. But, it did not work. The error I received (in the atlassian-confluence.log file):</p>
<p><textarea cols="75" rows="20">2008-12-20 12:00:56,428 WARN [Importing data task] [confluence.importexport.impl.ImportedProperty] saveLiteralProperty Unable to set property &#8216;owner&#8217; on instance of &#8216;class com.atlassian.confluence.pages.Draft&#8217; with id 13. This is probably due to internal data structure changes and doesn&#8217;t cause any data loss.<br />
 &#8212; referer: http://localhost:8080/wiki/setup/setup-restore-start.action | url: /wiki/setup/setup-restore.action | userName: anonymous | action: setup-restore<br />
2008-12-20 12:00:56,430 WARN [Importing data task] [confluence.importexport.impl.ImportedProperty] saveLiteralProperty Unable to set property &#8216;type&#8217; on instance&#8230;<br />
2008-12-20 12:00:56,431 WARN [Importing data task] [confluence.importexport.impl.ImportedProperty] saveLiteralProperty Unable to set property &#8216;spaceKey&#8217; on instance&#8230;<br />
2008-12-20 12:00:56,436 WARN [Importing data task] [confluence.importexport.impl.ImportedProperty] saveLiteralProperty Unable to set property &#8216;savedDate&#8217; on instance&#8230;<br />
2008-12-20 12:00:56,945 WARN [Importing data task] [confluence.importexport.impl.ImportedProperty] saveLiteralProperty Unable to set property &#8216;owner&#8217; on instance of &#8216;class com.atlassian.confluence.pages.Draft&#8217; with id 14. This is probably due to internal data structure changes and doesn&#8217;t cause any data loss.<br />
 &#8212; referer: http://localhost:8080/wiki/setup/setup-restore-start.action | url: /wiki/setup/setup-restore.action | userName: anonymous | action: setup-restore<br />
2008-12-20 12:00:56,946 WARN [Importing data task] [confluence.importexport.impl.ImportedProperty] saveLiteralProperty Unable to set property &#8216;type&#8217; on instance&#8230;<br />
2008-12-20 12:00:56,946 WARN [Importing data task] [confluence.importexport.impl.ImportedProperty] saveLiteralProperty Unable to set property &#8216;spaceKey&#8217; on instance&#8230;<br />
2008-12-20 12:00:56,946 WARN [Importing data task] [confluence.importexport.impl.ImportedProperty] saveLiteralProperty Unable to set property &#8216;savedDate&#8217; on instance&#8230;<br />
2008-12-20 12:00:58,660 WARN [Importing data task] [confluence.importexport.impl.ReverseDatabinder] writeObject Found duplicate key: class = com.atlassian.confluence.core.BodyContent, id = 2, skipping second object in import<br />
 &#8212; referer: http://localhost:8080/wiki/setup/setup-restore-start.action | url: /wiki/setup/setup-restore.action | userName: anonymous | action: setup-restore<br />
2008-12-20 12:00:58,788 ERROR [Importing data task] [sf.hibernate.util.JDBCExceptionReporter] logExceptions Duplicate entry &#8217;14&#8242; for key 1<br />
 &#8212; referer: http://localhost:8080/wiki/setup/setup-restore-start.action | url: /wiki/setup/setup-restore.action | userName: anonymous | action: setup-restore<br />
&#8230;<br />
net.sf.hibernate.exception.ConstraintViolationException: could not insert: [com.atlassian.confluence.pages.Page#14]<br />
 &#8212; referer: http://localhost:8080/wiki/setup/setup-restore-start.action | url: /wiki/setup/setup-restore.action | userName: anonymous | action: setup-restore<br />
net.sf.hibernate.exception.ConstraintViolationException: could not insert: [com.atlassian.confluence.pages.Page#14]<br />
	at net.sf.hibernate.exception.ErrorCodeConverter.convert(ErrorCodeConverter.java:73)<br />
	at net.sf.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:29)<br />
	at net.sf.hibernate.persister.AbstractEntityPersister.convert(AbstractEntityPersister.java:1331)<br />
	at net.sf.hibernate.persister.EntityPersister.insert(EntityPersister.java:472)<br />
	at net.sf.hibernate.persister.EntityPersister.insert(EntityPersister.java:436)<br />
	at net.sf.hibernate.impl.ScheduledInsertion.execute(ScheduledInsertion.java:37)<br />
	at net.sf.hibernate.impl.SessionImpl.execute(SessionImpl.java:2449)<br />
	at net.sf.hibernate.impl.SessionImpl.executeAll(SessionImpl.java:2435)<br />
	at net.sf.hibernate.impl.SessionImpl.execute(SessionImpl.java:2392)<br />
	at net.sf.hibernate.impl.SessionImpl.flush(SessionImpl.java:2261)<br />
	at com.atlassian.confluence.importexport.impl.ReverseDatabinder.flushIfNeeded(ReverseDatabinder.java:532)<br />
	at com.atlassian.confluence.importexport.impl.ReverseDatabinder.writeObject(ReverseDatabinder.java:505)<br />
&#8230;<br />
Caused by: com.mysql.jdbc.exceptions.MySQLIntegrityConstraintViolationException: Duplicate entry &#8217;14&#8242; for key 1<br />
	at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:931)<br />
	at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2870)</textarea></p>
<p>I did some Googling, but wasn&#8217;t able to find a solution. I looked closer at the information contained in the log and guessed that there were really only two records at issue, and that they both were drafts: </p>
<p><code>instance of 'class com.atlassian.confluence.pages.Draft' with id 13.</code></p>
<p><code>instance of 'class com.atlassian.confluence.pages.Draft' with id 14.</code></p>
<p>I opened the Confluence entities.xml file (located in the back-up zip) and searched for &#8220;draft&#8221;. As hoped, I found two elements: </p>
<p><textarea cols="75" rows="10"><object class="Draft" package="com.atlassian.confluence.pages"><br />
<id name="id">13</id></p>
<property name="pageId"><![CDATA[441]]&gt;</property>
<property name="owner"><![CDATA[admin]]&gt;</property>
<property name="type"><![CDATA[page]]&gt;</property>
<property name="spaceKey"><![CDATA[dev]]&gt;</property>
<property name="title"><![CDATA[FreeMarker Notes]]&gt;</property>
<property name="content"><![CDATA[content... content... content]]&gt;</property>
<property name="savedDate">2007-07-18 13:02:04.000</property>
<property name="originalVersion">3</property>
</object></textarea></p>
<p><textarea cols="75" rows="10"><object class="Draft" package="com.atlassian.confluence.pages"><br />
<id name="id">14</id></p>
<property name="pageId"><![CDATA[700]]&gt;</property>
<property name="owner"><![CDATA[admin]]&gt;</property>
<property name="type"><![CDATA[page]]&gt;</property>
<property name="spaceKey"><![CDATA[dev]]&gt;</property>
<property name="title"><![CDATA[Blah Project - Reviews]]&gt;</property>
<property name="content"><![CDATA[content... content... content]]&gt;</property>
<property name="savedDate">2008-06-16 18:17:37.000</property>
<property name="originalVersion">19</property>
</object></textarea></p>
<p>I deleted these two elements from the XML file, re-zipped the back-up, re-executed the import, and it worked perfectly.</p>
]]></content:encoded>
			<wfw:commentRss>http://milestoneinc.com/blogs/tech_blog/confluence-upgrade-duplicate-entry-error/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Differences Between Hibernate and JPA</title>
		<link>http://milestoneinc.com/blogs/tech_blog/differences-between-hibernate-and-jpa</link>
		<comments>http://milestoneinc.com/blogs/tech_blog/differences-between-hibernate-and-jpa#comments</comments>
		<pubDate>Wed, 10 Dec 2008 02:02:20 +0000</pubDate>
		<dc:creator>Michael Scepaniak</dc:creator>
				<category><![CDATA[the only category]]></category>

		<guid isPermaLink="false">http://milestoneinc.com/blogs/tech_blog/?p=41</guid>
		<description><![CDATA[Fans of the Hibernate object-relational mapping (ORM) framework will realize that the Java Persistence API (JPA) is basically a standardization of that framework. And, if you&#8217;re like me, you really haven&#8217;t given much thought to JPA, because, gee, isn&#8217;t it just a watered-down Hibernate? Maybe, maybe not. (I&#8217;m not going to get into that here [...]]]></description>
			<content:encoded><![CDATA[<p class="dropcap-first">Fans of the <a href="http://hibernate.org/">Hibernate</a> object-relational mapping (ORM) framework will realize that the <a href="http://java.sun.com/javaee/overview/faq/persistence.jsp">Java Persistence API</a> (JPA) is basically a standardization of that framework. And, if you&#8217;re like me, you really haven&#8217;t given much thought to JPA, because, gee, isn&#8217;t it just a watered-down Hibernate? Maybe, maybe not. (I&#8217;m not going to get into that here and now.)</p>
<p>It can be useful, though (even if only politically or procedurally), to code to JPA instead of the Hibernate API. If you find yourself in that situation, you may find this compare/contrast between the two API&#8217;s to be useful:</p>
<table style="padding-bottom: 1em; padding-top: 1em; border-collapse: separate; border-spacing: 0px; border-width: 0px;" border="0">
<tbody>
<tr>
<th style="text-align: center;">Hibernate</th>
<th style="text-align: center;">JPA</th>
</tr>
<tr>
<td style="border-color: gray; border-style: solid; border-width: 1px; padding-right: 15px;">SessionFactory</td>
<td style="border-color: gray; border-style: solid; border-width: 1px; padding-right: 15px;">EntityManagerFactory</td>
</tr>
<tr>
<td style="border-color: gray; border-style: solid; border-width: 1px; padding-right: 15px;">Session</td>
<td style="border-color: gray; border-style: solid; border-width: 1px; padding-right: 15px;">EntityManager</td>
</tr>
<tr>
<td style="border-color: gray; border-style: solid; border-width: 1px; padding-right: 15px;">sessionFactory.getCurrentSession().[method]()</td>
<td style="border-color: gray; border-style: solid; border-width: 1px; padding-right: 15px;">entityManager.[method]()</td>
</tr>
<tr>
<td style="border-color: gray; border-style: solid; border-width: 1px; padding-right: 15px;">saveOrUpdate()</td>
<td style="border-color: gray; border-style: solid; border-width: 1px; padding-right: 15px;">persist()</td>
</tr>
<tr>
<td style="border-color: gray; border-style: solid; border-width: 1px; padding-right: 15px;">Query.setInteger/String/Entity()</td>
<td style="border-color: gray; border-style: solid; border-width: 1px; padding-right: 15px;">Query.setParameter()</td>
</tr>
<tr>
<td style="border-color: gray; border-style: solid; border-width: 1px; padding-right: 15px;">list()</td>
<td style="border-color: gray; border-style: solid; border-width: 1px; padding-right: 15px;">getResultList()</td>
</tr>
<tr>
<td style="border-color: gray; border-style: solid; border-width: 1px; padding-right: 15px;">uniqueResult()</td>
<td style="border-color: gray; border-style: solid; border-width: 1px; padding-right: 15px;">getSingleResult()</td>
</tr>
<tr>
<td style="border-color: gray; border-style: solid; border-width: 1px; padding-right: 15px;">uniqueResult() returns null</td>
<td style="border-color: gray; border-style: solid; border-width: 1px; padding-right: 15px;">getSingleResult() throws NoResultException</td>
</tr>
<tr>
<td style="border-color: gray; border-style: solid; border-width: 1px; padding-right: 15px;">CriteriaQueries &#8211; yes</td>
<td style="border-color: gray; border-style: solid; border-width: 1px; padding-right: 15px;">CriteriaQueries &#8211; no</td>
</tr>
</tbody>
</table>
<p>Additionally, there are a couple Hibernate-specific JPA-isms to keep in mind:</p>
<ul>
<li>If the underlying JPA implementation is Hibernate, either/both annotations or/and mapping files may be used &#8211; at the same time. In such a situation, I believe the mapping files act as an override for the annotations.</li>
<li>The best of both worlds (in my mind) is to base the code (at an interface- or API-level) on JPA and its EntityManager, but to have the implementation interact with the Hibernate Session, which can be obtained by calling getDelegate() on the EntityManager.</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://milestoneinc.com/blogs/tech_blog/differences-between-hibernate-and-jpa/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Change Apache DocumentRoot on Mac</title>
		<link>http://milestoneinc.com/blogs/tech_blog/change-apache-documentroot-on-mac</link>
		<comments>http://milestoneinc.com/blogs/tech_blog/change-apache-documentroot-on-mac#comments</comments>
		<pubDate>Sat, 22 Nov 2008 21:14:42 +0000</pubDate>
		<dc:creator>Michael Scepaniak</dc:creator>
				<category><![CDATA[the only category]]></category>

		<guid isPermaLink="false">http://milestoneinc.com/blogs/tech_blog/?p=13</guid>
		<description><![CDATA[I was trying to configure Apache on my Mac to better incorporate it into my desktop development environment. Part of that included customizing the DocumentRoot location &#8211; changing it from the default directory (/Library/WebServer/Documents) and pointing (or linking) it to a directory that just made more sense to me. But it wasn&#8217;t as easy as [...]]]></description>
			<content:encoded><![CDATA[<p class="dropcap-first">I was trying to configure <a href="http://httpd.apache.org/">Apache</a> on my Mac to better incorporate it into my desktop development environment. Part of that included customizing the <a href="http://httpd.apache.org/docs/2.0/mod/core.html#documentroot">DocumentRoot</a> location &#8211; changing it from the default directory (<code>/Library/WebServer/Documents</code>) and pointing (or <a href="http://en.wikipedia.org/wiki/Ln_(Unix)">linking</a>) it to a directory that just made more sense to me. But it wasn&#8217;t as easy as I expected.</p>
<p>Trouble was, I couldn&#8217;t get Apache to reflect my changes to the Apache configuration file (<code>httpd.conf</code>), regardless of how many times I restarted Apache (via <a href="http://en.wikipedia.org/wiki/System_Preferences">System Preferences</a>). Finally I did a <a href="http://en.wikipedia.org/wiki/Find">find</a> (<code>find /etc/ -name "httpd.conf"</code>) and figured out that I was editing the wrong configuration file (<code>/etc/httpd/httpd.conf</code>). My Mac was actually running Apache v2, but I was editing the configuration file for the now defunct (but apparently still present) Apache v1 installation. So I edited the correct configuration file (<code>/etc/apache2/httpd.conf</code>), restarted Apache as before, and everything worked as expected. <img src='http://milestoneinc.com/blogs/tech_blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://milestoneinc.com/blogs/tech_blog/change-apache-documentroot-on-mac/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>mod_jk Fail, mod_proxy Success</title>
		<link>http://milestoneinc.com/blogs/tech_blog/mod_jk-fail-mod_proxy-success</link>
		<comments>http://milestoneinc.com/blogs/tech_blog/mod_jk-fail-mod_proxy-success#comments</comments>
		<pubDate>Sat, 15 Nov 2008 05:31:05 +0000</pubDate>
		<dc:creator>Michael Scepaniak</dc:creator>
				<category><![CDATA[the only category]]></category>

		<guid isPermaLink="false">http://milestoneinc.com/blogs/tech_blog/?p=9</guid>
		<description><![CDATA[I have a production site configured with Apache2 forwarding requests to Tomcat using mod_jk. I wanted to mimic this configuration on my desktop environment, but was not able to get it to work locally on my Mac. I ended up using mod_proxy locally instead. This is the ordeal I went through&#8230; I grabbed a binary [...]]]></description>
			<content:encoded><![CDATA[<p class="dropcap-first">I have a production site configured with <a href="http://httpd.apache.org/">Apache2</a> forwarding requests to <a href="http://tomcat.apache.org/">Tomcat</a> using <a href="http://tomcat.apache.org/connectors-doc/">mod_jk</a>. I wanted to mimic this configuration on my desktop environment, but was not able to get it to work locally on my Mac. I ended up using <a href="http://httpd.apache.org/docs/2.0/mod/mod_proxy.html">mod_proxy</a> locally instead. This is the ordeal I went through&#8230;</p>
<p>I grabbed a binary for Mac OSX (x86) from the <a href="http://tomcat.apache.org/connectors-doc/">Tomcat Connectors site</a>, renamed it to mod_jk.so, and dropped it in the directory with the other modules. I made the necessary changes and additions to the Apache config files. Unfortunately, when I started Apache, I received the following error:</p>
<pre>
<code>no suitable image found.  Did find: /usr/libexec/apache2/mod_jk.so:
mach-o, but wrong architecture</code>
</pre>
<p>Googling the error helped me realize that I wasn&#8217;t alone with my issue and I figured out that I needed to build mod_jk from source, passing in some special flags to the build:</p>
<pre>
<code>./configure CFLAGS='-arch x86_64' APXSLDFLAGS='-arch x86_64'
-with-apxs=/usr/sbin/apxs</code>
</pre>
<p>This was great, but the next step (i.e., &#8220;make&#8221;), kept failing for me:</p>
<pre>
<code>jk_global.h:66:21: error: apr_lib.h: No such file or directory
jk_global.h:67:25: error: apr_strings.h: No such file or directory
make[1]: *** [jk_ajp12_worker.lo] Error 1
make: *** [all-recursive] Error 1</code>
</pre>
<p>I found lots of other pages explaining further variations of the same basic premise that I needed to build from source:</p>
<ul>
<li><a href="http://de-co-de.blogspot.com/2008/04/if-you-install-modjk.html">http://de-co-de.blogspot.com/2008/04/if-you-install-modjk.html</a></li>
<li><a href="http://egopoly.com/2007/10/29/how-to-install-tomcat-mod_jk-on-mac-os-x-leopard/">http://egopoly.com/2007/10/29/how-to-install-tomcat-mod_jk-on-mac-os-x-leopard/</a></li>
<li><a href="http://blog.lo-fi.net/2007/10/leopard-for-web-developer-installing.html">http://blog.lo-fi.net/2007/10/leopard-for-web-developer-installing.html</a></li>
</ul>
<p>I followed all of these instructions, but still had no luck. Then I tried going down the <a href="http://darwinports.com/">DarwinPorts</a> path:</p>
<ul>
<li><a href="http://mod_jk.darwinports.com/">http://mod_jk.darwinports.com/</a></li>
</ul>
<p>But I didn&#8217;t get anywhere with this:</p>
<pre>
<code>mike$ sudo port install mod_jk
...
Configuring APR library
Platform: i386-apple-darwin9.4.0
checking for working mkdir -p... yes
APR Version: 1.3.2
checking for chosen layout... apr
checking for gcc... /usr/bin/gcc-4.0
checking for C compiler default output file name...
configure: error: C compiler cannot create executables
See `config.log' for more details.</code>
</pre>
<p>I came to suspect that I might require an install of Apple&#8217;s Xcode to get any of these solutions to work. So I started downloading it. As I was waiting for the download to complete, I started looking at mod_proxy as an alternative to mod_jk. Using mod_proxy wouldn&#8217;t accomplish my goal of mirroring the production configuration and I wasn&#8217;t sure if it could handle sticky sessions, but I didn&#8217;t need that at this point. So I gave it a whirl, fought with it a little bit, and eventually was able to configure a solution before I got anywhere with Xcode:</p>
<p>In Apache&#8217;s httpd.conf: </p>
<pre>
<code>&lt;Proxy balancer://myCluster&gt;
   BalancerMember ajp://dev.milestoneinc.com:8010 route=node1
&lt;/Proxy&gt;

ProxyPass /blogs !
ProxyPass /balancer-manager !
ProxyPass / balancer://myCluster/ stickysession=JSESSIONID

&lt;Location /balancer-manager&gt;
	SetHandler balancer-manager
&lt;/Location&gt;</code>
</pre>
<p>In Tomcat&#8217;s server.xml: </p>
<pre>
<code>&lt;Engine defaultHost="localhost" jvmRoute="node1" name="Catalina"&gt;</code>
</pre>
<p>More information regarding mod_proxy and load-balancing/session-affinity:</p>
<ul>
<li><a href="http://www.darkcoding.net/2006/02/page/2/">http://www.darkcoding.net/2006/02/page/2/</a></li>
<li><a href="http://wiki.apache.org/cocoon/LoadBalancingWithModProxy">http://wiki.apache.org/cocoon/LoadBalancingWithModProxy</a></li>
<li><a href="http://www.nabble.com/mod_ajp-and-Load-Balancing-Issue-td18283072.html">http://www.nabble.com/mod_ajp-and-Load-Balancing-Issue-td18283072.html</a></li>
<li><a href="http://www.theserverside.com/tt/knowledgecenter/knowledgecenter.tss?l=LoadBalancingTomcatApache">http://www.theserverside.com/tt/kno&#8230;er.tss?l=LoadBalancingTomcatApache</a></li>
<li><a href="http://www.markround.com/archives/33-Apache-mod_proxy-balancing-with-PHP-sticky-sessions.html">http://www.markround.com/archi&#8230;ncing-with-PHP-sticky-sessions.html</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://milestoneinc.com/blogs/tech_blog/mod_jk-fail-mod_proxy-success/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Here be Miracles</title>
		<link>http://milestoneinc.com/blogs/tech_blog/here-be-miracles</link>
		<comments>http://milestoneinc.com/blogs/tech_blog/here-be-miracles#comments</comments>
		<pubDate>Wed, 05 Nov 2008 01:29:03 +0000</pubDate>
		<dc:creator>Michael Scepaniak</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://milestoneinc.com/blogs/tech_blog/?p=4</guid>
		<description><![CDATA[This blog is Milestone&#8217;s (meaning &#8211; Michael Scepaniak&#8217;s) attempt to give something back to the open-source software community. My evolution as a software developer started right about the same time the Web began to blossom, Java gained traction, and open-source software initiated its march toward ubiquity. Without open-source software (specifically open-source software frameworks and components) [...]]]></description>
			<content:encoded><![CDATA[<p class="dropcap-first">This blog is Milestone&#8217;s (meaning &#8211; Michael Scepaniak&#8217;s) attempt to give something back to the open-source software community. My evolution as a software developer started right about the same time the Web began to blossom, Java gained traction, and open-source software initiated its march toward ubiquity.</p>
<p>Without open-source software (specifically open-source software frameworks and components) such as the <a href="http://springframework.org/">Spring Framework</a>, <a href="http://hibernate.org/">Hibernate</a>, <a href="http://commons.apache.org/">Jakarta Commons</a>, <a href="http://tomcat.apache.org/">Tomcat</a>, <a href="http://htmlunit.sourceforge.net/">HtmlUnit</a>, <a href="http://freemarker.org/">Freemarker</a>, <a href="http://linux.org/">Linux</a>, and others, I suspect that software development would be an immensely frustrating, passion-less chore. What open-source software brings to the table is creative, inspired, developer-focused solutions to real, trench-level problems and inefficiencies. It spurs openly-accessible, internet-wide discussion and peer-based support amongst a large community of geographically-isolated individuals.</p>
<p>I, like countless other software developers the world over, have benefited greatly from such software, both professionally and personally (not to mention monetarily). The effort required to build open-source software is significant, second only to the effort required to publish it, maintain it, test it, document it, and support it. The fact that the users of that open-source software (meaning, other software developers) tend to be a demanding, critical lot makes this effort even tougher.</p>
<p>I have massive amounts of respect for open-source software developers and everyone that contributes to fostering the ecosystem. With this blog, I hope to become a more meaningful participant of that ecosystem &#8211; more than simply a consumer.</p>
<p>I don&#8217;t expect to earn any oohs or aahs with this effort. It&#8217;ll simply be me sharing tips and tricks and know-how and workarounds that I have picked-up over my years doing software development. I don&#8217;t expect it to be the sort of blog to which people feel compelled to subscribe. Rather, I hope it becomes something that software developers stumble across when desperately googling for a solution to whatever gotcha&#8217; they&#8217;ve found themselves caught in &#8211; a solution that I&#8217;ve already managed to figure out at some point in the past.</p>
<p>At the deepest, darkest point of maximum frustration, even a simple answer can seem like a miracle.</p>
]]></content:encoded>
			<wfw:commentRss>http://milestoneinc.com/blogs/tech_blog/here-be-miracles/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
