Dear all,
thanks for the help, but after some digging, I was able to implement
a simpler solution!
If anyone has a similar problem, here is what I did:
ProxySelector.setDefault(new ProxySelector() {
@Override
public List<Proxy> select(URI uri) {
ArrayList<Proxy> list = new
ArrayList<Proxy>();
list.add(new Proxy(Proxy.Type.HTTP, new
InetSocketAddress("proxy.de", 8080)));
return list;
}
@Override
public void connectFailed(URI uri, SocketAddress sa,
IOException ioe) {
logger.error("Error in ProxySelector, connection
Failed: ", ioe);
}
});
Authenticator.setDefault(new
ProxyAuth(Config.getProxyUsername(), Config.getProxyPassword()));
That has to be set prior to the first Internet use, plus the
following class for Basic Authentizication:
public class ProxyAuth extends Authenticator {
private PasswordAuthentication auth;
public ProxyAuth(String user, String password) {
auth = new PasswordAuthentication(user, password == null ?
new char[] {} : password.toCharArray());
}
protected PasswordAuthentication getPasswordAuthentication() {
return auth;
}
}
Best regards
Jan-Patrick
Am 07.05.2019 um 11:23 schrieb Andrii
Berezovskyi:
Dear Jan-Patrick,
ProxyServlet is actually developed for the case
when you have an adaptor that needs to act as a proxy
itself. That is not what you need.
In general,
here is how you supply an Apache HttpClient builder
object to Lyo Client. And then you simply configure it to
use your proxy
this way. Or, maybe not so
simple – I am happy not to be behind the proxy
😊 If this does not help, Jim is the expert on
Lyo Client and should be able to help you.
Good luck!
–Andrew.
Dear all,
thanks for the links, I found the ninarcm and the ProxyServlet
mentioned in the old discussion on the list.
https://github.com/OSLC/lyo-adaptor-ninacrm/blob/master/src/main/java/org/eclipse/lyo/samples/ninacrm/ProxyServlet.java
I'm not sure if I understand it completely, though.
1) How do I use this ProxyServlet, i.e. how do I make that
this is used by the RestClient etc to use that?
2) Since the ProxyServlet is using HttpURLConnection, it
should work with a proxy, if this is configured. Does this
mean, the standard RestClient does use something else than
HttpURLConnection? Just to confirm that this is indeed helping
me with my Proxy problem...
@Andrew: I had a look at the config you send me, thanks for
that. But it's not my adaptor that is behind a proxy, it's the
client calling the adaptor, and I don't see how setting a
proxy-mapping help in this case.
Best regards
Jan-Patrick
Am 06.05.2019 um 23:56 schrieb Jad
El-Khoury:
@andrew!
The link you propose below is for a generated Bugzilla
adaptor based on LyoDesigner. It is incomplete, and I
don’t believe it’s what the original Bugzilla code that
Jan-Patrick needs.
http://git.eclipse.org/c/lyo/org.eclipse.lyo.docs.git
was migrated to
https://github.com/eclipse/lyo.docs.
Refer to the “lyo-rest-workshop” to find the code for all 6
labs of the Bugzilla example.
Have a look within Lab1, for a pdf
version of the complete tutorial.
Hope this help to get you started on the
original proxy problem!
regards
______________________________
Jad El-khoury, PhD
KTH Royal Institute of Technology
School of Industrial Engineering and
Management, Mechatronics Division
Brinellvägen
83, SE-100 44 Stockholm, Sweden
Phone:
+46(0)8 790 6877 Mobile: +46(0)70 773 93 45
jad@xxxxxx,
https://www.kth.se/profile/jad
Dear
Jan-Patrick,
Thanks
for reporting the broken links. Good news and bad news:
- The
Bugzilla example has been moved to
https://github.com/OSLC/lyo-adaptor-bugzilla
- Mozilla
landfill has been shut down, you will need your private
Bugzilla installation:
https://github.com/OSLC/lyo-adaptor-bugzilla/issues/12
- There
were problems to get Bugzilla adaptor to run, I fixed
them, but they don’t seem to have gotten to the repo I
linked above. I have just open-sourced all three private
forks we had of the Bugzilla adaptor (non-generated
code, TRS support, and Lyo Store support respectively).
Hope at least one of them helps you (run all of them
with ‘mvn jetty:run-exploded’):
- https://gitlab.com/assume/lyo/se.kth.md.cpse.adaptor.bugzilla
- https://gitlab.com/assume/lyo/adaptor-bugzilla-trs
- https://gitlab.com/assume/lyo/adaptor-store-support
The original hint was here:
if you click on the Bugzilla example at
the bottom of the page, you get
Where it mentions to download the
example from:
Basically, all these links to git do
now work anymore, for every example
And I can only hope, that if I find the
BugZilla example, there is
indeed an example on Proxy usage, that
is still working...
Am 06.05.2019 um 16:35 schrieb Jad
El-Khoury:
Can you share the links to BugZilla
example that are all inaccessible? I might be able to
help you find them?
Hope someone can help you with the
specific question too. I’m not particularly familiar
with it myself.
could you provide me a current link
that shows how to configure a LYO
Client to connect through a proxy?
I found an old thread here on the
list that links to the Bugzilla
example, but the links to BugZilla
example are all inaccessible, also
on the lyo page.
I have currently set
"useSystemProxy" and setup an Authenticator, and
this works for normal http(s)
access, but when I try it via
LyoClient/RestClient/ServiceProviderRegistryClient
I only get
Dipl. Inform. Jan-Patrick Osterloh
Human Centered Design Group
OFFIS e.V. - Institut für
Informatik | Institute for Information Technology
FuE Bereich
Verkehr | R&D Division Transportation
Escherweg 2, 26121
Oldenburg - Germany
Phone/Fax: +49 441 97 22-524 /
-502
Registergericht: Amtsgericht
Oldenburg VR 1956
Vorstand: Prof. Dr.-Ing. Wolfgang
H. Nebel (Vorsitzender),
Prof. Dr. techn. Susanne
Boll-Westermann,
Prof. Dr.-Ing. Axel Hahn,
Prof. Dr.-Ing. Andreas
Hein,
Prof. Dr. Sebastian
Lehnhoff
_______________________________________________
To change your delivery options,
retrieve your password, or unsubscribe from this list,
visit
_______________________________________________
To change your delivery options,
retrieve your password, or unsubscribe from this list,
visit
Dipl. Inform. Jan-Patrick Osterloh
Human Centered Design Group
OFFIS e.V. - Institut für Informatik |
Institute for Information Technology
FuE Bereich Verkehr |
R&D Division Transportation
Escherweg 2, 26121
Oldenburg - Germany
Phone/Fax: +49 441 97 22-524 / -502
Registergericht: Amtsgericht Oldenburg
VR 1956
Vorstand: Prof. Dr.-Ing. Wolfgang H.
Nebel (Vorsitzender),
Prof. Dr. techn. Susanne
Boll-Westermann,
Prof. Dr.-Ing. Axel Hahn,
Prof. Dr.-Ing. Andreas Hein,
Prof. Dr. Sebastian Lehnhoff
_______________________________________________
To change your delivery options,
retrieve your password, or unsubscribe from this list,
visit
_______________________________________________
lyo-dev mailing list
lyo-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://www.eclipse.org/mailman/listinfo/lyo-dev
--
Dipl. Inform. Jan-Patrick Osterloh
Senior Research Engineer
Human Centered Design Group
OFFIS e.V. - Institut für Informatik | Institute for Information Technology
FuE Bereich Verkehr | R&D Division Transportation
Escherweg 2, 26121 Oldenburg - Germany
Room: D107
Phone/Fax: +49 441 97 22-524 / -502
E-Mail: osterloh@xxxxxxxx
URL: http://www.offis.de
Registergericht: Amtsgericht Oldenburg VR 1956
Vorstand: Prof. Dr.-Ing. Wolfgang H. Nebel (Vorsitzender),
Prof. Dr. techn. Susanne Boll-Westermann,
Prof. Dr.-Ing. Axel Hahn,
Prof. Dr.-Ing. Andreas Hein,
Prof. Dr. Sebastian Lehnhoff
_______________________________________________
lyo-dev mailing list
lyo-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://www.eclipse.org/mailman/listinfo/lyo-dev
--
Dipl. Inform. Jan-Patrick Osterloh
Senior Research Engineer
Human Centered Design Group
OFFIS e.V. - Institut für Informatik | Institute for Information Technology
FuE Bereich Verkehr | R&D Division Transportation
Escherweg 2, 26121 Oldenburg - Germany
Room: D107
Phone/Fax: +49 441 97 22-524 / -502
E-Mail: osterloh@xxxxxxxx
URL: http://www.offis.de
Registergericht: Amtsgericht Oldenburg VR 1956
Vorstand: Prof. Dr.-Ing. Wolfgang H. Nebel (Vorsitzender),
Prof. Dr. techn. Susanne Boll-Westermann,
Prof. Dr.-Ing. Axel Hahn,
Prof. Dr.-Ing. Andreas Hein,
Prof. Dr. Sebastian Lehnhoff
|