Tuesday, May 10, 2016
A new blog is born
Thursday, May 7, 2015
Switching between maven settings.xml
Often you have to copy the maven settings.xml file which is configured for a specific customer. But while developing in my spare time I just want to use my own settings.xml file. The easiest way to switch to using a different file is shown below:
mvn -gs $M2_HOME/conf/settings_pelssers.xml clean install
Thursday, April 9, 2015
Using ssh tunnel with port forwarding
Connectivity has been setup from our staging environment to the third party server (endpoint of our soap clients). However, I wanted to connect locally with SOAP UI to this server, so I needed to setup an ssh tunnel with portforwarding on my macbook. I used to do this with putty on windows in the past so it took me a bit longer to figure this out.
Let's say the endpoint used from our staging environment would be "http://3rdpartyhostname/coolservice". In this case I want to listen on port 8877, and forward traffic from this port using the ssh tunnel to 3rdpartyhostname on port 80
ssh -f username@staginghostname -L 8877:3rdpartyhostname:80 -N
Now I can connect in SOAPUI to the following endpoint "http://localhost:8877/coolservice"
Thursday, March 26, 2015
Fixing collisions ObjectFactory while executing wsdl2java
Often you have to deal with WSDL's from third parties. Sometimes the WSDL including referenced schemas are setup crappy and you run into issues while converting the WSDL to Java. Below we will look into how to fix these issues.
Eclipse will complain with following message
[ERROR] file:/playground/objectfactory/src/main/resources/xsd/helloworld.xsd [32,3]:
(Relevant to above error) another "ReasonType" is generated from here.
[ERROR] file:/playground/objectfactory/src/main/resources/xsd/helloworld.xsd [32,3]:
Two declarations cause a collision in the ObjectFactory class.
[ERROR] file:/playground/objectfactory/src/main/resources/xsd/helloworld.xsd [26,3]:
(Related to above error) This is the other declaration.
[ERROR] file:/playground/objectfactory/src/main/resources/xsd/helloworld.xsd [9,3]:
Two declarations cause a collision in the ObjectFactory class.
[ERROR] file:/playground/objectfactory/src/main/resources/xsd/helloworld.xsd [10,3]:
(Related to above error) This is the other declaration.
[ERROR] file:/playground/objectfactory/src/main/resources/xsd/helloworld.xsd [15,7]:
Two declarations cause a collision in the ObjectFactory class.
[ERROR] file:/playground/objectfactory/src/main/resources/xsd/helloworld.xsd [14,7]:
(Related to above error) This is the other declaration. A class/interface with the same
name "com.pelssers.helloworld.wrapper.ReasonType" is already in use.
Use a class customization to resolve this conflict.
Below a version that fixes all issues. Ps. Sometimes it might also be useful to add @underscoreBinding="asCharInWord" to the globalBindings.
Tuesday, April 15, 2014
Saturday, April 12, 2014
Friday, April 11, 2014
Thursday, April 10, 2014
Wednesday, April 9, 2014
Friday, April 4, 2014
Ceylon: annotations
An annotation is a top level function that returns a subtype of ConstrainedAnnotation.
There are 2 interfaces which satisfy ConstrainedAnnotation directly:
- OptionalAnnotation: An annotation that may occur at most once at a single program element and only on certain program elements.
- SequencedAnnotation: An annotation that may occur multiple times at a single program element, and only on certain program elements.
Let's see the type hierarchy of ConstrainedAnnotation to get a better picture.
Wednesday, April 2, 2014
Using Java's FutureTask to execute Callable tasks concurrently
In this demo we have 2 Case Providers, one for Activiti and one for WPS. I used Thread.sleep to mimic a time consuming computation (e.g. IO). Now we want to have a composite Case Provider which composes cases from both case providers. However, as we naively implement this in SequentialCaseProvider we will see that the total time it takes is the sum of having the 2 caseproviders fetch the cases (9 seconds). By using a concurrent approach in ConcurrentCaseProvider, we can reduce the time to +- the time it takes the longest CaseProvider to fetch the cases. (5 seconds)

