Friday, March 30, 2012

Passing a property file as a parameter to Maven tests

It seems that

"surefire plugin is run under a different JVM instance that is launched by Maven."

the syntax is:

mvn test -DargLine=""

If I loved Maven before, I love it even more now....

Thursday, March 29, 2012

Monday, March 26, 2012


I wanted to brand this new type of SOA: FranckenSOA.

FranckenSOA is an integration effort where Services adopt a business model which is built by extending elements from the model of multiple service Consumers.

Imagine a ESB which offers an enterprise-wide Service, call it PippoService, to offer a virtualization of your ERP System.

PippoService can we invoked by a multiplicity of Services, belonging to disparate domains of the Enterprise.

This ESB serves a multiplicity of Systems, each with their System-dependent interface.

The question is: which language will PippoService speak?

This calls for the adoption of a Canonical Data Model, an enterprise-wide Data Model abstracting from the individual System, and speaking an Universal Esperanto.

Experiments on the adoption of the Esperanto show us that, apart from a small community of geeks, nobody ever uses it. Simply because it's not natively spoken anywhere, it's not backed up by any Political-Economical-Military superpower, and doesn't have a big corpse of literature like Latin has.

It takes a lot of time to build an Esperanto Domain Model, time to maintain, time to map it to all the external systems.

It's a lot simpler to adopt one of these 2 approaches:

a) Global Dictatorship: instead of Esperanto, the ESB and the services that it offers speak the language of the most important System (today it would be English). Each System has to develop an adapter to turn their Language into the English

b) Local Geopolitical Powers: in some areas of the ESB, people build a local Lingua Franca that serves their purpose, maybe shared amongst akin Systems, and the Most Dominant Systems determine the language spoken by their own facades.

(more to elaborate...)


While MS2 was STARTING (from WLS console using the NodeManager) I decided to shut it down (always from the console). TOo bad for me. MS2 went into FAILED_NOT_RESTARTABLE and there was nothing more I could do with it.
I had finally to restart the NodeManager to make it go back to "SHUTDOWN". Weird-oh.

Sunday, March 25, 2012

Integrating Docflex with XMLSpy

I install docflex

I install XMLSpy

I find C:\Program Files\Altova\XMLSpy2012\XMLSpyInterface.jar

I adjust the classpath in generator.bat
I adjust also the parameters of the com.docflex.xml.Generator class, adding:
"-m:IMAGE_PROVIDER_CLASS=com.docflex.xml.xmlspy.SpyKit -m:XMLSPY_VERSION=2012"

I get this

DOCFLEX ERROR REPORT, 2012-03-25 00:08:07
DocFlex/XML, Version 1.8.5
Main class: com.docflex.xml.Generator
Arguments: -m:IMAGE_PROVIDER_CLASS=com.docflex.xml.xmlspy.SpyKit -m:XMLSPY_VERSION=2012
java.vendor=Sun Microsystems Inc. Vista
When processing: DocFlex/XML XSDDoc, Version 2.5.0
Generator Exception:
When executing function 'spyStart'
java.lang.UnsatisfiedLinkError: C:\Windows\System32\XmlSpyLib.dll: Can't find dependent libraries
at Template Init Expression:
spyStart (
getStringParam ("integration.xmlspy.diagramFormat"),
Template Location Trace:
at Template: C:\pierre\downloads\docflex-xml-1.8.5\docflex-xml-1.8.5\templates\XSDDoc\lib\integrations\xmlspy.tpl
at Call Template 'lib\integrations\xmlspy.tpl'
at Stock Section 'Init'
at Template: C:\pierre\downloads\docflex-xml-1.8.5\docflex-xml-1.8.5\templates\XSDDoc\FramedDoc.tpl
When executing function 'callStockSection'
at Template Init Expression:

setXMLNameForm (
getBooleanParam("show.nsPrefix") ? "qualified" : "unqualified"
Template Location Trace:
at Template: C:\pierre\downloads\docflex-xml-1.8.5\docflex-xml-1.8.5\templates\XSDDoc\FramedDoc.tpl
Exception Stack Trace:
java.lang.UnsatisfiedLinkError: C:\Windows\System32\XmlSpyLib.dll: Can't find dependent libraries
at java.lang.ClassLoader$NativeLibrary.load(Native Method)
at java.lang.ClassLoader.loadLibrary0(
at java.lang.ClassLoader.loadLibrary(
at java.lang.Runtime.loadLibrary0(
at java.lang.System.loadLibrary(
at XMLSpyInterface.SpyApplication.(
at com.docflex.xml.xmlspy.SpyKit.a(Unknown Source)
at com.docflex.xml.xmlspy.a.a(Unknown Source)
at com.docflex.a.d.a(Unknown Source)
at com.docflex.a.j.if(Unknown Source)
at Source)
at com.docflex.e.d.i.lX(Unknown Source)
at Source)
at com.docflex.e.d.i.a(Unknown Source)
at com.docflex.e.d.ak.else(Unknown Source)
at Source)
at Source)
at Source)
at com.docflex.e.d.n.if(Unknown Source)
at com.docflex.e.d.ah.else(Unknown Source)
at Source)
at Source)
at com.docflex.e.d.n.if(Unknown Source)
at com.docflex.e.d.ab.if(Unknown Source)
at com.docflex.e.d.a5.a(Unknown Source)
at com.docflex.e.d.a.l.a$b.a(Unknown Source)
at com.docflex.a.d.a(Unknown Source)
at com.docflex.a.y.a(Unknown Source)
at com.docflex.a.j.if(Unknown Source)
at Source)
at com.docflex.e.d.i.lX(Unknown Source)
at Source)
at com.docflex.e.d.i.mb(Unknown Source)
at Source)
at com.docflex.e.d.i.l9(Unknown Source)
at com.docflex.e.d.i.a(Unknown Source)
at com.docflex.e.d.i.a(Unknown Source)
at Source)
at com.docflex.xml.l.access$300(Unknown Source)
at com.docflex.xml.l$ Source)

What is missing? Widows doesn't tell you.

I download

it turns out that ICCFM.DLL was missing. I find this file somewhere and copy it to C:\Windows\System32

Anyway the end result is GREAT, the HTML generated with XmlSpy graphs embedded is REALLY looking good. Awesome product this DocFlex

Saturday, March 24, 2012

Priceless tips on how to live well and be prosperous in IT

the most important points:

Continuous Visible Productivity

Sounding enthusiastic

Say supportive and positive things at meetings

Surreal and hilarious video on how IT firms and head hunters consider us:

Quote of the day. "the server will die and we will be hunted down and killed like dogs". Fantastic!

Monday, March 19, 2012

GetActiveUnitOfWork in JCA DbAdapter in Polling batching mode

We were getting this error: servicebus:/WSDL/POSTXMLBatchPOC/Adapter/InsertIntoBatchOrders [ InsertIntoBatchOrders_ptt::InsertIntoBatchOrders(InputParameters,OutputParameters) ] - WSIF JCA Execute of operation 'InsertIntoBatchOrders' failed due to: Could not create/access the TopLink Session.
This session is used to connect to the datastore.
Caused by java.lang.NullPointerException.
; nested exception is:
Could not create/access the TopLink Session.
This session is used to connect to the datastore.
Caused by java.lang.NullPointerException.
You may need to configure the connection settings in the deployment descriptor (i.e. DbAdapter.rar#META-INF/weblogic-ra.xml) and restart the server. This exception is considered not retriable, likely due to a modelling mistake.

Setting the property GetActiveUnitOfWork to false fixed the issue.

The official Oracle doc says:

GetActiveUnitOfWork is an advanced setting that forces all invoke activities in the same global transaction to use the same SQL connection if going to the same database. This makes it easier to guarantee that later invoke activities can see the changes of earlier invoke activities, but you may not need to set this at all (if using emulated two-phase commit, it should automatically be the same connection). Another difference is that for MERGE and INSERT, all changes are not written until the global transaction commits, so this setting also changes the timing of when WRITE operations occur.

The Datasource driver is a oracle.jdbc.xa.client.OracleXADataSource.... in the DbAdapter the Datasource ConnectionFactory is set with the xADataSourceName....

Sunday, March 18, 2012

Project Management - tools of the trade

If you track tasks on a whiteboard or with Excel files, you might consider using some more modern tools.

Inspiring video from Asana

Here also Pivotal Tracker, I have used it and it's simple and cool.

Friday, March 16, 2012 PS has been disabled PS has been disabled
This is most likely due to a poison message in a Queue, being redelivered over and over because you forgot to set Redelivery Limit and Redelivery Delay on the queue.

Go to the JMSServer, monitoring, see all active destinations, enable display of all the columns and look for pending messages. You can pause consumption on the destination and/or delete the pending JMSMessage.

Monday, March 12, 2012

Asynchronous vs Request-Reply vs One Way

Definition of Asynchronous:

"A sender sends a message asynchronously to a receiver expecting some response at a later time. The sender tags the request with an identifier allowing the response to be correlated with the originating request. The sender may also tag the message with an identifier for another service (other than the originating sender) which will be the recipient of the response. "

Definition of Fire and Forget (aka One Way Message, Request-Only)

"A sender wishes to send an unacknowledged message to a single receiver"

Under certain interpretations, the Fire and Forget is a subcase of Asynchronous - without callback.

Definition of Request-Reply

Unlike popular belief, Request-Reply doesn't necessarily means the reply is sent back in the same thread. One can have a Asynchronous Request-Reply scenario.

Tuesday, March 6, 2012

Oracle DB package versus procedure

What is the difference between a package and a procedure? When should I use packages?

Here a series of great examples:

Here the official documentation

Here a chapter on the advantages of packages

The Diminishing Returns of Technology

I have seen a colleague implement a relatively simple Web Application using Spring MVC, Maven and Hibernate.

It's all fine for me, the problem is that in the project almost no one knows these technologies. I wonder what these "add-on" technologies enable us to do, that we could not do with the basic JSP and JDBC Java frameworks, and with a simple javac/jar statement to compile and build a .war.

I personally I tend to be very conservative when it comes to adopting technology. There is always a setup time, a learning curve and the risk of having to deal with incompatibilities and bugs.

Of course all this sounds very luddite, but we are in this business to earn money for the client, not to build artwork.

Technology adoption has a cost and side effects that should not be underestimated.

To me, simplicity is the greatest technology of all.

Thursday, March 1, 2012

Recursive find and replace in files

If you need to make a change in all your OSB artifacts:

copy the sbconfig.jar in an empty folder
jar xvf sbconfig.jar
rm sbconfig.jar

perl -p -i -e 's/originalString/targetString/g' `find . -name '*' -type f`

jar cvf sbconfig.jar


if originalString contains / (like /bla/bly ) you can do this: \/bla\/bly