Oracle Blog

Some thoughts and comments about the Java world

mardi oct. 13, 2009

When selling GlassFish ESB to partners, we (Sun) have to provide our partners with all the material allowing them a quick ramp-up on our technology. That's the main reason why my group (Sales Engineers, Northern Europe) created a 3 days GlassFish ESB technical workshop.

My contribution to this workshop is a one hour module about WS-Security and GlassFish ESB (and OpenESB). The idea is to demonstrate how easy it is to setup a WS-Security enabled channel between a web service provider and a web service client.

Specifically, the screencast tutorial shows how to establish mutual certificate authentication between an EJB based web service and a JBI service assembly, acting as web service client, in this case, a BPEL module.

“ HermesJMS is an extensible console that helps you interact with JMS providers making it easy to browse or search queues and topics, copy messages around and delete them. It fully integrates with JNDI letting you discover administered objects stored, create JMS sessions from the connection factories and use any destinations found”

Configuring HermesJMS to connect to OpenMQ is not intuitive at all and I found very few resources on the web explaining how to do it.

At this stage, I would like to thank Michael Czapski and Thomas Barrett for having showed me the steps required to configure HermesJMS and for all the work they did to prepare a great CEC 2008.

Step 1 : Start Hermes JMS

The easiest way to start Hermes JMS is using Java Web Start. You can do that from their web site or using the icon below (requires Java SE 6+, if you have older versions of Java, other links are provided on Hermes JMS' web site)

Note that it will only work if your Java MQ is installed to use default port 7676.

Step 2 : Create a JavaMQ session

Replace <new> with JavaMQ and click the Apply button.

Step 3 : Add Java MQ JARs files to the classpath

Click on the Providers Tab on the bottom of the screen, right click anywhere inside the Classpath Groups pane and choose Add Group.

Name the group JavaMQCLasspahGroup (or whatever meaningful name you want). Right-click on the long button called Library and choose Add JAR(s).

Navigate to your GlassFish application server's imq/lib directory. For OpenESB installed to OPENESB_HOME it will be something like : $OPENESB_HOME\\glassfish-v2-ur2-b04-patch-20080929\\imq\\lib

This should work whether the imq/lib comes from Java MQ 4.1, OpenESB installation, GlassFishESB installation or Java CAPS 6 installation.

Choose the 10 following JARs. Not all may be required by we did not spend the time figuring out the minimum necessary set.

fscontext.jar

imq.jar

imqadmin.jar

imqbroker.jar

imqjmx.jar

imqutil.jar

imqxm.jar

jaxm-api.jar

jhall.jar

jms.jar

Allow Hermes to scan the JARs.

Once the JARs are scanned the Library will list all the JARs. Click the Apply button. Your screen should now look like this :

Click on Apply, then OK

Right-click the JavaMQ session and choose Edit to open configuration dialogue again.

Pull down the Loader menu and choose the JavaMQClasspathGroup. Pull down the Class menu and choose the com.sun.messaging.QueueConnectonFactory class. Click OK

Step 4 : Add an existing JMS queue / topic to your session

The last step is to actually add the queues and topics you want to monitor

Right-click JavaMQ session and choose New->Add queue ...

and be sure to choose the name of an existing queue or topic.

Step 5 : Enjoy browsing your queues and topics

Once the Java MQ session is configured and queues of interest are configured we can interact with the Java MQ broker, view messages in destinations, truncate destinations (delete all messages) and so on. The functionality of Hermes JSM can be used as required.

Until today, customers had either to download the latest stable build from our open source and community web sites (such as OpenSSO, OpenESB), either to subscribe to the commercial equivalent of these tools (Access Manager, Java CAPS) .

Once again, Sun is changing the rules.

GlassFishESB will be the officially supported version of the community open source project OpenESB, with stable releases on a more frequent basis than the commercial equivalent Java CAPS, also based on OpenESB.

But we don't want to leave our Java CAPS customers behind, therefore the components that are being released with GlassFish ESB are targeted for use by Java CAPS customers as well. The objective being that Java CAPS or ESB Suite customers can use all of the capabilities released with GlassFish ESB at the time they are available.

Further, going forward, customers who buy the higher levels Suites should not be "disadvantaged" in terms of either not having access to new components and also having access to them at the same time. In other words, we want customers of the "suites" to have the benefits and flexibility of the community approach as well

Similarly, OpenSSO Express
is the supported version of OpenSSO, available to Access Manager
customers. Access Manager releases are published every 12-15 months,
while OpenSSO Express releases are planed every 3 months.

contains many useful information, like the timestamp, the message severity level, the component that issued the message, the thread name and pool etc ... But when I do look at a GlassFish log file, nine times out of ten, I do not need all these extra information, I just need the last message.

Visually filtering out this is boring, error prone and, in general, slow down your analysis process.

When looking at the server log file from NetBeans, it does filter out all that information to propose you only the "relevant" part. But, when working from command line, switching to NetBeans "just" to read your uncluttered log file is tedious as well.

I decided to implement from the command line, the same filtering as the one proposed by NetBeans, using sed and regular expressions. The first expression I crafted is

\^\\[.\*;\\|

It matches any line starting (\^) with a bracket and containing anything (.\*) until it matches the sequence ;|. ([ and | must be escaped because they have special meanings in regular expression language).

Combining this with sed's substitute function (s/.../...), allows me to eliminate the first part of each line in the log entry. Applying this to the previous log line gives :

The files we do receive have a first row containing the title of the columns, not any actual business data. My intent was to skip this line while encoding the CSV file into XML, using some feature of the Open ESBCustom Encoders module. Apparently, the Custom Encoder can not be configured in such a way, i.e. there is no possible configuration telling the Custom Encoder to skip the first line of a file.

So, I returned to the OpenOffice API and decided to remove the first row in the spreadsheet itself, before converting it to CSV.

Excel files are always a bit tricky to handle when you're not developping nor deploying on Windows servers (if you are using Windows, then check out our DCOM Binding Components as it might be an elegant way to handle DCOM compliant objects from OpenESB - or - our DCOM OTD for the folks using Java CAPS repository-based projects)

The solution I choose to handle these files is quite simple : I am using the OpenOffice API to programmatically open the XLS file with OO and save it as a CSV text file ... just like you would do it by hand, using the OO GUI.

For this sample to compile and execute, you will need a couple of OO jar files in your classpath (see the code sample for the exact list of required jars, they are all shipping with OpenOffice) and you will need to start OpenOffice in background mode, listening to network invocations from your client program (the exact command is given in the code sample).

mardi févr. 05, 2008

The next version of Java Composite Application Platform Suite (Java CAPS, formerly Seebeyond ICANN) will be available for Mac OS X. While Sun will not support production use of this platform, we will ship a Mac OS X build for development, testing and demo purposes.
I downloaded and installed our internal milestone 6 yesterday on my Macbook Pro and, so far so good, it seems to run as fine as the Solaris or Windows version.

As Netbeans and Glassfish are at the heart of this future version, and because they just run well on Mac OS X, it would have been surprising to not publish a Mac OS X build for Java CAPS.

Other platforms available for this M6 build are AIX, Linux, in addition of Windows and Solaris of course.

While this move won't probably drastically change the adoption rate of Java CAPS, it will make the life of many developers easier, as they will be able to use the Mac as their main development or test platform, with the exact same tool as the one used for production.

Many Sun Sales Engineers and Professional Services Engineers are using Macs as well. For us too, having a native build will avoid playing with huge virtual machines images, just for the purpose of demo.

About

Sébastien Stormacq is a Senior Software Architect at Sun Microsystems. He uses his 15+ years of professional experience to design large scale, secured and highly transactional architectures based on Sun's middleware solutions.