Administrative service for this server is not enabled when deploy

Full error is:

The timer job for this operation has been created, but it will fail because the administrative service for this server is not enabled. If the timer job is scheduled to run at a later time, you can run the jobs all at once using stsadm.exe -o execadmsvcjobs. To avoid this problem in the future, enable the Windows SharePoint Services administrative service, or run your operation through the STSADM.exe command line utility.

Here is the solution :

Go to Start > Run and Type services.msc

Now in Services window select “SharePoint 2010 Administration”Right click and start

Thats it.

Sharepoint 2010 Access Denied when modifing web.config with ApplyWebConfigModifications()

Ok i accept this problem is one of my favorite. After 3 hours finally i found a solution .Let me describe the error first. I have a feature receiver class which makes web.config modifications but SPWebApplication.ApplyWebConfigModifications() method cause an access denied error in activation process.Here is my code :

public override void FeatureActivated(SPFeatureReceiverProperties properties)

{

bool bApplyChanges = ApplyWebConfigMods(properties);

SPSite currentSite = properties.Feature.Parent as SPSite;

if (bApplyChanges)

{

SPWebApplication currentWebApp = currentSite.WebApplication;

string sClassName = typeof(NSF.Modules.ErrorModule).FullName;

SPWebConfigModification moduleEntry = addHttpModule(“NFSErrorModule”,

“NFSErrorModule”, PreConditions.integratedMode, sClassName, 1);

currentWebApp.WebConfigModifications.Add(moduleEntry);

//currentWebApp.WebService.ApplyWebConfigModifications();

SPFarm.Local.Services.GetValue<SPWebService>().ApplyWebConfigModifications();

currentWebApp.Update();

}

}

First i changed currentWebApp.WebService.ApplyWebConfigModifications()  to SPFarm.Local.Services.GetValue<SPWebService>().ApplyWebConfigModifications();

Secondly i gave permission read/write Network Service user which is my apppool identity for wss folder where web.config in it.

Third I ran powershell commadlet that change RemoteAdministratorAccessDenied propterty to false . i found it in below url
http://unclepaul84.blogspot.com/2010/06/sppersistedobject-xxxxxxxxxxx-could-not.html

function Set-RemoteAdministratorAccessDenied-False(){ # load sharepoint api libs [System.Reflection.Assembly]::LoadWithPartialName(“Microsoft.SharePoint”) > $null [System.Reflection.Assembly]::LoadWithPartialName(“Microsoft.SharePoint.Administration”) > $null
# get content web service $contentService = [Microsoft.SharePoint.Administration.SPWebService]::ContentService  # turn off remote administration security $contentService.RemoteAdministratorAccessDenied = $false  # update the web service $contentService.Update()  }

For more info:
http://stefvanhooijdonk.com/2010/08/02/custom-spjobdefinition-and-access-denied-error/
http://blogs.msdn.com/b/navdeepm/archive/2010/09/15/sharepoint-2010-adding-nested-web-config-entries-using-the-spwebconfigmodification.aspx

and now its ok.

by the way default value of RemoteAdministratorAccessDenied property is totally sucking idea.And so shouldnt be someone code it with throwing explanatory exception ?

Have a nice codding…

Sharepoint 2007 & 2010 Execution Timeout

Sometimes your code needs  time to execute and sharepoint throw an error about Timeout .  here is the solution:

Add this config line to your web.config.

<httpRuntime maxRequestLength=”51200″ executionTimeout=”1200″/>

MSDN say for executionTimeout : Optional Int32 attribute.Specifies the maximum number of seconds that a request is allowed to execute before being automatically shut down by ASP.NET.

This time-out applies only if the debug attribute in the compilation element is False. If the debug attribute is True, to help avoiding application shut-down while you are debugging, do not set this time-out to a large value.

The default is 110 seconds. If you set executionTimeout 1200 means 20 minutes.

Here’s the complete syntax for this tag:

<httpRuntime executionTimeout=”seconds”
maxRequestLength=”kbytes”
minFreeThreads=”numberOfThreads”
minLocalRequestFreeThreads=”numberOfThreads”
appRequestQueueLimit=”numberOfRequests”
useFullyQualifiedRedirectUrl=”true|false”  />

This time-out applies only if the debug attribute in the compilation element is False. when set to “debug=true” mode, the runtime will ignore the timeout setting.

Important note: If you are working with application pages in Layouts folder you should change web.config of this folder not your application folder.

If you want to use this attribute for one page your config should be like this

<location path=”MyPages/TestPage.aspx”>
<system.web>
<httpRuntime
executionTimeout=”1200″
maxRequestLength=”51200″ />
</system.web>
</location>

Happy tips..

HTTP 500 – Internal server error page Sharepoint 2007

You can get more detailed error open debug functionality in web config

  • In the <system.web> tag, locate the <customErrors mode=”On”> tag and change it to <customErrors mode=”Off”> to see the ASP.NET exception when an error occurs instead of being redirected to the error page.
  • In the <SharePoint> tag, locate the <SafeMode MaxControls=”50″ CallStack=”false”/> tag and change it to <SafeMode MaxControls=”50″ CallStack=”true”/>. This causes the ASP.NET error message to display with stack trace information
  • In my case error caused by Language pack . You should check your server version and service packs also .

    See :

    https://blog.bugrapostaci.com/2010/10/21/sharepoint-2007-language-pack-service-pack-order/

    See you now.

    Sharepoint 2007 Language Pack & service pack order

    Language packs enable site owners and site collection administrators to create SharePoint sites and site collections in multiple languages without requiring separate installations of Microsoft Office SharePoint Server 2007

    You must install the Windows SharePoint Services 3.0 language packs before you install the Office SharePoint Server 2007 language packs.
    You must install the language packs in the correct order. The correct order is as follows:

    1.Windows SharePoint Services 3.0 language pack
    2.Windows SharePoint Services 3.0 SP1 or SP2 language pack
    3.Office SharePoint Server 2007 language pack
    4.Office SharePoint Server 2007 SP1 or SP2 language pack

     

    Important Notes:

    • You must be a member of the Administrators group on the front-end Web server to install these language files. After the language files are installed, the languages are available to all users of the computer.
    • If you are uninstalling a Microsoft Office Server product, you must uninstall all language packs before you uninstall the product.
    • If you are running Service Pack 2 (SP2) of Office SharePoint Server 2007 you only have to download the SP2 language packs. The SP2 language packs include all materials that are in the SP1 language packs.
    • You must download both the Windows SharePoint Services 3.0 language packs and the Office SharePoint Server 2007 language packs.

    For each Service Pack do the following :

    1. Disconnect users from the server farm by stopping the World Wide Web Publishing service (w3svc) on all Web servers.

    2. Begin the software installation on the server hosting the central admin web site

    3. At the end of the software update installation, the SharePoint Products and Technologies Configuration Wizard start Note:  If the wizard does not start automatically, click Start, point to All Programs, point to Administrative Tools, and then click SharePoint Products and Technologies Configuration Wizard.

    4. On the SharePoint Products and Technologies Configuration Wizard Welcome page, click Next.

    5. In the dialog box that notifies you that some services might need to be restarted during configuration, click Yes.

    6. On the Completing the SharePoint Products and Technologies Configuration Wizard page, click Next.

    7. When the dialog box about installation in a server farm appears, do not click OK. Instead, leave each server with the following dialog box displayed: – THIS IS CRITICAL TO THE SUCCESSFUL INSTALL.
    You must run Setup to install new binary files for every server in your server farm. If you have multiple servers in your server farm, run Setup and the configuration wizard on the other servers now, and then return to this server and click OK to continue.

    8. When the dialog box from the previous step is displayed on all Web servers in the server farm, use one Web server that hosts the Central Administration Web site to finalize the installation.

    9. On the server you selected in the previous step (Step 2), click OK.

    10. On the Configuration Successful page, click Finish. 11. Continue updating the remaining computers in the server farm, one at a time, by clicking OK in the dialog box.

     

     

     

    For  More Information and Resources:
    http://technet.microsoft.com/en-us/library/cc262108(office.12).aspx
    http://sharepoint.microsoft.com/Blogs/fromthefield/Lists/Posts/Post.aspx?ID=50