MOSS 2007 trial key expired – update license causing error

Yesterday my trial license key for SharePoint 2007 (MOSS) expired, right in the middle of the day!
I was expecting this but ran into a problem with the license key update. Good news was someone posted about the same issue just this Monday and I found it via Google. I didn’t know Google was this fast in indexing content!

If you are also running into this problem this is the link to Shane’s “The SharePoint Farmer’s Almanac” blog where he has a solution: http://msmvps.com/blogs/shane/archive/2007/05/29/problems-with-licensing-moss.aspx

Here are the details of my issue with the trial license update.

After entering the new license key for the Enterprise version in the Central Administration and clicking OK the update in progress screen was shown for about 5 minutes (yes 5!). After completion I just got a rather generic error message in the sort of “An error occurred please check the log for details”.

I first checked the Event viewer for more information, found the error but not much was shown:

Not much in here so I checked the log file for more details.
The log file can be found in the 12 hive > LOGS directory (normally C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\LOGS)

Here more details were available:

05/30/2007 11:45:31.15             OWSTIMER.EXE (0x0B5C)                               0x158C Office Server                             Setup and Upgrade                 7fwn     High    Executing the Trial Conversion Job.       
05/30/2007 11:45:31.20             OWSTIMER.EXE (0x0B5C)                               0x158C Windows SharePoint Services   Timer                                     7psa     Critical  The Execute method of job definition Microsoft.Office.Server.Administration.LicensingConversionJob (ID e9a304e0-b90e-4787-969c-372f6d27e6e2) threw an exception. More information is included below.  Arithmetic operation resulted in an overflow.  
05/30/2007 11:45:31.20             OWSTIMER.EXE (0x0B5C)                               0x158C Windows SharePoint Services   Timer                                     72ae     Unexpected      Exception stack trace:    at Microsoft.Office.Server.Administration.Licensing.RecordSqmDataPoints(Boolean trialConversion)     at Microsoft.Office.Server.Administration.Licensing.ConvertTrialToLicensed()     at Microsoft.Office.Server.Administration.LicensingConversionJob.Execute(Guid targetInstanceId)     at Microsoft.SharePoint.Administration.SPTimerJobInvoke.Invoke(TimerJobExecuteData& data, Int32& result)
 

As the error details did not guide me towards a solution I opened up Google and after 2 clicks found Shane’s post.
So a simple iisreset seems to solve the problem. Would be nice to find the actual problem behind this issue.

 


MOSS 2007 and WSS3 development process: some ideas and tips

As my first SharePoint 2007 WCM project comes an end (for phase 1 that is), I think it is a nice moment to take a step back and post my thoughts on the development process in WSS3 and MOSS 2007.

I’m not going into the details about the project at this stage, in this post I would just like to share lessons learned and my ideas and tips on development.

Before giving my own thoughts, a good article was recently posted on MSDN containing guidelines for team based development on SharePoint 2007: Team-Based Development in Microsoft Office SharePoint Server 2007 (http://msdn2.microsoft.com/en-us/library/bb428899.aspx). I was glad our own approach to SharePoint development was very close to was is recommended, so I won’t go over the same points in this post.

Essential tools and resources
Most of the development helpers and tools I use are already posted in a separate page on this site: see Resources. These are the basic ones every developer in the team had to install:
- Visual Studio 2005 WSS3 Extensions
- The WSS3 SDK
- SharePoint 2007 SDK and the ECM Starter Kit. The starter kit contains some nice code samples.
- Reflector.Net for digging into the SharePoint classes when documentation was well, not very extensive.

I bundled my ideas in a few tips:

Tip 1: Build and test your development by using solutions
During development of custom features, application pages, web parts etc we used batch file based installation files. We used XCOPY for installing custom features, custom pages in the layouts directory, the gacutil.exe for registering and so forth. This works fine at first but as you eventually will need to combine all those developments into a SharePoint solution don’t wait on that. Create the solution from the start so that your installation process gets tested. The nice thing about solutions is that when you uninstall the solution all installed files get nicely deleted/cleaned from all the SharePoint 12 hive directory. No need to manually go through the installation directories and delete custom layout files, features and the like.

Tip 2: put it all in a solution
Why is this second tip as well as the first? Well I can’t emphasize enough how important it is to integrate as much as possible in the solution. You can add SafeControl sections for webparts, custom config sections, features, add CAS sections that are automatically merged into configuration, add root files that should go into the 12 hive root, site definitions that are nicely installed into the different directories (for site definitions, template files go into ‘C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\SiteTemplates’; webtemp*.xml files go into ‘C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\1033\XML’) and so on.

Tip 3: CAS for web application assemblies
If you follow the guideline that is to install your custom DLLs in the web application’s bin directory you will need to use CAS (Code Access Security) to define the permissions your assembly gets when running on SharePoint. Don’t start by installing your assembly in the GAC and then moving to the web application later. You’ll probably just lose time when doing the change. CAS might seem extra work in the beginning but is essential to get your assembly to run correctly when installed in the application’s bin directory.

Tip 4: use features
This might as well been tip # 1, everything can be a feature! Features can be used to create content types, libraries, instantiate lists, add event receivers, customize setting, and so on and so on...
Important during the analysis phase: don’t make too many features either. The analysis phase is crucial to correctly separate or combine customizations into features. I would recommend analyzing the benefits of separating elements into features or combining several elements into a single feature.

Tip 5: For multiple language interfaces, test in every language needed
Test your development and customization in every language early in the development process. My own development setup is in English but at the client we are using a Dutch version. This gave us a few small problems as we hadn’t foreseen because sometimes display names are used to access lists or base SharePoint elements.
Use resource files and satellite assemblies for translated elements.

That’s it for now. I have more ideas on this but will put those in another post when I get the time to present them in an orderly fashion.

So what are your ideas on the WSS and SharePoint development?

Technorati tags: , , ,

 


Back from vacation

Just back from a week in the north of Portugal.
Unfortunately the wheather wasn't as nice as we had hoped or was used to in Portugal. But it was a very nice time to get some new energy and get ready for the next months.

We rented a villa in the Minho region, next to the national park of Peneda & Geres. Lots of nice walks, ancient remains from the Romans and beautiful views.

So, some catching up to do on all my RSS subscriptions, more than one week without my laptop and Internet is a real break.

And the picture, that's from the holiday :-)

 

 

 

 


Resources for WCM security on MOSS: securing anonymous sites

[via the Microsoft SharePoint Products and Technologies Team Blog]

Two very good resources on how to correctly implement security for anonymous users on MOSS internet facing websites:

- A guide on Microsoft Technet: Plan security for an external anonymous access environment (Office SharePoint Server) (http://technet2.microsoft.com/Office/en-us/library/f507f5d6-4c9d-4f98-909f-069c53b9a3f61033.mspx?mfr=true)

- A comment with a link to a very good post by Steven Tapping: Restricting Document Library Browsing for SharePoint 2007 Anonymous Users.
Steven gives a step by step overview on how you can correctly enable read access to library items without giving anonymous users the permission to browse the library (http://blogs.vertigo.com/personal/steventap/Blog/Lists/Posts/Post.aspx?ID=22).

 


MOSS 2007 error in event viewer - permission settings do not grant Local Activation permission for the COM Server

[Update July 2007: see below]

Last week we did a clean installation of Microsoft Office SharePoint Server 2007 on a new Windows 2003 server.

After completing installation we found a recurring error message in the Event Viewer regarding two application pool users. The error message states:

The application-specific permission settings do not grant Local Activation permission for the COM Server application with CLSID

{61738644-F196-11D0-9953-00C04FD919C1}

 to the user [domain\username] SID (S-1-5-21-GUID..).  This security permission can be modified using the Component Services administrative tool.

It seems the application pool user that we used when creating our web application does not have enough permissions on a DCOM component. After a few searches on the net I came to a blog post that solved our problem: http://geekswithblogs.net/mhamilton/archive/2006/12/19/101568.aspx

In our case this resulted in our user not having launch permissions for the service "IIS WAMREG admin service".

I have one idea why this could occur: we used a local windows account for the setup user instead of a domain account. The MSDN documentation recommends a domain account.

Based on the blog post by Mike H. we applied the following steps:

  1. Start-->Run-->regedit
  2. Click “My computer” > Edit > Find > and paste the CLSID {61738644-F196-11D0-9953-00C04FD919C1}
  3. The found item will be opened. Check the name of the service the ID belongs to. In our case it was the IIS WAMREG admin service.
  4. Open Component Services by going to Start > All Programs > Administrative Tools > Component Services.
  5. Expand the tree to Computers > My Computer > DCOM Config.
  6. Search for the service "WAMREG admin service" and right-click Properties.
  7. Choose the Security tab > Customize in the Launch and activation permissions. Click Edit.
  8. A permissions dialog box opens. Add the user name that was mentioned in the Event Viewer.
  9. That solved it for us.

Thanks to Mike H. 

[Update 19 July 2007]
Peter left a comment about a KB article about this issue that is now available: Event ID 10017 error messages are logged in the System log after you install Windows SharePoint Services 3.0. So check out the article at http://support.microsoft.com/kb/920783
Thanks Peter!


MOSS 2007 Publishing web site definition template – onet.xml – syntax for properties and getting the right content types

The documentation for creating site definitions and provisioning for MOSS 2007 Publishing sites is almost non-existing on MSDN.

My first suggestion is to look at the out of the box publishing site definition “BLANKINTERNET”.
This site definition is located in the 12 hive: C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\SiteTemplates\BLANKINTERNET
The template configuration for this site definition can be found in the file: C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\1033\XML\webtempsps.xml. Note that only the part in the element <Template Name="BLANKINTERNET" ID="53">... is applicable.

I will post a more complete article on how to create your own publishing site definition with custom page layouts, master pages and content types later when I have more time... For now I’ll just go over the elements on which I had most work getting them to work. It’s actually not quite hard as long as you know how to do it.

1. Make sure the required onet.xml and webtemp*.xml files are copied to the right directories

Your onet.xml file should go into the folder C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\SiteTemplates\[YOURSITEDEF]\XML
Provisioned files may go one level higher: C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\SiteTemplates\[YOURSITEDEF]

webtemp*.xml file should go into: C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\1033\XML

2. onet.xml: referencing the correct site features

In order to get the publishing site features activated when you create a site based on your custom site template, make sure all required publishing site and web features are activated. Features at site level are defined and activated at the site collection level. Web features will be activated for every new web you create using this configuration.

... <!-- part ommitted for clarity -->
<
Configurations>
<
Configuration ID="-1" Name="NewWeb"/>

<Configuration ID="0" Name="[YOURSITEDEF]">

<SiteFeatures>

<!-- Workflow Features -->
<!--
Workflow Expiration -->

<Feature ID="C85E5759-F323-4EFB-B548-443D2216EFB5" />

<!-- Workflow Review -->
<
Feature ID="02464C6A-9D07-4F30-BA04-E9035CF54392" />

<!-- Workflow Signature -->
<
Feature ID="6C09612B-46AF-4B2F-8DFC-59185C962A29" />

<!-- Workflow Translation -->
<
Feature ID="C6561405-EA03-40A9-A57F-F25472942A22" />

<Feature ID="A392DA98-270B-4e85-9769-04C0FDE267AA">

<!-- PublishingPrerequisites -->

</Feature>

<Feature ID="7C637B23-06C4-472d-9A9A-7C175762C5C4">

<!-- ViewFormPagesLockDown -->

</Feature>

<Feature ID="AEBC918D-B20F-4a11-A1DB-9ED84D79C87E">

<!-- PublishingResources -->

<Properties xmlns="http://schemas.microsoft.com/sharepoint/">
<
Property Key="AllowRss" Value="false"/>
<
Property Key="SimplePublishing" Value="false" />
</
Properties>

</Feature>

<Feature ID="F6924D36-2FA8-4f0b-B16D-06B7250180FA">

<!-- Office SharePoint Server Publishing -->

</Feature>

</SiteFeatures>

<WebFeatures>

<!-- Include the common WSSListTemplateFeatures used by CMS -->

<Feature ID="00BFEA71-DE22-43B2-A848-C05709900100" > </Feature>

<Feature ID="00BFEA71-E717-4E80-AA17-D0C71B360101" > </Feature>

<Feature ID="00BFEA71-52D4-45B3-B544-B1C71B620109" > </Feature>

<Feature ID="00BFEA71-A83E-497E-9BA0-7A5C597D0107" > </Feature>

<Feature ID="00BFEA71-4EA5-48D4-A4AD-305CF7030140" > </Feature>

<Feature ID="22A9EF51-737B-4ff2-9346-694633FE4416">

<!-- Publishing -->

<Properties xmlns="http://schemas.microsoft.com/sharepoint/">
<
Property Key="ChromeMasterUrl" Value="~SiteCollection/_catalogs/masterpage/mymasterpage.master"/>
<
Property Key="WelcomePageUrl" Value="$Resources:cmscore,List_Pages_UrlName;/default.aspx"/>
<
Property Key="PagesListUrl" Value=""/>
<
Property Key="AvailableWebTemplates" Value="*-MYSITEDEF#1"/>
<
Property Key="AvailablePageLayouts" Value="~SiteCollection/_catalogs/masterpage/mypagelayout.aspx"/>
<
Property Key="AlternateCssUrl" Value="" />
<
Property Key="SimplePublishing" Value="false" />

</Properties>

</Feature>

<Feature ID="541F5F57-C847-4e16-B59A-B31E90E6F9EA">

<!-- Per-Web Portal Navigation Properties-->

<Properties xmlns="http://schemas.microsoft.com/sharepoint/">

<Property Key="InheritGlobalNavigation" Value="true"/>

<Property Key="IncludeSubSites" Value="true"/>

</Properties>

</Feature>

<Feature ID="94C94CA6-B32F-4da9-A9E3-1F3D343D7ECB">

<!-- Office SharePoint Server Publishing -->

</Feature>

</WebFeatures>

<!-- remaining elements ommitted -->

</Configuration>

3. The right syntax for AvailablePageLayouts and AvailableWebTemplates

The Publishing Web Feature (ID 22A9EF51-737B-4ff2-9346-694633FE4416) contains some properties that allow us to specify master pages, page layouts and available web templates.

The syntax for specifying the values in the onet.xml file is not documented (as far as I could find).

AvailablePageLayouts

Your custom page layout should be deployed to the site collection by activating a page layout provision feature for example.

For a single page layout, the syntax is available in the BLANKINTERNET site definition:

<Property Key="AvailablePageLayouts" Value="~SiteCollection/_catalogs/masterpage/mypagelayout.aspx"/>

For defining multiple AvailablePageLayouts I found that the separator is : (colon) by looking at the Search site definition (SRCHCEN):

<Property Key="AvailablePageLayouts" Value="~SiteCollection/_catalogs/masterpage/
mypagelayout.aspx:~SiteCollection/_catalogs/masterpage/mypagelayout2.aspx
"/>

AvailableWebTemplates

If you want to restrict the list of available web templates you can do this with the AvailableWebTemplates property.

<Property Key="AvailableWebTemplates" Value="*-MYSITEDEF#1"/>

For specifying multiple web templates, I found the syntax thanks to a post in a forum: http://www.eggheadcafe.com/software/aspnet/29217247/availablewebtemplates-key.aspx

Someone found the syntax by looking at the Microsoft.SharePoint.Publishing.PublishingWeb class using reflector. Snippet from the solution mentioned in the forum:

AvailableWebTemplates Key Format is:
LCID-[sitetemplatename][#sitetemplatenumber];LCID-[sitetemplatename]
[#sitetemplatenumber];LCID-[sitetemplatename][#sitetemplatenumber]

1033-BLANKINTERNET#1;1049- BLANKINTERNET #1;*- BLANKINTERNET #2

*-BLANKINTERNET#2 - ALL Languages
(Thanks Sorgi?)

So if we know the separator is ; (semi-colon) the element should look like:

<Property Key="AvailableWebTemplates" Value="*-MYSITEDEF#1;*-MYSITEDEF#3"/>

Please see the Microsoft.SharePoint.Publishing.PublishingWeb class reference on MSDN: http://msdn2.microsoft.com/en-us/library/microsoft.sharepoint.publishing.publishingweb.aspx. Looking at the class properties will also give you more insight into how to use the properties in the onet.xml file.

4. Using multiple configuration and hiding them in the UI

The webtemp*.xml file may contain multiple template configurations. You may make some of these hidden for example if you want to create those specific sites via code only. Use for Hidden="TRUE" this.

webtemp*.xml snippet:

<!-- ... snippet:-->

<Template Name="MYSITEDEF" ID="10020">

<Configuration ID="0" Title="My site template" Hidden="FALSE" ImageUrl="/_layouts/1033/images/img.gif" Description="This is a publishing site template" SubWebOnly="FALSE" DisplayCategory="My own category">

</Configuration>

<Configuration ID="1" Title="My site template – Autocreated contact section" Hidden="TRUE" ImageUrl="/_layouts/1033/images/img.gif" Description="This template is used by code to generate the contact site." SubWebOnly="TRUE" DisplayCategory=" My own category" VisibilityFeatureDependency="97B7C2D9-51E6-4add-844E-D133D25B7B15">

</Configuration>

<!-- ... snippet end-->

5. Making your own content types available

When you use custom page layouts chances are you are also using custom content types. By using the AvailablePageLayouts properties your custom page layouts become available but there is still a problem. By default the Pages library only contains the MOSS publishing content types, as you can see in this screenshot:

Users will be available to create new pages using your page layout but all the custom properties you use in their related content types are missing. The page layout may not show any property in edit mode. If you go the Site Settings > Site content types, you will see your custom content types and their site columns.
You may manually add the content types to the Pages library by going to Site Actions > Site Settings > Modify Pages Library Settings. Choose “Add from existing site content types” and choose the content types. Once this is done your custom page layouts should start working normally.
Doing the manual setting is one possibility but having to do this manually for every new web is not really an option.
I ended up creating a web feature that is automatically activated by the site template definition. My feature contains a ReceiverAssembly and class in which I add the desired content types to the Pages library.

Code snippet:

string pageLib = Microsoft.SharePoint.Publishing.PublishingWeb.GetPagesListName(web);

SPContentTypeCollection allContentTypes = web.Site.RootWeb.AvailableContentTypes;

SPContentTypeCollection usedContentTypes = web.Lists[pageLib].ContentTypes;

foreach (SPContentType contentType in allContentTypes)

{

if (contentType.Hidden==false && contentType.Group.ToLower().StartsWith("Mygroupname ") == true)

//if the content type does not yet exist in the library add it:

{

if (usedContentTypes[contentType.Name] == null)

{

web.Lists[pageLib].ContentTypes.Add(contentType);

}

}

}

That’s it for me!

 

Copyright © 2007 Katrien De Graeve.