Print Page | Close Window

NullReferenceException after installing 5.2.2

Printed From: IdeaBlade
Category: DevForce
Forum Name: DevForce 2009
Forum Discription: For .NET 3.5
URL: http://www.ideablade.com/forum/forum_posts.asp?TID=1473
Printed Date: 02-May-2025 at 9:56pm


Topic: NullReferenceException after installing 5.2.2
Posted By: sebma
Subject: NullReferenceException after installing 5.2.2
Date Posted: 16-Sep-2009 at 4:00am
Hi,
 
I upgraded from 5.1.0 to 5.2.2.
My codes are updated based on "breaking changes" documented in the release notes, and successful built.
 
My N-tier applications have been working before so I did not change any app.configs settings. Note that I have own implementations of ILoginManager and IEntityServerSaving in probeAssemblyNames. Examples below.
 
ServerConsole.exe.config:
<configuration>
  <configSections>
    <section name="ideablade.configuration" type="IdeaBlade.Core.Configuration.IdeaBladeSection, IdeaBlade.Core, Version=5.1.0.0, Culture=neutral, PublicKeyToken=287b5094865421c0" />
    <section name="EmailConfig" type="DomainModel.EmailConfig, DomainModel" />
  </configSections>
  <ideablade.configuration version="5.00" updateFromDomainModelConfig="Ask" loginManagerRequired="true">
    <probeAssemblyNames>
      <probeAssemblyName name="LoginManager" />
      <probeAssemblyName name="EntityServerHandlers" />
    </probeAssemblyNames>
    <!--    -->
    <logging logFile="DebugLog.xml" />
    <objectServer isDistributed="true" remoteBaseURL=" http://localhost - http://localhost " serverPort="9009" serviceName="EntityService" />
    <edmKeys>
...
...
 
WinFormClient.exe.config:
<configuration>
  <configSections>
    <section name="ideablade.configuration" type="IdeaBlade.Core.Configuration.IdeaBladeSection, IdeaBlade.Core, Version=5.1.0.0, Culture=neutral, PublicKeyToken=287b5094865421c0" />
    <!-- Custom config section, where type = "fully qualified typename, AssemblyName"-->
    <section name="SkillConConfig" type="DomainModel.SkillConConfig, DomainModel" />
  </configSections>
  <ideablade.configuration version="5.00" updateFromDomainModelConfig="Ask">
    <logging logFile="DebugLog.xml" />
    <objectServer isDistributed="true" remoteBaseURL=" http://localhost - http://localhost " serverPort="9009" serviceName="EntityService" />
    <edmKeys>
...
...
 
 
There was no errors querying entities. But on saving entity, I have a null reference exception somewhere but was unable to trace. Server-side DebugLog.xml shows the following:
 
2009-09-16 18:09:44 sysuser IdeaBlade.EntityModel.Server EntityServer::GetInstanceImplementing Probed for 'IdeaBlade.EntityModel.Server.IEntityServerSaving' and found: EntityServerHandlers.DefaultEntityServerSavingHandler
2009-09-16 18:09:44 sysuser IdeaBlade.EntityModel.Server EntityServerErrorHandler::CreateMessageFault Caught exception: System.NullReferenceException: Object reference not set to an instance of an object. at IdeaBlade.Core.DomainServices.AuthorizationHelperFns.GetAuthorizeFunction(MethodInfo method) at IdeaBlade.EntityModel.Server.EntityServer.<.ctor>b__4(IEntityServerSaving f) at IdeaBlade.Core.MemoFns.<>c__DisplayClass4`2.<Memoize>b__3(A arg) at IdeaBlade.EntityModel.Server.EntityServer.OnSaving(SessionBundle sessionBundle, EntityCache& savingEntityCache, Object& context) at IdeaBlade.EntityModel.Server.EntityServer.SaveChanges(SessionBundle sessionBundle, EntityCache entityCache, SaveOptions saveOptions) at SyncInvokeSaveChanges(Object , Object[] , Object[] ) at System.ServiceModel.Dispatcher.SyncMethodInvoker.Invoke(Object instance, Object[] inputs, Object[]& outputs) at System.ServiceModel.Dispatcher.DispatchOperationRuntime.InvokeBegin(MessageRpc& rpc) at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage5(MessageRpc& rpc) at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage4(MessageRpc& rpc) at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage3(MessageRpc& rpc) at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage2(MessageRpc& rpc) at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage1(MessageRpc& rpc) at System.ServiceModel.Dispatcher.MessageRpc.Process(Boolean isOperationContextSet)
 
Is there anything I need to re-set in my app.config, like the "Version=5.x.x.x"? Have I missed anything?
Thanks much!
Sebastian



Replies:
Posted By: kimj
Date Posted: 16-Sep-2009 at 9:51am
Everything looks fine in your config files.  Make sure that the OnSaving method implemented in your DefaultEntityServerSavingHandler is marked public -- we now do additional reflection to look at the attributes on this method. 
 
If the method is public, can you post your entire DefaultEntityServerSavingHandler implementation, or send it to my email address (kimj ...)?


Posted By: sebma
Date Posted: 16-Sep-2009 at 9:23pm
Like you said, I made my OnSaving method public and now it works.

Thanks Kim!



Print Page | Close Window