... 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 :)

2006-06-30

Tomcat Deployment By Reference

You can deploy web applications and static content in Tomcat without dropping files into the webapps directory.  This is useful if you want the content to reside outside of the Tomcat directory tree.  You do this by putting a Context fragment in the host's configuration directory (e.g. ${TOMCAT_HOME}/conf/Catalina/localhost).  That is, use an XML file that looks like this:

<Context path="/mycontent" docBase="c:\somewhere\mycontent"/>

The docBase can be a WAR file.

2006-06-28

The QName Saga Continues

Sun "fixed" the QName bug as of JDK 1.5.0_07.  That is, they changed the serialver of QName back to what it used to be back in JDK 1.4.  However, this "fix" is problematic since many vendors have already issued patches to accommodate the bug.  For example, BEA has an elaborate workaround to make WebLogic 9.1 interoperate with older version of QName (e.g. as you might find in ALDSP 2.1/WebLogic 8.x).  That workaround is now broken with JDK 1.5.0_07.

However, Sun has thoughtfully provided the system property:

-Dcom.sun.xml.namespace.QName.useCompatibleSerialVersionUID=1.0

Sparse documentation about this magic incantation can be found in the JAXP 1.3.1 release notes.  When this property is defined, QName will use the serialver ID that existed for only a few microrevs of JDK 1.5.  For reference, here are the relevant serialvers:

Prior to JDK 1.5: -9120448754896609940L
JDK 1.5.0, microrevs _00 through _06: 4418622981026545151L
JDK 1.5.0_07 (and hopefully, everything greater): -9120448754896609940L (once again)

Interestingly, the JDK 1.5.0_07 release notes say that the relevant bug in the Java Bug Parade is "fixed", but the notes for that bug say that no action was taken (which is not true).

WebLogic 9.x vs. JDK 1.5.0_07

WebLogic 9.x won't start at all under JDK 1.5.0_07, even if ALDSP is not in the picture at all.  There seems to be some component within the server that still wants to use the '4418' version of QName.  The magic incantation above will fix the problem.  Check out the thread "javax.xml.namespace.QName incompatible" in the BEA WebLogic server newsgroup.

2006-06-26

Mysterious Stale Data in JIRA

Okay, it happened again.  This time, a JIRA item (RAPT-558) did not show in the All filter for the RAPT project -- or any other filter for that matters.  You could load the item directly, it just didn't appear in any lists.  Rebuilding the indexes corrected the problem.

Oracle, SQL*Plus, PL/SQL

SQL*Plus will behave as you expect when executing this sequence:

variable result number;
update zot set x=x+1 returning x into :result;
print result;

but not this sequence:

variable result number;
select count(*) into :result from user_catalog;
print result;

In the latter case, the SELECT statement is accepted and executed, but the INTO clause is not respected.  On the other hand, you can make it work by using a PL/SQL block:

variable result number;
begin
  select count(*) into :result from user_catalog;
end;
/
print result;

While we're on the topic of SQL*Plus, here are some useful snippets that I haven't captured before...

set echo on
whenever sqlerror exit failure

define supplied_user = &&1
define supplied_tablespace = &&2

prompt Creating tables for &&supplied_user in &&supplied_tablespace

declare
  table_count number;
begin
  select count(*) into table_count from user_catalog where table_name='ZOT';
  if 0 = table_count then
    execute immediate
      'create table &&supplied_user..zot (x integer) '
      || ' tablespace &&supplied_tablespace'
      ;
  end if;
end;
/

Note the two dots in "create table &&supplied_user..zot".  The second dot is needed because SQL*Plus will gobble the first dot it sees after any use of the "&" operator (unless you change that behaviour using SET CONCAT).

2006-06-23

Windows Service Dependencies

You can add a dependency between one Windows service and another by creating a REG_MULTI_SZ key with the name:

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\dependent service name\DependOnService

The value is a newline-delimited list of prerequisite service names (identified by their registry key name).

2006-06-21

<a name="Mysterious_Stale_Data_in_JIRA">Mysterious Stale Data in JIRA</a>

Twice now we have run into problems in JIRA where data shown in an issue list differs from the detail page of an issue.  The first time, the state of an issue was wrong on the issue list.  The second time, the summary was wrong.  The first time, I cleared the issue cache -- even though the cache was supposedly disabled.  This appeared to clear the problem, but someone else had also added a comment to the issue so I don't which action (if either) caused the update.  The second time, I restarted JIRA to no effect.  The problem went away after I changed the summary of the issue, although someone else had tried that a couple of times already.

The next time this occurs, I am going to try re-indexing using Administration/System/Indexing.

2006-06-20

File URLs in Firefox

In Firefox, it is possible to trust file URLs on a configured set of sites.  Add the lines like this to user.js:

user_pref("capability.policy.policynames", "localfilelinks");
user_pref("capability.policy.localfilelinks.sites", "http://site1 http://site2");
user_pref("capability.policy.localfilelinks.checkloaduri.enabled", "allAccess");

For some reason, it is hard to add these preferences using about:config.  You can create these keys, but they are not shown on the configuration page so you are typing blind.  They do appear in the prefs.js file, however.  More information on configurable security policy can be found at:

http://www.mozilla.org/projects/security/components/ConfigPolicy.html

2006-06-16

OpenWiki

To delete a page in OpenWiki, add the line "#DEPRECATED" to the top of the page.  Then, run the administrative page deprecate.asp to actually delete deprecated pages.  You must edit that script first because it is shipped in a non-functional state (for protection).  Also, it includes a parameter for the minimum length of time that a page must remain unedited before it is deleted.

2006-06-12

Eclipse RCP

When you use the export function of an Eclipse RCP production configuration, it overwrites the plugin.xml of the main application project to update the 'about' screen.  This behaviour is a bit unexpected, and is not friendly to the version control system.

2006-06-09

Subversion and Ant

Here is a cheesy, but effective, way to recover the current Subversion revision number of a directory using only Ant -- the Subversion client is not necessary:

<project name="svn-version" default="get-svn-revision">

  <xmlproperty file="../.svn/entries" prefix="svn"/>

  <target name="get-svn-revision">
    <echo message="${svn.wc-entries.entry(revision)}"/>
  </target>

</project>

I call this method cheesy, because it depends on the internal details of the SVN entries file, the format of which is subject to change.  Also, it relies on the fact that the first entry is the one that contains the revision number for the directory since the Ant xmlproperty task does not handle duplicate elements.  The method has its charms, however, since it does not require the Subversion client to be on the path (or even installed), and does not need any temporary files (such as those the xslt task might demand).

QA

A good quality in a QA person is the ability to raise issues with developers without immediately polarizing the discussion.  The personalities of both QA people and developers make this a challenging proposition sometimes.

Blog Archive