<nativehr>0x80070002</nativehr> in Sharepoint 2010 - sharepoint-2010

I recently upgraded from Sharepoint 2007 to 2010. I have a windows service that inserts pdfs into sharepoint. It works great on 2007. When I migrated to 2010, I started getting the following intermittent error:
<nativehr>0x80070002</nativehr>
at Microsoft.SharePoint.Library.SPRequestInternalClass.GetMetadataForUrl(String bstrUrl, Int32 METADATAFLAGS, Guid& pgListId, Int32& plItemId, Int32& plType, Object& pvarFileOrFolder) at
Microsoft.SharePoint.Library.SPRequest.GetMetadataForUrl(String bstrUrl, Int32 METADATAFLAGS, Guid& pgListId, Int32& plItemId, Int32& plType, Object& pvarFileOrFolder) at Microsoft.SharePoint.SPWeb.GetList(String strUrl)
Here is the offending line of code:
SPList parentList = web.GetList(url);
What's weird, is that this only occasionally fails. I've actually wrapped this line of a loop, and if it it fails, I wait a bit, and then try to get the list again. Usually after a few tries, the GetList will succeed.
Since it's not easly duplicatable, I'm looking for any leads I might be able to track down.
From google searches, the "recommend" fix is to change any .GetList(...) calls to SPWeb.Lists[".."];
But, I got away from that, due to the perf hit on 2007 ( .GetList(...) has better perf than SPWeb.Lists["..."])
Any suggestions?
Thanks!
Dave

Maybe you could understand the error better if you first retrieved an SPFolder or SPFile related to the url in question. Check .GetFile(...).Exists and .GetFolder(...).Exists. You could also get the ParentList property hence.

SPWeb.GetList Method will certainly raise error if list is not there in the site. The method is designed like that. It is already documented in msdn.
If you are unsure that list is there or not; use Webobject.List[ListName] to avoid exception.
You can check my blog SharePoint Codes for sample code
I think this is late reply, but hope it helps others in future.

What resolved exact same error on SPWeb.GetList(reletiveUrl) with error thrown in method GetMetadataForUrl on SharePoint 2010:
restart IIS
restart SPTimerV4 (SharePoint 2010 Timer)
restart SPAdminV4 (SharePoint 2010 Administration)

Related

InDesign server COM error

I am using InDesign server on windows. And developing application using Microsoft .Net web platform (ASP.NET).
I am generating Indd file using ImportXML() method provided by InDesign. I am getting following error randomly (sometimes more often):
System.Runtime.InteropServices.COMException (0x0000FFFF): Exception from HRESULT: 0x0000FFFF
at System.RuntimeType.ForwardCallToInvokeMember(String memberName, BindingFlags flags, Object target, Int32[] aWrapperTypes, MessageData& msgData)
at InDesignServer.Document.ImportXML(String From)
There is no more information provided by InDesign about where it fails so am blocked there.
Can anyone help here. Thanks.
I am not familiar with ASP.NET, but in ExtendScript it is importXML (starts with low case and case-sensitive)
Also, check the file path you are passing to the importXML.
Make sure the document is created and initialised before you import xml
After a long time. But, I became active again on 'Stack'.
This was the error due to in-appropriate permission in DCOM config.
See steps below to check:
1. From the Start menu, click Run and type Dcomcnfg.exe
2. Select 'Computers'
3. Select 'My Computers'
4. DCOM Config
5. Find InDesign COM component and select properties
6. In this set appropriate security and identity.
COM exceptions are always vague, hard to answer by anyone!

Unhandle exception issue

We have a large app built using VB.NET VS2012. Every now and then when closing the app an unhandled exception occurs. Very random, sometimes it does it sometimes it doesn't.
The error is below.
System.InvalidOperationException was unhandled
HResult=-2146233079
Message=Invoke or BeginInvoke cannot be called on a control until the window handle has been created.
Source=System.Windows.Forms
StackTrace:
at System.Windows.Forms.Control.MarshaledInvoke(Control caller, Delegate method, Object[] args, Boolean synchronous)
at System.Windows.Forms.Control.BeginInvoke(Delegate method, Object[] args)
at System.Windows.Forms.WindowsFormsSynchronizationContext.Post(SendOrPostCallback d, Object state)
at System.Windows.Forms.AxHost.ConnectionPointCookie.Finalize()
InnerException:
We produce a dump file to try and find where this is originating but have had no luck. The debugger just shows No source code available. We are using some third-party controls. At this point we just want to find what is trying to create the control. If its a problem with the third party control and if we don't have that code, we can't fix it but maybe we can work around it. But we can't find what is trying to create control (when shutting down).
We have reviewed many web posts describing how to utilize the crash dump files but have had no luck identifying the control (or even the control type) that is generating this.. Just knowing the type would help narrow it down.
Any ideas how we can at least get the type of control or the originating caller or?
If enough info isn't provided please let me know and I will post what I can.
Posting code is not an option because we have no idea where the message is coming from.
Thanks in advance!
I should have added that we do use try catch blocks for just about everything. We also do have a logging procedure but we arent seeing any of these exceptions in the log file.

Null Reference exception DNN Core 5.6.3

My site has been running fine for sometime now until recently I see in the event viewer a null reference exception in the DNN core:
DotNetNuke.Common.Globals.GetStatus() in
F:\Builds\Maintenance\WorkingDirectory\Library\Common\Globals.vb:line
1125 at DotNetNuke.Common.Initialize.InitializeApp(HttpApplication
app) in
F:\Builds\Maintenance\WorkingDirectory\Library\Common\Initialize.vb:line
138 at DotNetNuke.Common.Initialize.Init(HttpApplication app) in
F:\Builds\Maintenance\WorkingDirectory\Library\Common\Initialize.vb:line
228 at DotNetNuke.Common.Global.Global_BeginRequest(Object sender,
EventArgs e) at
System.Web.HttpApplication.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
at System.Web.HttpApplication.ExecuteStep(IExecutionStep step,
Boolean& completedSynchronously)
the line 1125 is:
_Status = UpgradeStatus.None
Which is a property of the Globals class and an Enum
Also when this happens it doesnt just do it once then sort its self it does it roughly every minute for an hour or so.
I made sure all dataprovider.instances are either in a using or a try catch finally or self closing(if the reader is not used)
Any suggestion most welcome, as I'm officially lost.
Thanks
Similar to what ScottS mentioned, that line is setting a static enum value, so I don't see how a NullReferenceException could be thrown. Indeed, it could be a side-effect from something else.
That particular error is coming from Global.asax BeginRequest, which calls Initialize.Init(app). The only thing I can think of is to check your Http Modules. Both the RequestfilterModule and the UrlRewriteModule (which are default DNN http modules) also call Initialize.Init(app).
Perhaps check your web.config and IIS (particularly if you're running IIS 7) and make sure everything checks out?
had a look at the release.config and it have autoupdate=true set that to false and it hasnt been an issue since.

FileInfo..ctor(string fileName) throwing exception: bug in SL 4.0 or .NET 4.0?

The following test case passes in .NET 4.0:
var fiT = new FileInfo("myhappyfilename");
Assert.IsNotNull(fiT);
... but fails in Silverlight 4.0 with the following error:
System.ArgumentNullException: Value cannot be null.
Parameter name: format
at System.String.Format(IFormatProvider provider, String format, Object[] args)
at System.Environment.GetResourceString(String key, Object[] values)
at System.IO.FileSecurityState.EnsureState()
at System.IO.FileInfo.Init(String fileName, Boolean checkHost)
at System.IO.FileInfo..ctor(String fileName)
Either the failure is a bug in SL 4.0, or the non-failure is a bug in .NET 4.0. Anyone know which it is?
(For the record, I'm running SL 4.0 on VS 2010 RC, which may be contributing to the problem).
See the MSDN documentation for FileInfo for Siverlight 4:
When it is called by an elevated-trust
application, provides instance methods
for the creation, copying, deletion,
moving, and opening of files, and aids
in the creation of FileStream objects.
This class cannot be inherited.
Chances are your application isn't running with elevated trust. If you want to access those restricted methods, it'll need to be.
As to why it's returning a null - that may well be a bug, possibly an improperly propagated SecurityException. Then again, it may be as designed - the docs are also still pre-release. EDIT: gabe's answer is most likely correct on this point.
Since you generally can't access the filesystem from Silverlight (you need a fully-trusted OOB app), it looks like SL4 is trying to throw an exception, but is failing because the text for that exception isn't available in the SL4 beta. Presumably you would get the correct exception once SL4 is released.

SocketException on Windows Server 2003

I am trying to get an FTP application up and running on Windows Server 2003, before this application was on windows XP professional running with no problem. I have tried googling around for answers, but the only "workaround" I can seem to find on Microsoft’s website didn’t correct the problem (being edit the registry and add a new field DisableRawSecurity with a value of 1(in the correct area). I am debugging this application in VB .Net
The exception: An attempt was made to access a socket in a way forbidden by its access permissions.
As requested here is the source code of the sub its hitting the problem on:
Private Sub Listen()
Try
ListenerSocket.Bind(LocalEndPoint)
ListenerSocket.Listen(100)
While True
ListenerSocket.BeginAccept(New AsyncCallback(AddressOf AcceptCallback), ListenerSocket)
End While
Catch ex As System.Exception
Stop
End Try
ListenerSocket.Shutdown(SocketShutdown.Both)
End Sub
Any help would be appreciated.
You might be having a problem because the call to BeginAccept is in an infinite loop. You should only be calling that once until the AsyncCallback is hit, then call EndAccept and BeginAccept again. So essentially you call BeginAccept once to start, and then again after every connection is established.
Everything in Windows has an Access Control List (ACL). It sounds to me like the user running your application does not have the proper permissions in the ACL to do do what you are asking it to do. I'm not sure how you would go about finding the ACL for a raw socket, but thats where I would start looking.
Are you even using Raw sockets in your application? If not, then that KB article does not apply, and your exception is due to some other reason.