Issue - JBoss 7.x 데이터 소스 연결 테스트 시 localhost 찾는 에러 해결 방안
The following exception is raised when obtaining a connection from a non-XA Microsoft SQL Server datasource:
Test Environment
- Test Version : JBoss EAP 7.2
Issue
... Caused by: com.microsoft.sqlserver.jdbc.SQLServerException: The TCP/IP connection to the host localhost, port 1433 has failed. Error: "Connection refused. 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."
- When using a datasource-class, the connection-url property is ignored and no JDBC url is supplied, hence the exception.
- non-XA pool 에서 datasource-class를 사용할 경우 connection-url property가 무시되어 해당 Exception 이 발생한다고합니다.
Resolution
- standalone.xml 에 <datasource-class> 설정 라인 삭제 후 jboss 재기동
<datasource jndi-name="java:/mssql" pool-name="mssqljdbc" statistics-enabled="true">
<connection-url>jdbc:sqlserver://127.0.0.1:1433;DatabaseName=ucpost</connection-url>
<driver-class>com.microsoft.sqlserver.jdbc.SQLServerDriver</driver-class>
<datasource-class>com.microsoft.sqlserver.jdbc.SQLServerDataSource</datasource-class> ==> 해당 부분 삭제
cause
- The issue may be due to specification of a datasource-class when defining a non-XA pool.
- The use of an implementation of javax.sql.DataSource requires significantly different configuration from the standard java.sql.Driver mechanism which is the default for JDBC 4 compliant drivers when creating non-XA connections.
- When using a datasource-class, the connection-url property is ignored and no JDBC url is supplied, hence the exception.
0 Comments:
댓글 쓰기