Exception: Absolute path information is required

If a webapplication with relative path was created and not provisioned, it stops the user from creating any more webapplications; also we can’t delete that webapplication from the central administration site, though we can see the webapplication name and information. Whenever we try to create a site collection on top of that web application or delete that web application we will get the following error.

 “Absolute path information is required”

There are 2 work-arounds available to this issue:-

1. Recreate the entire farm from scratch, uninstalling MOSS and reinstalling, then creating a new

configuration database. (It won't be feasible solution always)

2. Use object model code to remove the broken web application from the configuration database.

If you want to delete that webapplication from the configuration DB, the easy and supported way is through SharePoint object model. You can use the following .NET console based application code to delete a half baked webapplication from the configuration DB.

using Microsoft.SharePoint.Administration;

namespace ConsoleApplication1

{

    class Program

    {

        static void Main(string[] args)

        {

            SPWebApplicationCollection oWebCollection = SPWebService.ContentService.WebApplications;

            foreach (SPWebApplication oWeb in oWebCollection)

            {

                if (oWeb.Name == "MySampleWebApplication")

                    oWeb.Delete();

            }

        }

    }

}