... until the collector arrives ...

This "blog" is really just a scratchpad of mine. There is not much of general interest here. Most of the content is scribbled down "live" as I discover things I want to remember. I rarely go back to correct mistakes in older entries. You have been warned :)

2004-12-23

CruiseControl

I had trouble getting the CruiseControl JSP page that displays build results to work.  It kept getting a 'file not found' error for the log files.  The problem turned out to be caused by spaces in the pathname.  The spaces were being URL-escaped (to %20), but the file was being referenced directly, not as an URL.  This appears to be a bug in CruiseControl.

I have set up a skeletal data directory for a CruiseControl build server.  Since the CruiseControl config.xml does not support variables and is quite repetitive in structure, this skeleton uses Ant to generate the configuration from a simpler configuration file.

2004-12-14

JMeter

Apache's JMeter has sure come a long way since I last looked at it.  It seems to be capable of quite sophisticated web load testing.

2004-12-13

SQL Server

In the absence of Enterprise Manager, here is how to create and configure a login using OSQL:

  1. sp_addlogin 'userid','password','defaultdb'
  2. sp_adduser 'userid'
  3. sp_addrolemember 'db_owner','userid'

To switch MSDE to use 'mixed mode' authentication, set the registry key:

HKLM\Software\Microsoft\MSSqlserver\MSSqlServer\LoginMode

to '2' ('1' is Windows authentication mode only, the default).

XSLT

The key() function is sensitive to the current context node in that it will only find nodes that are in the current document.  This is surprising behaviour.  The XSLT specification actually notes this "feature" (read: bug) at the end of section 12.2.  It suggests using <xsl:for-each select="$document"> construct to switch the context prior to using the key function.  That wouldn't work for me in a stylesheet that I was working on because I needed an XPath expression.  This worked:  $root[key('...', ...)]

2004-12-07

JBOSS

To configure a JDBC data source for a web application in JBOSS, perform the following steps:

  1. Add a reference to the data source in web.xml:
    <resource-ref>
      <description>My Data Source</description>
      <res-ref-name>jdbc/my-data-source</res-ref-name>
      <res-type>javax.sql.DataSource</res-type>
      <res-auth>Container</res-auth>
    </resource-ref>
  2. Map the reference name to a JBOSS-style JNDI name in the vendor-specific data source, jboss-web.xml:
    <resource-ref>
      <res-ref-name>jdbc/my-data-source</res-ref-name>
      <res-type>javax.sql.DataSource</res-type>
      <jndi-name>java:/my-data-source</jndi-name>
    </resource-ref>
  3. Create a data source for the JBOSS-style JNDI name by creating a data source file named my-data-source-ds.xml in the JBOSS deploy directory, containing:
    <datasources>
      <local-tx-datasource>
        <jndi-name>my-data-source</jndi-name>
        <connection-url>jdbc:some url</connection-url>
        <driver-class>some.driver</driver-class>
        <user-name>user</user-name>
        <password>password</password>
        <max-pool-size>20</max-pool-size>
        <min-pool-size>0</min-pool-size>
        <blocking-timeout-millis>5000</blocking-timeout-millis>
        <prepared-statement-cache-size>0</prepared-statement-cache-size>
        <check-valid-connection-sql>select 1</check-valid-connection-sql>
      </local-tx-datasource>
    </datasources>

2004-12-06

MSXML

Here is how to perform an XSLT transformation and write the result to a file:

var outputStream = new ActiveXObject("ADODB.Stream");
outputStream.Open();
outputStream.Type = 1; // adTypeBinary
xmlDoc.transformNodeToObject(xslDoc, outputStream);
outputStream.SaveToFile("output.html", 2); // adSaveCreateOverWrite
outputStream.Close();

Blog Archive