Thursday, September 24, 2009

FF 3.5.3 crashed again

My Firefox 3.5.3 crashed again for the third time today:

Add-ons: {2B8EFF80-1240-11DB-BF6C-934CD2EFDFE8}:20080728.334,{CF40ACC5-E1BB-4aff-AC72-04C2F616BCA7}:1.5.2.35,toolbar@alexa.com:1.3.0,{2fa4ed95-0317-4c6a-a74c-5f3e3912c1f9}:2.1.062,firebug@software.joehewitt.com:1.4.2,{d37dc5d0-431d-44e5-8c91-49419370caa1}:2.5.35,{e4a8a97b-f2ed-450b-b12d-ee082ba24781}:0.8.20090123.1,{CAFEEFAC-0016-0000-0007-ABCDEFFEDCBA}:6.0.07,{CAFEEFAC-0016-0000-0011-ABCDEFFEDCBA}:6.0.11,{CAFEEFAC-0016-0000-0015-ABCDEFFEDCBA}:6.0.15,LogMeInClient@logmein.com:1.0.0.460,{B7082FAA-CB62-4872-9106-E42DD88EDE45}:3.0,{20a82645-c095-46ed-80e3-08825760534b}:1.1,pencil@evolus.vn:1.0.6,refractor@developer.mozilla.org:1.0b2,twitternotifier@naan.net:1.8.3,web@veoh.com:1.4,{972ce4c6-7e08-4474-a285-3208198ce6fd}:3.5.3
BuildID: 20090824101458
CrashTime: 1253813633
InstallTime: 1252611358
ProductName: Firefox
SecondsSinceLastCrash: 70976
StartupTime: 1253811215
Theme: classic/1.0
Throttleable: 1
URL: about:blank
Vendor: Mozilla
Version: 3.5.3

This happened while I was doing Google searches…probably one of the add-ons’ fault (probably the Alexa toolbar). 

Update 17:40 EDT: It’s not the Alexa toolbar. Next guess: McAfee SiteAdvisor 3.0

One of the design goals that one should aim to achieve, when building any plug-in architecture, is isolation, to the extent that  a crash in one of the  plug-ins should not bring down the entire application.

Somehow, that is very hard to do, isn’t it?

Guilty as charged.

[+/-] Read More...

Tuesday, September 01, 2009

COMException : Creating an instance of the COM component with CLSID {…}

I recently changed my NAnt build script, as part of its post-build cleanup step,  to unregister all .NET COM interop components after doing the build. Now my unit tests fails with this error:

System.Runtime.InteropServices.COMException : Creating an instance of the COM component with CLSID {596C3AA2-D5EC-4F86-85E3-7FAF86EC17A3} from the IClassFactory failed due to the following error: 800a005b.

What’s the cause?

Here are the facts: My .NET lib X depends on a  COM lib Y (596C3AA2-D5EC-4F86-85E3-7FAF86EC17A3), which depends on COM lib Z, which in turn invokes  .NET COM interop lib N.

It turns out that the real culprit was N, which wasn’t registered for some reason, even though I’ve told it to register via the regasm NAnt task.

Well, as it turned out, I needed to add the codebase=”true” attribute to the regasm task that registers N, which makes sense in hindsight, because my DLLs are not all in the same directory. Another “doh!” I suppose.

[+/-] Read More...

Monday, August 24, 2009

AccessViolationException in OpenFileDialog.ShowDialog()

Note to self:  Next time I get this error, when running in a 64-bit OS, make sure to specify x86 for Platform target in the Build options.

[+/-] Read More...

Saturday, August 01, 2009

PageRequestManagerParserErrorException

Good tips from Eilon Lipton on this error:

Microsoft Internet Explorer
---------------------------
Sys.WebForms.PageRequestManagerParserErrorException: The message received from the server could not be parsed. Common causes for this error are when the response is modified by calls to Response.Write(), response filters, HttpModules, or server trace is enabled.

I suppose I fell into trap #5 listed on the article.  I was looking to do parameter passing from the current page to the redirected page. Basically, I had a general “catch all” event handler that catches unhandled exception, and forwards the detail to an error display page.  There doesn’t seem to be any direct way of passing parameters from one  .aspx page to another. So I stuffed this parameter into the HttpContext object.  The problem is: Reponse.Redirect() wipes out all parameters stored in the context. This problem doesn’t happen if I use Server.Transfer().

All of this was happening inside an UpdatePanel,  just as Eilon explained.  Hence, the PageRequestManagerParserErrorException. I looked in my ErrorStack, saw what the originating error was, fixed it, and the PageRequestManagerParserErrorException was gone.

I guess the next step would be to figure out how to display the error properly when invoked from an UpdatePanel, as it is working well everywhere else.

[+/-] Read More...

Monday, June 29, 2009

Wow!

I want a Mac for Christmas:


Just kidding.

[+/-] Read More...

Thursday, June 18, 2009

Flight scheduling system test case: flight number re-use

Scenario:

  • Mom books a flight from airline X, gets assigned flight number 123, arriving at airport YYZ @ 5:45am
  • Mom tells son: “my flight #123 arrives tomorrow @ 5:45am”
  • “Tomorrow” comes. Son goes online and checks flight info, which states that flight 123 is on-time.
  • 6:15am: son arrives at YYZ to pick up mom.
  • Son checks the Arrivals Fight Info board, which says flight 123 has landed. Son waits at the Arrivals Area.
  • Three hours later. Mom was “no show”. Son calls mom, who says “oh, did I say ‘today’? I meant ‘tomorrow’. Tomorrow @ 5:45am.”

Why someone would design a flight number assignment algorithm such that any X flight departing XXX for YYZ at time hh:mm, on any day of the week, would get assigned the exact same flight number, is beyond me. Are flight numbers so scarce that they have to reuse the same numbers every day?

[+/-] Read More...

Friday, June 12, 2009

LINQ to Entities does not recognize the method 'Boolean Like(System.String, System.String)' method

I’ve been dabbling with the ADO.NET Entity Framework in .NET 3.5, was trying to convert this SQL WHERE clause, which uses the LIKE operator, into LINQ syntax:

String strWhereClause = String.Format(CultureInfo.CurrentCulture, "Type={0} AND Name LIKE '*{0}*'", orgType, orgName);

I read somewhere which suggested to use the SqlMethods helper class. So I tried:

var objQuery = repository.Organization.Where(vendor => vendor.Type == orgType && SqlMethods.Like(vendor.Name, "”%” + orgName + “%”));

The query is targeting an Organization table. repository is an instance of an ObjectContext subclass which has been  auto generated by Visual Studio’s ADO.NET Entity Data Model wizard.  orgType and orgName are passed-in parameters.

The above approach resulted in the following runtime error (notice the redundant occurrence of the word ‘method’ in the error message):

LINQ to Entities does not recognize the method 'Boolean Like(System.String, System.String)' method, and this method cannot be translated into a store expression

I then saw a post on stackoverflow which suggested to use Contains(), StartsWith(), or EndsWith() to mimick the LIKE operator. So I tried:

var objQuery = repository.Organization.Where(vendor => vendor.Type == orgType && vendor.Name.Contains(orgName));

This works, but if orgName.Length is zero, then the query returns zero rows.  So finally, a slight mod to the above query achieved the desired effect:

var objQuery = repository.Organization.Where(vendor => vendor.Type == orgType && (orgName.Length == 0 || vendor.Name.Contains(orgName)));

[+/-] Read More...

“The underlying provider failed on Open.”

I’m deploying my ASP.NET app to a brand new server with a fresh install of SQL Server 2008 Express. The db connection step failed with this error:

Message: The underlying provider failed on Open.
StackTrace:  at System.Data.EntityClient.EntityConnection.OpenStoreConnectionIf(Boolean openCondition, DbConnection storeConnectionToOpen, DbConnection originalConnection, String exceptionCode, String attemptedOperation, Boolean& closeStoreConnectionOnFailure) at System.Data.EntityClient.EntityConnection.Open() at System.Data.Objects.ObjectContext.EnsureConnection() at System.Data.Objects.ObjectQuery`1.GetResults(Nullable`1 forMergeOption)

I checked the connectionString, which uses Windows authentication, and it looked fine.

Somebody suggested to Allow Remote Clients in the Network DTC Access settings. That option is already enabled on my environment.

I looked at the Event Viewer, and noticed this entry:

Event Type:    Failure Audit
Event Source:    MSSQL$MSSQL
Event Category:    Logon
Event ID:    18456
User:        NT AUTHORITY\NETWORK SERVICE
Description:
Login failed for user 'NT AUTHORITY\NETWORK SERVICE'. Reason: Failed to open the explicitly specified database. [CLIENT: <local machine>]

So IIS is trying to access the database under the credential   'NT AUTHORITY\NETWORK SERVICE' .  I looked that the db settings via SQL Server Management Studio and, sure enough, that account is not listed as one of the users allowed to connect. So I added him. And the web app was able to connect successfully.

[+/-] Read More...