When jar files are not jar files

In the Open ESB project (and its documentation, examples, wiki pages) there are too many references to .jar files where technically speaking the artifacts are actually misnamed zip files. Even some of the tooling file wizards default to looking for .jar file extension names for artifacts that the JSR-208 specification clearly describes as zip files.

This has lead to some confusion. One customer reasonably asked if he could just add an Open JBI Component .jar file to his classpath (no, since the component archives are actually zip files containing jbi.xml and implementation files).

When using some NetBeans-based tools, I always have to remember to change the file pattern filter from the inappropriate default  *.jar to find a .zip file I’m trying to install or deploy.

Technically, jar files contain class files and can be added to a classpath. JBI archives (components and service assemblies) really should be (named as) zip files, since they almost never can be added to a classpath (I’ll leave it as an exercise how to make a JBI archive actually also usable on a classpath, but I haven’t seen a use-case for this yet).

JBI zip files usually contain nested archives (sometimes also misnamed as .jar files).  In the case of a component installation archive, the nested files are, in fact, .jar files containing the actual component implementation.  However, theoretically they could just contain class files, and these don’t have to be in the standard place for class files within a normal jar file.

For JBI Service Assemblies, the nested Service Unit archives are zip files, generally containing XML.  However, the Service Units can contain anything in addition to the jbi.xml; the rest is specified to be “opaque” to the JBI management layer and only needs to make sense to the target component.  (In rare cases, a Service Unit could contain classes or nested jar files, if it was being deployed to some JBI Binding or Engine that was provisioned somehow via compiled Java instead of XML.)

So, if you create a JBI artifact, try to remember to name it with a .zip file extension.  Please :-)

Category: glassfish esb, jbi, netbeans, open-esb

Posted by: Mike Wright on: December 19, 2008

Tags:

upload vs. copy during JBI Component install

step 1 radio buttons

(install step 1; radio buttons)

 I was asked today about the difference between upload and copy when using the GlassFish v2 web admin console to install a JBI component into Open ESB.


Case 1. The JBI archive is on the “client” system. Use the default “File to Upload:” radio button.

browser's file upload dialog

(browser upload dialog)


opens the web-browser’s file upload dialog to select the file to be uploaded from the client file system to the remote GlassFish Domain Admin Server (DAS).  uploads the selected file.

Case 2. The JBI archive is on the “server” system. Use the “File to Copy:” radio button.

woodstock chooser

woodstock file chooser

opens a  Woodstock file chooser in a pop-up window, showing only files on the system running the GlassFish DAS.  copies the selected file.

Case 3. The web browser and the DAS are running on the same system. Either upload or copy would work, since the JBI archive is accessible by both the web browser and the DAS.

Category: glassfish, jbi, open-esb, web admin console

Posted by: Mike Wright on: August 28, 2008

Tags: