Rob Williams is a probabilistic Lean coder of Java and Objective-C. Rob is a DZone MVB and is not an employee of DZone and has posted 170 posts at DZone. You can read more from them at their website. View Full User Profile

More JEE6 Fun: See If You Can Make It Work!

  • submit to reddit

Well Glassfish 3.1 is finally out. Didn't they say it was going to come out at JavaOne?? 5 months later.. So the whole thing that was coming in 3.1 that was super appealing was the embedded server, which, with Arquillian, was going to make it possible to do real integration testing finally (in Java‘s 16th year).

I installed Glassfish, then went to the site to find the eclipse update site URL, plugged that in, installed everything, and couldn‘t figure out if it was done. Earlier in the day, installing the TestNG plugin, something similar happened: it seemed to install it, but then I never got a confirmation or had it ask me if I wanted to restart. (The Update Manager has already invaded my dreams, so at this point, I start thinking ‘oh jesus, here we go again…‘).

The plugin has changed in this iteration. After install, you go to the Servers view and it shows the embedded Glassfish server. Then I went to create a project and filtered the archetypes on the Maven wizard page to Weld and was thrilled to see they had a new one. The new one, unlike the old family of 4, didn‘t have any annotations on it, so was not sure whether it was going to include JSF2 and JSP. When I finished, I looked around at the readme, etc. Looked good. Then the fun started.

First off, I was lucky that I had just wrestled with this issue on another project, but Glassfish did not recognize the project that was generated by the archetype. You have to go into the project properties and convert it to a faceted project, then turn on the dynamic web app stuff. Sure enough, GF saw it after that, but unfortunately, it still refused to deploy it.

Then it turned into the usual farce. A Java one? No, a typical computing one that unfortunately is still common 50 years into the revolution: first a spurious message, then a long thread of stupid config kludges. The bogus message was that Glassfish couldn‘t find any EJBs. Then in the server.log file, there were a bunch of messages about not being able to find logger classes. Generally, class not founds are easy. Ironically I had been reading some other threads earlier in the day about the stupid configuration of logging in Glassfish. (Logging is one of the 4 signs of the Java Apocalypse: 16 years, a JDK release, then a standard too, later, and it‘s a buggered up mess. Seriously, if you had the choice between working out the problems with Glassfish‘s logging wiring and applying for a building permit for a hillside lot in Malibu, you‘d be thinking ‘well, at least the coastal commission inspectors have to perform to keep their jobs.‘)

The thread is below. I thought ‘well there is a simple answer at least.‘ But adding those logger dependencies did not fix this for me. The app will still not deploy. There is a profile in the pom file that will run the Arquillian tests. Dying to see that. The project builds but the deploy doesn‘t work.

Ironically, Xcode 4 went final yesterday with iOS 4.3. I used to think I was just a whiney bitch because I was 15 years in a community where everyone else shamed people who complained about the fact that things didn't work. Then I tried the iOS stuff. Getting to the gotterdammerung phase. I am still rooting for Red Hat especially, and JEE6 is a very worthwhile release, but come on. Put a clock on something. JSF 2 took what, 5 years?

I have blogged before that the problem is that the illusion of promoting choice has produced a cabal of fascists. What choices do we have here?? All I‘m trying to do is take Weld (CDI RI from RH) and deploy it on the Sun app server?? If that can‘t work out of the box with an example, this ‘platform‘ is a doomed illusion.



Published at DZone with permission of Rob Williams, author and DZone MVB.

(Note: Opinions expressed in this article and its replies are the opinions of their respective authors and not those of DZone, Inc.)


Andy Gibson replied on Fri, 2011/03/11 - 1:55pm

You aren't alone, trust me.I can say that the EJB not found error message usually means that some other error happened (like it couldn't configure JPA properly) and it bugged out before it got to the EJB loading stuff and hence, no EJBs. Its a very misleading message, and often has nothing to do with the root problem.

 Getting all this stuff to work together really is a nightmare and it really makes you wonder whether anyone has actually tried for something other than the smallest sample prior to releasing it. I will say that there's probably a good chance of getting it to work, but you are missing the minor tweak to get it going. Not sure about the weld archetypes, they were often buggy which is why I wrote my own.

 On the other hand, when you look at Spring and the fact that very little (if anything?) has broken over the last several years from version to version and it still provides a better user experience and integrates nicely. I've been playing recently with the Spring testing stuff and its fantastic, and whats more, I got it working in less than an hour.


Cay Horstmann replied on Sun, 2011/03/13 - 1:12am

"All I‘m trying to do is take Weld (CDI RI from RH) and deploy it on the Sun app server". You are a brave man indeed. That's like saying "All I'm trying to do is to take this motor from a 2011 Prius and put it into my 2010 Prius". GlassFish has an implementation of Weld, which is a bit behind the latest and greatest. If that's not good enough for your need, it's actually possible to add a different version into your web app, but that's like running the Prius with two motors. It's amazing if it works, but I wouldn't expect it to be trouble-free.

Henk De Boer replied on Sun, 2011/03/13 - 4:08am in response to: Cay Horstmann

This is great fun! Who doesn't love just copying an implementation from Red Hat to Debian? This stuff should just work right?

Another hobby of my, copying internal JDK classes from the Oracle implementation to the IBM one and see if things keep working. If it doesn't, I suggest the platform must doomed, right?

Rob Williams replied on Mon, 2011/03/14 - 6:55am in response to: Andy Gibson

Hi Andy, probably time to look at Spring again. I thought I'd give preference to standards. As I said, clearly that's pointless.

Rob Williams replied on Mon, 2011/03/14 - 6:58am in response to: Cay Horstmann

I got it working, Cay. And I didn't employ any techniques that come close to differentiating a quadratic equation (something I did in high school). And, no, I disagree with your characterizations. Take the names (e.g. Weld, Glassfish) out of it and restate your thesis: 'I tried to deploy a CDI RI on a CDI container.' Yeah, that sounding absurd says everything you need to know about the state of Java 15 years later.

Rob Williams replied on Mon, 2011/03/14 - 7:15am in response to: Henk De Boer

Henk: thanks for your witless response. You make my argument for me.

Have you ever used maven?? Would be totally simple to put out a version of this that works as soon as you install it. Go back and see the solution on my blog: the stupid injectable logger was the culprit. Removing it was all it took to deploy the app. One of the great ironies of this is that the pom actually has a bunch of profiles in it. So the provisions are there for variation (including one whose stated purpose is to support Arquillian on Glassfish).

You clearly haven't looked at any of this. My mentioning that it doesn't work has obviously piqued your interest because you're unfortunately typical of this platform: infantile tinkerers who not only have no drive to make things work, but who mock people who do.

It's frankly hilarious that a logger causes things like this. 15 years and a simple way to configure access to the console and a file is too much to ask for. Frankly, I don't even get injecting a log. I have a template in eclipse for making a log declaration that takes a second or two.

Liam Knox replied on Sun, 2011/03/20 - 10:54pm in response to: Rob Williams

I think you are best considering history and success ahead of standards. J2EE, J2ME, Web Services etc. there are countless 'standards' that have failed us. What do you get from adopting a failed standard? Comfort with your now sub standard system ratified by people who have every interest in you using their floored designs?

Spring gives a great demonstration in bucking a standard because it was a pile rubbish. I am just sorry people are still swallowing the word 'standard' as the equivalence of 'good' or 'proven'. Nothing could be further from the truth.

Fab Mars replied on Wed, 2011/03/23 - 12:04pm in response to: Cay Horstmann

+1 to Cay. I just migrated my company's website (EE5, Hibernate, EJBs, JSF) to EE6 (incl CDI) and I didn't have any problem (oh yes I had, with GF 3.0; but GF 3.1 is mint!)

Gar Labs replied on Sun, 2011/10/23 - 9:59am

Glassfish is an Oracle-sponsored application server project. This was not originally owned by Oracle. The creators were Sun Microsystem and it went to Java EE and finally to Oracle. Looks like glassfish has found a home at Oracle. - GAR Labs

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.