Wednesday, December 23, 2009

Trying to use an SPWeb object that has been closed or disposed and is no longer valid.

Dealing with sharepoint is always a pain. Especially when you get a stack trace that leads you into the terrible black box of code that is completely foreign.

I kept getting this error: "Trying to use an SPWeb object that has been closed or disposed and is no longer valid."

Stack trace: at Microsoft.SharePoint.WebPartPages.SPWebPartManager.get_Web()
at Microsoft.SharePoint.WebPartPages.SPWebPartManager.ActivateConnections()
at System.Web.UI.WebControls.WebParts.WebPartManager.OnPageLoadComplete(Object sender, EventArgs e)
at System.EventHandler.Invoke(Object sender, EventArgs e)
at System.Web.UI.Page.OnLoadComplete(EventArgs e)
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)


The scenario was a simple list with a checkbox that was causing the page to reload. For some reason, sometimes it worked, and sometimes it was throwing this error.

After reading this great post, I figured out what the issue was. The using() directive was causing the SPWeb object to be disposed before all code was executed:

http://www.theartofsharepoint.com/2007/06/trying-to-use-spweb-object-that-has.html

I commented out the shit I no longer needed, and here's an example of the result:



protected void LoadClip(yadda)
{
... do some logic ...

// using (SPWeb ThisWeb = SPContext.Current.Web)
//{
SPWeb ThisWeb = SPContext.Current.Web;
ThisTable = ThisWeb.GetSiteData(q);
//}

... and more code here with reference to ThisWeb ...

}



here's a few more links that were helpful:

http://blogs.msdn.com/rogerla/archive/2009/01/14/try-finally-using-sharepoint-dispose.aspx


http://msdn.microsoft.com/en-us/library/aa973248.aspx

Monday, November 30, 2009

css display

Typically I just design and go... but dammit sometimes you have to do things for specific browsers. Whenever I run into an issue with the "display" property and it's browser-specific, I go to this page. It tells you all the compatibility differences between browsers and this wonkey css style.

http://www.quirksmode.org/css/display.html

Thursday, November 19, 2009

android adb missing flash_image

I was updating one of our android dev phones today and found i couldn't flash a recovery ROM because i was constantly getting the error "flash_image not found"

and here's the fix! http://wiki.cyanogenmod.com/index.php/RE-recovery-img

Wednesday, November 18, 2009

android + Cisco VPN

We have a normal Cisco VPN at my work. After upgrading my device to 1.6 (Donut) I noticed there are new VPN settings you can use to connect your wireless. The four that are offered currently are PPTP, L2TP, L2TP/IPSec PSK, and L2TP/IPSec CRT

UNFORTUNATELY we use a standard IPSec over TCP or UDP, and it doesn't use the PSK or CRT file. I need to manually input the groupID and whatnot.

SO, after some googling I found get-a-robot-vpnc which seems to address my issue.

I also found this post and from all I can tell, it has successfully worked for some people.

BUT my device isn't giving me any such love. My current error reads:

D/vpnc service( 5587): Attempt to read vpnc process id did not return anything


we'll see how far I get on this problem. My guess is it's a permissions problem that will be easily solved...

blogger and andriod

so far, no love for an android app that will post to blogger.

the most i can find is http://mobile.blogger.com which seems to require SMS or MMS

Tuesday, November 17, 2009

cyanogenmod and memory

i was running into memory problems with my android dev phone.
easy enough to fix: just cleared out my Dalvik cache after upgrading to a new cyanogenmod on my ADP1

adb remount
adb shell rm -rf /data/dalvik-cache/*

http://pitupepito.homelinux.org/?p=109

Wednesday, February 25, 2009

winqual windbg

Just got the newest Debugging Tools for Windows...http://www.microsoft.com/whdc/DevTools/Debugging/default.mspx

here's the script we typically use to analyze winqual cab files:

.sympath SRV*c:\temp\symbols*http://msdl.microsoft.com/download/symbols
.exepath+ C:\Windows\Microsoft.NET\Framework\v2.0.50727;c:\temp\symbols
.loadby sos mscorwks
.reload
!analyze -v

Friday, February 20, 2009

AIR + ANT + out of memory

I kept running into an OutOfMemoryError issue during compile of my AIR app using ANT.

[mxmlc] java.lang.OutOfMemoryError

the fix was simple: set fork="true" and maxmemory="512m" in my mxmlc
<mxmlc compiler.debug="false"
file="${MAIN_SOURCE_FILE}"
output="${dist}/${APP_ROOT_FILE}"
configname="air"
fork="true"
maxmemory="512m"

...


more info can be found here: Flexcoverhints

continuous integration

I'd highly recommend any developer using source control to check into continuous integration - it's a big time saver

http://cruisecontrol.sourceforge.net/

Thursday, February 19, 2009

air application icons

I ran into the same problem many seem to have: my AIR application icons seems to be throwing a compile error when I try to export release build of my project.

Error creating AIR file: 303: ERROR, [...filename...]

This is a known bug... still open apparently ( in a few places ) when you try to export from Eclipse

http://bugs.adobe.com/jira/browse/FLEXDOCS-427
http://bugs.adobe.com/jira/browse/FB-11712

My only working solution is to place the icon files directly in the src folder rather than in images/assets/icon.png

refreshdenver.org

i'm really needing to do a bit more geek posting....
here's a shoutout to refreshdenver for a sweet event last night!

http://refreshdenver.org