https://bz.apache.org/bugzilla/show_bug.cgi?id=63890
Bug ID: 63890
Summary: JDNI & JDBC Connection when using IPV4 going back to
IPV6
Product: Tomcat 9
Version: unspecified
Hardware: PC
Status: NEW
Severity: normal
Priority: P2
Component: Catalina
Assignee: [email protected]
Reporter: [email protected]
Target Milestone: -----
Apologize in advance my this is my first bug report.
When specifying a Tomcat Resource there is an error with IPV4 and IPV6
conflict.
I tested this on 3 different Windows server 2016 Standard and got the same
result.
The deployed application needs IPV4 for IOT device connections. The resource
was a SQL Server 2016. I used the 4.2 driver with Java 8 AdoptOpen JDK 8_222
and also tried JDK 8_232. I also tried the 7.4 driver. The Windows servers in
question have IPV6 disabled and I also checked other settings like pinging DNS
names to verify that IPV4 was resolving.
I used the and -Djava.net.preferIPv4Addresses=true to ensure that the tomcat
was starting with an IPV4 forced preference.
<Resource auth="Container"
driverClassName="com.microsoft.sqlserver.jdbc.SQLServerDriver"
initialSize="5"
logAbandoned="true"
maxIdle="5"
maxTotal="20"
maxWaitMillis="120000"
minEvictableIdleTimeMillis="1800000"
minIdle="2"
name="jdbc/blahblahdb"
numTestsPerEvictionRun="3"
removeAbandonedOnBorrow="true"
removeAbandonedTimeout="60"
testOnBorrow="true"
testOnReturn="true"
testWhileIdle="true"
timeBetweenEvictionRunsMillis="900000"
type="javax.sql.DataSource"
url="jdbc:sqlserver://${log4j.dbServer}\${log4j.dbInstance};DatabaseName=${log4j.dbDatabase};"
username="${log4j.dbUser}"
validationQuery="select 1"
password="${log4j.dbAuth}"
/>
The error I get each time is the host cannot be resolved. Generally, I set
sqlserver=localhost but I tried with 127.0.0.1, servername01.company.com,
10.10.2.2 and all give the same error.
--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]