November, 2007

SUN Campus Ambassador

Yesterday I started officially with my job as SUN Campus Ambassador at Lucerne University of Applied Sciences and Arts. I’m very glad to have this position and will do the best. My main responsibilities with this job are:

– Lead the Sun open source developer community on my campus
- Run Sun Technology demo sessions on my campus
- Promote Sun training events on my campus
- Promote Sun’s open source platforms and development tools to professors and researchers

I’m working part-time about 5 hours a week. I’m very excited to hold my first tech demo before the end of this year. More information about this will follow. Also I ask all the students, professors and researchers here on the campus to contact me if they  have any questions to SUN related products and technologies. At this point I want to thank SUN for this great opportunity and my employer, the Lucerne University of Applied Sciences and Arts, for giving me the chance to combine my studies, my employment at Enterprise Lab and my position as SUN Campus Ambassador. As soon as I have my SUN blog working, I will also post a link here.

Office prank [pics]

I hope that this never happens to me. Some people seem to have too much time ;)

Hoaxes, hoaxes, hoaxes

Today morning the complete staff at our campus received an email warning of a virus. The mail tells you to forward the information to all your colleagues and relatives. Please, please, please, to all who receive such messages: Check the message first if its a hoax before forwarding it to thousands of people. A good link for hoaxes is the hoax index from TU Berlin.

JRuby applications in glassfish – Databases

As I promised earlier, I will now write how I added database support to a JRuby application running under glassfish v2.
The first step you’ll have to do is installing another plugin. The plugin is called “ActiveRecord-JDBC”. You can add this plugin to your rails project by adding “http://jruby-extras.rubyforge.org/svn/trunk/rails-integration/plugins/” to your plugin repositories. If you’re using gem for plugin management, just execute “gem install activerecord-jdbc”.

The second step you’ll have to do is including the Java libraries in your environment. Just edit configure/environment.rb and add “require ‘jdbc_adapter’” to it.

You’re almost done. The last step (and the important one) is to add the new database connectivity to your databases.yml. There you’ll have to edit the “production” section although  you’re developing. Add the following to your configuration:

     production:
      host: localhost
      adapter: jdbc
      driver: com.mysql.jdbc.Driver
      url: jdbc:mysql://localhost/<yourapp>_development
      username: ...
      password: ...

Just recreate your war file and put it in your autodeploy folder. Your JRuby application should now be able to access the MySQL Database.

JRuby applications in glassfish

I developed a few projects in Ruby on Rails so far. Now I noticed, that with the new glassfish v2 open source application server from sun, it is possible to load specially prepared RoR applications directly into a glassfish web container.

To develop my RoR applications I’m using the new Netbeans 6.0 IDE. They built an RoR only IDE which is available here.
To deploy a war file one needs to install a plugin for RoR to add a rake task which builds the war file. The plugin is named goldbrick. It can easaly be installed by adding “http://jruby-extras.rubyforge.org/svn/trunk/rails-integration/plugins/” to your plugin repositories.

After installing the goldbrick plugin and refreshing your list of rake tasks, you can build a war file by running rake war:standalone:create .
This will build a .war file in the projects top folder.

You can now easily deploy this application to glassfish by copying the .war file to your autodeploy folder. (eg. /opt/glassfish/domains/domain1/autodeploy).

If you now point your web browser to localhost:8080/<railsprojectname> , your rails project page should fire up.

I’m going to write soon about how to use the jdbc adapter for activerecord to access your MySQL database from within your rails application on your glassfish server.

My first entry

Hello together

Since November, 1. 2007 I got a new job at HSLU T&A. I’m working for the Enterprise Lab team to give technical support to users and maintain the Lab. Also visit my personal web log.
I mostly will write about my experiences with the Enterprise Lab but also about my position as “SUN Campus Ambassador” at SUN Microsystems. Hope to see you soon back here again!