Hello, I am new to Sharepoint to CA configuration.
I have tried to create an web application, and half way during the creation, I got an error.
Now I want to delete the Web Application and I got this error:Â Object reference not set to an instance of an object.
I tried using powershell to remove the web application also got error.
I have checked the Content DB is empty, IIS doesn’t show this site, virtual directory doesn’t exist.
How do it solve this?
Regards,
Vin
?width=750
Thats great Vin and thanks for posting solution for others
Hi Ajeet,
I have found the solution for this, simply point the web application to another web application IIS using this function:
Function Set-WebApplicataionPool($WebAppURL,$ApplicationPoolName){
$apppool = [Microsoft.SharePoint.Administration.SPWebService]::ContentService.ApplicationPools | where {$_.Name -eq $ApplicationPoolName}
if ($apppool -eq $null){
write-host -foreground red “The Application Pool $ApplicationPoolName does not exist!”
return 1
}
$webapp = get-spwebapplication -Identity $WebAppUrl
if ($webapp -eq $null){
write-host -foreground red “The Web Application $WebAppUrl does not exist!”
return 1
}
$webapp.Applicationpool = $apppool
$webApp.Update()
$webApp.ProvisionGlobally()
write-host -foreground green “$WebappURL Application Pool has been changed to $ApplicationPoolName”
return 0
}
Set-WebApplicataionPool -WebAppURL “http://sitename” -ApplicationPoolName “SharePoint – SiteName”
source from:Â Cannot Create, Extend, or Delete a Web Application in Central Administration
Hope this help to someone!!
Regards,
Vin
Thanks for the reply, I got the error from the SharePoint log using get-splogevent, this is the errors:-
Message : Name=Request (POST:http://www.test-net.net:2013/_admin/DeleteWebApplica
tion.aspx?WebApplicationId=3ca350d6d9194da79b86373adaa08786&IsDlg=1)
Message : Non-OAuth request. IsAuthenticated=True, UserIdentityName=,
ClaimsCount=0
Message : Site=/
Message : Leaving Monitored Scope (PostAuthenticateRequestHandler). Execution
Time=10.3866
Message : Application error when access /_admin/DeleteWebApplication.aspx,
Error=Object reference not set to an instance of an object. at Micr
osoft.SharePoint.Administration.SPWebApplication.Unprovision(Boolean
deleteWebSites) at Microsoft.SharePoint.Administration.SPWebAppli
cation.UnprovisionGlobally(Boolean deleteIisWebSite) at Microsoft
.SharePoint.ApplicationPages.DeleteWebApplicationPage.BtnSubmit_Click
(Object sender, EventArgs e) at
System.Web.UI.WebControls.Button.RaisePostBackEvent(String
eventArgument) at System.Web.UI.Page.ProcessRequestMain(Boolean
includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
Message : System.NullReferenceException: Object reference not set to an
instance of an object. at Microsoft.SharePoint.Administration.SPWe
bApplication.Unprovision(Boolean deleteWebSites) at Microsoft.Sha
rePoint.Administration.SPWebApplication.UnprovisionGlobally(Boolean
deleteIisWebSite) at Microsoft.SharePoint.ApplicationPages.Delete
WebApplicationPage.BtnSubmit_Click(Object sender, EventArgs e)
at System.Web.UI.WebControls.Button.RaisePostBackEvent(String
eventArgument) at System.Web.UI.Page.ProcessRequestMain(Boolean
includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
Message : Getting Error Message for Exception
System.Web.HttpUnhandledException (0x80004005): Exception of type
‘System.Web.HttpUnhandledException’ was thrown. —>
System.NullReferenceException: Object reference not set to an
instance of an object. at Microsoft.SharePoint.Administration.SPW
ebApplication.Unprovision(Boolean deleteWebSites) at Microsoft.Sh
arePoint.Administration.SPWebApplication.UnprovisionGlobally(Boolean
deleteIisWebSite) at Microsoft.SharePoint.ApplicationPages.Delete
WebApplicationPage.BtnSubmit_Click(Object sender, EventArgs e)
at System.Web.UI.WebControls.Button.RaisePostBackEvent(String
eventArgument) at System.Web.UI.Page.ProcessRequestMain(Boolean
includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
at System.Web.UI.Page.HandleError(Exc…
Message :
Message : Micro Trace Tags: 0 nasq,2 agb9s,10 b4ly,30 8nca,0 tkau,0 ajlz0,1
aat87
Message : Leaving Monitored Scope (Request (POST:http://www.test-net.net:2013/_ad
min/DeleteWebApplication.aspx?WebApplicationId=3ca350d6d9194da79b8637
3adaa08786&IsDlg=1)). Execution Time=55.1704
Not sure what i am looking on, any suggestion?
Regards,
Vin
Hi Vin,
To get exact issue do following:
1- Click on technical Details link and get the correlation id.
2- use the PowerShell cmdLet to retrieve the information from log (Though you can check it from Logs also but is very tedious task)
you can get the PowerShell cmdLet from here.
3- Then check the issue else post the same here so we can provide some help to you.