I'm receiving the following exception:
java.net.SocketException: "Permission denied": connect
when instantiating a Socket from a servlet:
final Socket smtpSocket = new Socket(mailTransportHost, mailTransportPort);
This application was running as a service under Windows Server 3003 R2 32-bits. After migrating it to Windows Server 2008 R2 64-bit, I cannot longer establish connection with the smtp server.
This only happen when running Tomcat as a service. Running as a standalone (starting it up using startup.bat) works fine. No exception instantiating Socket, emails are sent.
Environment:
- Windows Server 2008 R2 64-bit
- Tomcat 7.0.39
- jdk1.6.0_33-x64