Did a telnet to localhost to get /localstart.asp which is protected by Integrated windows authentication. Response HTTP header is :
HTTP/1.1 401 Access Denied
Server: Microsoft-IIS/5.1
Date: Wed, 31 May 2006 04:09:56 GMT
WWW-Authenticate: Negotiate
WWW-Authenticate: NTLM
Content-Length: 4431
Content-Type: text/html
Now, the browser is required to authenticate using NTLM. This mode is supported only in IE. So, the same page(localstart.asp) when opened using firebox will retry sending username/password from the popup and will fail. Whereas In IE, it will render the page properly. So, to view the localstart.asp page in browsers other than IE, we can't use Integrated windows authentication. Rather we may use Basic authentication. HTTP Response headers in case of basic authentication:
HTTP/1.1 401 Access Denied
Server: Microsoft-IIS/5.1
Date: Wed, 31 May 2006 04:14:47 GMT
WWW-Authenticate: Basic realm="APPLICATIONS"
Content-Length: 4431
Content-Type: text/html
Wednesday, May 31, 2006
My horrible experience with IIS
Tried installing IIS in my XP Pro. After install, initially the localstart.asp is erroring out with HTTP 500 server error. Resolution :
------------------------------------------------------------------------------------
Please make sure that anonymous authentication is not selected for the localstart.asp file as per the instructions in KB Article 251361.
http://support.microsoft.com/default.aspx?scid=kb;EN-US;q251361
It does not matter if you are logged on as administrator or not. The RFC says that the client is supposed to try anonymous authentication first, which the client does. If this authentication method is supported (enabled), the client has no reason to try to authenticate, and the anonymous user account specified on the server will be used to run the ASP file. This user account does not have permissions to the metabase, hence it fails with this error message.
------------------------------------------------------------------------------------
So, I unchecked the unanonymous access checkbox. After this I get the HTTP 401.2 unauthorized: Logon. Searched google and found some solutions relating to excluding the localhost from the exceptions list in proxy, adding the webserver program in the windows firewall list. These two solutions didn't work. Solution is that atleast one type of authentication method should have been used :
http://support.microsoft.com/default.aspx?scid=kb;en-us;Q253667&sd=tech
Then I used the checkbox "Integrated Windows Authentication". Issue got resolved. Probably a good documentation for IIS was missing or I didn't search properly...
------------------------------------------------------------------------------------
Please make sure that anonymous authentication is not selected for the localstart.asp file as per the instructions in KB Article 251361.
http://support.microsoft.com/default.aspx?scid=kb;EN-US;q251361
It does not matter if you are logged on as administrator or not. The RFC says that the client is supposed to try anonymous authentication first, which the client does. If this authentication method is supported (enabled), the client has no reason to try to authenticate, and the anonymous user account specified on the server will be used to run the ASP file. This user account does not have permissions to the metabase, hence it fails with this error message.
------------------------------------------------------------------------------------
So, I unchecked the unanonymous access checkbox. After this I get the HTTP 401.2 unauthorized: Logon. Searched google and found some solutions relating to excluding the localhost from the exceptions list in proxy, adding the webserver program in the windows firewall list. These two solutions didn't work. Solution is that atleast one type of authentication method should have been used :
http://support.microsoft.com/default.aspx?scid=kb;en-us;Q253667&sd=tech
Then I used the checkbox "Integrated Windows Authentication". Issue got resolved. Probably a good documentation for IIS was missing or I didn't search properly...
Thursday, May 25, 2006
Overloading with var-args: ambiguous match
package junk;
public class Test8{
public static void print(String title) {
System.out.println("first print");
}
public static void print(String title, String... messages) {
System.out.println("second print");
}
public static void print(String... messages) {
System.out.println("third print");
}
public static void main(String... args)
{
print("Hello");
print("Hello", "Krishna");
print("Hello", new String[]{"Krishna"});
print(new String[]{"Hello", "Krishna"});
}
}
Output:
reference to print is ambiguous, both method print(java.lang.String,java.lang.String...) in junk.Test8 and method print(java.lang.String...) in junk.Test8 match
public class Test8{
public static void print(String title) {
System.out.println("first print");
}
public static void print(String title, String... messages) {
System.out.println("second print");
}
public static void print(String... messages) {
System.out.println("third print");
}
public static void main(String... args)
{
print("Hello");
print("Hello", "Krishna");
print("Hello", new String[]{"Krishna"});
print(new String[]{"Hello", "Krishna"});
}
}
Output:
reference to print is ambiguous, both method print(java.lang.String,java.lang.String...) in junk.Test8 and method print(java.lang.String...) in junk.Test8 match
Does static initializers loop infinitely if they reference each other in the initialization code?
package junk;
public class Test7{
public static void main(String... args)
{
System.out.println("x.i = " + X.i);
System.out.println("x.j = " + Y.j);
System.out.println("y.i = " + X.i);
System.out.println("y.j = " + Y.j);
}
}
class X{
static int i=1;
static int j=2;
static{
System.out.println("X static : before calling Y");
i = Y.i;
System.out.println("X static : after calling Y");
}
static{
System.out.println("next static block in X : start");
j = Y.j;
System.out.println("next static block in X : end");
}
}
class Y{
static int i=3;
static int j=4;
static{
System.out.println("Y static : before calling X");
i = X.i;
System.out.println("Y static : after calling X");
}
static{
System.out.println("next static block in Y : start");
j = X.j;
System.out.println("next static block in Y : end");
}
}
output:
X static : before calling Y
Y static : before calling X
Y static : after calling X
next static block in Y : start
next static block in Y : end
X static : after calling Y
next static block in X : start
next static block in X : end
x.i = 1
x.j = 2
y.i = 1
y.j = 2
public class Test7{
public static void main(String... args)
{
System.out.println("x.i = " + X.i);
System.out.println("x.j = " + Y.j);
System.out.println("y.i = " + X.i);
System.out.println("y.j = " + Y.j);
}
}
class X{
static int i=1;
static int j=2;
static{
System.out.println("X static : before calling Y");
i = Y.i;
System.out.println("X static : after calling Y");
}
static{
System.out.println("next static block in X : start");
j = Y.j;
System.out.println("next static block in X : end");
}
}
class Y{
static int i=3;
static int j=4;
static{
System.out.println("Y static : before calling X");
i = X.i;
System.out.println("Y static : after calling X");
}
static{
System.out.println("next static block in Y : start");
j = X.j;
System.out.println("next static block in Y : end");
}
}
output:
X static : before calling Y
Y static : before calling X
Y static : after calling X
next static block in Y : start
next static block in Y : end
X static : after calling Y
next static block in X : start
next static block in X : end
x.i = 1
x.j = 2
y.i = 1
y.j = 2
Wednesday, May 10, 2006
Subscribe to:
Posts (Atom)