1

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.

DuncanKinnear
  • 4,563
  • 2
  • 34
  • 65
  • OK, we got it working again, but don't know why. We were using version 1.6.1 of blueprint-core. We've upped that to 1.6.2 and the problem goes away. If anyone can shed light on why, that would be good. – DuncanKinnear Dec 06 '21 at 01:37
  • I can confirm the same experience. Switching to 1.6.2 solved it. The problem does not occur for servers that do not have internet connectivity. It is related to loading the XSD for the blueprint XML from internet. – majster Dec 06 '21 at 13:35
  • Yes, it would be good if there was some way to stop Blueprint going to the internet each time. – DuncanKinnear Dec 06 '21 at 19:00

1 Answers1

0

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.

  • Note that the same error happens with blueprint-core 1.7.1 in Apache Karaf (sorry, I don't have enough reputation to add this comment on the question). – Marc Durand Dec 08 '21 at 19:48