404 on all pages after editing master page in SharePoint desinger
January 15, 2009
I needed to make avery small change to a master page on a MOSS publishing based website yesterday, so opened up the file using SharePoint designer, saved my changes and went to the site to review and check all was Ok – I was greeted with SharePoints 404 not found page. Hmmm…not ideal!
After trying a few more pages I decided to enable the stack trace and switch off custom errors (In web.config), so I could get a better idea of what was going on – Hopingthis would tell me exactly what was missing. (I knew the pages were there, as I could see them in the SharePoint admin site).
Enabling verbose errors didnt help much – This simply gave me a slightly less friendly 404 page. I then viewed the master page directly – This time, I saw that ‘welcome.ascx’ was missing. Having checked that this was in place, I decided to check the references to the control on the master page. It took me a while, but I eventually found the problem – SharePoint designer had removed the tilde character that normally precedes the path to the control. The actual reference should have been something like this:
<%@ Register TagPrefix=”wssuc” TagName=”Welcome” src=”~/_controltemplates/Welcome.ascx” %>
After adding the tilde character back in (using notepad) and uploading via SharePoint admin, all was good again!
Just another little oddity to remember when working with SharePoint!
Access Denied for Site Collection Administrator
October 9, 2008
I have been carrying out some SharePoint disaster recovery planning/testing recently. One of the scenarios is restoring the content database from a failed SharePoint install, and restoring into a working, vanilla installation under a different server name/domain (therefore with a different set of active directory users).
After restoring the site content database and attaching to it within central admin, I opened the homepage of the site collection. I was logged in as the farm administrator, so was suprised to see ‘Access Denied’
This is because the site collection administrator user account did not exist on the new server/domain, nor did any of the other users with permission to access the site.
As you may well know, setting the site collection administrator is done within the site settings, so that was a no-go. My next thought was that this must be possible with the command line stsadm tool – Nope, no so!
Luckily, Microsoft MVP Gary Lapointe has developed some rather cool extensions to stsadm which provide a whole host of goodies not available in the standard stsadm.exe tool. One of these add-ons is the ability to set a SharePoint sites collection administrator!
The add-ons are installed as a global solution, available to download at http://stsadm.blogspot.com. Bear in mind there are two versions, one for WSS and one for MOSS.
Business Data Catalog – First Attempts
May 14, 2008
I’ve been playing around with BDC today as part of my revision for 70-630 exam.
After successfully installing the AdventureWorks BDC application using the sample ADF (Application Definition File) I hit a bit of a wall using the Business Item Webpart.
I get the following error when selecting an item to view:
Unable to connect to AdventureWorksInstance
The ADF LOBSystemInstance was originally setup with PassThrough Authentication, which means the currently logged on users credentials are passed to the LOB system (In this case a SQL Server 2005 database). Although this method does bring the obvious benefit of being able to take advantage of the LOB security provision, there are two issues:
a) This method does not work across servers – e.g. If you are connecting to a LOB on another server, you will encounter the double hop issue, which means the credentials are lost (Not an issue for my development environment, where everything is hosted on one box)
b) Performance is likely to suffer due to the way connection pooling is handled in this scenario -
I next tried using ‘RevertToSelf’ authentication method, which causes the BDC to use the identity of whatever application pool is running the web app – I added this login to SQL Server, verified that it had correct permissions by configuring an ODBC connection (Nice quick way of testing connectivity) and tried again – Same error! It was at this point that I realized my mistake – The ADF file I had downloaded was for the SQL 2000 AdventureWorks example database, which is normally called ‘AdventureWorks2000′, I was using the SQL 2005 example, which is called ‘AdventureWorks.
So, having deleted the application from BDC, renamed the default catalog in the ADF and reimported, I was able to authenticate.
I then got this error:
An error occurred while retrieving data from AdventureWorksSampleInstance. Administrators, see the server log for more information
I then tried to find the logs for BDC – Apparently these reside in 12 hive/logs, and are gererated every ½ hour. I didnt have any luck finding anything useful, so considering my earlier problem, wondered if the schema for AdventureWorks2000 was different from AdventureWorks2005 – Which I proved to be the case having examined some of the property queries in the ADF file.
So, a quick Google found the updated AdventureWorks2005 ADF file which I downloaded, changed the LOBSystemInstance ‘RdbConnection Data Source’ property value to my SQL Server name, and the AuthenticationMode to ‘RevertToSelf’ – After this, it worked!
SharePoint Resources
February 21, 2008
Below is a collection of useful MOSS/WSS development and administration/fault diagnosis resources which I find useful whilst carrying out Microsoft Office SharePoint Server work.
Development
How To
- Create Features
- Enable Anonymous Access
- Enable verbose error output
- Provision a File
Guides
- Calculation Operators
- Common Formulas
- Content Type Creation Including Inheritence
- Content Type IDs Explained
- Data Calculations
- Features
- User Management
- XML Schema Intellisense in Visual Studio
- WebParts – Adding Custom Properties
Best Practice
- Common Coding Issues When Using the SharePoint Object Model
- Using Disposable Windows SharePoint Services Objects
References
- MOSS 2007 Developer Portal (The Bible!)
- Field Names for Document Libraries and Lists
- Scaling Limits
- SDK
- Web Part Controls Description Files
Downloads
- CAML Query Builder
- CSS Reference
- Internet Explorer Web Developer Tool Bar
- Visual Studio Project Templates
Administration
- Making BDC Data Searchable
It is possible to include BDC data in search scopes, making line of business data available to your users on SharePoint search. There are a few steps to go through to enable this. Whilst the process itself is quite straughtforward, there a quite a few dependencies, and the permissions involved are some what complicated.
Check out Sahil Maliks blog article on configuring this.
Troubleshooting
- SharePoint returns a ‘Service Unavailable’ message
This is caused by one of three things – Password has been changed for the application pool identity, but not reflected in IIS; The application poole identify has been removed from the worker process group(s) or the application pool is not running
How to check and fix SharePoint ‘Service Unavailable’ error
An unhandled exception occurred in the user interface.Exception Information: OSearch
January 17, 2008
Whilst configuring Office SharePoint Server Search Service settings, I kept getting the following error message everytime I clicked Ok…
An unhandled exception occurred in the user interface.Exception Information: OSearch
I was entering just the username. SharePoint expects a fully qualified username domainname/username
(computername/username if you do not have a domain).
Where is STSADM.EXE?
January 17, 2008
I’ve now had a few situations where I’ve needed to make use of the SharePoint command line utility – stsadm.exe. However, these occasions have been some months apart, so I’ve had to look up the location each time, for your convenience, actually, more for mine so I dont have to go a-googlin’…here is the location of stsadm.exe:
c:\program files\Common Files\microsoft shared\web server extensions\12\bin
Incidentally, one up from the bin folder in the path above is commonly known to us SharePoint types as ’12 Hive’ which is where SharePoint gets installed to, specifically – MOSS 2007.
Less often, you’ll also see the term ’60 Hive’ which refers to:
c:\program files\Common Files\microsoft shared\we server extensions\60\bin
This is where SPS 2003 and WSS 2.0 are installed to.
If you use stsadm.exe regulary, you could add the path to your system paths, which would allow you to call stsadm.exe from any directory. I find this particular useful on development machines where I make quite heavy use of stsadm.exe
Quikstart Guide to Creating SharePoint 2007 Web Parts
October 26, 2007
Here is a link to Mart Muller’s SharePoint BLOG article explaining how to create SharePoint 2007 Web Parts – Its a basic quick start guide which should be useful
http://blogs.tamtam.nl/mart/CreateASharePoint2007WebpartStepByStep.aspx
