Recent Posts

RSS Feeds

GlassFish & TopLink?

Ok I admit that in Ocotber I was a bit distracted but it totally amazed me when I found out last night that Oracle open sourced 'TopLink Essentials' as part of Glassfish. Looking at this the initial code was checked in in mid October, that is amazing. Why did I not hear about that? Seems like big news to me... But maybe it is just me, I first heard of TopLink when it was a Smalltalk product. Ah showing my age again...

So is Oracle turing over a new leaf in thier approach to Open Source?

I'm not sure because of stuff like this. If Top Link is part of the Glassfish community why are the EJB 3.0 extensions they are offering called out as such? Why not just be 'Glassfish extensions'. But that could just be a lack of community participation expierence on the part of who ever wrote that doco. If you dig into the FishEye link though none of the oracle classes have been repackage to be part of the glassfish package space. Perhaps its seen as little bang for the buck but I'd feel better about their commitment if the code were repackaged to the glassfish package structure. And yes I do know that the glassfish community exists to make me feel better :-)

On the positive side Oracle is donating ADF Faces to the ASF and specifically the MyFaces team. Very cool indeed. So this is very exciting indeed. Maybe Oracle is starting to get it (we will have to wait and see).

Here are some more links about this in no particular order...

So anyway, very interesting times that we live in...

Permalink     2 Comments

Experimental: Eclipse Debugging VidCast

Ok this is not really done but its something I was toying with when I upgraded to GarageBand 3.0

Permalink     No Comments

TestNG is a leap beyond JUnit 3.8

Ok so so a little background first. I'm toying with testing the JSF runtime and wanted to run some multi-threaded tests. Everything I googled about JUnit said basically the same thing 'don't try this at home boys and girls'. But while googling I found numerous hits that TestNG had threading built into its nature. I remember when Cédric Beust first announced TestNG I thought I'd have to give that a shot but you know how things go, busy with this that or the other thing and it drops off the 'need to do' and into the 'someday I'll do that' pile. Anyway, TestNG fell into the 'today' pile last night while I was thinking about the multi-threaded test stuff for the JSF bits I wanted to test. So I downloaded the latest copy of TestNG (4.5.2) and the Eclipse plugin (4.5.0.4) and started playing around. One of the cool features in the Eclipse plugin is that you can convert your JUnit tests to TestNG tests with a Quick Fix (kind of funny that converting to TestNG is a fix :). So I clicked on my JUnit test and hit Command-1 (on Windows its Cntrl-1) and choose 'use annotations' and bada-boom bada-bing I've got TestNG tests. Quick painless and everything is working as it was before! I love it when a plan comes together.

This definitely passes the 10 minute test!

Now on to a quick tip - While playing with the multi threaded stuff I noticed that my ConcurrentAccessException was rarely happening with a few threads (3 to 6) and 20 to 30 runs of the test method. So I started poking around, turns out that 'invocationCount' causes all the invocations of the method to run in the same thread. Hmmm I thought perhaps if I put in additional methods they will all get their own thread too.

  @Test(groups={"threaded"}, invocationCount=7)
  public void testSetFactory1() {
    testSetFactory();
  }
  @Test(groups={"threaded"}, invocationCount=3)
  public void testSetFactory2() {
    testSetFactory();
  }
  @Test(groups={"threaded"}, invocationCount=5)
  public void testSetFactory3() {
    testSetFactory();
  }

  @Test(groups={"threaded"}, invocationCount=9)
  public void testSetFactory() {
    System.out.println("Thread.name = " + Thread.currentThread().getName());
    FactoryFinder.setFactory(FactoryFinder.APPLICATION_FACTORY,
        MockApplicationFactory.class.getName());
    Object factory = FactoryFinder
    .getFactory(FactoryFinder.APPLICATION_FACTORY);
    assert factory != null;
    assert factory instanceof ApplicationFactory;
  }

What do you know, problem solved. I later emailed back and forth with the google group and found that Cédric is going to be introducing a new feature soon that will make this even easier. One quick side note about Cédric, I don't think he sleeps! I was emailing back and forth with him at 12:30 am MST and I saw posts from him at 7:30am EST this morning. Caffeine must be your friend Cédric!

One other quick question/problem I ran into... When trying to use the Eclipse plugin to run groups I was not seeing my list of groups. Well turns out that you actually need to initialize the annotations with the correct type for things to work (go figure!) so anyway. I had code like this;

  @Test(groups="threaded", invocationCount=7)
  public void testSetFactory1() {
    testSetFactory();
  }
  @Test(groups="threaded", invocationCount=7)
  @ExpectedException(FooException.class)
  public void testSetFactory2() {
    testSetFactory();
  }

Turns out Eclipse allows this wrong info no problem (the groups and exception stuff must be arrays in case its not obvious at first glance), must be a bug in the incremental compiler. So when the plugin was looking for groups it could not find them because there was a type mismatch in creating them. Interesting to me because I could not find anyting in the eclipse log either ($workspace/.metadata/.log for inquiring minds).

Well that is all I have today for tips and tricks of TestNG, put in on your plate of stuff to learn about now and take it for a spin soon, you won't regret it.

In other news: I've not had a chance to play with JUnit 4.0 so there could be some really cool stuff in there that compares with TestNG. If you have played with it please comment, I'd love to hear others experience. And yes JUnit 4.0 is on my plate of stuff to learn about now :-)

Permalink     4 Comments

OK - last one about JBoss

Well this has been an interesting time, buzz is still flying that Oracle will buy JBoss and lots of fun stuff is being said. I have several comments and thoughts on this topic that would probably take more time to write down and I have so let me just respond to couple of things that I've found interesting in this post.

Of course JBoss is open source, I never meant to imply that it was not open source. What I was trying to say in particular was that the openness of JBoss is not a sure thing over the long haul because of the closed nature of the developer community. The company employees most/all of the contributors to its projects (with the notable exception of Tomcat). While there are some distinct advantages to both the company and the community in this model there are also some gotchas. Most particularly this (look for the entry titled "Rewriting versus Refactoring" posted by Bill Venners) post referenced by Yakov here.

Now contrast this with a community like Tomcat. If/when JBoss is purchased by Oracle (I truly do hope it happens, would be great for JBoss folks and make an already very hot market even hotter) there will be virtually no impact on the Tomcat project, ever. The group of developers on Tomcat are dispursed, only a few are JBoss employees. In other words the committer base is spread across several companies and several individuals that do Tomcat in their spare time. So even if Oracle buys JBoss and removes its support from Tomcat (which would never happen, just hypothetical thinking) the community would feel the blow for sure but Tomcat would go on, both in being free and in development of new free versions. If Oracle dropped its support for JBoss (again, would never happen) where would JBoss go?

Contrast this with something like Eclipse, even though many don't quite trust IBM I think its plain to see that they understand the value of community. The Eclipse.org group is independent of IBM now more than ever. The percentage of IBM committers continues to go down and the percentage of other developers goes up. Even if IBM were to go belly up (ok stop laughing) the Eclipse code base would continue to be developed and contine to be free, this is the value in an open and robust developer community.

In my engineering background I think of a robust developer community as redundancy. Redundancy is ineffecient in may ways but there is no substitute for an additional way to make oxygen if you are half way to the moon and the primary system suddenly drops dead.

So anyway that is my last post about JBoss for a while but I will have more to say about OpenSource companies and models...

Permalink     1 Comment

JBoss, OpenSource and 'sucks' all in one post again!?

First off thanks, Norman, Sam and Nick (hey Nick, good to hear from you :-) for taking the time to comment.

To address Norman's comments; I love people making money from their work in open source, as I tried to say about Sid's comments to the Business Week article. It's a pity when people work on stuff they don't care about, life is too short to waste it doing boring work that you hate. That said I'm very glad that Norman and many other great people are making their living from JBoss. I have no problem with people making money from the code base at all. My problem is that JBoss is not a commons, its direction and content is decided by a company. What is different between that and BEA, IBM etc. That is why I say it's not truly open. Sure the code is avalible, the forums are open but the development is not.

The major reason I find this troublesome is that if JBoss.com (the company) were to go away what becomes of JBoss.org (the code base). I don't know for sure and don't want to speculate. But if the base of developers were widely dispursed throughout many companies and one of the companies went away (say purchased by Oracle) then no big deal, in fact hooray for the community.

Survival of a community/organism is more likely when it is widely dispersed rather than highly centralized. That is part of my worry about JBoss as open source.

Now on to Sam's comments; I love capitalism! I'm all over people making money in fact I'm hoping to score big in the ol' capitalism system myself some day :-). I agree that open source is not communism, which is what I was trying to say about Sid's comments. Sid seems to think that people at Zend, JBoss and Sleepcat exist to make him cool software for free. Sid is a communist (i.e. one who wants a commune, not a politico from the old USSR) and I was calling him on it. I don't like commune's because the person/people in power will have everything and the people out of power will have only what the people in power think they should. Communism does not work and I don't advocate it at all. Viva La Capitialism!

While I don't totally agree with this idea 100% I like Simon Phipps idea about OpenSource as a 'Commons-Based Peer Production' economic system. Simon gave a great keynote at Colorado Software Summit in 2003 you can find here. I really liked his ideas about the commons. The idea was spurred on/based on this paper. My understanding of the basic idea (you should of course read it for yourself and get your own idea) is that the code is a common knowledge base that many become proficent on at different levels. The closest to the code are developers, they drive the code. The developers are able to monitize the knowledge base by providing support, consulting and other services that require intimate knowledge of the code and how it is built. The next level out is the group of people that provide consultation around the code base, they are experts in how to use the code and probably know quite a bit about how its built but have not had time or desire to work on a committership. They monitize the knowledge by providing the consulting services and potentially developing applications around the knowledge base. Finally there is the group of users of the knowledge base, they use the knowledge base, help each other with using the knowledge base via forums etc. This group does not necessarly monitize thier knowledge other than getting a better job somewhere. All three groups are critical to the ecosystem. JBoss has the outter two groups but does not have the inner group, the developers are JBoss.com employees. In fact, Microsoft, BEA and IBM/WebSphere all have the outter two layers in spades. That is what I don't like about JBoss's model.

And finally on to Nick's comments; Nick you hit the nail on the head on the assimilation stuff. In fact here is a great example. Also I have found in my reading on the JBoss forums related to Hibernate many examples of arrogance. Now many OS commiters are arrogant so I guess I can't call them different in that respect but I do think most open source folks could stand to be a little more humble.

For people who did not read Nick's comments make sure to check out the post he did on commercial open source stuff here it does a great job of expressing a lot of the stuff in my head that I've not taken the time to organize in such an eloquent manner. Esp relevant is the first bit on letting go of control.

Ok, thanks for sticking with me on this rather long post and I'm really looking forward to the debate.

(and BTW, Tom thanks for your comments too.)

Permalink     No Comments

Oracle buying JBoss? Who cares?

Ok, I've been following the hype and speculation about Oracle buying JBoss but the latest bit that I read on Business Week really got my dander up. Its not the article from BW that was irritating at all it was the comment by some one claiming to be 'Siddharth Gulhati'. I don't know Sid but his comment is over the top for me.

Quoth Sid;

Guys! Open source is definitely under threat, especially if the top open source players JBoss, Zend and Sleepycat are ready to sell off their passion and commitment for a chunk of money. I would like to ask them: Where is your passion and commitment to serve the community? Does it still exist, or has it been completely wiped off by a few dollars. I bet, post aquisition of these open source players by market leaders and commercializers like Oracle, the term open source itself will lose its meaning.

Come on Sid! JBoss sucks as open source. It is really just a propritary model (i.e. Oracle) on a public CVS tree. How many committers on any part of the JBoss stack have you heard of that are not JBoss employees? I susspect that # is approaching zero... And sheesh, give me a break Sid, why is it bad for someone to make some $ from their great work and passion. I mean come on, if you don't make money off something you are passionate about I pitty you! If the community was truly open (i.e. the community was really about the technology and not about gratifying egos) then the purchase of one company that provides support would be a good thing for the community as a whole.

There is a lot more to be said about this for sure, but I'm trying to finish a project before I start ranting on open source business models. No I don't have all the answers but I really hate JBoss.com as a model.

Permalink     4 Comments

StockTracker sample JSF/Spring/Hibernate application posted

About a year ago I did a talk at the DJUG and I had a simple app that I developed for that talk. Well I got busy and never posted it. So I spend the last few days sprucing it up to use the lastest versions of stuff and finaly getting it out the door. I still did not get the templating converted to tiles but it should be straightforward and a great learnign exercise for anyone interested in making that conversion. I'd be happy to post any patches that somone sends to me :-)

I will be doing a public JSF/MyFaces class at the end of the month in San Jose for anyone intrested.

Here is the list of stuff that is used in this example;

  • hibernate 3.1 (www.hibernate.org - used hibernate 3.1.2)
  • hibernate tools 3.1-beta4
  • hibernate annotations 3.1-beta8
  • MyFaces 1.1.1 (myfaces.apache.org)
  • DBUnit 2.01
  • Commons Lang 2.0
  • Commons DBCP 1.2.1
  • Commons Pool 1.2
  • Spring 2.0-m2
  • JUnit 3.8.1
  • XDoclet 1.2.3 (although should be removed because its only generating a very simple web.xml file)
  • MySQL - 4.x or 5.x (I used 5.0.18)
  • MySQL JDBC 3.1.12 (not sure if this driver requires 5.0 or not not)
  • Tomcat 5.5.15

One interesting thing I ran into is that Tomcat 5.5.15 forces stuff that goes into the session to be serializable (an oversight on my part initially when I wrote the code). A resonable assertion but it apparently was not enforced in 5.0.x or 5.5.9 because I had to make the page objects serializable to get the app to work. I had to look in the localhost.xxxx-xx-xx.log (the xx's are for the date) to find the error that I was getting.

SEVERE: Servlet.service() for servlet jsp threw exception
javax.faces.el.EvaluationException: Cannot get value for expression '#{!menu.userLoggedIn}'
	at org.apache.myfaces.el.ValueBindingImpl.getValue(ValueBindingImpl.java:397)
	at javax.faces.component.UIComponentBase.isRendered(UIComponentBase.java:822)
	at org.apache.myfaces.renderkit.html.HtmlGridRendererBase.renderChildren(HtmlGridRendererBase.java:176)
	at org.apache.myfaces.renderkit.html.HtmlGridRendererBase.encodeEnd(HtmlGridRendererBase.java:85)
	at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:331)
...snip...
Caused by: java.lang.IllegalArgumentException: setAttribute: Non-serializable attribute
	at org.apache.catalina.session.StandardSession.setAttribute(StandardSession.java:1249)
	at org.apache.catalina.session.StandardSessionFacade.setAttribute(StandardSessionFacade.java:129)
	at org.apache.myfaces.context.servlet.SessionMap.setAttribute(SessionMap.java:50)
	at org.apache.myfaces.context.servlet.AbstractAttributeMap.put(AbstractAttributeMap.java:104)
...snip...
Feb 9, 2006 7:39:03 AM org.apache.catalina.core.ApplicationDispatcher invoke
SEVERE: Servlet.service() for servlet jsp threw exception
javax.faces.el.EvaluationException: Cannot get value for expression '#{!menu.userLoggedIn}'
	at org.apache.myfaces.el.ValueBindingImpl.getValue(ValueBindingImpl.java:397)
	at javax.faces.component.UIComponentBase.isRendered(UIComponentBase.java:822)
	at org.apache.myfaces.renderkit.html.HtmlGridRendererBase.renderChildren(HtmlGridRendererBase.java:176)
	at org.apache.myfaces.renderkit.html.HtmlGridRendererBase.encodeEnd(HtmlGridRendererBase.java:85)
	at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:331)
...snip...
Caused by: java.lang.IllegalArgumentException: setAttribute: Non-serializable attribute
	at org.apache.catalina.session.StandardSession.setAttribute(StandardSession.java:1249)
	at org.apache.catalina.session.StandardSessionFacade.setAttribute(StandardSessionFacade.java:129)
	at org.apache.myfaces.context.servlet.SessionMap.setAttribute(SessionMap.java:50)
	at org.apache.myfaces.context.servlet.AbstractAttributeMap.put(AbstractAttributeMap.java:104)
	at org.apache.myfaces.el.VariableResolverImpl$13.put(VariableResolverImpl.java:192)
	at org.apache.myfaces.el.VariableResolverImpl.resolveVariable(VariableResolverImpl.java:328)
...snip...

The other interesting thing that I noticed is how far along the hibernate annotations are, I had no real problems with my little sample app, of course your millage might varry. Next up I'd like to convert the app to use Cayenne and then get it to deploy on Geronimo... Ah if only I could give up sleep :-)

Anyway here is the screen flow captured in a notation that is easy to do with Omni Graffle. And here is the domain model. And finally for you that are sick of docs and just want to look at the code you can download it here. And finally a pointer to the way back preso here. The code for the example is licensed with the ASF 2.0 license so you are fee to do with it what you will as long as you don't sue me...

Have fun, and any feed back would be greatly appreciated.

Permalink     3 Comments