Thursday, October 30, 2014

Deploying Spring Petclinic demo application to JBoss/WildFly

Spring Petclinic is a very good demo application to experiment with - it is simple enough, yet demonstrates quite a good number of features. Usually I deploy it to Tomcat and obviously don't have any issues with it - it just deploys, runs, and works as expected.

Recently, however, for demonstration purposes, I needed to deploy this application to JBoss (or WildFly). And this is not as straightforward as one might expect.

First I tried with JBossAS 7.1.1.Final. The deployment fails with the following exception:

11:42:38,247 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/petclinic]] (MSC service thread 1-3) Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in class path resource [spring/business-config.xml]: Invocation of init method failed; nested exception is java.lang.NoSuchMethodError: javax.persistence.JoinColumn.foreignKey()Ljavax/persistence/ForeignKey;
  at [spring-beans-4.1.1.RELEASE.jar:4.1.1.RELEASE]
  at [spring-beans-4.1.1.RELEASE.jar:4.1.1.RELEASE]

The latest Petclinic application (as of October 2014) uses JPA 2.1 and JBoss 7.1.1 bundles JPA 2.0 APIs. So I decided that it should probably work out of the box on WildFly since it comes with JPA 2.1 jars. And it did - the application deployed just fine, but then there's another library that prevents the application from operating properly - Dandelion:

Exception starting filter dandelionFilter: com.github.dandelion.core.DandelionException: The protocol vfs is not supported. 
        at com.github.dandelion.core.utils.ResourceScanner.scanForResourcePaths( [classes:] 
        at com.github.dandelion.core.utils.ResourceScanner.findResourcePaths( [classes:] 
        at com.github.dandelion.core.bundle.loader.spi.AbstractBundleLoader.loadBundles( [dandelion-core-0.10.0.jar:] 

The issue was reported but at the time of writing this post the fix wasn't published yet. So hopefully Dandelion v0.11.0 will be capable to be deployed on WildFly.

So to overcome this and deploy Spring Petclinic (at the state of October 2014) to WildFly 8.1 one would have to get rid of the dependency on Dandelion, and rewrite some of the JSPs not to use Dandelion taglibs. Then the application deploys and works just fine.

So after making all the fixes I got Spring Petclinic running deployed to WildFly and could monitor it with XRebel:

Saturday, September 6, 2014

JCrete 2014

I had a honor to take part of the discussions at the JCrete unconference.

JCrete 2014 - The Hottest Java Conference in the World (literally) from Heinz Kabutz on Vimeo.

Geerjan Wielenga has written a good overview of the event in his blog, and so did Yakov Fain. I'd like to second their opinion on the fact that JCrete is awesome.

The event is invite only, and this makes sure that the crowd that gets together has a very good motivation to collaborate on ideas, discuss various topics - all the attendees contribute to the event, everyone is a speaker!

I have attended many discussions in the official part - at the scheduled sessions. But there was also "unofficial part" - the discussions were happening everywhere: in the car while driving to Falassarna, at the beach after lunch, at the dinner. So the density of useful information and ideas you get at this event is very high!

I have attended the discussions about Gralde, developer tooling, profilers, JIT & JITWatch, Java 8 lambdas, sun.misc.Unsafe, Asciidoctor, hardware performance counters, GC- and lock-free programming, and maybe some more. There's a wiki page that includes notes for the various sessions, contributed by the attendees.

The dates for JCrete 2015 are already announced, so if you like geeky discussions, Mediterranean sea and olive oil - I definitely recommend to attend the event.

Friday, August 22, 2014

MVC in Java EE

Java EE is getting MVC. And the crowd is going wild! :)

I'm actually quite positive about this move, although this came a little too late, in my opinion. Java EE has been criticised for not having MVC support, but it stayed opinionated and sticked with JSF. Apparently, MVC is actually a part of JAX-RS, so to speak. Not in the same spec though, it it will have integration points with JAX-RS. And there's also some sort of MVC support in Jersey already.

It is actually cool that it happened, just surprising that it took so long.

Friday, July 18, 2014

IntelliJ IDEA: Have you tried Search Everywhere yet?

The Search Everywhere action, invoked with double Shift key press, was added in IntelliJ IDEA version 13. I guess, most of the IDEA users/fans know about this feature and are enjoying it. At first glance, it just provides the means for search. You can search "everything": classes, files, symbols, actions, settings, etc. However, Search Everywhere widget is full of easter eggs.

Try using to jump between the search result groups. Or try left arrow to navigate in the history of search entries. But also, depending on the nature of the item that was found, the widget can provide some extra actions, like in the screenshot below: the "Show Navigation Bar" entry has an extra switch - on/off - showing that you can actually invoke this action.

Search Everywhere is a little gem in IntelliJ IDEA and all its features are yet to be discovered ;)

Saturday, June 14, 2014

Tuesday, June 3, 2014

RebelLabs: Java Tools and Technologies Landscape for 2014

A great report on Java Tools and Technologies, aka JavaTnT :), was published just recently. As usual, one may say that those is a "biased" numbers. Well, the numbers might be biased. But it is not really clear, the bias agains/towards what?

There are discussions at Reddit and Hackernews about the report. Some would say that the numbers are legit. Some would say that the numbers do not make sense. Of course, the numbers do not make sense if you don't like them ;)

In any case, the results present the JavaTnT landscape pretty well. It would be nice if more people would care to enter their data during the survey instead of arguing about the numbers afterwards. Oh well.. first world problems :)


At DevNation event I picked a very nice device - Mbed NXP LPC1768 and a Xively development board. It is surprisingly easy to program: you don't have to install any software on your own computer - just log in at website, they provide a web-based IDE. The compiled program can be downloaded directly into the host device via USB (just like if it was a flash drive). When the device is reset, the latest binary is picked by the system and executed. Embedded programming have never been easier! :)

DevNation 2014: post factum

DevNation was fun. It would have been even more fun it it wasn't co-located with Red Hat Summit. It basically fell into the same trap as JavaOne with Oracle Open World - being just a side event of the "real" conference.
The schedule was actually awesome but lots of talks didn't receive the attention they deserved due to the dispersed focus and many parallel tracks. The event really has a great potential to become the next big even for Java (and not only Java). There are quite a few videos available from the talks. Here are some interesting ones:

Neal Ford - Opening Keynote: Agile Architecture and Design.

Jason Greene - JVM Finalize Pitfalls: How to Avoid the Danger

 The positive side of DevNation event is definitely the location. I love San Francisco - very nice city!

Friday, March 21, 2014

DevNation 150OFF

A sneak peek into my session about JRebel at DevNation conference in San Francisco :

Check out the full schedule here:

Register with promo code 150OFF and get $150 off the registration fee!

Thursday, February 27, 2014

GeekOUT Conference Early Bird Registration is Live!

Registration to GeekOUT conference in Tallinn is now open! Geekout in numbers:
  • 15 amazing invited talks
  • 14 great speakers
  • Hand-picked vendors @ Demogrounds
  • Kickass party
And a special extra: Reactive Programming workshop with Erik Meijer!

Disqus for Code Impossible