Archive

Archive for the ‘/Sun’ Category

Documenting the GlassFish v3 Schema

September 24th, 2009 jlee Comments off

Once work had started on GlassFish v3 the decision was made to drop schema validation for the domain.xml configuration file.  In previous versions, you could be assured that your xml was valid because we shipped a DTD to enforce that.  In v3, however, that is no longer the case.  The decision was made because v3 is very different in some fundamental ways.  In v3, you can add an arbitrary container to GlassFish and configure it via domain.xml.  This dynamic nature of the document structure makes validation difficult at best so the decision was made to drop validation altogether.  However, the problem still remains of how to determine what the document should look like.

First things first, you should avoid editing that xml file by hand.  You should be able to do everything you need via either the admin GUI console or the asadmin CLI tool.  That said, that still doesn’t necessarily help you know what values can go where.  The question has come up dozens of times even among the development team.  Various teams have updated and migrated their respective sections of the document leaving some confusion about the new schema.  (My own work on the grizzly-config updates is probably the biggest offender here).  There are, to my knowledge, two different attempts to fix this.

Tim Quinn developed the first publicly available tool.  You can find that here.  I had my own going on locally as well.  I borrowed some ideas from Tim’s approach and came up with this.  My version differs from Tim’s in that it runs in container as an asadmin command.  This has a few advantages but most importantly is that I think it’s easier to use.  The output I generate is also a bit more accessible than Tim’s but then Tim’s was really a rough first cut.  I’m not sure he’s done much with it since.  I, on the other hand, still get questions about the grizzly-config schema changes so this is near and dear to my heart.

At the moment, it only generates a javadoc-like HTML output.  I plan on adding a DTD and XSD option but there are some disconnects between the internal Java API used to configure GlassFish and what a user sees in domain.xml that make this not so trivial.  You can find those details here.  The HTML generated reflects the currently valid structure of the document and not the content.  This structure changes as you add/remove modules such as JRuby support and the like.  The files are generated in the config directory (<glassfish>/domains/domain1/index.html for most people).

The color scheme is a work in progress.  The main blue is a bit jarring, I think, but I just haven’t had much time to play with such things lately.  You can find sample output here.  In the detail frame you’ll see that some elements have properties defined.  This lists all the documented properties on that attribute.  In a perfect world, that list would be exhaustive but that’s not always possible.  e.g., Some configuration elements such as JDBC connection pools configure third party libraries and capturing all possible properties there is impossible.  Nevertheless, for all internal GlassFish items this list should give you much of what you need.  If you find a missing property, don’t hesitate to file an issue with the GlassFish tracker and we’ll try to update our documentation.

If you find an issue with the doc tool itself, please file an issue and I’ll do my best to correct it.  This is an unofficial contribution to GlassFish, though, so bugging the GlassFish lists isn’t likely to help much.  I hope this tool helps you as you evaluate v3.  We really are very excited about this one.

Categories: /Sun, config, glassfish

Grizzly Config one pager for review

January 15th, 2009 jlee Comments off
We're approaching what we hope is the final form for the grizzly config project for v3 and would like to solicit feedback before asarch review next week. Please look over the document and reply with any feedback you might have. The schema is all but done as far we've been able to determine but if anyone finds something missing or out of place, please let us know. We're especially interested in feedback from the glassfish admin team for input as to impact and scope for these changes. You'll notice several slugs and placeholders in the document to expound on the efforts there. Thanks.
Categories: /Sun, Java, config, glassfish, grizzly

Java is dead?

December 16th, 2008 jlee Comments off

There's been a lot said about closures both in favor and against the last couple of years.  The debate has raged on for what feels like an eternity.  But the semi-official announcement at Devoxxx recently that closures won't be making it into java7 seems to have put everyone back on their heels a bit.  I, for one, am relieved at the announcement.  Others are not so thrilled and have gone so far as to declare that Java is dead for their lack.  Personally, every major proposal out there made my eyes bleed.  There were so many gymnastics being proposed to deal with typing and generics and backward compatibility and the like that most of those proposals just made a mangle of the language.  I did see one idea that I like (my thoughts on that here) but there's little chance it'll get any serious traction.

I've used closures in both my fan work and my groovy work and I've enjoyed using them.  But the syntax employed is much simpler than what the main proposals had offered.  As nice as closures are, inner classes have served me well enough so far with very little heartburn.  Until Sun is ready to break with older versions of Java, I'm just not sure how well closures will work the current language and VM constraints.

What I was happiest too see was Mark Reinhold's jigsaw project.  A small, modular, independently updatable runtime would be fantastic.  I know many are upset at the lack of any major language changes being promised in java7 but I'd rather see what we have now work better.  Let's not destroy the language trying to shoehorn in things that just aren't working out.

Categories: /Sun, Java, closures, java7

Java 6 on OS X

November 11th, 2008 jlee Comments off

Most of the Java loving world has probably already upgraded to OS X 10.5 which has an official, Apple sanctioned Java 6 implementation available.  However, some of you might be stuck on 10.4 for whatever reason (as I was until today...) and are desperate for some Java 6 love.  When doing some work just this morning on gfv3, I finally ran into a Java 6 only reference that I couldn't get around.  After some flailing and whining, I was reminded of soylatte (a colleague here at sun has been using it) which is built off the openjdk sources.

I grabbed that 10.4 build and extracted it and gave it a spin.  If you're a *nix-head like myself, configuring your shell to use soylatte is a trivial process.  Despite my best efforts, however, I failed to find a way to configure OS X to use soylatte in general rather than Apple's 1.5 VM.  So I had to resort to running IntelliJ IDEA on 1.5 but I could register soylatte as a platform VM inside IDEA and run my apps using that.  And that seemed to work quite well.  I can verify that gfv3 does indeed run on soylatte and that makes me very happy.  It made me happy for about 30 minutes until the UPS man showed up with my OS X upgrade DVD with which I could upgrade and get a formal release instead.  But it was an interesting exercise and hopefully anyone else stuck on 10.4 can use this hint as well.  It certainly would've made staying on 10.4 for a longer period much more palatable.

Categories: /Sun, Apple, Java, java6, soylatte

Quick Introduction

November 7th, 2008 jlee Comments off

As much as I wanted to part of the GlassFish v3 Prelude festivities, I didn't really have anything to contribute. See, I started with Sun on the code freeze day for v3 prelude so I had 0 to do with prelude. :) Anyway, I'm the newest(?) member of the webtier team and will be working a number of different items leading up to the 3.0 spec release as part of the EE 6 release next year. There's always v3 FCS day, I suppose. :)

As for who I am, I'm a long time java user (since '96ish). I've been building web applications for most of that actually starting in the pre-JSP days and most recently using Wicket. I'm very excited to work under the hood for a change especially during this major revision cycle underway. One of my roles here at Sun is, of course, to blog about the work going on with GFv3 and especially our web container work. Full blown blogs might not be as frequent as I sometimes wish, but I have a twitter stream that I'm trying to use for more of the quick notes that aren't really quite blog worthy. (I admit I have low blog-stamina these days). I'll try to post either here or on twitter some of the things I come across as a relative newbie to this code. Perhaps my efforts to get elbow deep in glassfish code might help some of you who have been wondering how and where to get started.

In any case, it's nice to meet. Hopefully I'll see you around...

Categories: /Sun, Java