Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[jersey-dev] support request for using ApacheConnectorProvider to connect via proxy

Hi, I guess this is not the appropriate place to post this request but I have not been able to find the right place.

So please if the request is not appropiate point me to the right place.

I have a Jersey client properly working but I'm struggling to use it to connect via a proxy.

Using documentation

https://eclipse-ee4j.github.io/jersey.github.io/documentation/latest/user-guide.html#client

and stackoverflow I have been led to guess that I have to use ApacheConnectorProvider

So I have added to the configuration of the client these two lines

configuration.connectorProvider(new ApacheConnectorProvider());

configuration = configuration.property(ClientProperties.PROXY_URI, "localhost:8000");

(I need proxy for debugging purposes, not production)

Of course I have added

jersey-apache-connector-2.25.1.jar

to the classpath.

When I run the client I get this exception

java.lang.NoClassDefFoundError: org/apache/http/protocol/HttpContext
	org.glassfish.jersey.apache.connector.ApacheConnectorProvider.getConnector(ApacheConnectorProvider.java:115)
	org.glassfish.jersey.client.ClientConfig$State.initRuntime(ClientConfig.java:425)
	org.glassfish.jersey.client.ClientConfig$State.access$000(ClientConfig.java:90)
	org.glassfish.jersey.client.ClientConfig$State$3.get(ClientConfig.java:122)
	org.glassfish.jersey.client.ClientConfig$State$3.get(ClientConfig.java:119)
	org.glassfish.jersey.internal.util.collection.Values$LazyValueImpl.get(Values.java:340)
	org.glassfish.jersey.client.ClientConfig.getRuntime(ClientConfig.java:733)
	org.glassfish.jersey.client.ClientRequest.getConfiguration(ClientRequest.java:286)
	org.glassfish.jersey.client.JerseyInvocation.validateHttpMethodAndEntity(JerseyInvocation.java:135)
	org.glassfish.jersey.client.JerseyInvocation.<init>(JerseyInvocation.java:105)
	org.glassfish.jersey.client.JerseyInvocation.<init>(JerseyInvocation.java:101)
	org.glassfish.jersey.client.JerseyInvocation.<init>(JerseyInvocation.java:92)
	org.glassfish.jersey.client.JerseyInvocation$Builder.method(JerseyInvocation.java:437)
	org.glassfish.jersey.client.JerseyInvocation$Builder.post(JerseyInvocation.java:343)


TIA for any suggestion


--

Archimede Informatica tratta i dati personali in conformità a quanto
stabilito dal Regolamento UE n. 2016/679 (GDPR) e dal D. Lgs. 30 giugno 2003 n. 196
per come modificato dal D.Lgs. 10 agosto 2018 n. 101.
Informativa completa

Il contenuto di questo messaggio e dei suoi eventuali allegati è riservato. Nel caso in cui Lei non sia il destinatario, La preghiamo di contattare telefonicamente o via e-mail il mittente ai recapiti sopra indicati e di cancellare il messaggio e gli eventuali allegati dal Suo sistema senza farne copia o diffonderli. Le opinioni espresse sono quelle dell'autore e non rappresentano necessariamente quelle della Società.
This message and any attachment are confidential.If you are not the intended recipient, please telephone or email the sender and delete this message and any attachment from your system. If you are not the intended recipient you must not copy this message or attachment or disclose the contents to any other person. Any opinions presented are solely those of the author and do not necessarily represent those of the Company.

dott. Ivano Mario Luberti

Archimede Informatica società cooperativa a r. l.
Via Gereschi 36, 56127 Pisa

tel.: +39 050/580959

web: www.archicoop.it
linkedin: www.linkedin.com/in/ivanoluberti
facebook: www.facebook.com/archimedeinformaticapisa/


Back to the top