Oracle Doesn’t Mention Java – Does It Matter?

Posted in: Software Development, Database Technologies, Software Development, Development Tools, News, Software Development, Open Source

The following image is available on the Oracle website currently (original URL):

For me personally the 2 biggest questions about the whole deal have always been What happens to MySQL? and What happens to Java?

MySQL has always been open source and Java has been creeping slowly towards open source over the last few years.

Can Oracle really kill either of these technologies if they chose too? Probably not outright, but they could certainly damage their reputation and community support. People can fork code bases and start again, but it would take time (many years) to build back up to the flagships they are today.

The above image from Oracle is interesting in that it does call out MySQL but does not mention Java at all.

Perhaps Oracle sees more value in MySQL than Java and is attempting to protect it better. Or perhaps Oracle believes Java needs less protection than MySQL, after all, much of the debate over the Oracle/Sun deal has surrounded MySQL and not Java.

Wednesday is the day when some of these questions will hopefully begin to answered.

Why do you think Oracle called out MySQL and not Java?

So Long And Thanks For All The Glassfish

Posted in: Software Development, Database Technologies, Software Development, Development Tools, Software Development

Well, it seems almost official now, Oracle will get it hands on Sun and the Java and MySQL communities (among others) will need to hold their breath and wait to see what kind of chaos this might cause for our industries.

James Gosling (the father of Java) has long been publishing Java related images on his internal Sun blog. He has now posted his very last one.

The best comment I saw so far was “So long and thanks for all the Glassfish”.

You can read the original post here.

Performance Tuning Resources For Web Clients

Posted in: Software Development, Architecture & Design, Software Development, Craftsmanship, Software Development, Development Tools, Software Development, Open Source, Software Development, Web Technologies

Recently I have been doing some research on tweaking websites to make them faster (either in reality, or at least in appearance to the client). Specifically the research has been focused on the actual client tier interaction – requesting the page, downloading the assets and rendering the page in the browser. In this post I will document some of the better resources I have found, focusing on client-side tweaks, so these resources should be relevant no matter if you are a Java, PHP, .Net or any other flavor of developer.
Continue reading »

Coding Standards – Quality From The Ground Up

Posted in: Software Development, Configuration Management, Software Development, Development Tools, Software Development, Open Source, Software Development, Quality Assurance & Control

Coding styles are THE religious debate of the Software Engineering industry. Everyone has an opinion, but no one has an iron clad argument as to why their ideas are better than someone else’s.

It doesn’t matter what language you write your code in or what company your work for or even what open source project you contribute too, the topic of coding styles will sooner or later raise its head. The debate can range from the banal, like which line the curly brace goes on, to the overly subjective, like how to name variables.

In the end most of the decision points are pretty subjective and it is somewhat irrelevant what you choose, as long as everyone agrees and you are consistent. But don’t be mistaken, a consistent coding style is an important consideration on any project, from the solo developer to the multi-national team.
Continue reading »

How To Test Drive Development With Linux

Posted in: Software Development, Development Tools, Software Development, Open Source, System Administration

Building Social Applications using Zembly

Posted in: Software Development, Development Tools, Social Networking, Software Development, Web Technologies

Performance Analysis and Monitoring with Perf4j

Posted in: Software Development, Development Tools, Software Development, Open Source, Software Development, Quality Assurance & Control, Reviews

Get Your Firefox Add-Ons Under Control

Posted in: Software Development, Craftsmanship, Software Development, Development Tools, Software Development, Quality Assurance & Control, Reviews, Software Development, Web Technologies

Firefox add-ons can be hard to manage – for me, mostly in terms of finding quality add-ons that do something you find useful.

There is a new feature available called Add-on Collections. The name is helpfully descriptive – basically people can now group related add-ons together, give that group (or “collection” if you will) a name and list it on the site. So if you are on every social network, there is a collection of all of the add-ons that allow you to stay connected with those networks from the browser. If you like to travel, there is a collection that pulls together all of the add-ons that will help you do your thing. You get the idea.

Read more about Firefox Add-on Collections here.

So, if you consider yourself a web developer of any kind, please take my recommendation and install the Web Developer’s Toolkit collection right now, today, without delay. Hopefully you are already using Firebug, but there are a bunch of other add-ons in this collection that you might not be using already and you really should be.

And if I can provide one more piece of advice today – learn to use the tools you have available to you. Every day I see software developers doing things the hard way, particularly when it comes to debugging issues. There is a cornucopia of tools out there to help you do your job and if you know how to use them and you know what issues they will help you solve, you will instantly become a better developer – more efficient, more productive, more reliable, more dependable – perhaps, dare I say it, a craftsman.

Imagine an Electrician who carried around a whole toolbox of tools, but only knows how to use a screwdriver and a hammer – he can probably complete most tasks with those two tools, but he is probably going to disappoint his customers and not make much money as a contractor.

So, in summary, get some decent add-ons for Firefox to help you be a better Web Developer, and then actually take the time to learn how to use them. Easy.

Subversion Best Practices Webcast

Posted in: Software Development, Configuration Management, Software Development, Development Tools

CollabNet is sponsoring a webcast tomorrow entitled Subversion Best Practices: Maximizing Productivity.

You can register to attend here:
https://event.on24.com/eventRegistration/EventLobbyServlet?target=registration.jsp&eventid=147957

Installing JBoss Portal

Posted in: Software Development, Development Tools, System Administration

Today I finished a successful fresh install of JBoss Portal. Below is the process I followed.

Versions

  • JBoss Portal — 2.7.2 (bundled with JBoss AS 4.2.3)
  • JavaSE — 5.0 Update 19
  • MySQL — 5.1.34 (Community Edition)
  • Linux Flavor — Red Hat Enterprise Linux Server 5.2 (64 bit)

Step 1 – Downloads

  1. I grabbed the Java installer from here http://java.sun.com/javase/downloads/index_jdk5.jsp. The downloaded file was called jdk-1_5_0_19-linux-amd64-rpm.bin
  2. I grabbed the Portal binaries from here http://www.jboss.org/jbossportal/download/index.html. The downloaded file was called jboss-portal-2.7.2-bundled.zip
  3. I grabbed the MySQL binary from here http://dev.mysql.com/downloads/mysql/5.1.html#linux-rhel5-x86-64bit-rpms. I downloaded the server (MySQL-server-community-5.1.34-0.rhel5.x86_64.rpm) and the client (MySQL-client-community-5.1.34-0.rhel5.x86_64.rpm) RPMs
  4. I grabbed the MySQL JDBC driver from this page http://dev.mysql.com/downloads/connector/j/5.1.html. The downloaded file was called mysql-connector-java-5.1.7.tar.gz

Step 2 – Install JavaSE

  1. I made the installer executable

    $ chmod +x jdk-1_5_0_19-linux-amd64-rpm.bin
  2. Then executed the installer

    $ ./jdk-1_5_0_19-linux-amd64-rpm.bin
  3. I paged through endless legal boilerplate and accepted it by typing yes and hitting enter (hopefully I didn’t sell my soul)
  4. The installer extracted the RPM file and installed it.
    I double checked the package was installed by querying the RPM database:

    $ rpm -q jdk
    jdk-1.5.0_19-fcs
    $

    This RPM installed all of the files into /usr/java/jdk1.5.0_19

  5. I edited the /etc/profile file to make the JAVA_HOME environment variable and Java binaries available to everyone on the box. I added the following lines to achieve this

    export JAVA_HOME=/usr/java/jdk1.5.0_19
    export PATH=$PATH:$JAVA_HOME/bin
  6. I double checked it all worked

    $ source /etc/profile
    $ echo $JAVA_HOME
    /usr/java/jdk1.5.0_19
    $

Step 3 – Deploy Portal Binaries

  1. I am never sure the correct place in a Linux distribution to put 3rd party stuff, but I went with /usr/local this time

    $ pwd
    /usr/local
    $ unzip ~/jboss-portal-2.7.2-bundled.zip

    This created the directory /usr/local/jboss-portal-2.7.2

  2. Once again, I edited the /etc/profile file to add the JBoss environment to it by adding the following line

    export JBOSS_HOME=/usr/local/jboss-portal-2.7.2

    Then I tested it

    $ source /etc/profile
    $ echo $JBOSS_HOME
    /usr/local/jboss-portal-2.7.2
    $

Step 4 – Change Default Port (Optional)
For my install I have no need to run Apache in front of JBoss, so I want JBoss to listen (or more correctly, have Tomcat listen) directly on port 80 – by default it listens on 8080.

  1. I opened the $JBOSS_HOME/server/default/deploy/jboss-web.deployer/server.xml file, (which is a standard Tomcat configuration file) in an editor.
  2. I changed the port of the HTTP connector to 80 (you can find it by searching for 8080). I also change the HTTPS connector to use 443 (you can find this one by searching for 8443). I then changed the value of the redirectPort attribute of the HTTP connector to match.

Step 5 – Change Portal to be the root web app. (Optional)
For my install, the Portal will be the main application on the server, so I want it to be accessible from the root of the server, and not have to enter the portal context path all of the time.

  1. First, I disabled the current root application

    $ mv $JBOSS_HOME/server/default/deploy/jboss-web.deployer/ROOT.war $JBOSS_HOME/server/default/deploy/jboss-web.deployer/ROOT.war.old
  2. I opened the $JBOSS_HOME/server/default/deploy/jboss-portal.sar/portal-server.war/WEB-INF/jboss-web.xml file, in an editor.
  3. I found the <context -root> tag and changed the vallue to be just a single forward slash character.

    <context-root>/</context-root>
  4. I saved the file and exited the editor.

Step 6 – Install MySQL
By default, JBoss Portal will use a Hypersonic database for all of its internal data. My environment will be a production environment, so I want to use something more robust.

  1. I Installed the MySQL binaries by using a normal RPM install

    $ rpm -ivh MySQL-server-community-5.1.34-0.rhel5.x86_64.rpm
    $ rpm -ivh MySQL-client-community-5.1.34-0.rhel5.x86_64.rpm

    The installation process started the mysqld service automatically. It also installed MySQL as a service automatically.

  2. I checked that it was running

    $ mysqladmin version
    mysqladmin Ver 8.42 Distrib 5.1.34, for unknown-linux-gnu on x86_64
    Copyright 2000-2008 MySQL AB, 2008 Sun Microsystems, Inc.
    This software comes with ABSOLUTELY NO WARRANTY. This is free software,
    and you are welcome to modify and redistribute it under the GPL license

    Server version 5.1.34-community
    Protocol version 10
    Connection Localhost via UNIX socket
    UNIX socket /var/lib/mysql/mysql.sock
    Uptime: 5 hours 29 min 16 sec

    Threads: 1 Questions: 5 Slow queries: 0 Opens: 15 Flush tables: 1 Open tables: 8 Queries per second avg: 0.0
    $

There are a lot of things you might want to do to a base MySQL install before putting it into production, but that is beyond the scope of this document. I would start with this link for some of the things you need to consider: http://dev.mysql.com/doc/refman/5.1/en/unix-post-installation.html

Step 7 – Point the Portal at MySQL

  1. I connected to the MySQL server running on localhost, as the current user (which happened to be root in my case).

    $ mysql
    Welcome to the MySQL monitor. Commands end with ; or g.
    Your MySQL connection id is 15
    Server version: 5.1.34-community MySQL Community Server (GPL)

    Type ‘help;’ or ‘h’ for help. Type ‘c’ to clear the current input statement.

    mysql>

  2. I created a Database instance for the Portal to use

    mysql> CREATE DATABASE jbossportal;
    Query OK, 1 row affected (0.00 sec)
  3. Then I created a user for the Portal to connect as

    mysql> CREATE USER ‘portal’@'localhost’ IDENTIFIED BY ‘portalpassword’;
    Query OK, 0 rows affected (0.00 sec)
  4. Then I granted all privileges for the jbossportal Database to the user I just created

    mysql> GRANT ALL ON jbossportal.* TO ‘portal’@'localhost’;
    Query OK, 0 rows affected (0.00 sec)

    At this point I quit the MySQL interpreter.

  5. Next, I untared the MySQL JDBC driver

    $ tar zxvf mysql-connector-java-5.1.7.tar.gz
  6. Then I copied the driver jar file to the $JBOSS_HOME/server/default/lib/ directory

    $ cp mysql-connector-java-5.1.7/mysql-connector-java-5.1.7-bin.jar $JBOSS_HOME/server/default/lib
  7. Next I disabled the original Hypersonic datasource

    $ mv $JBOSS_HOME/server/default/deploy/portal-hsqldb-ds.xml $JBOSS_HOME/server/default/deploy/portal-hsqldb-ds.xml.bak
  8. Then I deployed a datasource descriptor for MySQL. There is an example datasource descriptor in the JBoss Portal binary distribution

    $ cp $JBOSS_HOME/setup/portal-mysql5-ds.xml $JBOSS_HOME/server/default/deploy

    I double checked the username, password and database name settings in the file were correct

Step 9 – Check Your Work
Now I checked my handy work before moving on to the next step.

  1. I made the JBoss run script executable
    $ chmod +x $JBOSS_HOME/bin/run.sh
  2. Next I ran the script
    $ $JBOSS_HOME/bin/run.sh

    It will take a while but, eventually the server will finish booting.

  3. Now I hit the basic JBoss AS home page at this URL: http://myserver/ and made sure it looked OK.
  4. Then I hit the JBoss Portal page at this URL: http://myserver/portal and checked it as well.

If you have trouble accessing your URL, there could be an issue with the address that JBoss is listening on. This can be caused by various issues with your server setup (hostname, hosts file etc.). One quick thing to try is to pass -b 0.0.0.0 as an argument to the run.sh script – this tells JBoss to listen on all addresses, which might help you figure out where the issue is.

Step 10 – Setup JBoss Portal as a Service

  1. I opened the file $JBOSS_HOME/bin/jboss_init_redhat.sh in an editor.
  2. First I double checked the environment variables set at the top of the file (particularly JBOSS_HOME and JBOSS_USER) were correct.
  3. Then at the very top of the file, below the shebang line, I added the following 3 lines to make the script compatible with the chkconfig system

    # Comments to support chkconfig
    # chkconfig: 2345 80 40
    # description: JBoss Portal

    I saved the file and exited the editor.

  4. Then I made it executable

    $ chmod +x $JBOSS_HOME/bin/jboss_init_redhat.sh
  5. Next I linked the script into the init.d directory

    $ ln -s $JBOSS_HOME/bin/jboss_init_redhat.sh /etc/init.d/jboss
  6. Then I ran chkconfig to register the script for the correct run levels

    $ chkconfig –add jboss
  7. I then started the server by hand to double check my work and also just to get the server up and running without having to do a reboot

    $ service jboss start
  8. Then I hit the JBoss Portal page once again and checked that it came up properly

Step 11 – Have A Beer
It is always appropriate to reward yourself with a craft, micro-brewed or home-brewed beer!