How to Install a Glassfish Patch

Recently I’ve been working quite extensively with glassfish and had a need to apply a patch for some of the core code.

To my big surprise I was not able to find the official way to apply patches to a glassfish installation. I found several patches posted on the issue tracker and paying customers have access to tested and supported patch bundles, which are released outside of the regular release cycle. But even some extensive googling didn’t easily reveal how to apply them.

Then luckily I found this discussion on the glassfish mailing list, which describes the process.

To make life easier for others and google to index this information, here is a brief recap:

  1. Create a directory <glassfishroot>/lib/patches
  2. Copy the jar with your patch into this directory
  3. Edit your <glassfishroot>/domain/<domainname>/config/domain.xml and add attribute classpath-prefix="${com.sun.aas.installRoot}/lib/patches/<patchname.jar>" to the <java-config ...> node
  4. Restart your domain

I

Continue reading “How to Install a Glassfish Patch”

How to Install a Glassfish Patch

Recently I’ve been working quite extensively with glassfish and had a need to apply a patch for some of the core code.

To my big surprise I was not able to find the official way to apply patches to a glassfish installation. I found several patches posted on the issue tracker and paying customers have access to tested and supported patch bundles, which are released outside of the regular release cycle. But even some extensive googling didn’t easily reveal how to apply them.

Then luckily I found this discussion on the glassfish mailing list, which describes the process.

To make life easier for others and google to index this information, here is a brief recap:

  1. Create a directory <glassfishroot>/lib/patches
  2. Copy the jar with your patch into this directory
  3. Edit your <glassfishroot>/domain/<domainname>/config/domain.xml and add attribute classpath-prefix="${com.sun.aas.installRoot}/lib/patches/<patchname.jar>" to the <java-config ...> node
  4. Restart your domain

I tested this with Glassfish v2, I’ll have to check if it works with the upcoming v3 as well.

#133 Capistrano Tasks

Do you know how to make Capistrano tasks? See how to change default deployment behavior with custom tasks in this episode.

#133 Capistrano Tasks

Do you know how to make Capistrano tasks? See how to change default deployment behavior with custom tasks in this episode.

RailsConf Europe: Jacqui Maher, Pat Allan and Intridea – Ruby on Rails Podcast

Jacqui Maher talks about the technical challenges involved in writing Rails apps for a medical team in Malawi. Pat Allan encourages Rails developers to volunteer their time and skills.
Developers from Intridea discuss hacking Rails internals, UI design, and mid-end development.
From RailsConf 2008 in Berlin.

Also mentioned:

RailsConf Europe: Jacqui Maher, Pat Allan and Intridea – Ruby on Rails Podcast

Jacqui Maher talks about the technical challenges involved in writing Rails apps for a medical team in Malawi. Pat Allan encourages Rails developers to volunteer their time and skills.
Developers from Intridea discuss hacking Rails internals, UI design, and mid-end development.
From RailsConf 2008 in Berlin.

Also mentioned:

Determine Test Coverage on your Flex Projects with Flexcover.

This week I was playing with Flexcover a test coverage tool for Flex…and it’s really cool. If you you to determine how much test coverage you have in your Flex application then check out this screencast…maybe skip to the end where you will see flexcover in action. The first part is how to assemble the Flexcover SDK to use with FlexBuilder. Again this is a non-scripted screencast with several “oops” and a big Swiss-French accent which I hope you will find useful.

The key here is if you do Flex, write unit tests and use this test coverage tool.


Setting up Flexcover as test coverage tool for your Flex applications. from daniel wanja on Vimeo.

Enjoy,
Daniel.

#132 Helpers Outside Views

Have you ever wanted to access helper methods outside of the view layer? In this episode I show you a couple ways to do just that.

#132 Helpers Outside Views

Have you ever wanted to access helper methods outside of the view layer? In this episode I show you a couple ways to do just that.

Rails for .NET Developers now shipping + Pragmatic Podcast

We’re happy to announce that our book, Rails for .NET Developers, is now shipping! You can pick it up today in plain ol’ paper, PDF, or a combo. We hope you enjoy it as much we enjoyed writing it.

Jeff and I are also featured in today’s Pragmatic Podcast… thanks to Susannah Pfalzer for the interview.

My Confluence 3.0 Wishlist

Confluence 2.9 was released last month and I’ve seen references to 2.10 in the Confluence issue tracker, so I expect to see it out in 1-2 months. That makes me think about what’s next.

As a part of my adventures of working on Sun’s external wiki wikis.sun.com, I’ve been working on Confluence plugins and even the Confluence core code for a year and a half now, adding new features, enhancing the existing features and very often fixing bugs. Sometimes it was trivial to enhance the code or fix a bug, other times it was not, but what I want to write about today are things that were not possible at all without irreversibly forking the code.

Confluence 3.0 should be a version that really deserves to have the first digit incremented. Not because marketing said it’s time for that, but because the changes

Continue reading “My Confluence 3.0 Wishlist”

My Confluence 3.0 Wishlist

Confluence 2.9 was released last month and I’ve seen references to 2.10 in the Confluence issue tracker, so I expect to see it out in 1-2 months. That makes me think about what’s next.

As a part of my adventures of working on Sun’s external wiki wikis.sun.com, I’ve been working on Confluence plugins and even the Confluence core code for a year and a half now, adding new features, enhancing the existing features and very often fixing bugs. Sometimes it was trivial to enhance the code or fix a bug, other times it was not, but what I want to write about today are things that were not possible at all without irreversibly forking the code.

Confluence 3.0 should be a version that really deserves to have the first digit incremented. Not because marketing said it’s time for that, but because the changes in the application are so significant.

I’m sure that Atlassian has lots of ideas about what Confluence 3.0 should look like, but Atlassian guys, in case you start to run out of ideas, here is my wish list:

Fix the Database Schema

Confluence has been in development for years and the database schema definitely shows that. Since the database is the heart of the application, I think it deserves a lot of attention and major performance boost could be gained by doing a clean up.

Specific improvements:

  • Establish and in the future enforce naming conventions
  • Replace all the natural foreign keys with surrogate keys, e.g. user name, spacekey, group name should be replaced with ids in all the referencing tables (this would finally allow CONF-4063 to be implemented)
  • Add caches for the lower function (patch) and maybe counter caches

Rework the Clustering

Clustering is usually supposed to fulfill two functions: scalability and robustness. In the case of Confluence mainly the second attribute is missing. In fact, I’d go as far as saying that a Confluence cluster is less robust than a single instance of Confluence. Why? Because the way it is implemented makes the entire cluster vulnerable when one node has problems.

I personally experienced several cluster lock-ups or crashes, usually initiated by a separate Confluence bug, in which the effect was multiplied by the clustering code. One of such of these bugs: CONF-12319

Mike’s presentation covers quite a few design goals behind the implementation in Confluence. Clustering can really get ugly and complicated and Mike covered it pretty well. Unfortunately the distributed share part of the clustering makes Confluence prone to problems.

One of the clustering goals that Mike emphasizes in his presentation is that clustering should be “admin-friendly” (low admin overhead and easy setup). While I agree with the low overhead part, the easiness of setup should not compromise the goals which clustering is trying to fulfill in the first place. Clustering is for people who are serious about running Confluence, and as such should be expected to be qualified for the job.

Specific improvements:

  • Either reevaluate the distributed share clustering so that it is super robust, or consider implementing clustering via a centralized share
  • Avoid shutting down the entire cluster when “cluster panic” is detected. A better solution, which avoids unnecessary downtime, would be to shut down all the nodes, except for the nodes properly clustered with the oldest node.

Clean Up the HTML and CSS Code

The html code that comes out of Confluence is horrendous. While the rendered output looks pretty pleasant, looking under the hood (browsing the source code in a browser) is not recommended for pregnant women, men with ED, high cholesterol, and generally not recommended for people over 50.

Some improvements were done in this area in the recent releases, but all of them were just minor cosmetic surgeries. Confluence really needs major surgery that will bring the html code up to current standards. The benefit of this will be much faster page loads and code that is easier to maintain and enhance.

Specific improvements:

  • Rewrite most of the templates and macros to make them XHTML 1.0 compliant
  • Minify and combine javascript and css files (CONF-8622)
  • Use image sprites to even further speed up page loads (especially in the rich text editor)

Redo the URI Namespace

Human friendly URIs and URLs are becoming more and more important on today’s Internet. Confluence is not doing well in this area.

Specific improvements:

  • /display/MySpace/My+Page – is the /display part really necessary? Can’t we do /MySpace/My+Page
  • /pages/diffpages.action?pageId=2490471&originalId=45714293 – What is this? I don’t know. How about: /MyWiki/My+Page/diff/23:22. I think that actually means something. There might be a better format, this is just a thought.
  • I think in general redoing the URI name space using REST conventions would be interesting.

Improve Atlassian-Renderer

When I was creating come patches for the atlassian-renderer I was surprised to find that atlassian-render, the module responsible for rendering wiki markup into html is full of hardcoded html snippets. The main reason why this surprised me is that most of the Confluence code is pluggable, which allows for parts of the code to be replaced with a better version without a lot of problem. This is not the case with the render. And this presents two problems: it’s not possible get Confluence to directly render anything else than html (pdf and doc are only derived from the html), and it’s not possible to use anything else than Confluence markup as the input for the renderer.

The first problem makes me unable to render custom output like docbook or to improve the PDF output, which is pretty poor.

The second issue means that all the customers that use Confluence are locked-in because all the content created via Confluence is Confluence-specific and can’t be easily moved to a different wiki engine when needed.

In my opinion the sooner all major wiki engine developers settle on one wiki markup standard the sooner we will all be better off. This might be especially difficult for Atlassian to swallow and implement, because they standardized on their own markup that they also use in their other products.

An interesting initiative that is gaining a lot of traction is Creole, a standardized wiki markup. Confluence is one of the few major wiki players that doesn’t support this initiative.

Specific improvement:

  • Split the current renderer into two pluggable parts: parser and renderer
  • Implement Creole support (CONF-12077)

Improve Developer Documentation

spent countless hours, especially in the beginnings trying to figure out how Confluence works and how Confluence plugins should be written. I learned some new tricks and that’s the good part, the bad thing is that the experience could have been much better if the the code contained more javadocs comments and if the plugin interfaces and mainly the configuration file format was better documented.

Specific improvements:

  • Add JavaDoc comments where missing
  • Finally provide complete specification and documentation for the plugin config file (JRA-12183)

Thanks! 🙂

That’s about as much as I can think of for now. There are probably other things that I missed and then there enhancements around security, which I know are already on the roadmap.

I understand that most of the changes above will create incompatibilities with many existing themes and plugins, but hey, Confluence 3 will happen only once EVAR and releases like this are expected to bring major incompatibilities. Data can always be migrated automatically and existing plugins and themes will be migrated when there are people interested in using them and proper migration instructions are provided.

I hope that Confluence 3 will not be a “marketing” release, but instead something really cool that all users and developers will enjoy working with.

#131 Going Back

This episode demonstrates a couple ways to redirect the user back to a previous page. Applying this to your site can help minimize the user’s need to press the back button.

#131 Going Back

This episode demonstrates a couple ways to redirect the user back to a previous page. Applying this to your site can help minimize the user’s need to press the back button.

Flex test coverage?

It’s hard to imaging writing a Rails application without using rcov and get that fuzzy feeling you tested most if not all you application. Or at least get a good idea of what’s tested. I heard way back that Alex Uhlmann was working on some test coverage tools, but I didn’t see anything coming out from Adobe. I haven’t used test coverage for my Flex apps, but want to start. Any body has any good hints, stories, frameworks they use for test unit coverage in Flex? A quick google search pointed me to this article describing Flexcover, just what I was looking for. Please share your experience.

Thanks!
Daniel.

UPDATE: I am playing with FlexCover and just saw this “Flexcover is a joint effort with Alex Uhlmann of Adobe Consulting, who has been working on a related set of ideas.”. So I guess this is really Alex’s work that Steven was referring to which is now open source under the MIT license. Cool!

Coming home to Vim

Over three years ago, I was faced with a dilemma. I had recently switched to the Mac (from Linux) and was still using my text editor of choice (vim), but at the time, vim’s “integration” with OS X was pretty minimal (and that’s putting it optimistically). I experimented with emacs, but it never clicked for me, and honestly, emacs on OS X wasn’t all that better than vim at the time. Sadly, reluctantly, I said good-bye to vim and switched to TextMate.

TextMate was (and certainly still is) a fantastic text editor. The project drawer was awesome, finding files via cmd-T was super powerful, and smarter auto-completion and snippets promised a new and faster way to pound code. After a couple of months of reteaching my fingers how to edit text, I was happy.

Sometimes, though, late at night, I would think again of vim.

Fast forward three years. The vim landscape is different now. There is actually a Mac-friendly GUI version of vim now, MacVim, which actually looks like it belongs on OS X. Vim 7 supports UI tabs, and a much more powerful auto-completion mechanism than before. And plugins like rails.vim and fuzzyfinder.vim mean that TextMate no longer has a corner on powerful project navigation.

For the last few weeks I’ve been toying with switching back to vim. TextMate’s “snippet” feature never clicked for me, and the only times I used it were by accident (when it annoyed me more than it helped me), but I really was hooked on the project browser, and cmd-T, and a few other things. I realized that, with a little work, perhaps a way could be found to reimplement most of the things I loved about TextMate, in vim.

This last week I’ve worked exclusively in vim, to test that theory. It’s like coming home. As I said, TextMate is a powerful and wonderful editor, too, but differently powerful and wonderful. Vim’s wonderfulness and power is the wonderfulness and power of git, or linux, where the learning curve is steep (ridiculously steep at times), but the rewards of mastery are sublime. I didn’t even realize I had missed a sane shift-J, or using the dot key to repeat the last command. Fix transposition typos with ‘xp’. Select a single word with ‘viw’. Drop bookmarks with ‘m’, and jump right back to them with single quote.

If any of that makes your stomach roil, then vim is not for you. 🙂 But to me, it’s like being embraced by a long-lost friend after years apart. And vim holds no grudges.

There was still the issue of the TextMate features that I had particularly come to love. First to tackle was cmd-T, since my workflow had become so dependent on that for finding files. Takeshi NISHIDA’s fuzzyfinder.vim script seemed like exactly what I wanted…at first. It’s definitely a powerful tool, but the fuzzy finder for files was not TextMate’s cmd-T, and my instinctive attempts to treat it so were causing me a lot of aggravation.

So I took an evening and wrote fuzzy_file_finder, a Ruby library that mimics (and improves on, if I do say so myself) TextMate’s cmd-T functionality. Then, I extended fuzzyfinder.vim with fuzzyfinder_textmate, which bound the fuzzy_file_finder to vim. The result?

See for yourself: http://s3.amazonaws.com/buckblog/videos/fuzzyfinder_textmate.mov (600K, QuickTime video).

I’m still working on a solution for the project browser. Yes, I know there are several (“countless” might be a more accurate term) vim plugins that present a project drawer in a split window, but even before being spoiled by TextMate those didn’t feel right to me. I’m experimenting with a cocoa tree view that sends files to a specific vim server, and it mostly works, but I’m still not sure it’s the right solution. If I do come up with something, I’ll definitely open it up and share it. (On the other hand, if any of you out there in readerland already know of such a thing, please point me at it!)

So, I’m still reacquaiting myself with all my old muscle memories, but here are some commands I wasn’t previously very familiar with which are proving useful in conquering my TextMate habits:

  • :e [file]. This is great if you don’t want to use fuzzy finding. Vim will even do tab completion to make things easier.
  • :ls. Shows all of your buffers.
  • :buffer [file]. Fantastic for quickly switching between buffers. You can give it just part of a file name and it will jump to the buffer that matches.
  • The ctrl-6 (technically ctrl-caret) key is awesome for switching back and forth between two buffers. For instance, if I just need to quickly look at one buffer, I can jump right back to where I was with ctrl-caret.
  • ctrl-W introduces a whole host of options for working with split windows.

And lastly, can I just say that Vim is seriously the poster-child for documentation? I recommend spending 15-30 minutes, every day, in :help, just exploring. There is a LOT there, and all excellently documented.

So, all you vimsters out there: what commands do you frequently use? What features of vim are you so dependent on that you’d be useless without them? Do share!

RailsConf Europe: Rubinius and CoachTV – Ruby on Rails Podcast

Wilson Bilkovich explains the recent rewrite of Rubinius.
Lars Pind discusses Coach TV, his new video blog on happiness and personal development for geeks.

Also mentioned

RailsConf Europe: Rubinius and CoachTV – Ruby on Rails Podcast

Wilson Bilkovich explains the recent rewrite of Rubinius.
Lars Pind discusses Coach TV, his new video blog on happiness and personal development for geeks.

Also mentioned

#130 Monitoring with God

Need to ensure your background processes stay up and running and don’t use too many resources? Check out the god gem as shown in this episode.

#130 Monitoring with God

Need to ensure your background processes stay up and running and don’t use too many resources? Check out the god gem as shown in this episode.