Lets Get Dugg!



Quick blurb concerning Typeface

I have been off in Java Wicket Land for the past month or two. In this time, I have let Typeface slide without putting out much needed maintenance releases for the various quirks currently found in Typeface. Anyway, I hope to get a new release of Typeface in a few days or so that will fix some of the rough edges.


How to deploy a self contained Rails application on Tomcat, painlessly!

Here at work we have a Postfix email server which handles all our email for multiple domains. The authentication and users are handled via the PostgreSQL database backend. To make life easy, I used Rails to scaffold a few tables in that Postfix PostgreSQL database. End result, is an easy to use interface to manage emails and domains. However, deployment isn't as fun as it could be, even with mongrel. I still have to have Rails/Ruby installed AND manage startup scripts to start the mongrel instance for my Rails MailManager application. Well JRuby to the rescue!

Here is how I created a self-contained Rails Application that can be reused in any Tomcat deployment.

I used the pure Ruby PostgreSQL implementation instead of the Java-centric ActiveRecord-JDBC solution, so I can develop using native Ruby while deploying via WAR using JRuby without any database.yml changes!

First off we want to instal GoldSpike which adds rake tasks to create WAR files.

script/plugin install svn://rubyforge.org/var/svn/jruby-extras/trunk/rails-integration/plugins/goldspike

Now I needed to implement a self-contained postgres-pr module. I implemented it as a Rails Plugin!

Create the postgres plugin

./script/generate plugin postgres

Copy the postgres pure implementation gem files to your Rails plugin

cp -rf /opt/local/lib/ruby/gems/1.8/gems/postgres-pr-0.4.0/lib/* ./vender/plugins/postgres/lib/

Setup database.yml
I setup host as pdatabase, so on any server you deploy the WAR just add an alias to /etc/hosts ; 127.0.0.1 pdatabase

production:
  adapter: postgresql 
  database: postfix 
  username: victori  
  password: .......
  host: pdatabase

Run the rake task to build your reusable self-contained web application

rake war:standalone:create

Pretty darn easy eh?


Today as I sat down at my cubicle and did my daily routine to initiate eclipse. I encountered a horrible sight; eclipse would start and all of a sudden just crash.

I first tried the obvious solution, to clean out the workspace.

	./eclipse -clean

Nope, no go, still eclipse kept crashing. Ugh, I fell into despair, all those key-binds and spring templates, all gone. So, rationally I hopped on to #eclipse on irc.freenode.net to get some feed back on my situation. Rcjsuen was kind enough to provide the answer that would solve my problem.

The solution was fairly straight forward. I had to remove org.eclipse.core.resources from my workspace.

	cd ~/Documents/workspace/.metalog/.plugins
	rm -rf  org.eclipse.core.resources

By removing org.eclipse.core.resources, you clear out all the project metadata from your workspace. However, don't worry, once you start eclipse you can just go to "File -> Import -> import eclipse projects" and re-import all your workspace projects.