Object reference not set error after moving to 2009 R2

Joe_MathisJoe_Mathis Member Posts: 173
edited 2011-02-15 in NAV Three Tier
Weird... :-k

Is anyone else having issues with it on a SQL 2005 instance?

Works fine on the SQL 2008 R2 instance, but when I try to connect to a database on SQL 2005 I get the list of company names then a sudden stop message.

"Microsoft Dynamics NAV has encountered a problem and needs to close.
We are sorry for the inconvenience."

I send the error report which has ...

EventType : dynamicsnavserviceexception P1 : microsoft.dynamics.nav.client
P2 : 6.0.32012.0 P3 : 4d030e65
P4 : microsoft.dynamics.nav.client.builder.dll P5 : 6.0.32012.0
P6 : 4d030e62 P7 : dc P8 : 4c P9 : system.nullreferenceexception

Client and service are both NAV 2009 R2. Have to change the ClientUserSetting.config file after this in order to even see the RTC selection screen again. If I don't change it I get the same error.

I guess I can move the databases as this is just dev database for me, but didn't read anything about compatibility with 2005 going away.

EDIT: Found this on the download page: An overview of system requirements for Microsoft Dynamics NAV 2009 R2. Note that the system requirements have not changed since Microsoft Dynamics NAV 2009 SP1.

Put the database on the SQL 2008 box and it still has the error.
Reading the dumpfile says:
Type: System.NullReferenceException
Message: Object reference not set to an instance of an object.

Answers

  • Joe_MathisJoe_Mathis Member Posts: 173
    Had to change the title of the post because I am able to get another database on the SQL 2005 running.

    It's 3 databases that were running SP1 that were executable convereted to R2 that will not start.

    Recompiled all of the objects in 1 and just the pages in the other 2 and all three give the same message with the same dump file.

    Will post whatever answers I find of course, but any suggestions are welcome.

    EDIT:

    It was a trigger in CU#1 the CompanyOpen had code to open a form. (Variation of the database info screen ala Waldo) SP1 didn't seem to care about it, but R2 doesn't like it, added a check for service tier (ISSERVICETIER) and now it works properly.
  • Jens_M-PJens_M-P Member, Microsoft Employee Posts: 39
    I would be interested in seeing your 'before' and 'after' code. I do think the new behavior is by design, but I would like to make sure.
    Best regards,
    Jens Møller-Pedersen [MSFT]

    This posting is provided 'AS IS' with no warranties, and confers no rights.
  • Joe_MathisJoe_Mathis Member Posts: 173
    No Problem...

    It is in Codeunit 1, the CompanyOpen trigger. The form is just a simple form with the database and company name, the license name, and then some colors that are controlled by settings on the Database Info Setup table (for me it's table 99991) which is a table out of the customers licensed range.

    Before:
    CompanyOpen()
    IF GUIALLOWED THEN 
      LogInStart;
    
    IF GUIALLOWED THEN 
      IF recDatabaseInfoSetup.WRITEPERMISSION THEN BEGIN
        CLEAR(recDatabaseInfoSetup);
        IF recDatabaseInfoSetup.GET THEN
          IF recDatabaseInfoSetup."Show Database Info Form" THEN
            FORM.RUN(FORM::"Database Info");
      END;
    
    After:
    CompanyOpen()
    IF GUIALLOWED THEN 
      LogInStart;
    
    IF GUIALLOWED AND NOT ISSERVICETIER THEN 
      IF recDatabaseInfoSetup.WRITEPERMISSION THEN BEGIN
        CLEAR(recDatabaseInfoSetup);
        IF recDatabaseInfoSetup.GET THEN
          IF recDatabaseInfoSetup."Show Database Info Form" THEN
            FORM.RUN(FORM::"Database Info");
      END;
    
    

    I may have to remove it all together, and add something into the role center instead. A co-worker had some issue when the RTC brought up a CC to run a report that it tried to open the page, but then gave an error. The report still ran and we changed it to an RTC report shortly after, but if we have to have a CC report, then we can't have this error message showing up for the customer... actually it will probably only affect our company because the table should be out of the range and the code won't try to run the page/form.

    Either way, I will probably figure out something different.
  • tarkmylertarkmyler Member Posts: 57
    This thread saved me a lot of time and hair. When moving our ISV application to RTC we had a "splash" screen that had a branch for "GUIALLOWED", but needed the ISSERVICETIER test to not make the RTC fall on its face with the cryptic message. Same thing - CU1 was the culprit. Thank you, thank you, thank you, thank you.... \:D/
    Mark Tyler
    Pacific City, OR
  • Joe_MathisJoe_Mathis Member Posts: 173
    I can't remember how many times the board saved me...

    That's why I post the solutions too.

    You are very welcome.
Sign In or Register to comment.