简体   繁体   中英

Wildfly Datasource via VPN to MS SQL Server

currently, I am facing some odd behavior. I have a Java EE Web Application that I am deploying to a wildfly server. This Java EE Application needs a database to which we need to connect via vpn. We are using OpenVPN. When I am using SSMS I have no problems connecting to the database. When I am using pure JDBC, there also is no problem.

But if I am creating a datasource in wildfly (and I am using the exact same jdbc connection url) it does not working. I am using the wildfly admin ui and click the test-button.

Caused by: com.microsoft.sqlserver.jdbc.SQLServerException: The TCP/IP connection to the host 10.1.115.51, port 1433 has failed. Error: "connect timed out. Verify the connection properties. Make sure that an instance of SQL Server is running on the host and accepting TCP/IP connections at the port. Make sure that TCP connections to the port are not blocked by a firewall.".

I mean, the stack trace is pretty clear. However, the connection should be possbile as I connect via ssms and pure jdbc. Just wildfly datasource is not working.

Furhtermore, I have installed a MS SQL Server on the same mashine the wildfly is running on and using this MS SQL instance the datasource is working fine.

The jdbc url connection url is the following:

jdbc:sqlserver://< ip >:1433;databaseName=projdat;user= **;password= **

I have compared the jdbc url connection urls multiple times. Both in the pure jdbc and in the datasource they are the same.

Does anybody have any ideas? Is possible that I need to configure openvpn in a special way that wildfly can connect or do I need to configure Wildfly to be able to connect via vpn. Or do I have to configure the MS SQL Server in special way?

  • Version of MS SQL Server: 12
  • Version Wildfly: 19.0.0.Final
  • SQL Server driver: mssql-jdbc-8.2.2.jre8.jar

I apreciate any hint or advise.

Apparently, I was using an older version of Wildfly (in fact, it was wildfly 16). After I upgraded to Wildfly 19, it is now working. However, I have no clue why it was not working with wildfly 16.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM