Getting Exception Filling SFSUsersBO


Author
Message
Peter Denton
Peter Denton
StrataFrame Novice (97 reputation)StrataFrame Novice (97 reputation)StrataFrame Novice (97 reputation)StrataFrame Novice (97 reputation)StrataFrame Novice (97 reputation)StrataFrame Novice (97 reputation)StrataFrame Novice (97 reputation)StrataFrame Novice (97 reputation)StrataFrame Novice (97 reputation)
Group: Forum Members
Posts: 77, Visits: 787
G'day

I'm getting the following exception:

System.ArgumentNullException was unhandled by user code
  Message="Value cannot be null. Parameter name: InString"
  ParamName="InString"
  Source="mscorlib"
  StackTrace:
       at System.Convert.FromBase64String(String s)
       at MicroFour.StrataFrame.Security.Encryption.TripleDESWrapper.Decrypt(String text)
       at MicroFour.StrataFrame.Security.BusinessObjects.SFSUsersBO.EncryptedData..ctor(String DataString, String UserName, Int32 ProjectPK)
  InnerException:

This occurs on line 521 in the following Strataframe code:

C:\Program Files\MicroFour\StrataFrame Source Code\MicroFour StrataFrame Base\encryption\tripledeswrapper.vb

520        Public Function Decrypt(ByVal text As String) As String
521 >>>>       Dim input() As Byte = Convert.FromBase64String(text)
522            Dim output() As Byte = Transform(input, m_des.CreateDecryptor(m_key, m_iv))
523
524            Return m_utf8.GetString(output)
525        End Function

There are two spots in my code that cause this (as indicated):

        Dim UserName As String = "PeterD"
        Dim SFUsersBO As New MicroFour.StrataFrame.Security.BusinessObjects.SFSUsersBO

>>>>    SFUsersBO.FillByUserName(UserName)

...

>>>>    SFSUsersBO.FillAll(0)

I'm running Strataframe 1.6.6, with SQL references updated and recompiled so it can interact with SQL Server 2008.

The SFS tables (excluding the project table) are in our Application Database, on a SQL server 2008 instance.

I've populated the Users progamatically, but they show as normal users in the security dialog, and I'm able to edit them sucesfully.

If I ignore the exception, (which recurs in the first instance 3 or 4 times, and in the second instance once for each user in the table), the BO gets populated with information that looks OK to me.

Any thoughts as to what might be happening?

Peter

Trent Taylor
Trent Taylor
StrataFrame Developer (8.5K reputation)StrataFrame Developer (8.5K reputation)StrataFrame Developer (8.5K reputation)StrataFrame Developer (8.5K reputation)StrataFrame Developer (8.5K reputation)StrataFrame Developer (8.5K reputation)StrataFrame Developer (8.5K reputation)StrataFrame Developer (8.5K reputation)StrataFrame Developer (8.5K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 6.9K
Well, how the record got into this state, I am unsure.  We have this version of RBS deployed to many locations in the field so I am confident in the code and the release.  But what is happening here is that the serialized object we are expecting isn't in that field which produces the NULL error.  I have seen this happen when people manually create user records, but if created through the RBS editors, then this should never happen.  I have also seen this before when people are trying to side-step security (i.e. people that have access to the SQL tables but not the source code and are trying to short-circuit the security).
Peter Denton
Peter Denton
StrataFrame Novice (97 reputation)StrataFrame Novice (97 reputation)StrataFrame Novice (97 reputation)StrataFrame Novice (97 reputation)StrataFrame Novice (97 reputation)StrataFrame Novice (97 reputation)StrataFrame Novice (97 reputation)StrataFrame Novice (97 reputation)StrataFrame Novice (97 reputation)
Group: Forum Members
Posts: 77, Visits: 787
Thanks Trent,

Stupidity on my part.

I have a process to automatically create the Users rather than using the RBS Editor. I insert the users into the Users Table with SQL, then in VB code update password and other fields that make up the data field for each user. I've been able to use RBS editor to examine Users created that way and am able to further changes and save them.

On my most recent testing I forgot to run my VB code after the SQL insert!

Peter

Trent Taylor
Trent Taylor
StrataFrame Developer (8.5K reputation)StrataFrame Developer (8.5K reputation)StrataFrame Developer (8.5K reputation)StrataFrame Developer (8.5K reputation)StrataFrame Developer (8.5K reputation)StrataFrame Developer (8.5K reputation)StrataFrame Developer (8.5K reputation)StrataFrame Developer (8.5K reputation)StrataFrame Developer (8.5K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 6.9K
Well, I am just glad that you got it going.  Glad you found your problem. Smile
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search