Jun 11

I mean really, why doesn’t the JMS spec dictate that there is a programatical way to determine if a JMS Connection is open or connected?

I have built a JMSBroker to handle all the internal JMS stuff to create connections and get access to Queue’s and Topics, but the biggest issue I have to deal with is reconnection.

It seem that we often have connection issues to the JMS Server, and so want to have the underlying JMS client side layer automatically handle this and retry the message. To do this I have to use the following logic.

Build the Packet,
Try to send it,
If that works YAY packet out.
Otherwise…
work out what failed,
- which could be either the connection or the session.
- Theres no way to know except which method call failed, so the try catch loops have to be tight with error handling in multiple places.
- Re-connect each of the broken bits, and go back to the start.

Would it be much nicer to do:
- getConnection() – checks if cached connection is open, if so returns, else creates a new one and returns.
- getSesison() – checks if cached session is open, if so returns it else calls getConnection().createXXXSession()
- Message uses session to send out..

Now isn’t that cleaner…

I think so.

Apr 28
Trying Eclipse – Part 1
icon1 Steve Mactaggart | icon2 Java | icon4 04 28th, 2007| icon3No Comments »

I have long been an Eclipse Junkie, but recently have found that I am hearing more and more about NetBeans, even using it in parts over the last 12 months to do some quick UI work. So I have now undertaken a serious effort to get my projects working and editable inside NetBeans.

I’m running the 6.0 dev version M8, and so some of my issues may just be due to the Dev nature of the build.

So in this post I’ll give my inital feelings, then look at later ones as to pros and cons of NetBeans vs Eclipse.

Straight off the bat its nice and small. 40 odd MB for the NB IDE version, in comparison to 150+ for the Eclipse / WST bundle. I guess NB is a bit bigger as I used the Update Center to get all the editing tools for the web stuff, but still feels way under the 150+ that Eclipse is.

Maven integration is COOL. With a capital Cool… I just check out each of my modules then do Project Open and boom… Project is open, all dependecies are downloaded, and different code sections are layed out nicely.

Things I miss, or can’t find yet:
- A problems view for each project? Must be there somewhere but can’t see it.
- Collapsing packages to those that only contain classes or multiple sub packages
- Sync the Package Tree and selected file.

But so far so good.. Update later

Sep 5
JDK 6.0 on Ubuntu
icon1 Steve Mactaggart | icon2 Java | icon4 09 5th, 2006| icon31 Comment »

After hunting around to get JDK6.0 Beta2 on ubuntu working, I found a post on the debian-java mailing list that shows some simple changes to allow java-package to generate a debian package correctly.

http://www.mail-archive.com/debian-java@lists.debian.org/msg10870.html

From the site it is:

Adapting java-package to 6.0 was nothing more than trivial.

(1)
# cd /usr/share/java-package
# cp -ax sun-j2sdk1.5 sun-j2sdk6.0

(2)

sun-j2sdk.sh is the script that handles the Sun JDK (you know better than me) and it needs only a few tweaking:

# diff -u sun-j2sdk.sh.orig sun-j2sdk.sh
— sun-j2sdk.sh.orig 2005-04-22 19:33:46.000000000 +0200
+++ sun-j2sdk.sh 2006-05-16 22:01:28.948657750 +0200
@@ -35,6 +35,11 @@
j2se_expected_min_size=130
found=true
;;
+ “jdk-6-beta”*) # EXPERIMENTAL
+ j2se_version=6.0.0+beta-${archive_name:17:2}
+ j2se_expected_min_size=100
+ found=true
+ ;;
esac
;;
“ia64-linux”)

Now make-jpkg handles Java 6.0 Mustang binary snapshots as it dows with 5.0 releases.

$ fakeroot make-jpkg jdk-6-beta2-bin-b84-linux-i586-11_may_2006.bin

$ ls sun*
sun-j2sdk6.0_6.0.0+beta-84_i386.deb

The only changes I had were that I had to change
j2se_version=6.0.0+beta-${archive_name:17:2}
to
j2se_version=6.0.0+beta-${archive_name:10:1}

This was due to me using the jdk-6-beta2-linux-i586.bin binary instead of the one specified in the thread.

Jun 17
Why is it a little cross?
icon1 Steve Mactaggart | icon2 Java, Technology | icon4 06 17th, 2006| icon3No Comments »

Ever wondered what made the developers of windows choose the icons for close, minimise and maximise?

It came to me the other day that the choice for the close button has more than one meaning.  Yes the cross is standard for no, cancel, remove which is basically what you are doing when want to close the window, but another more accurate term came to me. 

When you want to leave somewhere you “Exit” the building, so taking the visuals litterly when you click on the close icon, you are X-ing it, or X-it-ing.

So now when ever you click the little close button you can rememeber that not only are you closing the window, but X-it-ing it too.

May 31
Linux Tomcat Chkconfig Script
icon1 Steve Mactaggart | icon2 Java | icon4 05 31st, 2006| icon3No Comments »

I’ve been meaning to post this for a while, this is my script that can be used to allow tomcat to start and stop with the server cleanly.
It will startup tomcat as one of the last services (95) and shut it down pretty early too.

Feel free to take it, I primarly posted it here so that I can find it when I install tomcat on a new server.

#! /bin/bash
#
# tomcat          Start/Stop the Tomcat Http/Servlet server.
#
# chkconfig: 2345 95 65
# description: Tomcat is a java based HTTP/Servlet server
# processname: tomcat
# pidfile: /var/run/tomcat.pid

# Source function library.
. /etc/init.d/functions
. /etc/profile

RETVAL=0
TOMCAT_HOME=/usr/local/tomcat
# See how we were called.

start() {
echo -n $"Starting Tomcat "
$TOMCAT_HOME/bin/startup.sh
RETVAL=$?
echo
[ $RETVAL -eq 0 ] && touch  /var/lock/subsys/tomcat
return $RETVAL
}

stop() {
echo -n $"Stopping Tomcat "
$TOMCAT_HOME/bin/shutdown.sh
RETVAL=$?
echo
[ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/tomcat
return $RETVAL
}

restart() {
stop
start
}

case "$1" in
start)
start
;;
stop)
stop
;;
restart)
restart
;;
status)
ps ax | grep $TOMCAT_HOME
;;
*)
echo $"Usage: $0 {start|stop|status|restart}"
exit 1
esac

exit $?
May 15
Playing with Netbeans Mobility Pack
icon1 Steve Mactaggart | icon2 Java | icon4 05 15th, 2006| icon3No Comments »

Recently I installed Netbeans 5.0 to try out the Matisse GUI editor, and so far its been great.  Now being an eclipse person its hard to cross over to NB full time, so i’m just using it for my GUI creation and doing all the heavy lifting in eclipse.

A new project at work relates to Mobile applications, thus brining be back to Netbeans again. After listening to the Java Posse and hearing about the Netbeans Mobility Pack I thought now is a good time to try it.

I have little to no experiance with MIDP applications, but within 10 mins of getting the Mobility Pack installed, I had a functioning application working and testable in a simulated phone. Ok, so it didn’t do much, but it did at least let me get my feet wet without all the extra work.

I especially like the Flow Design section that allows you to drag and drop links between screens to manage the navigation.

Apr 6
Java Gaming
icon1 Steve Mactaggart | icon2 Games, Java | icon4 04 6th, 2006| icon3No Comments »

After listening to The Java Posse podcast, I heard about a few Java games written that start to show off the performance of java in a game development.  I’m sure there are heaps more available, but so far I have found and tried:

And have on my list to try

Feel free to post a comment here on more games..  If I find may more or have any review I’ll keep you updated.

Aug 26
Building and installing mod_jk
icon1 Steve Mactaggart | icon2 Java | icon4 08 26th, 2005| icon3No Comments »

I can never remember where mod_jk’s sources are and the way to build it, so here is a quick reference for me to remember.

To use aspx install the httpd-devel package via apt-get

Apache mod_jk
————-
# cd /usr/local/src
# wget http://apache.mirror.pacific.net.au/jakarta/tomcat-connectors/jk/source/jakarta-tomcat-connectors-current-src.tar.gz
# tar xzvf jakarta-tomcat-connectors-current-src.tar.gz
# cd jakarta-tomcat-connectors-1.2.10-src
# cd jk/native
# ./configure -with-apxs=/usr/sbin/apxs
# make
# make install

Jul 25

The Konfabulator widgets are something that I’ve played with a while ago, and really looked at building a couple, but got caught with having to pay for the runtime to run them.  Now Yahoo! is looking at releasing it for free, it may be a more attractive platform.

Macworld: News: Yahoo! acquires Konfabulator

Yahoo! Inc. on Monday will announce the acquisition of Konfabulator, a Macintosh and Windows application that allows users to run mini files known as Widgets on their desktop — the same model used by Apple for its Dashboard application. Yahoo! company executives said they would also be giving Konfabulator away for free, completely doing away with the US$19.95 currently charged for the product.

Tags:

Jul 18
Tom Riddles Diary (via AJAX)
icon1 Steve Mactaggart | icon2 Cool Stuff, Java | icon4 07 18th, 2005| icon3No Comments »

A very cool page I just stumbled upon (via the AJAXIAN blog) is a site that simulates Tom Riddles Diary.

For those who aren’t Harry Potter fans, Tom Riddles Diary contained a copy of Tom Riddle and would talk to people via them writing in the diary.  This website works in much the same way, you enter text onto the page and Tom answers the questions.  It works all in realtime using ajax technologies.

Pretty cool.

Check it out at:
http://pandorabots.com/pandora/talk?botid=c96f911b3e35f9e1

I asked it questions about how it works, and what it is. It answers the questions well. Even things like what it the capital city of …. seems to work.  But I did stump it with the Atomic Weight of Gold… I guess not everything can know everything.

Play and feel free to comment here on any interesting questions to ask.

Now playing: steve@gillmor.comGillmor Gang Goes East

Tags:

« Previous Entries