StrataFrame Forum

Error access data via ES

http://forum.strataframe.net/Topic8813.aspx

By Greg McGuffey - 5/15/2007

I getting a very reproducible (on my side anyway) error side when attempting to access some data via ES. Other data is accessed fine. Here is the error reported to the client:



BusinessLayerException

An error occurred while refreshing the data from field 'ProjectOrganizationBO.Owner' to property 'Text' on control 'txtOwner.'

BusinessLayerException

An error occurred while refreshing property 'Text' to control 'txtOwner'

TargetInvocationException

Exception has been thrown by the target of an invocation.

CryptographicException

Bad Data.





Source : MicroFour StrataFrame Business



Stack Trace:

at System.Security.Cryptography.CryptographicException.ThrowCryptogaphicException(Int32 hr)

at System.Security.Cryptography.Utils._DecryptData(SafeKeyHandle hKey, Byte[] data, Int32 ib, Int32 cb, Byte[]& outputBuffer, Int32 outputOffset, PaddingMode PaddingMode, Boolean fDone)

at System.Security.Cryptography.CryptoAPITransform.TransformFinalBlock(Byte[] inputBuffer, Int32 inputOffset, Int32 inputCount)

at System.Security.Cryptography.CryptoStream.Read(Byte[] buffer, Int32 offset, Int32 count)

at System.IO.Compression.DeflateStream.Read(Byte[] array, Int32 offset, Int32 count)

at System.IO.Stream.ReadByte()

at System.IO.BinaryReader.FillBuffer(Int32 numBytes)

at System.IO.BinaryReader.ReadBoolean()

at MicroFour.StrataFrame.Data.Enterprise.BaseResults.ReadDataFromStream(BinaryReader Reader)

at MicroFour.StrataFrame.Data.Enterprise.ExecuteScalarResults.ReadDataFromStream(BinaryReader Reader)

at MicroFour.StrataFrame.Data.Enterprise.ExecuteScalarResults.CreateFromStream(BinaryReader Reader)

at MicroFour.StrataFrame.Data.Enterprise.EnterpriseDataSourceItem.?(BaseParams A_0, RemoteDataSourceCommand A_1)

at MicroFour.StrataFrame.Data.Enterprise.EnterpriseDataSourceItem.?(DbCommand A_0, Boolean A_1, String A_2)

at MicroFour.StrataFrame.Data.Enterprise.EnterpriseDataSourceItem.ExecuteScalar(DbCommand Command)

at MicroFour.StrataFrame.Business.BusinessLayer.ExecuteScalar(DbCommand CommandToExecute)

at FOXSystems.RAMS.BusinessObjects.Project.ProjectOrganizationBO.get_Owner() in E:\FoxSystems\RAMS\RAMS.NET\BusinessObjects\Project\ProjectOrganizationBO.vb:line 387

at System.RuntimeMethodHandle._InvokeMethodFast(Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner)

at System.RuntimeMethodHandle.InvokeMethodFast(Object target, Object[] arguments, Signature sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner)

at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks)

at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)

at System.Reflection.RuntimePropertyInfo.GetValue(Object obj, BindingFlags invokeAttr, Binder binder, Object[] index, CultureInfo culture)

at System.Reflection.RuntimePropertyInfo.GetValue(Object obj, Object[] index)

at MicroFour.StrataFrame.Business.ReflectionPropertyDescriptor.GetValue(Object component)

at System.Windows.Forms.BindToObject.GetValue()

at System.Windows.Forms.Binding.PushData(Boolean force)

at System.Windows.Forms.Binding.ReadValue()

at MicroFour.StrataFrame.Business.BusinessLayer.RefreshValue(Control ControlToRefresh, String PropertyName)

at MicroFour.StrataFrame.Business.BusinessLayer.RefreshControl(IBusinessBindable ControlToRefresh, Boolean DataPresent)

at MicroFour.StrataFrame.Business.BusinessLayer.RefreshBoundControls()

at MicroFour.StrataFrame.Business.BusinessLayer.raise_Navigated(NavigatedEventArgs e)

at MicroFour.StrataFrame.Business.BusinessLayer.OnNavigated(NavigatedEventArgs e)

at MicroFour.StrataFrame.Business.BusinessLayer.Navigate(BusinessNavigationDirection Direction, Int32 AbsoluteIndex, Object[] PrimaryKeyValues, Boolean AttemptToCheckRules, Boolean IsRefill)

at MicroFour.StrataFrame.Business.BusinessLayer.NavigateToPrimaryKey(Object[] PrimaryKeyValues)

at FOXSystems.RAMS.MitaAnalysis.OrgTools.SynchBoToTree(TreeView anyTree, BusinessLayer anyBO) in E:\FoxSystems\RAMS\RAMS.NET\MitaAnalysis\OrgTools.vb:line 421

at FOXSystems.RAMS.MitaAnalysis.MITAWizardPages.OrgDefinePage.tvwOrg_AfterSelect(Object sender, TreeViewEventArgs e) in E:\FoxSystems\RAMS\RAMS.NET\MitaAnalysis\MITAWizardPages\OrgDefinePage.vb:line 303

at System.Windows.Forms.TreeView.OnAfterSelect(TreeViewEventArgs e)

at System.Windows.Forms.TreeView.TvnSelected(NMTREEVIEW* nmtv)

at System.Windows.Forms.TreeView.WmNotify(Message& m)

at System.Windows.Forms.TreeView.WndProc(Message& m)

at System.Windows.Forms.Control.ControlNativewindow.OnMessage(Message& m)

at System.Windows.Forms.Control.ControlNativewindow.WndProc(Message& m)

at System.Windows.Forms.Nativewindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)





Here is the error reported via ES:



ArgumentNullException

Object Graph cannot be null.

Parameter name: graph



Source : mscorlib



Stack Trace:

at System.Runtime.Serialization.Formatters.Binary.ObjectWriter.Serialize(Object graph, Header[] inHeaders, __BinaryWriter serWriter, Boolean fCheck)

at System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Serialize(Stream serializationStream, Object graph, Header[] headers, Boolean fCheck)

at System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Serialize(Stream serializationStream, Object graph)

at MicroFour.StrataFrame.Data.Enterprise.ExecuteScalarResults.WriteDataToStream(BinaryWriter Writer)

at MicroFour.StrataFrame.Enterprise.Server.RemoteDataSource.ProcessRequest(HttpContext context)




Some info about what is going on:



- This error does not happen if I connect directly.

- If I step through the code, the error occurs on the line that fills the data table of the BO.

- The Owner property is actually a custom property that is doing a separate ExecuteScalar command to get that value.

- txtOwner is bound to the Owner property.



Any ideas why this isn't working with ES?
By Greg McGuffey - 5/15/2007

One more thing...the ExecuteScalar could and is likely returning Nothing, as there is often no row found. On the client I'm checking for Nothing and DbNull.Value.
By StrataFrame Team - 5/15/2007

Yep, this was the bug that we mentioned in class... It's not that we're testing on DBNull.Value, it's that we're not testing at all and just trying to serialize the returned value, which is nothing...

Here are the DLLs that you need to fix it.  Copy them to the bin\ folder of your enterprise server and either restart IIS, recycle the application pool, or stop and start the website.

By Greg McGuffey - 5/15/2007

Thanks Ben! I missed that this was a current ES bug.



I copied the dlls to the server, restarted IIS. Now I'm getting bad data error. (CrypographicException).

I checked the keys and they match. Did the public tokens change on the dlls? Did I not get IIS reset enough?
By Greg McGuffey - 5/15/2007

As a test, I turned off encryption and now I get EndOfStreamException.
By StrataFrame Team - 5/16/2007

OK, here are all of the DLLs that are part of the server, just in case another one of them changed.

[Edit: removed attachment]

By StrataFrame Team - 5/16/2007

OK, well Greg, it wasn't a problem with the ES, it was a problem with the operator... I never created the proper project configuration for the Dotfuscator project, so if I built it in debug and then built the solution, it would create the proper DLLs for you.  So, I've been sending you the same version over and over again...

So, here are the fixed DLLs Smile  Give them a shot and let me know how it works...

By Greg McGuffey - 5/16/2007

I don't think my existing license file will work with this...reference problem. How do I get a new license file for 1.6.0 ES?
By StrataFrame Team - 5/16/2007

Your license file will still work.  If you're still having problems activating that MAC address, send it to me so I can debug it.
By Greg McGuffey - 5/16/2007

This is the error being returned when attempting to look at the status page:



Could not load file or assembly 'MicroFour License Base, Version=1.6.0.0, Culture=neutral, PublicKeyToken=7bb29517c3189d04' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)




The ServerCheck.aspx page returns "OK.".
By Greg McGuffey - 5/16/2007

And it doesn't work...get a 500 error (internal error)
By StrataFrame Team - 5/16/2007

Well, by golly, that's a new one.  Give me a bit...
By StrataFrame Team - 5/16/2007

OK, what I have found so far is that the DLL version referenced does not exactly match the binary for the DLL that was found... does the machine have MicroFour License Base.dll in the GAC?  It might need to be removed, or the one that is in that ZIP file might need to be put into the GAC.
By Greg McGuffey - 5/16/2007

No Microfour dlls in the GAC. (c:\windows\assembly right?)
By Trent L. Taylor - 5/17/2007

Greg,

We do not store any of the MicroFour assemblies in the GAC when installing the ES.  It actually reduces the complexity of the ES and installation process and ultimately makes it easier to migrate a single ES server forward while leaving another in tact in the future.  You will find the MicroFour DLLs in the Bin folder of the ES install.

By Greg McGuffey - 5/17/2007

Got it. That is good. I was checking because Ben is trying to run down a problem I'm having and (I think) he wanted to make sure I didn't have some other version hanging around in GAC. Any progress on that Ben? Anything I need to do/test?
By Greg McGuffey - 5/21/2007

Status on this? I'd really like to get this resolved in the next day or so.
By Trent L. Taylor - 5/21/2007

I was pretty sure that Ben had already given you a resolution on another thread and had posted the assemblies for you.  So I am not sure of anything outstanding here.
By Greg McGuffey - 5/21/2007

Trent L. Taylor (05/21/2007)
I was pretty sure that Ben had already given you a resolution on another thread and had posted the assemblies for you. So I am not sure of anything outstanding here.




That would explain the lack of a response! Wink



OK, I'll recap (all in this thread, if more details needed)....



- I was getting the Null argument error

- Ben posted dll with the fix

- I then got another error, ben apparently didn't do build right with obfuscation

- Ben posted full ES folder

- I then got this error:

[quote/Could not load file or assembly 'MicroFour License Base, Version=1.6.0.0, Culture=neutral, PublicKeyToken=7bb29517c3189d04' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)[/quote]

- Ben had some idea about what problem was, but....

- I think I got confused here, thinking Ben wanted me to check GAC, but I think he actually was suggesting putting the license base in GAC???



Anyway that as far as we got, and I'm still stuck with the quoted error above. I got side tracked on something else but I'm back on this now. So, what do I try next?



Thanks!
By Trent L. Taylor - 5/21/2007

If you download the es.zip from earlier in this thread (http://forum.strataframe.net/FindPost8830.aspx) and you do not have anything in your GAC relating to the ES, then you should be good to go.  There isn't anything left on our side that needs to be done.  We have been testing this version and running it for quite some time now and it is working fine.
By Greg McGuffey - 5/22/2007

I'm getting a reference error in License Base. I don't know how I can fix that problem.



Here's what I did:



- d/l the es.zip (the second one) that Ben posted, with all the ES files in it

- Stopped the site with ES

- Deleted all the files in my ES folder, except my License file in the bin folder, my datasources and web config files.

- Copied all the files from ES.zip into my folder, except the datasource and web config files

- Started the site

- Restarted IIS



I have no other ES or SF files on this machine.



Here is the stack trace, found at the bottom of the error page returned when attempting to hit the Status.aspx page:



[FileLoadException]: Could not load file or assembly 'MicroFour License Base, Version=1.6.0.0, Culture=neutral, PublicKeyToken=7bb29517c3189d04' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)

at MicroFour.StrataFrame.Enterprise.Server.Status.Status_PreInit(Object sender, EventArgs e)

at System.Web.UI.Page.OnPreInit(EventArgs e)

at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)

[HttpUnhandledException]: Exception of type 'System.Web.HttpUnhandledException' was thrown.

at System.Web.UI.Page.HandleError(Exception e)

at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)

at System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)

at System.Web.UI.Page.ProcessRequest()

at System.Web.UI.Page.ProcessRequestWithNoAssert(HttpContext context)

at System.Web.UI.Page.ProcessRequest(HttpContext context)

at ASP.status_aspx.ProcessRequest(HttpContext context)

at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()

at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)




I'm at a loss of what I could have done wrong to get this error. ES was working on this machine prior to upgrading to the version that fixed the null argument problem.
By StrataFrame Team - 5/23/2007

OK, the version that I sent you is the same version that we are using on our test servers.  Do you have the MicroFour License Base.dll in the GAC?  If it's in the GAC, the ES will be pulling it from there and ignoring the one that is in the bin\ folder... and if it wasn't updated to that version, will cause the ES to fail.
By Greg McGuffey - 5/23/2007

No microfour files anywhere but in the installation folder (and the zip file).
By Greg McGuffey - 5/23/2007

Spoke too soon...Nothing in the GAC, but all the mircofour dlls where in the C:\Windows\Microsoft.NET\Framework\2.0.50727\Temporary ASP.Net Files\root\.... (6 more folders deep) folder. I deleted them, restarted IIS. Same error.
By Larry Caylor - 5/24/2007

I'm having a problem that is likely related to the issue that started this thread. I use ExecuteScalar in a couple of places to populate custom properties in a BO. It works fine when connected directly to the DB but fails to return values when connected via ES. While it's annoying to my users it's not a critical error and given the issues that Greg is having I'm reluctant to update ES and risk brining down my entire application. I'm waiting to hear how this all turns outUnsure

-Larry

By StrataFrame Team - 5/24/2007

Yes, once we get this resolved, there is a fix for the error you are experiencing, Larry.  We just have to figure out what is causing Greg so much grief.
By Greg McGuffey - 5/24/2007

Anything more I can do to help figure out the problem...experiments to try, incantations to say???!? Alien
By StrataFrame Team - 5/25/2007

I sent you an email to your dev@ email address yesterday... did you get it?  I'd like to setup a screen sharing session with you if possible.
By Greg McGuffey - 5/25/2007

Nope, didn't get it. That email is feeling a bit sick. Sent you a pm with alternate email and phone. Thanks!
By StrataFrame Team - 5/25/2007

OK, here's the ES site with the refreshed manifest for the MicroFour License Base.dll.
By Greg McGuffey - 5/25/2007

Thanks for help Ben! It is working now.