Quantcast

Error connecting to the database with tomcat 7 on eclipse jave ee

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Error connecting to the database with tomcat 7 on eclipse jave ee

Yosef Fastow
Hi, I am running a spring framework website on eclipse jave ee using tomcat
7. When I try to connect to do anything connected to the databse it raises
a HTTP 500:

Request processing failed; nested exception is
org.springframework.jdbc.CannotGetJdbcConnectionException: Could not get
JDBC Connection; nested exception is
org.apache.commons.dbcp.SQLNestedException: Cannot create
PoolableConnectionFactory (The driver could not establish a secure
connection to SQL Server by using Secure Sockets Layer (SSL) encryption.
Error: "java.security.cert.CertificateException: Failed to validate the
server name in a certificate during Secure Sockets Layer (SSL)
initialization. The server name is *.database.windows.net, the name in
certificate is xxx.xxx.xxx.database.windows.net.".)

(the xxx is replacing the real information)

Anyways I was wondering what is causes this error and how to fix it. I'm
using sqljdbc.4-2.0.jar if that means anything. Thanks in advance.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Error connecting to the database with tomcat 7 on eclipse jave ee

Christopher Schultz-2
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Yosef,

On 5/17/17 11:38 AM, Yosef Fastow wrote:

> Hi, I am running a spring framework website on eclipse jave ee
> using tomcat 7. When I try to connect to do anything connected to
> the databse it raises a HTTP 500:
>
> Request processing failed; nested exception is
> org.springframework.jdbc.CannotGetJdbcConnectionException: Could
> not get JDBC Connection; nested exception is
> org.apache.commons.dbcp.SQLNestedException: Cannot create
> PoolableConnectionFactory (The driver could not establish a secure
> connection to SQL Server by using Secure Sockets Layer (SSL)
> encryption. Error: "java.security.cert.CertificateException: Failed
> to validate the server name in a certificate during Secure Sockets
> Layer (SSL) initialization. The server name is
> *.database.windows.net, the name in certificate is
> xxx.xxx.xxx.database.windows.net.".)
>
> (the xxx is replacing the real information)
>
> Anyways I was wondering what is causes this error and how to fix
> it. I'm using sqljdbc.4-2.0.jar if that means anything. Thanks in
> advance.

Your JDBC driver can't establish a TLS connection to your database,
probably because the JVM doesn't trust the server's certificate.

You should review the documentation for your JDBC driver to see how to
configure a trust store for the JDBC connections. It's usually done
via a parameter in the JDBC URL, and points to a file on the disk.

- -chris
-----BEGIN PGP SIGNATURE-----
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQIzBAEBCAAdFiEEMmKgYcQvxMe7tcJcHPApP6U8pFgFAlkfBrgACgkQHPApP6U8
pFikQhAAyv86ZM/U+NX70dJWz9Ud6yXP/mJbNapDedqAeDoeqiK55tV2m2fxpkt0
83WO/p2QEQZhRKAF7F2HpqwriXyqzhwjprPsK+Thxur0ACuvNTyoYaGvRK90uQCz
NlFVpsQFYPYqaUB3z/yYu2OSwCmZPMFCI06w+/WtNLc1hZvxAW64T56sn4MLLqS5
vclJ/SAdIoKRvtgCos0eX5rUvS2QX+x+grmOhg1KFQF22DEfy0azccZH9bBUswAu
HpVugKnXPZmgYzDlnWc+XNYBfkrMvTW/HlFA67gZOgFcSWMRVAPb/haBLHUbT57B
dcngNRhuF/z/CWcnyz6A6pTIxpMsJYtZwS7r5VgJGftRMpFYqWo6OtXnx+Xr5Y9B
6aUiAuqGqyJG3MPxgTTB5QoLdnDDrwbXcXLVws1tmIsOaOaF0TM1KYXz7jNAlJAo
yfxngj4umkUtp3G5cJ2WKOQWms6yx9Ib0Zo2VtvPQuwFMC8Hmk86d9vVOcKgQcVc
usWLdhxKaHPIQvq4D2ezYU3D2uRZeTeLGVHYePeWNjSIgOpo3g4sBii89ZuCt3LE
lryomtXaYaaHbUphT8DaxlwobTAzCtlIw2yAQnLbyz2yterNEYEzlcHubsyB7ey+
tfVLMJom0R0LUSX/Vk66uHmjlC2AybQo4aZDYrIgcyJGvPmtBTs=
=MW3g
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Loading...