The AddressFamily InterNetwork is not valid for the System.Net.IPEndPoint
Rob Joosen <[email protected]> Thu, 05 Oct 2017 13:47:00 +0000
| Newsgroups | gmane.comp.java.ikvm.devel |
|---|---|
| Message-ID | <CAKSVE54z8inJG-rmhAoP_5BBvX1+VcC6mRWwuZJsP3sefPAnag@mail.gmail.com> |
--===============2461116491695831539==
Content-Type: multipart/alternative; boundary="94eb2c0c96e601217a055accf608"
--94eb2c0c96e601217a055accf608
Content-Type: text/plain; charset="UTF-8"
When using the DriverManager.getConnection(url) with a valid
connectionstring to an Azure SQL Database ("jdbc:sqlserver://
XXXX.database.windows.net;database=XXXX;user=XXXX;password=XXXX"), I get
this error:
"The AddressFamily InterNetwork is not valid for the System.Net.IPEndPoint
end point, use InterNetworkV6 instead.
Parameter name: socketAddress"
Stack Trace:
at java.net.AbstractPlainSocketImpl.doConnect(InetAddress , Int32 ,
Int32 )
at java.net.AbstractPlainSocketImpl.connectToAddress(InetAddress , Int32
, Int32 )
at java.net.AbstractPlainSocketImpl.connect(SocketAddress , Int32 )
at java.net.PlainSocketImpl.connect(SocketAddress , Int32 )
at java.net.SocksSocketImpl.connect(SocketAddress , Int32 )
at java.net.Socket.connect(SocketAddress endpoint, Int32 timeout)
at
com.microsoft.sqlserver.jdbc.SocketFinder.getConnectedSocket(InetSocketAddress
, Int32 )
at com.microsoft.sqlserver.jdbc.SocketFinder.getDefaultSocket(String ,
Int32 , Int32 )
at com.microsoft.sqlserver.jdbc.SocketFinder.findSocket(String , Int32 ,
Int32 , Boolean )
at com.microsoft.sqlserver.jdbc.TDSChannel.open(String , Int32 , Int32 ,
Boolean )
at
com.microsoft.sqlserver.jdbc.SQLServerConnection.connectHelper(ServerPortPlaceHolder
, Int32 , Int32 , Boolean )
at com.microsoft.sqlserver.jdbc.SQLServerConnection.login(String ,
String , Int32 , String , FailoverInfo , Int32 , Int64 )
at
com.microsoft.sqlserver.jdbc.SQLServerConnection.connectInternal(Properties
, SQLServerPooledConnection )
at com.microsoft.sqlserver.jdbc.SQLServerConnection.connect(Properties ,
SQLServerPooledConnection )
at com.microsoft.sqlserver.jdbc.SQLServerDriver.connect(String str,
Properties p)
at java.sql.DriverManager.getConnection(String , Properties ,
ClassLoader )
at java.sql.DriverManager.getConnection(String url, CallerID )
at java.sql.DriverManager.getConnection(String url)
at
GeoNet.Route.ConnectionHandlers.DBConnection.PrepareDatabaseConnection(String
connectionString)
at GeoNet.Route.Route.CalculateRoute(RouteResultInputMessage input)
(Snippet
case "AZURE":
ikvm.runtime.Startup.addBootClassPathAssemby(Assembly.Load("sqljdbc41"));
ikvm.runtime.Startup.addBootClassPathAssemby(Assembly.Load("xercesimpl"));
DriverManager.registerDriver(new
com.microsoft.sqlserver.jdbc.SQLServerDriver());
When I run this code locally, no problems at all. (it is a WCF Service).
When I deploy this to Azure,the mentioned error occurs...
Thank you for your help.
Rob
--94eb2c0c96e601217a055accf608
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr">When using the DriverManager.getConnection(url) with a val=
id connectionstring to an Azure SQL Database ("jdbc:sqlserver://<a hre=
f=3D"http://XXXX.database.windows.net">XXXX.database.windows.net</a>;databa=
se=3DXXXX;user=3DXXXX;password=3DXXXX"), I get this error:<div><br></d=
iv><div><div>"The AddressFamily InterNetwork is not valid for the Syst=
em.Net.IPEndPoint end point, use InterNetworkV6 instead.</div><div>Paramete=
r name: socketAddress"</div></div><div><br></div><div>Stack Trace:=C2=
=A0</div><div><br></div><div><div>=C2=A0 =C2=A0at java.net.AbstractPlainSoc=
ketImpl.doConnect(InetAddress , Int32 , Int32 )</div><div>=C2=A0 =C2=A0at j=
ava.net.AbstractPlainSocketImpl.connectToAddress(InetAddress , Int32 , Int3=
2 )</div><div>=C2=A0 =C2=A0at java.net.AbstractPlainSocketImpl.connect(Sock=
etAddress , Int32 )</div><div>=C2=A0 =C2=A0at java.net.PlainSocketImpl.conn=
ect(SocketAddress , Int32 )</div><div>=C2=A0 =C2=A0at java.net.SocksSocketI=
mpl.connect(SocketAddress , Int32 )</div><div>=C2=A0 =C2=A0at java.net.Sock=
et.connect(SocketAddress endpoint, Int32 timeout)</div><div>=C2=A0 =C2=A0at=
com.microsoft.sqlserver.jdbc.SocketFinder.getConnectedSocket(InetSocketAdd=
ress , Int32 )</div><div>=C2=A0 =C2=A0at com.microsoft.sqlserver.jdbc.Socke=
tFinder.getDefaultSocket(String , Int32 , Int32 )</div><div>=C2=A0 =C2=A0at=
com.microsoft.sqlserver.jdbc.SocketFinder.findSocket(String , Int32 , Int3=
2 , Boolean )</div><div>=C2=A0 =C2=A0at com.microsoft.sqlserver.jdbc.TDSCha=
nnel.open(String , Int32 , Int32 , Boolean )</div><div>=C2=A0 =C2=A0at com.=
microsoft.sqlserver.jdbc.SQLServerConnection.connectHelper(ServerPortPlaceH=
older , Int32 , Int32 , Boolean )</div><div>=C2=A0 =C2=A0at com.microsoft.s=
qlserver.jdbc.SQLServerConnection.login(String , String , Int32 , String , =
FailoverInfo , Int32 , Int64 )</div><div>=C2=A0 =C2=A0at com.microsoft.sqls=
erver.jdbc.SQLServerConnection.connectInternal(Properties , SQLServerPooled=
Connection )</div><div>=C2=A0 =C2=A0at com.microsoft.sqlserver.jdbc.SQLServ=
erConnection.connect(Properties , SQLServerPooledConnection )</div><div>=C2=
=A0 =C2=A0at com.microsoft.sqlserver.jdbc.SQLServerDriver.connect(String st=
r, Properties p)</div><div>=C2=A0 =C2=A0at java.sql.DriverManager.getConnec=
tion(String , Properties , ClassLoader )</div><div>=C2=A0 =C2=A0at java.sql=
.DriverManager.getConnection(String url, CallerID )</div><div>=C2=A0 =C2=A0=
at java.sql.DriverManager.getConnection(String url)</div><div>=C2=A0 =C2=A0=
at GeoNet.Route.ConnectionHandlers.DBConnection.PrepareDatabaseConnection(S=
tring connectionString)</div><div>=C2=A0 =C2=A0at GeoNet.Route.Route.Calcul=
ateRoute(RouteResultInputMessage input)</div></div><div><br></div><div>(Sni=
ppet<pre style=3D"font-family:Consolas;background-image:initial;background-=
position:initial;background-size:initial;background-repeat:initial;backgrou=
nd-origin:initial;background-clip:initial"><span style=3D"color:blue">case<=
/span>=C2=A0<span style=3D"color:rgb(163,21,21)">"AZURE"</span>:
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0ikvm.runtime.Startup.addBootCl=
assPathAssemby(<span style=3D"color:rgb(43,145,175)">Assembly</span>.Load(<=
span style=3D"color:rgb(163,21,21)">"sqljdbc41"</span>));
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0ikvm.runtime.Startup.addBootCl=
assPathAssemby(<span style=3D"color:rgb(43,145,175)">Assembly</span>.Load(<=
span style=3D"color:rgb(163,21,21)">"xercesimpl"</span>));
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0DriverManager.registerDriver(<=
span style=3D"color:blue">new</span>=C2=A0com.microsoft.sqlserver.jdbc.SQLS=
erverDriver());</pre></div><div><br><div>When I run this code locally, no p=
roblems at all. (it is a WCF Service). When I deploy this to Azure,the ment=
ioned error occurs...</div><div><br></div><div>Thank you for your help.</di=
v><div><br></div><div>Rob</div><div><br></div></div></div>
--94eb2c0c96e601217a055accf608--
--===============2461116491695831539==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
--===============2461116491695831539==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
_______________________________________________
Ikvm-developers mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ikvm-developers
--===============2461116491695831539==--