Friday, March 30, 2012

Passing a property file as a parameter to Maven tests

It seems that
http://www.cowtowncoder.com/blog/archives/2010/04/entry_385.html

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

the syntax is:

mvn test -DargLine="-Dsystem.test.property=test"

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

Thursday, March 29, 2012

Monitoring OSB with Alerts, SNMP Traps, JMX

see this post for products to download as SNPM console (also, Hyperic)

Interesting post:

http://technology.amis.nl/2011/01/10/enabling-snmp-traps-in-the-oracle-service-bus/

OSB JMX monitoring API

Sunday, March 25, 2012

FranckenSOA

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...)

FAILED_NOT_RESTARTABLE

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.

Integrating Docflex with XMLSpy

I install docflex
http://www.filigris.com/products/docflex_xml/integrations/xmlspy/

I install XMLSpy
http://www.altova.com/s

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.version=1.6.0_24
java.vendor=Sun Microsystems Inc.
os.name=Windows Vista
os.arch=x86
os.version=6.0
locale=en_US
--------------------------------------------------------------------------------
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 (
getBooleanParam("integration.xmlspy.showApp"),
getStringParam ("integration.xmlspy.diagramFormat"),
getBooleanParam("integration.xmlspy.workarounds.fixCoords")
)
--------------------------------------------------------------------------------
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:
--------------------------------------------------------------------------------
callStockSection("Init");

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(ClassLoader.java:1806)
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1731)
at java.lang.Runtime.loadLibrary0(Runtime.java:823)
at java.lang.System.loadLibrary(System.java:1028)
at XMLSpyInterface.SpyApplication.(SpyApplication.java:423)
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 com.docflex.e.d.bq.if(Unknown Source)
at com.docflex.e.d.i.lX(Unknown Source)
at com.docflex.e.d.ag.if(Unknown Source)
at com.docflex.e.d.i.a(Unknown Source)
at com.docflex.e.d.ak.else(Unknown Source)
at com.docflex.e.d.bt.else(Unknown Source)
at com.docflex.e.d.an.do(Unknown Source)
at com.docflex.e.d.au.if(Unknown Source)
at com.docflex.e.d.n.if(Unknown Source)
at com.docflex.e.d.ah.else(Unknown Source)
at com.docflex.e.d.ax.do(Unknown Source)
at com.docflex.e.d.au.if(Unknown 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 com.docflex.e.d.bq.if(Unknown Source)
at com.docflex.e.d.i.lX(Unknown Source)
at com.docflex.e.d.ag.if(Unknown Source)
at com.docflex.e.d.i.mb(Unknown Source)
at com.docflex.e.d.i.mk(Unknown 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 com.docflex.xml.l.case(Unknown Source)
at com.docflex.xml.l.access$300(Unknown Source)
at com.docflex.xml.l$4.run(Unknown Source)
at java.lang.Thread.run(Thread.java:662)




What is missing? Widows doesn't tell you.

I download http://www.dependencywalker.com/

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

http://www.theregister.co.uk/2012/03/21/how_to_get_paid_more/

http://www.theregister.co.uk/2012/03/21/how_to_get_paid_more/page2.html

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:



com.bea.wli.sb.transports.jca.JCATransportException: oracle.tip.adapter.sa.api.JCABindingException: oracle.tip.adapter.sa.impl.fw.ext.org.collaxa.thirdparty.apache.wsif.WSIFException: 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:
BINDING.JCA-11622
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 http://asana.com/



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

Friday, March 16, 2012

com.bea.wli.sb.transports.TransportException PS has been disabled

com.bea.wli.sb.transports.TransportException 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:

http://www.w3.org/TR/xmlp-scenarios/#DS17

"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)



http://www.w3.org/TR/xmlp-scenarios/#S1

"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

http://www.w3.org/TR/xmlp-scenarios/#S3

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:
http://www.java2s.com/Tutorial/Oracle/0540__Function-Procedure-Packages/Packages.htm


Here the official documentation
http://docs.oracle.com/cd/B12037_01/appdev.101/b10795/adfns_pc.htm


Here a chapter on the advantages of packages
http://docs.oracle.com/cd/B10501_01/appdev.920/a96624/09_packs.htm

The Diminishing Returns of Technology

http://en.wikipedia.org/wiki/Diminishing_returns

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

done


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