Friday, September 28, 2007

Creating features using the ElementFile node

Andrew Connell (one of the best known SharePoint MVP's around) has posted an article about using the, rather unknown, ElementFile node in which you can specify which files are included in your custom feature definition. So why do you wan to do this you might wonder.. well.. read the following snippet

When you package everything up in a WSS solution package you list your Feature's definition file within the manifest.xml file (using the <FeatureManifests /> node) which contain the instructions to SharePoint of what to do with the files within the package (*.wsp). If you have additional files that go along with your Feature, you should be listing them in the manifest.xml file as well using something like <TemplateFiles /> or <RootFiles /> (the former is preferred). But, if you listed all the files that were part of the Feature using the <ElementFile /> nodes within the Feature definition, you wouldn't have to list them here. Why? Because SharePoint will look at the definition and see those are files that are part of the Feature itself so the solution framework will deploy those as well.

Read the whole article including a sample how your feature.xml will look like if you use this approach here : Using the ElementFile node in Feature definitions saves you in the deployment 

 

Btw if you are unsure how to build your own feature and/or solution package, read the following articles which I found very useful:

 

Technorati tags: ,

Thursday, September 27, 2007

Friendly "Cannot Connect to the database" error someone?

Does anyone know how to modify the (as a mate perfectly described it) awful white page with "Cannot connect to database" written in black across the top? It seems that no real html file is being written/rendered. I tried to use the CustomError section in the web.config file, but that didn't do much unfortunately. I'm thinking that is error comes straight out of the ISAPI filter and that there isn't any nice and clean way of making this error more userfriendly. So if someone knows please let me know ;)

Technorati tags:

Tuesday, September 25, 2007

There is not enough space on the disk

Ever had that error? No? Well neither have I until recently. It seems that when an user tries to upload multiple large files and the webserver tries to check those files, the 'temp' folder is being used to store those files. Whenever the webserver runs out of disk space it prompts the user with the error "There is not enough space on the disk" or "There is not enough space on the disk (Exception from HRESULT 0x80070070)". Solution? Move the temp folders to a different partition/disk other than for example the C disk. How?

  • Go to the properties of the server
  • Click on the advanced tab
  • Click on environment variables,
  • Within the system variables section locate the the TEMP and TMP variable and change them
  • Reboot the machine

Technorati tags: , ,

Monday, September 17, 2007

Attempted to read or write protected memory. This is often an indication that other memory is corrupt.

This is the error that keeps coming back in a couple of events that are fired at the same time. I have these errors on the web server that is hosting the search queries. Using Google I stumbled upon a fix from the MS SharePoint RRE's, read the following post Timer Job Shocker to solve the errors as stated below:

Event Type:    Error
Event Source:    Windows SharePoint Services 3
Event Category:    Timer 
Event ID:    6398
Date:        17-9-2007
Time:        9:38:18
User:        N/A
Computer:    Webserver
Description:
The Execute method of job definition Microsoft.Office.Server.Administration.ApplicationServerAdministrationServiceJob (ID 3dc44d7a-008a-4c71-8e96-8c19da3d2ce2) threw an exception. More information is included below.

Attempted to read or write protected memory. This is often an indication that other memory is corrupt.

For more information, see Help and Support Center at http://go.microsoft.com/fwlink/events.asp.

Event Type:    Error
Event Source:    Office SharePoint Server
Event Category:    Office Server Shared Services 
Event ID:    7076
Date:        17-9-2007
Time:        9:38:18
User:        N/A
Computer:    Webserver
Description:
An exception occurred while executing the Application Server Administration job.

Message: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.

Techinal Support Details:
System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
   at System.DirectoryServices.Interop.UnsafeNativeMethods.IntADsOpenObject(String path, String userName, String password, Int32 flags, Guid& iid, Object& ppObject)
   at System.DirectoryServices.Interop.UnsafeNativeMethods.ADsOpenObject(String path, String userName, String password, Int32 flags, Guid& iid, Object& ppObject)
   at System.DirectoryServices.DirectoryEntry.Bind(Boolean throwIfFail)
   at System.DirectoryServices.DirectoryEntry.Bind()
   at System.DirectoryServices.DirectoryEntry.get_IsContainer()
   at System.DirectoryServices.DirectoryEntries.CheckIsContainer()
   at System.DirectoryServices.DirectoryEntries.Find(String name, String schemaClassName)
   at Microsoft.SharePoint.Metabase.MetabaseObjectCollection`1.Find(String name)
   at Microsoft.SharePoint.Metabase.MetabaseObjectCollection`1.get_Item(String name)
   at Microsoft.SharePoint.Administration.SPProvisioningAssistant.ProvisionIisApplicationPool(String name, ApplicationPoolIdentityType identityType, String userName, SecureString password, TimeSpan idleTimeout, TimeSpan periodicRestartTime)
   at Microsoft.SharePoint.Administration.SPMetabaseManager.ProvisionIisApplicationPool(String name, Int32 identityType, String userName, SecureString password, TimeSpan idleTimeout, TimeSpan periodicRestartTime)
   at Microsoft.Office.Server.Administration.SharedWebServiceInstance.CreateSharedWebServiceApplicationPool(SharedResourceProvider srp)
   at Microsoft.Office.Server.Administration.ApplicationServerJob.ProvisionLocalSharedServiceInstances(Boolean isAdministrationServiceJob)

For more information, see Help and Support Center at http://go.microsoft.com/fwlink/events.asp.
Event Type:    Error
Event Source:    Office SharePoint Server
Event Category:    Office Server Shared Services 
Event ID:    6482
Date:        17-9-2007
Time:        9:38:18
User:        N/A
Computer:    Webserver
Description:
Application Server Administration job failed for service instance Microsoft.Office.Excel.Server.ExcelServerSharedWebServiceInstance (836525f4-bb70-4f76-9ea3-759151a1edd4).

Reason: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.

Techinal Support Details:
System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
   at System.DirectoryServices.Interop.UnsafeNativeMethods.IntADsOpenObject(String path, String userName, String password, Int32 flags, Guid& iid, Object& ppObject)
   at System.DirectoryServices.Interop.UnsafeNativeMethods.ADsOpenObject(String path, String userName, String password, Int32 flags, Guid& iid, Object& ppObject)
   at System.DirectoryServices.DirectoryEntry.Bind(Boolean throwIfFail)
   at System.DirectoryServices.DirectoryEntry.Bind()
   at System.DirectoryServices.DirectoryEntry.get_IsContainer()
   at System.DirectoryServices.DirectoryEntries.CheckIsContainer()
   at System.DirectoryServices.DirectoryEntries.Find(String name, String schemaClassName)
   at Microsoft.SharePoint.Metabase.MetabaseObjectCollection`1.Find(String name)
   at Microsoft.SharePoint.Metabase.MetabaseObjectCollection`1.get_Item(String name)
   at Microsoft.SharePoint.Administration.SPProvisioningAssistant.ProvisionIisApplicationPool(String name, ApplicationPoolIdentityType identityType, String userName, SecureString password, TimeSpan idleTimeout, TimeSpan periodicRestartTime)
   at Microsoft.SharePoint.Administration.SPMetabaseManager.ProvisionIisApplicationPool(String name, Int32 identityType, String userName, SecureString password, TimeSpan idleTimeout, TimeSpan periodicRestartTime)
   at Microsoft.Office.Server.Administration.SharedWebServiceInstance.Synchronize()
   at Microsoft.Office.Excel.Server.ExcelServerSharedWebServiceInstance.Synchronize()
   at Microsoft.Office.Server.Administration.ApplicationServerJob.ProvisionLocalSharedServiceInstances(Boolean isAdministrationServiceJob)

For more information, see Help and Support Center at http://go.microsoft.com/fwlink/events.asp.

Tip: the hotfix that is described in the post is available for download here Download

 

Technorati tags:

Friday, September 14, 2007

MOSS is scary!

Don't know if I'm the only one who finds this scary. But in a farm, MOSS is modifying the hosts file of your servers. I had a really hard time figuring this one out actually. I was just playing around with different roles for each server. And then all of a sudden when I tried to use a share of one of the webservers from an indexserver I got the following error : "Logon Failure: The target account name is incorrect". If you google this error you will find information about wrongly configured DNS settings.
So with this information I decided to ping the webserver and see what IP I got back.. and you probably would have guessed it .. I got the IP back of the index server! Argh! So I logged on the webserver and try to ping itself and then ping the indexserver and all the IP's were fine. Back to the index server!

  • I checked all the DNS settings via the TCP/IP settings
  • Ran a tool called "netdiag" to check whether the server was properly configured in the domain

Nothing 'odd' or 'weird' was showing in the reports so I was getting a bit hopeless.. and then I thought: "Noo.. not the hosts file! It can't be!" With this as a result :

# For example:
#
#      102.54.94.97     rhino.acme.com          # source server
#       38.25.63.10     x.acme.com              # x client host
10.10.4.238    webservercomputername    # Added by Office SharePoint Server Search (9/13/2007 3:52 PM).
10.10.4.238    webserverhostname    # Added by Office SharePoint Server Search (9/13/2007 3:52 PM).
127.0.0.1    localhost    

See why I'm scared? ;) And that's why the share didn't work! It was just pointing to itself (although I should have seen the shares from the index server instead of that error).
The solution is just to modify the host file yourself and put in the proper IP.

Technorati tags:

Thursday, September 13, 2007

SharePoint & Cognos

In a ideal, MS-driven, world you would have a BI solution using the SQL2005 suite and then using SharePoint 2007 to publish your reports and analyses. But what if your reports are not generated using SSRS (SQL Server Reporting Services) or Excel2007 or Peformance Point Server but using Cognos? Well Servé posted a nice quick way to view the reports. Check it out at How to enable Cognos reports on a Sharepoint 2007 site!

 

Technorati tags: , ,

Friday, September 07, 2007

2003 : Wanna know if a site has a custom theme applied to it?

During upgrading you might be interested in knowing which custom webparts are used on sites or how to migrate the userprofiles but there is another thing that if you don't upgrade it correctly your users will complain about it immediately and that is custom themes! It's pretty easy to figure out which sites (webs actually) do have a custom theme applied to it.

SPGlobalAdmin globAdmin = new SPGlobalAdmin();
SPVirtualServer vServer = globAdmin.OpenVirtualServer(new Uri("portalurl"));
                
foreach (SPSite site in vServer.Sites)            
{
                    
    foreach (SPWeb web in site.AllWebs)
    {
        if (web.Theme != string.Empty)
        {Console.WriteLine(web.Url.ToString() + "|"+ web.Theme.ToString());}
                        
        web.Close();
        web.Dispose();
    }

site.Close();
site.Dispose();
}

It's quite funny to see that you only get a result back if there is another than the default theme is applied.