-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Igor,

On 10/23/13 12:34 AM, Igor Cicimov wrote:
> On Wed, Oct 23, 2013 at 1:59 PM, Rodolfo Piedrabuena
> <rpiedrabu...@gmail.com
>> wrote:
> 
>> Hi there,
>> 
>> 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
>> 
>> Any help would be much appreciated
>> 
> 
> Have you tried starting the JVM with -Dsocket.permit_connect=true ?
> Or maybe enable the permission to open sockets in the catalina
> policy files towards the smtp server, So maybe adding permission
> rule that looks something like this:
> 
> grant codeBase "file:${catalina.base}/webapps/<your_app>/-" { 
> permission java.net.SocketPermission "<smtp_server_ip>:25",
> "connect"; };
> 
> to /etc/tomcat6/policy.d/50local.policy might help. Sorry I only
> use linux/unix wouldn't know where exactly the policy files are on 
> windows.

... and even the above is quite distribution-specific. "Vanilla"
Tomcat users would find their security configured in
CATALINA_BASE/conf/catalina.policy.

- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.14 (Darwin)
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQIcBAEBCAAGBQJSZ+tKAAoJEBzwKT+lPKRYo7YP/379wVgrPfEJaRgZjbiITACr
jZl+J3t8G3M8rFc3cT9X9AfOmrhFN5BDXmhmQL7qFKxnylix99gV/Y8yWrkDobxR
TAfYRKQfO8FUr1SqF4XNiyyuqUFOBD38NCHZ2TVavZfUuHngtm++Cdmymuego/+N
S0UO1oEYboAO0Z/OX2/G9bButgXvQbxyYuvchtH2M/fba3LxNL+b+ZDHaEZpQT8m
p1WuwqZbJn6OKuKrLwBwRqB4HWnaApa5TPm5t/oNmEDBTPhu5HOuqzXSUCBp70U8
G8LYM2NvGJvxatNmgdP4hN/WOTyEe8uH/4qh5tBJMvGFNv3AYgDHLMGULKIE8RHm
yhclAXHX8ZB6KYPfh6MFZYekgP3+uJlBwfp3I6VyzabPNAEMxRtWho+WoUfCNqyF
g0B1Ab8TgLkup+UaxFmiRXfJw/zHvi9odisFwBI2fcIZtH1DM7WWZY86aaLv+h77
PxZQoOmiDQuqSLQkoCYpHDMxxrl0qKIR4kVVJGHqedaUmv2rCGZroYEmg5dbYQcM
SLkm32lZ29k6xtw9e66uIfv+vA2ceX1Fyxmna3xAx/u9Y15MfL0T5f3wJk8G+UVT
IuurCZOPHK/Wvu7HxtDtmruUakjawhbLU0Ww/FQ8+H8i8XER2WZhTNbM1G3ffD3q
43Npp9eesqFdUbF1vZnP
=Otob
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to