Wednesday, April 13, 2011

JBoss - using properties-service.xml to set environment variables

In every JBoss installation there will be a file called "properties-service.xml" in the deploy folder.  This file allows you to setup environment variables (rather then setting them at the JVM/System level) which all deployed applications can then use by calling the System.getProperty() method.  Just uncomment the section shown below to enable some global properties or use the URLList to point to external properties files:

[code language="xml"]
<!--
Set raw properties file style properties.
-->
<attribute name="Properties">
ATTRIBUTE_NAME_1=somevariable
ATTRIBUTE_NAME_1=anotherVariable
</attribute>
[/code]

Thursday, April 7, 2011

Debugging Flex 3 applications with Flash Player 10

I came across a problem recently when trying to debug my application after upgrading from Flash Player 9 (Debug version) to 10.2 (Debug version).  As soon as I upgraded my application stopped logging.  I searched everywhere and whilst I found a lot of people with the same problem never really found an answer.

After a lot of digging it appears to be the way you target the flash player version.  My application was targetting Flash Player 9 (in my flex-config.xml):

[code language="xml"]<target-player>9.0.124</target-player>[/code]

Changing this to 10 started the trace logging again.  As I wanted to maintain the v9 target I've ended up reverting back to Flash Player 9 to get the logging working again.

Wednesday, April 6, 2011

get-collection-size() vs size() in LiveCycle

Just a note to be careful when using the XPath expressions get-collection-size() and size() in LiveCycle to count the number of elements in a list variable. If your list is empty the two functions will not return the same value

Creating a test process to demonstrate this I added three variables:

  • lstTestList

  • intCountList -> count(/process_data/lstTestList)

  • intCollectSizeList -> get-collection-size(/process_data/lstTestList)


Running this process on an empty list gives the following output:

  • intCountList -> 1

  • intCollectSizeList -> 0


So if trying to find out whether or not a list is empty use get-collection-size() and not count()