Archive for the ‘Java’ Category

Getting Behind Python: Sun Hires Python & Jython Developers

Tuesday, March 4th, 2008

As both a fan and user of the great technologies Python, and the Sun JVM (primarily via Java), jython.png I was very happy to come across this eWeek article which says that Sun announced the hiring of two key Python engineers. You can read more about the hiring of Ted Leung and Frank Wierzbicki at their respective blogs.

I had pretty much written off Jython as being dead quite some time ago, but luckily it has had a lot of recent activity and is starting to catch back up with C-Python. By both hiring key JRuby and Jython developers, it looks like Sun is making sure the JVM stays relevant beyond Java and continues to evolve as what in my opinion is the best option for cross-platform applications.

Having a long background in ColdFusion (an Adobe language which compiles down to Java bytecode and runs on the JVM), I’ve seen first hand the benefits of moving a language to the JVM, and I look forward to seeing more progress on both JRuby and Jython on the JVM.

Maven: Including Axis2 Artifacts into EAR’s

Wednesday, January 30th, 2008

I’m going to skip over a rant about how much Axis2 sucks in order to pass a tip on how to include Axis2 artifacts (AAR’s, MAR’s, etc) into an EAR file using the Maven plugin to package EAR files, maven-ear-plugin. It’s a pretty obvious solution but if you’re in a hurry like I’ve been to convert a project from a single WAR to one with several EJB’s, a WAR, etc, there are a lot of new things to learn all at the same time (how classloading works with EAR’s in JBoss, how to share the same Hibernate transactions between your web app and EJB’s, etc), and this was one of those little things which wasn’t immediately obvious. If you’re seeing exceptions like these when trying to package an EAR in Maven:

[code]
[INFO]
————————————————————————
[ERROR] BUILD ERROR
[INFO]
————————————————————————
[INFO] Failed to initialize ear modules

Embedded error: Unknown artifact type[mar]
[INFO]
————————————————————————
[DEBUG] Trace
[/code]

… you’ve came to the right place. :)

There are many ways to setup your package structure under Maven2 to build EAR’s, but essentially what I do is create a root level project which packages a given application into an EAR, and nothing more. Once you have the maven-ear-plugin setup for the most part, all that you need to do is to tell the Maven EAR Plugin to treat the various Axis2 pieces of shit packages like JAR’s:

[code]

maven-ear-plugin



true






[/code]

This is just one of many gotcha’s I learned about while working on an aforementioned project. In fact it’s really pretty hard to find any comprehensive documentation on getting EJB3, Spring, and Hibernate working together on JBoss with a typical Java web application, especially while using Maven. I have a sample project I used to work through some of the integration issues with this, and will hopefully be able to wrap it up and add it to Google Code in the next few weeks to provide an example of getting all of these technologies to play together.

News Flash: Apple Finally Released Java 6 for MacOS X!

Friday, December 14th, 2007

UPDATE: I was up too late, and didn’t notice that it’s update 6 for Java, not Java 6. This is just another update for Java 5… *sigh*

I’ve been up pretty late doing a little work and tying-up some last minute Christmas shopping, and out of the blue this Apple update window popped-up:


Java 6 for MacOS X is here!

I’m super glad to finally see an Apple release of Java 6! I’ve been developing with SoyLatte lately and was going to write a quick tutorial on how to get it up and running on MacOS X, so I guess I don’t necessarily need to do that now. Although given Apple’s secrecy about Java releases and the future of Java on MacOS X, it certainly doesn’t hurt to have an alternative around.

I’m still on Tiger– I assume Leopard users are seeing this update too?

Java 6 for Developers on MacOS X: SoyLatte Reaches 1.0

Thursday, December 6th, 2007

For those many of you (including myself) who have been waiting almost a year now for Java 6 to be properly supported on the Mac, the wait is over if you’re a developer– Landon Fuller has released SoyLatte 1.0, which is a port of FreeBSD Java 6 to MacOS X which will eventually end-up as part of the OpenJDK. This seemed to come together very quickly once Leopard came-out and was missing Java 6.

Though Java 6 didn’t provide quite as much new syntactic sugar as Java 5, the performance increases in Java 6 are pretty dramatic. I highly recommend giving Java 6 a look if you’re doing any development which runs on the JVM if you haven’t already switched.

Keep in mind that this is mostly a developers port as it’s not yet integrated into Cocoa, the MacOS X native GUI. Desktop applications will run under X11, but this is the next hurdle to tackle (though it seems to be a pretty big one).

Dilbert Groks Java

Friday, September 7th, 2007

I can’t say I’m an avid reader of Dilbert by any means, but today’s comic features a mention of Java:

Don’t bother. I already coded a Java app to do everything you do.

Good stuff.

Development in Mac OS X: How To Fix the Lame Default Font in Eclipse

Wednesday, July 11th, 2007

The default Eclipse for Mac OS X font is kind of annoying since it’s way too big and reminds me of MS Comic Sans. If you try to replace it with one of the wonderful ProggyFonts without tweaking them first, you get stuck with anti-aliased fonts that look terrible. During my quest to get past this problem, I came across a way to setup a more programming friendly font in Mac OS X which uses one of the Proggy Fonts in aliased mode.

Although the above instructions aren’t terribly explicit, you can find the various Eclipse font settings under Eclipse > Preferences > General > Apperance > Colors and Fonts once you’ve installed the font and made the appropriate changes to your System Preferences.

Java 6 Shipped With Ubuntu 7.04

Friday, April 20th, 2007

Ubuntu 7.04 was recently released, and is the first Linux distribution to include the Java SDK as a standard part of the Operating System. This is exciting news and goes to show that the effort put into open sourcing Java is starting to pay dividends. Being that Java was non-free before version 6, it was not included in any standard distributions (that I know of at least).

Now if only Apple would get their act together and ship a version of Java 6 which was final instead of the current Alpha which was last updated in September. Or even better, maybe Sun could actually produce a Java SDK for Mac OS– wouldn’t that be novel?

A Good Java NIO Tutorial

Tuesday, April 10th, 2007

One of the newer features of Java as of 1.4 is non-blocking IO, yet it’s very hard to find decent documentation about it or even a simple tutorial. NIO is a very powerful feature but easy to get wrong given it’s complexity. However, James Greenfield, an engineer for Amazon, recently announced that he’d put up a tutorial for NIO, including a lot of important details of using NIO with SSL.

Tomcat 6 Surpasses 16,000 Simultaneous Connections

Thursday, April 5th, 2007

Fillp Hanik recently posted a blog entry about a load test comparison he did using Glassfish, Jetty, and Tomcat 6 using the new NIO (non-blocking io) connectors in which Tomcat 6 was able to handle 16,000 connections. As always load tests should always be taken with a grain of salt, but it certainly did produce some interesting results (especially when compared to other servlet containers).

I’ve been working on a sizable project at work that uses NIO under the hood, but luckily I’m using a 3rd party library which provides the network connectivity for me. It seems that NIO is very hard to implement correctly, but if you can, the performance advantages are definitely worth the effort. I’m only a few days away from starting to do some load testing on my work, so I’ll be interested in seeing the performance improvement over the section of code I’m replacing which uses standard IO (not to mention the various synchronization and thread consumption problems I’ll be fixing).

Being able to quickly handle a large number of concurrent connections is definitely a requirement for today’s AJAX applications, and it’s good to see an NIO based connector from someone other than Jetty.

Google Releases Guice: A Java Dependency Injection Framework

Sunday, March 18th, 2007

Google recently released yet another interesting piece of Java machinery, Guice. Given the direction that Spring 2.0 is going in, this looks like a good alternative if you’re looking for a simple dependency injection framework. If you’re curious about what is different between Guice and Spring, you can read more about their differences here.