Tuesday, September 24, 2013

Region & time zone settings in Linux Mint 15 Cinnamon

For some weird reason, in Linux Mint 15 Cinnamon, Region & city selection boxes have been removed from Cinnamon Settings > Calender. You can set your region during installation, but if you make a mistake during installation or travel between timezones with a laptop then indeed there seems to be no easy way to configure this. This issue has been reported already as an issue. In the meantime, you can change it from the command line.
Display available time zone options:
timedatectl list-timezones
Set the time zone:
timedatectl set-timezone
Or you can just use..
sudo dpkg-reconfigure tzdata

Sunday, June 30, 2013

[Quick Tip] BPEL Correlation, Load tests in soapUI and Groovy

In WS-BPEL, the concept of Correlation is used to maintain references to instantiated business process instances with the help of business-application-specific data (like social security numbers, Order IDs) in the exchanged messages. When you're testing these BPEL processes with asynchronous service invocations you might have come across the problem of maintaining a unique correlation value across the multiple test steps of a BPEL process (because the back-end services this asynchronous service calls made to, are not available in the test environment). Here's a quick tip to achieve this via a Groovy script in soapUI. In the beginning of your test case have a Groovy script test step which does the following: It creates a random integer value and assigns it to a property. So you can make use of this property in the SOAP request where the correlation set is initialized, and all the other SOAP request test steps which uses the same correlation set, as follows:

Thursday, May 9, 2013

Namespaces in E4X

ECMAScript for XML (E4X) extends JavaScript with support for XML-based data manipulation by introducing new XPath-like language features. Apache ODE/WSO2 BPS has an E4X Assign activity to ease Rich Data Manipulation in BPEL using E4X. To use namespaces in E4X queries, follow the syntax namespace::localName in place of a normal element specifier. Eg: To extract the hotelRequestId from the variable submitHotelReviewRequest which has a format similar to the following: You can use a js snippet as follows:
Related Links:
https://developer.mozilla.org/en-US/docs/E4X/Processing_XML_with_E4X
http://www.taval.de/publications/INPROC-2009-25/
http://stackoverflow.com/questions/922668/e4x-grab-nodes-with-namespaces

Friday, May 3, 2013

Few tips to setup a Linux UPnP/DLNA Media Server for iPad

For converting files to the Apple compatible format, I use arista-transcode
..or ffmpeg
In AVI/MKV files, sometimes there are AVI files with 2 audio streams,  the first and default track is not in your preferred language, but the second track is. This causes problems when you view it in a player that does not support multiple audio tracks. Here's how to delete the unwanted audio tracks and making one the default audio, using the MKVtoolnix package.

First, get the audio track info so we know which one to keep.
mkvmerge -i input.mkv

Then copy only selected audio tracks to the new file with --atracks option. Here 2 is the Audio Track ID we need to keep.
mkvmerge -o output.mkv --atracks 3 input.mkv

My preferred Media Server is MediaTomb.
mediatomb -e wlan0
Here I have used the wireless network interface to bind to, so all the other devices on the Home WiFi can connect to this server.
It also supports transcoding to perform format conversion of your content on the fly allowing you to view media that is otherwise not supported by your player. If you like to go ahead with tinkering the configuration, find it here: ~/.mediatomb/config.xml and change 'no' to 'yes' on the '<transcoding enabled="no">' line. But for mediatomb and iOS devices it's hard to find the right configuration for live transcoding. So I'm sticking to the above manual conversion.

Sources:
http://superuser.com/a/77582/52620
http://www.videohelp.com/tools/MKVtoolnix
http://www.techradar.com/news/digital-home/media-servers/build-a-transcoding-upnp-media-server-923345

Wednesday, April 17, 2013

How to use Hibernate as the persistence layer for Apache ODE/WSO2 BPS

Note: In order to run ODE/BPS under Hibernate, you will have to include external dependencies (and accept Hibernate LGPL license).

By default, Apache ODE/WSO2 BPS uses OpenJPA as the persistence layer, but also includes implementation for Hibernate as well. For switching to Hibernate add the following system propety. (For WSO2 BPS you can do it via $CARBON_HOME/bin/wso2server.sh)
-Dode.persistence=hibernate \

Make sure you have copied the required Hibernate jar to $CARBON_HOME/repository/components/lib directory.
If you are getting errors at server start up, check whether the necessary tables have been automatically created by Hibernate. If not, you can use a script to manually create the tables (similar to the following used for MySQL DB)  Note Hibernate has slightly different database schemas and also uses "BPEL_" prefix in table names instead of "ODE_" prefix.
If you are using a DB other than Apache Derby, H2, MySQL or Oracle, and having trouble resolving the DB dialect from the database product name, you can manually set the HIBERNATE_DIALECT in org.apache.ode.daohib.bpel.BpelDAOConnectionFactoryImpl class. For implementation details see dao-hibernate and dao-hibernate-db modules in Apache ODE source.

Related discusson on "Switch to the hibernate DAO layer" mail thread.

Wednesday, February 20, 2013

ReplyTo header in Unified Endpoint configuration of WSO2 BPS

In a BPEL process, when there is an invoke to an external synchronus web service, and if you want to send the response of this service to a different endpoint (rather than sending back to the BPEL process), you can use Unified Endpoint configuration of WSO2 BPS 3.0.0 to set the WS:Addressing ReplyTo header as follows:
You can refer to this config file (locatd in registry or in the file system) as follows, inside the deploy.xml file:
There are other use cases of UEP like adding QOS, Security etc. You can read more on that here.

Tuesday, February 19, 2013

Use of 'DynamicImport-Package: *' in OSGi

In OSGi, 'DynamicImport-Package' attribute is used in the MANIFEST.MF file to specify the patterns of packages that are not found in the normal bundle contents or Import-Package field. If the package is not available in the initial resolution process, it will not fail, but will be attempted to resolve every time a class from the package is required.

 'DynamicImport-Package: *' is a trick used by bundles to allow importing client packages which are not known during bundle build time, in addition to its own dependencies, to prevent ClassNotFoundException issues. [i.e. If there are classes which have Class.forName (or other dynamic look up)] This turns OSGi Framework into a very expensive class path for the packages involved and breaks the concept of versions in OSGi. Use of this attribute is said to be a sign of a non-modular design and it might be a good time to revisit the architecture.

To learn more:

Monday, February 11, 2013

How to make use of WS-Addressing ReplyTo header in an Asynchronus BPEL Process


In Apache ODE or WSO2 BPS, if you are looking for a way to asynchronously call back from a BPEL process, after the process is finished, to an reply address dynamically provided in the Request Message with WS-Addressing headers, you can copy the wsa:Address from the ReplyTo header, to the partnerLink related to the final invoke as follows:
If you're testing this with SOAP UI, make sure you include wsa:Action, wsa:To, wsa:ReplyTo and MessageID in the request. Otherwise you will get an error similar to 'org.apache.axis2.AxisFault: A required header representing a Message Addressing Property is not present'
You can read more here about Using WS-Addressing in SOAP UI
Hat-tip: From Apache ODE mail archives, Related question from StackOverflow

Friday, February 8, 2013

How to clean up Instance data for a given BPEL Process Instance ID from Apache ODE/WSO2 BPS

This is a stored procedure that can be used to delete all the instance related data from the DB for a particular BPEL instance.

Thursday, February 7, 2013

How to find BPEL Process Instance ID from Correlation Property Value in Apache ODE/WSO2 BPS

This is a small SQL query to retrieve Process Instance ID from the DB, when we know a Correlation Property Value, for a simple case where the correlation set consists of only one property.

SELECT PROCESS_INSTANCE_ID FROM ODE_SCOPE WHERE SCOPE_ID IN (SELECT cs.SCOPE_ID FROM ODE_CORRELATION_SET cs WHERE cs.CORRELATION_SET_ID IN (SELECT os.CORRSET_ID FROM ODE_CORSET_PROP os WHERE os.PROP_VALUE='$CORR_PROP'));

Here, use the respective correlation property value instead of $CORR_PROP