Object reference not set to an instance of an object

Object reference not set to an instance of an object

Post by Trevor Gra » Thu, 11 Sep 2003 15:58:35


Hi

Could be due to Searches.GetByGuid returning objects of
type HierarchyItem.

It can't implcitly convert it to a Posting. Have you tried
this:
posting = CType(context.Searches.GetByGuid(guid), Posting)

Trevor

passing
posting.Name
 
 
 

Object reference not set to an instance of an object

Post by Stefan [MS » Thu, 11 Sep 2003 17:22:02

Also ensure that the posting you are looking for is Published.
The CmsApplicationContext is only authenticated for Published mode in the
code below.

Regards,
Stefan.

 
 
 

Object reference not set to an instance of an object

Post by Stefan [MS » Thu, 22 Jul 2004 22:48:56

Hi Bob,

this can happen if

1) the node cache is to small to hold all items or
2) this item has never been requested before and is requested from the
database while it is updated by an import job

Not the whole database is locked only the items which get updated while they
are updated.
If the node cache is big enough and not flushed short before you run the
import the chance to hit an item that never has been hit before exactly in
the small timeframe while it is updated in the database is very very low.
But it exists.

Your mail seem to indicate that it happens very often in your situation - so
either your node cache is not big enough to hold all items or you cleaned
your node cache short before running the import (e.g. restart of the
application pool).

See here for an article on this:
http://www.yqcomputer.com/ +2002+-+(complete)+FAQ.htm#8F855853-100E-400F-A914-AC3A42C2EAD6

Cheers,
Stefan.

--
This posting is provided "AS IS" with no warranties, and confers no rights.

MCMS FAQ:
http://www.yqcomputer.com/ +2002+-+(complete)+FAQ.htm
MCMS Blog: http://www.yqcomputer.com/
MCMS Sample Code:
http://www.yqcomputer.com/ +Management+Server
MCMS Whitepapers and other docs:
http://www.yqcomputer.com/
--------------------------------




30 minutes I have a custom .exe that export all the new postings from the
first environment to the second environment.
received this error:
channel.postings and a search operation....
custom .exe), cms 2002 locks the database and the user can access only the
cache...is it possible that the reason of my error is that I navigate during
an export/import operation ???
 
 
 

Object reference not set to an instance of an object

Post by TmFuZG » Tue, 17 May 2005 23:06:05

Hi,

I have a problem getting my channels from the Root Channel Gallery. Till
last weekend before I did the DCA to another database, it was working fine.
Now, when I changed back and executed the following code, I am getting the
above error.

CmsHttpContext cmsContext = CmsHttpContext.Current;
Channel startChannel = (Channel)
cmsContext.Searches.GetByPath(startChannelPath);
ChannelCollection channels = startChannel.Channels;

Can someone please help me what may have gone wrong?

Thanks,
Nanda
 
 
 

Object reference not set to an instance of an object

Post by Stefan [MS » Wed, 18 May 2005 01:10:37

Hi Nanda,

in which line do you get this error?
I assume in the last one.
Then the GetByPath does not return an object.

If this is the case then either the current user does not have rights to
this channel or the path passed to this method is invalid.

Cheers,
Stefan

--
This posting is provided "AS IS" with no warranties, and confers no rights

New to MCMS?
Check out this book: Building Websites Using MCMS: http://www.yqcomputer.com/
----------------------
 
 
 

Object reference not set to an instance of an object

Post by TmFuZG » Wed, 18 May 2005 14:38:01

Hi Stefan,

Thanks for the reply. Yes, the error was coming in the last line.

I have tried checking the Logged in User for the HTTPContext. It is using
the Administrator User of MCMS. I have even tried to login to Site Manager
with same credentials and I could see all the Channels in every gallery. The
problem still persisits. Please help.

Thanks,
Nanda
 
 
 

Object reference not set to an instance of an object

Post by Stefan [MS » Wed, 18 May 2005 17:09:13

Hi Nanda,

please debug the code and verify that the correct path is passed to this
routine.

Cheers,
Stefan

--
This posting is provided "AS IS" with no warranties, and confers no rights

New to MCMS?
Check out this book: Building Websites Using MCMS: http://www.yqcomputer.com/
----------------------
 
 
 

Object reference not set to an instance of an object

Post by TmFuZG » Fri, 20 May 2005 23:56:03

Hi Stefan,

I debugged the code and also the permission sets. The problem is coming when
I have enabled the guest access from NRConfig. If it is enabled, my program
has been taking default guest access and throwing error that the user is not
authenticated. When I remove guest access, it asks for the authentication
even and displays the set of postings.

Can you please tell me whats the best configuration on guest access for a
MCMS site? I have even tried to add subscriber rights. But even then I had
been prompted for Login access.

Thanks!!
 
 
 

Object reference not set to an instance of an object

Post by Stefan [MS » Sat, 21 May 2005 01:03:54

i Nanda,

If you are logged in as guest then you are acting as the configured guest
user.

Which object is " throwing error that the user is not authenticated"?
Please post the code and outline the line that is causing this.

Cheers,
Stefan

--
This posting is provided "AS IS" with no warranties, and confers no rights

New to MCMS?
Check out this book: Building Websites Using MCMS: http://tinyurl.com/6zj44
----------------------


"Nanda" < XXXX@XXXXX.COM > wrote in message
news: XXXX@XXXXX.COM ...