Object reference not set to an instance of an object - on module load

Mar 9, 2012 at 10:21 AM

Hi, using DNN CE v06.01.02, .NET 4. Installed the module and added 2 albums with no images and everything was fine. FTP the images into the album folders and resync the Filemanager but the module now errors on load with the following event being logged:

Method: WillStrohl.Modules.Lightbox.ViewLightbox.GetImageFileUrl
StackTrace
:
Message
: DotNetNuke.Services.Exceptions.ModuleLoadException: Object reference not set to an instance of an object. ---> System.NullReferenceException: Object reference not set to an instance of an object. at WillStrohl.Modules.Lightbox.ViewLightbox.GetImageFileUrl(IFileInfo Image) at WillStrohl.Modules.Lightbox.ViewLightbox.GetImageFiles(String LightboxId, String FolderName, String GalleryName) at ASP.desktopmodules_willstrohl_lightboxgallery_viewlightbox_ascx.__DataBind__control5(Object sender, EventArgs e) at System.Web.UI.Control.OnDataBinding(EventArgs e) at System.Web.UI.Control.DataBind(Boolean raiseOnDataBinding) at System.Web.UI.Control.DataBind() at System.Web.UI.Control.DataBindChildren() at System.Web.UI.Control.DataBind(Boolean raiseOnDataBinding) at System.Web.UI.Control.DataBind() at System.Web.UI.WebControls.Repeater.CreateItem(Int32 itemIndex, ListItemType itemType, Boolean dataBind, Object dataItem) at System.Web.UI.WebControls.Repeater.CreateControlHierarchy(Boolean useDataSource) at System.Web.UI.WebControls.Repeater.OnDataBinding(EventArgs e) at System.Web.UI.WebControls.Repeater.DataBind() at WillStrohl.Modules.Lightbox.ViewLightbox.BindData() at WillStrohl.Modules.Lightbox.ViewLightbox.Page_Load(Object sender, EventArgs e) --- End of inner exception stack trace ---

 

We're using extension-less URLs using URLMaster if that has any bearing on this.

Regards
Dan

Coordinator
Mar 14, 2012 at 3:10 AM

What version of the module are you using?  To be honest, I have not tested against your scenario.

Mar 14, 2012 at 10:03 AM

It was v01.10.00

Coordinator
May 4, 2012 at 6:40 AM

This should be fixed in the most recent release.  This was due to a bug in the Folder Provider implementation.

May 4, 2012 at 9:48 AM

Hye,

 

Same problem with DNN 6.1.4 and i upload images with the DNN file manager... I upgrade the module with the 1.11 and still have the problem,

 

thank you

David

May 4, 2012 at 9:52 AM

I can add this log too:

 

DotNetNuke.Services.Exceptions.ModuleLoadException: The INSERT statement conflicted with the FOREIGN KEY constraint "FK_wns_lightbox_image_LastUpdatedBy". The conflict occurred in database "webplus6", table "dbo.Users", column 'UserID'.
The statement has been terminated. ---> System.Data.SqlClient.SqlException: The INSERT statement conflicted with the FOREIGN KEY constraint "FK_wns_lightbox_image_LastUpdatedBy". The conflict occurred in database "webplus6", table "dbo.Users", column 'UserID'.
The statement has been terminated.
   at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection)
   at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj)
   at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj)
   at System.Data.SqlClient.SqlDataReader.ConsumeMetaData()
   at System.Data.SqlClient.SqlDataReader.get_MetaData()
   at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString)
   at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async)
   at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, DbAsyncResult result)
   at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method)
   at System.Data.SqlClient.SqlCommand.ExecuteScalar()
   at Microsoft.ApplicationBlocks.Data.SqlHelper.ExecuteScalar(SqlConnection connection, CommandType commandType, String commandText, SqlParameter[] commandParameters)
   at Microsoft.ApplicationBlocks.Data.SqlHelper.ExecuteScalar(String connectionString, CommandType commandType, String commandText, SqlParameter[] commandParameters)
   at Microsoft.ApplicationBlocks.Data.SqlHelper.ExecuteScalar(String connectionString, String spName, Object[] parameterValues)
   at WillStrohl.Modules.Lightbox.SqlDataProvider.AddImage(Int32 LightboxId, String FileName, String Title, String Description, Int32 DisplayOrder, Int32 LastUpdatedBy)
   at WillStrohl.Modules.Lightbox.ViewLightbox.GetImageFiles(String LightboxId, String FolderName, String GalleryName)
   at ASP.desktopmodules_willstrohl_lightboxgallery_viewlightbox_ascx.__DataBind__control5(Object sender, EventArgs e)
   at System.Web.UI.Control.OnDataBinding(EventArgs e)
   at System.Web.UI.Control.DataBind(Boolean raiseOnDataBinding)
   at System.Web.UI.Control.DataBindChildren()
   at System.Web.UI.Control.DataBind(Boolean raiseOnDataBinding)
   at System.Web.UI.WebControls.Repeater.CreateControlHierarchy(Boolean useDataSource)
   at System.Web.UI.WebControls.Repeater.OnDataBinding(EventArgs e)
   at WillStrohl.Modules.Lightbox.ViewLightbox.BindData()
   at WillStrohl.Modules.Lightbox.ViewLightbox.Page_Load(Object sender, EventArgs e)

Coordinator
May 7, 2012 at 9:05 PM

newtito:  Are you using a different database provider or perhaps an Object Qualifier?  I cannot reproduce this error.

May 8, 2012 at 7:51 AM
Edited May 8, 2012 at 8:44 AM

Sorry, at the end it was a jquery conflict....

Coordinator
May 9, 2012 at 5:54 PM

Good to know that you have it figured out. Was it a conflict with another module/skin on the page importing jQuery?

Aug 16, 2012 at 1:58 PM

I'm having the same issue, how do I go about solving the jquery conflict?

Aug 16, 2012 at 6:53 PM

I have the latest version of everything, but this still seemed to be a folder issue for me, not jQuery. Originally I had my images located in a folder about four levels deep. I tried again with images in a different folder, only 2 levels deep, and it started working again.

Aug 17, 2012 at 12:27 PM

Had same issue with a clean DNNCE v6.2.2 install.  Installed and added the module to a page then pointed to the DNN folder under the images folder (under root.)  Was greeted immediately with this error and could only delete the module from the page.  Didn't have the ability to change its settings, etc.

Aug 23, 2012 at 6:42 PM

Downloaded and installed 1.1.10 (prior version) and was able to run the module without any problems.

Coordinator
Sep 28, 2012 at 2:39 AM

spook_man & ecwebmaster:  What was the folder path that was giving you problems?

Sep 28, 2012 at 12:09 PM
Edited Sep 28, 2012 at 12:10 PM

Not using the module anymore and I can't remember, but I know when I changed from the longer folder path to a shorter one, everything seemed to work as intended. Only reason I'm not still using it is I couldn't configure the captions the way I wanted.

Edit: also, the original folder path may have had spaces in it too, not sure if that matters