matt’s debates

because matt’s debating is not a crime

Archive for July, 2009

MOSS/Sharepoint 2007 SQL Server error log problem

This one had me going for a while. I was getting a Failure Audit entry in the Application event log every minute, looked a bit like this

Event Type: Failure Audit
Event Source: MSSQLSERVER
Event Category: (4)
Event ID: 18456
Date: 5/25/2007
Time: 1:57:00 AM
User: TNG\TNG-SQL_Service
Computer: SHAREPOINT
Description:
Login failed for user ‘System’. [CLIENT: ]

I started, stopped, restarted etc. all SQL related service. Changed passwords… nothing helped.

Inspetcing the SQL server logs, I soon found some errors, in particular “Cannot open database “SharedServices1_DB” requested by the login. The login failed.

Well that makes sense, seeing as my SSP is running on SharedServices2 – there used to be a SharedServices1 but I had deleted it when it got a bit confused over its identity. What stumped me then was what on earth was still trying to access the old database? Looked all through SSP admin, Central Admin.. until, there in SQL Server Agent Jobs was a job to clear up expired sessions. Must be created automagically when you create a new SSP, but cunningly doesn’t kill the job when an SSP gets deleted.

Needless to say, killing that job and my event log is now just full of errors, as opposed to the bloody annoying failure audits.

Sharepoint Workflow help: failed on start and more

At work, I’ve (reluctantly) been forced to get to grips with Sharepoint. I’ve done a couple of MCTS things, got some books, read some stuff, and even installed it. I’m still none the wiser.

Well, maybe a little, for instance I’ve been using the BDC for hooking up one of our CRM systems. One of the major selling points of SP is the workflow stuff, and designing very basic sequential workflows in Sharepoint Designer 2007 is really straightforward using the workflow designer wizard. But if you need to do anything more complicated than send an email (not strictly true, but you are quite limited, for instance, you can’t do any string manipulation other than building “dynamic strings”, ugh.), you’ll need to get involved with Visual Studio. And I have to say, as someone coming from a Visual Studio software background, creating workflows in it is a minefield. Certain expectations you may have with Winforms just go completely out the window.

Anyway, this isn’t supposed to be a discussion of it, rather, a few hints and tips that I’ve picked up whilst trying to get things working. Note that I’m using Visual Studio 2008 on an all in one MOSS2007 box (i.e., my development machine) to write these workflows. VS2008 does all of the debugging and deploying for you – I’ve read that if you’re developing on VS2005 then the process is a little different, as you have to manually develop the XML files that make up the package.

1. The workflow engine might not run at all if the web application pool is running as an administrative account. You can change the application pool to a network service in central administration.
2. Workflow failed to start (retrying) – this is a horrible error message. First thing to check is that the correlationtoken is set properly – in theory it should be as VS wouldn’t let you start debugging if it wasn’t. For anyone trying to get their head around what a correlationtoken is, don’t fret too much – it’s just a unique “key” that identifies the workflow. For your WorkflowActivated activity, you could set the token as “WorkflowActivatedToken” and then set the OwnerActivityName to the root class of your workflow. You can use the same correlationtoken for all activities in your workflow EXCEPT to say that logical units of the workflow (e.g., things surrounding the creation/use of tasks etc.) should get a separate token.
2b. If you change the name of your class i.e., from Workflow1 to MyAwesomeWorkflow, Visual Studio unhelpfully does NOT update the workflow.xml file – you should do this manually
2c. Sharepoint does a bollockload of logging, which, if you can trawl through them, might give you some info on the problem. The logs are by default in : %Program Files%\Common Files\Microsoft Shared\web server extensions\12\LOGS
3. In the properties of each your activities/methods, you don’t need to fill in all of the details. In fact, most of them will be empty, e.g., a method doesn’t necessarily need a MethodInvoking method if you don’t need to do anything more complex with it. In fact, you’ll find that if you ask VS to create your eventhandlers, you’ll end up with so much extra gibberish that you just don’t need.
4.

I’ll add more as I come across them, but for now here is a useful link for basic workflowing in Sharepoint / MOSS 2007 and Visual Studio 2008 which has a lovely video you can watch.

Sharepoint BDC tips, hints and errors

A couple of tips/hints I’ve stumbled over whilst working with the Business Data Catalog Definition Editor to create line of business (LOB) application definition files for use in Sharepoint MOSS 2007.

1. By default, BDC DE doesn’t create a specificfinder method. You’ll need one for use in Sharepoint.
2. When creating a finder method (for use with e.g., a Wildcard search) make sure the wildcard character is defined – which is done in the very topmost node of the tree (i.e, the LOB node.) Why it’s there, I have no idea but without it you might find the query runs, you just get no results.
3. You can create multiple filters on a single finder method, just make sure you specify default values and update your e.g., SQL select statement so instead of e.g., where name like @name you change it to where name like @name and date_create > @date_create_gt… etc.
4. If you get this error “The provided stream is invalid (not of type IDataReader, IEnumerable or IEnumerator). Parameter name: rawAdapterEntityInstanceStream” first thing to check is that your return parameter is the last one specified.. i.e., you can have multiple in parameters, but the return one has to be last in the list. (Ridiculous I know, this is XML for chrissakes, but hey ho, it’s Microsoft…). The way to fix this is export your ADF to an XML file, then manually adjust the order of the parameters, then reimport to BDC DE
5. If you make manual changes to your ADF file and want to reimport to BDC DE, you have to delete the original definition from BDC DE first.

I might add to this as I find more. For reference, there’s a really good series of articles on basic BDC stuff, right about here.

Come on Stifler!

OK, so he might have put out our boy Andy Murray, but I’m still rooting for Andy Roddick over Federer in this year’s Wimbledon final. It’s not because I care particularly, but because he looks a lot like Stifler. And Federer is just a good looking amazing sportsman with a beautiful girlfriend and lots of money. (I’m guessing.)

So c’mon Stifler!

Andy Roddick Steve Stifler
Andy Roddick Steve Stifler

30 in 30 for Les Bourgs Hospice

So that’s that. Completed the 30 in 30, raising money for Les Bourgs Hospice. Well done to everyone who took part, including the 4 people who completed 3 100 mile rides in 3 days, and the one crazy foo’ who rode his bike continuously for 30 hours. Nutcase. Personally I managed 613.6 miles – so roughly 20 miles per day. I’m happy with that!

Combined, we’ve raised over £35,000 for Les Bourgs Hospice.

There’s still time to sponsor me if you want, clicken sie hier.

Image004