When moving an existing SA from ServiceMix 3 to ServiceMix 4, you can run into exceptions like this that indicate that a namespace handler could not be found.

In ServiceMix 3, all the JAR files that are part of the container classpath are automatically available to the SU. In ServiceMix 4, the OSGi classloading mechanism is more fine-grained, so not every bundle is automatically available to the SU.

An example: if you encounter Unrecognized xbean namespace mapping: http://www.springframework.org/schema/util, you would have to add the bundle that contains the namespace handler for this namespace to your classpath. In this case, the namespace handler is available in the Spring framework bundle with bsn org.springframework.beans), so you can fix the problem by adding an explicit reference to the bundle to your xbean.xml

<beans xmlns:util="http://www.springframework.org/schema/util"
       ...>

  <classpath>
    <library>osgi:org.springframework.beans</library>
  </classpath>

  <util:constant static-field="java.sql.Connection.TRANSACTION_SERIALIZABLE"/>

</beans>
  • No labels