Home > xalan > TransformerException: Could not initialize BSF Manager

TransformerException: Could not initialize BSF Manager

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(ObjectFactory.java:462)
	at org.apache.xalan.extensions.ExtensionHandlerGeneral.(ExtensionHandlerGeneral.java:204)
	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)

and further down

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

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: , ,
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: