[Mono-devel-list] Npgsql - null reference exception during opening connection

Kamil Skalski nazgul at omega.pl
Sat May 15 06:47:20 EDT 2004


I've encountered an exception during opening of NpgsqlConnection. The stack 
trace is following:

sql.n:17:9: debug: System.NullReferenceException: A null value was found where 
an object instance was required.
in (unmanaged) /usr/lib/libmono.so.0(mono_class_from_name+0xd7) [0x4011c2a8]
in (unmanaged) /usr/lib/libmono.so.0 [0x400eb9a3]
in (unmanaged) /usr/lib/libmono.so.0 [0x400edbcf]
in (unmanaged) /usr/lib/libmono.so.0 [0x400ee2eb]
in <0x00066> System.Net.Dns:GetHostByName (string)
in <0x00032> System.Net.Sockets.TcpClient:Connect (string,int)
in <0x00026> System.Net.Sockets.TcpClient:.ctor (string,int)
in <0x00080> Npgsql.NpgsqlClosedState:Open (Npgsql.NpgsqlConnection)
in <0x00662> Npgsql.NpgsqlConnection:Open ()
in <0x0004f> (wrapper remoting-invoke-with-check) Npgsql.NpgsqlConnection:Open 
()

my connection string is
"Server=localhost;Database=test;User ID=postgres;Password=sql;"

The starngest thing is that I have another application, where exactly the same 
connection string succedes and I can query database without problem. I'm not 
yet able to find any related differences between those two application - 
there is no network / database specific code at all in them. 
I also tried Server=127.0.0.1 but the behavior is identical - I've one 
application succesfully opening connection and other failing.

I'm still trying to reproduce behavior in some small example, but maybe 
anybody has any suggestions? 

Kamil Skalski



More information about the Mono-devel-list mailing list