Random "Object reference not set" error on blank preceding rules

  • 9 August 2007
  • 7 replies
  • 1 view

Badge +2

Hi


I'm getting "Object reference not set to an instance of an object" errors randomly on 3 different preceding rules in my K2 process. The odd thing is that there are no preceding rules set up for any of the activities that throw this error and these activities have been functioning without throwing an error for over a year. 1 of the activities remains unchanged since the start of our development project but has been in successful use for over a year.


Whilst testing this process it seems that I can occassionaly progress beyond the activity that generates the error until I reach the end of the process - but frequently I encounter one of these errors on 1 of 3 activities.


Any assistance would be very helpful since we are in the closing stages of development and K2 issues are holding up our ability to get the project into our UAT test environment.


Many Thanks
Tim


7 replies

Badge +2

Blake


Thanks for the response. I've checked the config file and we don't have a debug flag in there.


If I restart K2 service the errors don't go away. At the moment I'm making changes to some of the events in the workflow so I'm exporting quite regularly and can't seem to get round this problem.


 


Tim

Badge +5

Hi Tim,


Could you run the K2Server in console mode and provide us with a screen capture of the console just after the errors occurs? In case the steps to get the K2 server running console are need:



  1. Click start and then run.
  2. Type "services.msc". 
  3. Shut down the K2Server service. 
  4. Click start then run, all programs, K2.net and click K2 Server Console.
Badge +2

How can I attach an image to a post? Do I need to upload it to the web?


Please see console dump here:


http://bp2.blogger.com/_ZDroQiNPiu0/RrsjxCpF0cI/AAAAAAAAAB4/brrkJ3qtKZ8/s1600-h/K2_Console.bmp


Tim

Badge +5

I normally just upload the files using the left navigation menu clicking on files and it returns you a url that you can use to insert an image.


Are you positive there's no code behind your preceeding rule?  Just wanted to double check because I see alot of Console.Writeline() statements which means your utlizing various code behinds.


-mike

Badge +2

Mike


 Thanks for the response. Something very strange appears to be going on. When I look at the properties of an activity called "Update Log to Review" (the activity that preceds Stage 2 - PERF Reviewed by Appraiser that can be seen at the bottom of the console) I can't see any preceding rules at all under properties. However when I look at the error in K2 service manager I can see that the error code is:


 public void Main(ref PrecedingRuleContext K2) {
K2.PrecedingRule = true;
}


If I search on PrecedingRuleContext in K2 Studio I find the above method in a code file that belongs to... you've guessed it... the "Update Log to Review" activity. It's almost like the rule is set up but is invisible some how.


a boggled Tim


 


 

Badge +5

Do you have a:


public void Main(ref PrecedingRuleContext K2) {
 K2.PrecedingRule = true;
}

in the preceding rule for the Stage 2 - PERF Reviewed by Appraiser activity?  If you do can you delete it an export and re-run.


-mike

Badge +2

Mike


I didn't have a preceding rule in stage 2, but I've discovered that the problem lay elsewhere.


It looks like 3 activities in K2 had become corrupted some how. I copied the activities into a debug process then rebuilt them in the main process and re-added lines to them. Once I compiled each of them, the whole process compliled without issue and the process now runs without the bogus preceding rule "object reference not found" errors.


This really through me because the error in service manager was pointing to an activity that was actually okay.


Anyway thanks for all of your assistance


Have a good weekend.
Tim

Reply