In org.apache.jena.riot.web.HttpOp there is a call to
SchemeRegistryFactory.createSystemDefault(). This method is new in HTTPClient
4.2.
public static HttpClient createCachingHttpClient() {
return new SystemDefaultHttpClient() {
/** See SystemDefaultHttpClient (4.2). This version always sets the
connection cache */
@Override
protected ClientConnectionManager createClientConnectionManager() {
PoolingClientConnectionManager connmgr = new
PoolingClientConnectionManager(
SchemeRegistryFactory.createSystemDefault());
String s = System.getProperty("http.maxConnections", "5");
int max = Integer.parseInt(s);
connmgr.setDefaultMaxPerRoute(max);
connmgr.setMaxTotal(2 * max);
return connmgr;
}
} ;
} ;
If you would be willing to replicate the code that is in httpclient 4.2+,
rather than calling SchemeRegistryFactory.createSystemDefault(), I would be
much obliged. The code in SchemeRegistryFactory is
public static SchemeRegistry More ...createSystemDefault() {
SchemeRegistry registry = new SchemeRegistry();
registry.register(
new Scheme("http", 80, PlainSocketFactory.getSocketFactory()));
registry.register(
new Scheme("https", 443,
SSLSocketFactory.getSystemSocketFactory()));
return registry;
}
-----Original Message-----
From: Rob Vesse [mailto:[email protected]]
Sent: Wednesday, October 23, 2013 10:30 AM
To: [email protected]
Subject: Re: Use of recent features from httpclient
We are always open to making the code as widely compatible as possible.
Could you point out where we call the troublesome method or provide a relevant
stack trace from your environment?
It's possible that this is something that gets called by the internals of HTTP
Client in which case we would likely not be able to change this.
Rob
On 23/10/2013 15:42, "Altmann, Michael"
<[email protected]<mailto:[email protected]>>
wrote:
>Sometime between version 2.7.3 and 2.11.0, jena upgraded the version of
>the apache httpclient library. It now uses 4.2.3. In particular, it
>calls a method that was added in the 4.2 version of httpclient, namely
>org.apache.http.impl.conn.SchemeRegistryFactory.createSystemDefault().
>
>While that is a completely reasonable thing to do from the Jena
>development point of view, it is causing us trouble. Our application
>uses Jena and also uses GWT (Google Web Toolkit). Even the most recent
>version of GWT ( 2.5.1) comes packaged with an old, 4.0, version of the
>org.apache.http.impl.conn.SchemeRegistryFactory class, which lacks the
>createSystemDefault() method. This means that we cannot use Jena
>beyond version 2.7.3 until GWT Fixes its packaging (see
>https://code.google.com/p/google-web-toolkit/issues/detail?id=4484).
>There are several bug fixes in recent versions of Jena that I would
>love to pick up, but cannot. Is there any chance that Jena would be
>willing to develop against httpclient is a way that is backwards
>compatible with httpclient 4.0?
>
>Thanks, Michael Altmann