Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
cave-2.3.0
-
None
-
All
Description
karaf-cave throws an exception and stops scanning if jsoup reads an unsupported mime type
For example, if your type the following commands into karaf:
karaf@root> features:addurl mvn:org.apache.karaf.cave/apache-karaf-cave/3.0.0-SNAPSHOT/xml/features
karaf@root> features:install cave-obr-server
karaf@root> cave:create-repository sonatype
karaf@root> cave:proxy-repository sonatype http://repo.maven.apache.org/maven2/org/sonatype/nexus/capabilities/nexus-capabilities-testsuite-helper/2.1/
Cave will throw the following error:
org.jsoup.UnsupportedMimeTypeException: Unhandled content type. Must be text/*, application/xml, or application/xhtml+xml. Mimetype=application/zip, URL=http://repo.maven.apache.org/maven2/org/sonatype/nexus/capabilities/nexus-capabilities-testsuite-helper/2.1/nexus-capabilities-testsuite-helper-2.1-bundle.zip
at org.jsoup.helper.HttpConnection$Response.execute(HttpConnection.java:436)[174:org.jsoup:1.7.1]
at org.jsoup.helper.HttpConnection$Response.execute(HttpConnection.java:393)[174:org.jsoup:1.7.1]
at org.jsoup.helper.HttpConnection.execute(HttpConnection.java:159)[174:org.jsoup:1.7.1]
at org.jsoup.helper.HttpConnection.get(HttpConnection.java:148)[174:org.jsoup:1.7.1]
at org.apache.karaf.cave.server.storage.CaveRepositoryImpl.proxyHttp(CaveRepositoryImpl.java:253)[176:org.apache.karaf.cave.server.storage:3.0.0.SNAPSHOT]
at org.apache.karaf.cave.server.storage.CaveRepositoryImpl.proxyHttp(CaveRepositoryImpl.java:260)[176:org.apache.karaf.cave.server.storage:3.0.0.SNAPSHOT]
To fix this, just catch the jsoup exception and ignore the file.
Patch included.
Thanks.
Don Corley