RSS Feed Subscribe to RSS Feed

 

Swing, Webstart, Maven – a difficult combination

I have spent the last few weeks struggling with a Swing app that I wanted to deploy via Webstart and build using Maven, via the the Webstart Maven Plugin. It has been a hugely painful process. I found the plugin documentation difficult to follow, struggled to understand the subtle config differences in jnlp, took longer than I expected to get jar signing working, had problems with webstart caching and suffered through a plethora of vague error messages. I found this posting where the author vowed to never use Webstart again, and I can empathize. Postings of people asking for help with Webstart problems certainly aren’t difficult to find. Using maven to build the jnlp provides some conveniences, but introduces new problems too. Overall, I’d prefer to avoid using a Swing/Webstart/Maven solution again.
Read more

Tags: , , , , ,

JavaOne: Tuesday’s Keynote

This morning’s Keynote at JavaOne contained a few interesting announcements, including

  • JDK7 for MacOS X Developer Preview announced by Hasan Rizvi (SVP @ Oracle). Available here.
  • Java FX to be open sourced, and it will be proposed to the JCP (Confirmed, see press release)
  • JDK8 will be released in the summer of 2013 (not 2012 as previously discussed), as announced by Adam Messinger from Oracle

There was also mention of an Oracle Java Magazine, which I confess I had never heard of before.

For a summary of this morning’s announcements, see here.

Overall, not the most exciting keynote I have seen. It opened with a presentation from Juniper Networks. I didn’t find the topic of “Programming the network” to bring networks and apps closer together particular relevant for me personally. They then rolled out a bunch of other corporate folks from the likes of Intel, Redhat, IBM and ARM. The Twitter guy did announce that Twitter are joining OpenJDK as well as the JCP though.

On to the sessions…

Tags: ,

JavaOne: Comparing Java Web Frameworks

The first talk I attended at this year’s JavaOne was “Choosing Your Java Web Framework” by Richard Pack from salesforce.com

Overall, I found this a really interesting talk. It was lacking in any sales pitch, nor did it have the unquestioning devotion to one particular framework that I felt some of the Java FX talks had. Instead it seemed like an unbiased look at web frameworks in general and a handful of frameworks in more detail, based on Richard’s extensive and hands on experience and SalesForce and Hyperic.
Read more

Tags: , , , , , , ,

@JavaOne

I am at JavaOne 2011 right now. Always fun and it seems to be bigger than last year, with a huge selection of talks and presentations (although frustratingly flaky wifi!).

Some of the themes of this morning’s keynote talk were JavaFX 2.0, what will be coming in Java 8 and a new Oracle NoSQL Database. There are some links here, here and here (and I believe the videos will be posted soon here).

I just attended a very useful Java Web Framework comparison talk that I will try to post about shortly. I also met up with some of the DZone team. For now, I am going to some JavaFX talks.

If any of you are attending, let me know!

Tags: ,

Spring MVC Hello World

There is a good Getting Started with Spring MVC blog post over on the Spring team blog.

I have created several Spring MVC projects for both work and play, and am attaching my own simple version of the HelloWorld example here, based on the Spring blog example.
Find my maven ready source here.
Like my previous JSP/Servlet example, I find these templates useful for getting prototypes up and running.

Tags: , , , , , ,

SLF4J & Logback is the new commons-logging & log4j

Interesting post on which logging framework to choose from the logging mess.

I still default to log4j, but it sounds like logback (as the new alternative to log4j), wrapped by SLF4J (as the new alternative to commons logging) is the way forward. Both are written by Ceki Gülcü (blog), the original log4j author.

Tags: , , ,

JSP EL statements not being evaluated

On several occasions I have had problems with EL (Expression Language) statements not being evaluated.
As an example, you add a statement to a JSP like
$(2+2), expecting the JSP to simply display 4, when it in fact displays the raw statement, i.e. $(2+2).

After digging around the web, I found a number of points to check…

Read more

Tags: , , ,

Setting up multiple instances of Tomcat

With multiple tomcat instances, each can run in its own JVM, have its own configuration and can be started/stopped independently.

One approach to doing this would be to have multiple, full tomcat installations. This article instead details how to install tomcat once (in CATALINA_HOME) but have multiple independent instances (by utilizing CATALINA_BASE). This is a more streamlined approach that makes creating multiple instances easier and also simplifies upgrades/rollbacks of tomcat.

Read more

Tags: , ,

EasyMock

EasyMock is an open source library for creating, and defining the behavior of, mock objects as part of your unit tests. This article describes how to use EasyMock (v3.0), including its record/playback approach, after setting the context with an brief introduction to unit testing in general and the associated need for mock objects.
Read more

Tags: , ,

Hamcrest Matcher

As a follow up to the Hamcrest post I made yesterday, I wanted to post an example of my own Hamcrest matcher implementation. This matcher tests if a string contains a specified number of substrings.
An example usage could be:


    String sql = "select a,b,c from tableA";
    assertThat(sql, hasNumberOfSubstrings(",", 2));

See the source code below. I have been reading up on OSS licenses recently and decided to release this using the same license as Hamcrest – the new BSD license.

I have also attached a jar which includes the associated unit tests, although you will need the hamcrest-unit-test project to compile, which can be downloaded as part of the hamcrest all-in-one jar.
Read more

Tags: , , ,