Search code examples
apache-camelblueprint-osgicamel-cxf

Blueprint container error on OSGi bundle start up


We have a Karaf OSGi server that has a bundle used for incoming web requests using CAMEL/CXF.

Since the weekend, when the server starts, the bundle has been giving the following error:

Unable to start blueprint container for bundle uniworks-camel-web-services/2.3.5 org.xml.sax.SAXParseException; systemId: http://cxf.apache.org/schemas/configuration/cxf-beans.xsd; lineNumber: 1; columnNumber: 1; Premature end of file.
        at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:203)[:1.8.0_221]
        at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.fatalError(ErrorHandlerWrapper.java:177)[:1.8.0_221]        at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:400)[:1.8.0_221]
.. etc. (I can supply more of the stack trace if required)

The code has not changed in this area, and even older versions of the same servers now have this issue.

It has stopped one of our Customers dead in their tracks, so any help would be greatly appreciated.


UPDATE: We updated the version of blueprint-core to 1.6.2 and this allowed the bundle to start OK. Obviously this version doesn't insist on the internet being there to check the XML.

The steps we did on our Karaf server were:

  1. Download the org.apache.aries.blueprint.core-1.6.2.jar and put in the folder system/org/apache/aries/blueprint/org.apache.aries.blueprint.core/1.6.2/
  2. Changed the version of 'blueprint-core' in system/org/apache/karaf/features/standard/4.0.5/standard-4.0.5-features.xml to 1.6.2
  3. Created an overrides.properties file in the Karaf etc folder with the line: mvn:org.apache.aries.blueprint/org.apache.aries.blueprint.core/1.6.2

A Karaf server restart then picks up the new version.


Solution

  • It appears as though the http status code of 301 (moved permanently) being returned by the web site is not handled on the Java side. As a workaround, you can add "127.0.0.1 cxf.apache.org" to the hosts file, or block internet access using the operating system firewall.