Kamal Wickramanayake's blog

Offline installation of Propel ORM tool (for PHP)

Linux users: The process is almost the same. See the bottom of this page.

Spring JPA web applications (JTA transactions, JBoss 5)

With Spring 3.x, you can develop JPA applications very easily. Here you find guidelines in creating such an application with the following features:

JAX-WS Web services in JBoss 5 do not work (JDK 1.6, Eclipse IDE)?

Environment: JDK 1.6, JBoss 5.1, Eclipse 3.5 (Galileo)

I came across the following JBoss error when a JAX-WS Web service was accessed:

11:15:18,008 ERROR [SOAPFaultHelperJAXWS] SOAP request exception
java.lang.UnsupportedOperationException: setProperty must be overridden by all subclasses of SOAPMessage
    at javax.xml.soap.SOAPMessage.setProperty(SOAPMessage.java:441)
    at org.jboss.ws.core.soap.SOAPMessageImpl.<init>(SOAPMessageImpl.java:87)

Convert MySQL tables and data from latin1 to utf8

Context: MySQL tables maintain textual data in latin1 character encoding unless the default settings are overridden at the server, database, table or column level. Still it is possible that text in utf8 goes into these latin1 tables (for example via a web form submission). For some reason you want to change the character set from latin1 to utf8.

What is a good software project estimate?

When software projects go out of hand, estimators are often blamed for not doing their job correct. While there is no question about the negative consequences of hasty estimates, how do you identify if an estimate is good (or bad) in the first place? And to what extent can we relate a failed software project to its estimate?

Here are the characteristics of a good software project estimate:

  1. Based on a well defined and credible effort/cost model (estimation technique).
  2. Detailed enough so that the coverage of the full scope is verifiable and leads to no ambiguity.
  3. The validity, relevance and credibility of historical data used and expert judgment are maintained high.
  4. Assumptions are clearly mentioned and verified with the client. Tendency of assumptions not to hold true is evaluated - failures are either tackled as risks or added to the Terms and Conditions of the contract.
  5. Risks identified, their impact assessed, and incorporated into the estimate.
  6. Facilitates future revision without much burden.

Apart from the above, a good estimate needs to be accepted and supported by the development team, project manager and other stakeholders of both the development company and the client.

In short, a good software project estimate is one that helps create a realizable development plan and that's it (It should also support realizable plan revisions anyway.). This point is important. So read this paragraph again.

If a project fails even with such a good estimate, there's no point of blaming the estimators. It's a matter of not following the initial plan that was expected and conceived to be realizable. As we already know, there are many other reasons for software project failures.

Configuring a JBoss + Spring + JPA (Hibernate) + JTA web application

Updated version available: If you are looking for how JPA can be used in JBoss 5 and Spring 3.x versions, look at "Spring JPA web applications (JTA transactions, JBoss 5)". What you find below is a workaround to use JTA transactions in JBoss 4.x versions.

Here's how one might go about deploying a Spring application in JBoss (4.something) that uses JPA with Hibernate as the provider for persistence and JTA for transaction demarcation.

How to redirect the ALSA output to a file?

Different people have tried this in different ways. For me, configuring ALSA to capture from the "Mix" device didn't work since I don't have a "Mix" listed when I try the amixer command. I could however write the ALSA output to a file by configuring the PCM chain.

Have the following code in your ~/.asoundrc file:

You are a spammer anyway, even if you are not!

I recently encountered an irritating problem – in fact for the second time. My IP address received from the service provider is blacklisted at Spamhaus. Effect? I send legitimate emails to my clients, they don't receive them. Neither do I receive any warning.

Sri Lanka Telecom (SLT)