I have a
java program that must poll an Http site, scrape certain content that will be in a known format, and then email confirmation that it did so to recipients. The program must connect to the Http server through a proxy. I am doing this by turning java.net.useSystemProxies system property to true, and then getting the proxy and creating the HttpUrlConnection via that proxy. This works.
However, later, when I go to send the email, if I set the system property, the email send times out every time just saying it cannot connect. If I comment that out, the email sends fine (but the Http part fails). I have tried clearing or setting the property to false (it was clear before my program) after the Http section, but this doesn't seem to matter. Once set, the JavaMail bit fails.
So the code for each is fine, but they seem to have this mutually exclusive relationship on this property, and resetting it with clearProperty or setProperty doesn't work. Ideas?