Archive for the ‘xalan’ Category

TransformerException: Could not initialize BSF Manager

17 February 2010 Leave a comment

If you get the following exception

org.apache.xalan.extensions.ObjectFactory$ConfigurationError: Provider org.apache.bsf.BSFManager
not found
	at org.apache.xalan.extensions.ObjectFactory.newInstance(
	at org.apache.xalan.extensions.ExtensionHandlerGeneral.(
	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
	at sun.reflect.NativeConstructorAccessorImpl.newInstance(

and further down

Caused by: javax.xml.transform.TransformerException: Could not initialize BSF Manager at org.apache.xalan.extensions.ExtensionHandlerGeneral.<init>(Ext 

it means that the BSF manager could not be instantiated. This is because in ExtensionHandlerGeneral, xalan looks for a property called org.apache.xalan.extensions.bsf.BSFManager which points to the BSFManager it should use. If it does not find it then it tries to find the default BSFManager which is the org.apache.bsf.BSFManager class. If it does not find any of them then it throws the above exception. Normally xalan should be able to load the default manager (if you have the Bean Scripting Framework jar (bsf.jar) in your classpath) but in case it does not, you might have to explicitly define it by passing the org.apache.xalan.extensions.bsf.BSFManager either in the command line

java -Dorg.apache.xalan.extensions.bsf.BSFManager=org.apache.bsf.BSFManager ...

or by programmatically setting the property using the System class


This should make the error go away.

Categories: xalan Tags: , ,