Monday 2 November 2009

Testing my posterous account

I this message appears in twitter and on my blog then posterous has processed my email and put it both on my blog and on twitter

this is a test

Posted via email from Paul's posterous

Wednesday 5 August 2009

How to fix the Glassfish Admin App

Recently we've been having intermittant issues with the GlassFish 2.1 (b.60e) Web Administration Console. The behaviour is that after successfully login you get a HTTP 500 error instead of the web app As follows (minus colours)

HTTP Status 500 - type Exception report

message
descriptionThe server encountered an internal error () that prevented it from fulfilling this request.

exception
javax.servlet.ServletException: java.lang.reflect.InvocationTargetException while attempting to process a 'beforeCreate' event for 'sun_frameSet4'.

root cause
java.lang.RuntimeException: java.lang.reflect.InvocationTargetException while attempting to process a 'beforeCreate' event for 'sun_frameSet4'.

root cause
java.lang.reflect.InvocationTargetException

root cause
javax.xml.transform.TransformerFactoryConfigurationError: Provider org.apache.xalan.processor.TransformerFactoryImpl not found

note The full stack traces of the exception and its root causes are available in the Sun GlassFish Enterprise Server v2.1 logs.
Sun GlassFish Enterprise Server v2.1

At first we were told it was a jar class but I was skeptical as the appserver should keep those isolated from one application to another, however there is something I overlooked that creeps across applications which is the System Properties which are across the JVM.

In the end the issue is down to how the TransformerFactory creates a new instance which uses system properties, more details follow:

Issue:
The Admin app breaks displaying the http 500 error after a successful logon when the javax.xml.transform.TransformerFactory system property is set to a class that is not in its classpath.

Rationale:
This is due to the way that the TransformerFactory is implemented which the Admin app calls to get an XML parser.

To get an XML parser javax.xml.transform.TransformerFactory.newInstance()is called and this uses the following ordered lookup procedure to determine the TransformerFactory implementation class to load:

  • Use the javax.xml.transform.TransformerFactory system property.
  • Use the properties file "lib/jaxp.properties" in the JRE directory. This configuration file is in standard java.util.Properties format and contains the fully qualified name of the implementation class with the key being the system property defined above. The jaxp.properties file is read only once by the JAXP implementation and it's values are then cached for future use. If the file does not exist when the first attempt is made to read from it, no further attempts are made to check for its existence. It is not possible to change the value of any property in jaxp.properties after it has been read for the first time.
  • Use the Services API (as detailed in the JAR specification), if available, to determine the classname. The Services API will look for a classname in the file META-INF/services/javax.xml.transform.TransformerFactory in jars available to the runtime.
  • Platform default TransformerFactory instance.

see http://java.sun.com/j2se/1.5.0/docs/api/javax/xml/transform/TransformerFactory.html#newInstance()

System Setting are across the JVM and by default the javax.xml.transform.TransformerFactory system property is not set.

Fix:
Remove the javax.xml.transform.TransformerFactory system property and use one of the other methods to determine the TransformerFactory implementation class

Wednesday 1 April 2009

Looping through a file search in unix

Little handy script in unix to get file details from a find result
#!/bin/sh

# Find all the log files and loop through them
for file in `find $HOME -type f -name \*.log`; do
  # Get the file details
  ls -al $file
done

Thursday 19 March 2009

GlassFish ESB Netbeans Server Starting Issue

Been having a few issue while doing the OpenESB  tutorials http://wiki.open-esb.java.net/Wiki.jsp?page=OpenESBIntroductionTutorial in that the GlashFish server doesn't connect up in Netbeans.

Symptoms:

On the Server's tab in NetBeans you right click start on GlashFish V2, it starts up in the Glassfish Log but you get a time out and the GUI displays the server as not started.  You can also go to the Admin console on http://localhost:4848 and everything looks fine and dandy.

Solution or at least the solution I found:

I seem to have a wierd setup where I mapped localhost to a MS Loopback Adaptor address, however when you ping this in cmd you still get the IP loopback address of 127.0.0.1.  I came to the conclusion that the server is taking the 127.0.0.1 IP and netbeans is resolving it to the MS Loopback address, so I change my host file c:\windows\system32\drivers\etc\hosts so that localhost is mapped back to the 127.0.01 IP loopback address.  Hey presto it now seems to work fine.

Wednesday 11 March 2009

Manually undeploying a Service Assembly in ServiceMix

Adding this entry mainly as a reference for myself.

The issue is that there is a a maven jbi plug-in deploy job but not an undeploy job which from a configuration management point of view is plain stupid.  Anyway if you have a maven service mix project that you've deployed the service assembly using the maven command:

mvn jbi:projectDeploy
Then you're going to have fun undeploying it as apparently there is no undeploy task see http://www.nabble.com/How-to-undeploy-a-SA-in-serviceMix-td16736845.html or http://markmail.org/message/67pysr5olbq6wazt this can be done in ant (great another technology to use !) or manually by doing:
  1. Stop ServiceMix
  2. Go to /data/smx/serviceassemblies & delete the service assembly folder
  3. Restart ServiceMix
To do this in ant you use the command:
ant -f servicemix-ant-task.xml -Dsm.username=smx -Dsm.password=smx -Dsm.service.assembly.name=NAME_OF_THE_SA undeploy-service-assembly

Update:

Instead of using
mvn jbi:projectDeploy -DforceUpdate=true

Clear ServiceMix by stopping ServiceMix, deleting everything in the /data and restarting.  Then just copy the jar from the /target/.jar to the /hotdeploy directory.

Appatently the force update redeploy's artifacts that don't need to be redeployed, see http://cwiki.apache.org/SM/discussion-forums.html#nabble-p21474293

Thursday 5 March 2009

First blog using iBlogger

Here we go, just bought the app at a discounted rate of 59p or $0.99 after scanning the reviews.

It works :-)

Savings products cut

Had a leaflet from Barclays yesterday entitled "Important information about our savings accounts" and was shocked to see that on page 3 they have cut 22 products leaving just 8 remaining.

Now some of this looks like some housekeeping such as removing the postal savings account but I was supprised to see the 30 and 60 day savings disappear, so it looks like it's not just the lending products that are being cut.

Details of the accounts are as follows:

Current range of Savings Accounts (8)
  • Active Savings
  • e-Savings
  • e-Savings Reward
  • Nest-egg Savings
  • Barclays Cash ISA
  • Tax Haven ISA
  • Children's Savings Account
  • BarclayPlus

Accounts no longer available to new savers (22)
  • Barclays Easy Saver
  • Barclays Flexible Saveings
  • Barclays Instant Cash Account
  • Barclays Instant Savings Account
  • Barclays Openplan Savings
  • Barclays TESSA-Only ISA
  • Bonus Saver
  • junior BarclaysPlus
  • Postal Account
  • Baby Postal Account
  • Barclays Savings Reserve
  • Day to Day Savings
  • Prime Account
  • Regular Savings Account
  • Reward Saver
  • Savings Builder
  • Tax Beater Cash ISA
  • Tracker Savings Account
  • 30 Day Savings Account
  • 60 Day Savings Account
  • Premier Openplan Savings
  • Premier Cash Reserve