Campbell Ritchie wrote:How did you import those types? How did you add the log4j types to the application? Did you use the CLASSPATH?
Campbell Ritchie wrote:What did the compiler error messages say? Please copy'n'paste the errors rather than posting screenshots.
Tim Cooke wrote:
Yogesh Gandhi wrote:The issue was with the Java Mail API version that was being used.
When I updated it to latest javax.mail.jar the problem was gone.
For the benefit of future readers of this conversation, what version did you upgrade from and to?
Tim Moores wrote:That's a highly unusual approach to making a JavaMail connection. Based on what information did you write that code?
Update: The host isn't publicly accessible - are you running this code somewhere where it is?
javax.mail.MessagingException: Connect failed;
nested exception is:
javax.net.ssl.SSLException: Connection reset
at com.sun.mail.pop3.POP3Store.protocolConnect(POP3Store.java:210)
at javax.mail.Service.connect(Service.java:295)
at javax.mail.Service.connect(Service.java:176)
at javax.mail.Service.connect(Service.java:125)
at TestProgram.main(TestProgram.java:50)
Caused by: javax.net.ssl.SSLException: Connection reset
at sun.security.ssl.Alert.createSSLException(Alert.java:127)
at sun.security.ssl.TransportContext.fatal(TransportContext.java:327)
at sun.security.ssl.TransportContext.fatal(TransportContext.java:270)
at sun.security.ssl.TransportContext.fatal(TransportContext.java:265)
at sun.security.ssl.SSLTransport.decode(SSLTransport.java:141)
at sun.security.ssl.SSLSocketImpl.decode(SSLSocketImpl.java:1198)
at sun.security.ssl.SSLSocketImpl.readHandshakeRecord(SSLSocketImpl.java:1107)
at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:400)
at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:372)
at com.sun.mail.util.SocketFetcher.configureSSLSocket(SocketFetcher.java:507)
at com.sun.mail.util.SocketFetcher.getSocket(SocketFetcher.java:238)
at com.sun.mail.pop3.Protocol.<init>(Protocol.java:107)
at com.sun.mail.pop3.POP3Store.getPort(POP3Store.java:261)
at com.sun.mail.pop3.POP3Store.protocolConnect(POP3Store.java:206)
... 4 more
Suppressed: java.net.SocketException: Broken pipe (Write failed)
at java.net.SocketOutputStream.socketWrite0(Native Method)
at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:111)
at java.net.SocketOutputStream.write(SocketOutputStream.java:155)
at sun.security.ssl.SSLSocketOutputRecord.encodeAlert(SSLSocketOutputRecord.java:81)
at sun.security.ssl.TransportContext.fatal(TransportContext.java:358)
... 16 more
Caused by: java.net.SocketException: Connection reset
at java.net.SocketInputStream.read(SocketInputStream.java:210)
at java.net.SocketInputStream.read(SocketInputStream.java:141)
at sun.security.ssl.SSLSocketInputRecord.read(SSLSocketInputRecord.java:466)
at sun.security.ssl.SSLSocketInputRecord.readHeader(SSLSocketInputRecord.java:460)
at sun.security.ssl.SSLSocketInputRecord.decode(SSLSocketInputRecord.java:159)
at sun.security.ssl.SSLTransport.decode(SSLTransport.java:110)
... 13 more
Stephan van Hulst wrote:You shouldn't have to. The URL in a WSDL is usually just a default. You can override the default URL when you construct an instance of the client.
David Nicholls wrote:Hi again,
in this case start your servlet container using these flags.
What is your environment? Are you using eclipse? Using tomcat?
Anyway. You may just as well alter your code:
Just put the following static initializer block in your thread class (or any class that is loaded before calling the service).
static {
System.setProperty("https.proxyHost", "IPgoesHere");
System.setProperty("https.proxyPort", "PortGoesHere");
System.setProperty("http.proxyHost", "IPgoesHere");
System.setProperty("http.proxyPort", "PortGoesHere");
}
I recommend starting the JVM using the -D options. Then you don't have to change your code.