繁体   English   中英

TOMCAT:与主机 127.0.0.1、端口 1433 的 TCP/IP 连接失败

[英]TOMCAT: The TCP/IP connection to the host 127.0.0.1, port 1433 has failed

我正在尝试启动 Tomcat 服务器,但出现此错误: The TCP/IP connection to the host 127.0.0.1, port 1433 has failed. Error: "Connection refused: connect. 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.". The TCP/IP connection to the host 127.0.0.1, port 1433 has failed. Error: "Connection refused: connect. 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.".

server.xml 看起来像这样:

<Resource name="jdbc/ProcessEngine"
              auth="Container"
              type="javax.sql.DataSource" 
              factory="org.apache.tomcat.jdbc.pool.DataSourceFactory"
              uniqueResourceName="Camunda"
              driverClassName="com.microsoft.sqlserver.jdbc.SQLServerDriver"
              url="jdbc:sqlserver://localhost:1433/Camunda"
              defaultTransactionIsolation="READ_COMMITTED"
              username="sa"  
              password=".v>>4T^[#f/B)9Qx"
              maxTotal="20"
              minIdle="5"
              maxIdle="20" />

PS。 TCP/IP 已启用并且 TCP 端口 id 等于 1433。此外,我可以通过 Microsoft SQL Server Management Studio 进行连接: 在此处输入图像描述

您必须在 SQL 服务器配置 -administration 中启用 TCP/IP 传入连接,默认情况下未打开端口。

  1. 在开始菜单上,单击所有程序 > Microsoft SQL 服务器 XXX > 配置工具 > SQL 服务器配置管理器。
  2. 单击 SQL 服务器 XXX 服务。
  3. 展开 SQL Server XXX Network Configuration 节点,然后展开 select Protocols for MSSQLServer(SQL 实例名称)。
  4. 右键单击 TCP/IP,然后单击启用。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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