0

次のコード表示に Failed to Clone Object {0} エラーが表示されます。C#.NET コードを介してローカル システムからドキュメントをアップロードするとき。

実際、私はこれを 7 システム 5 システムでエラーを示してテストしました。しかし、他の 2 つのコードでは正しく動作します。

ほとんどの場合、Win 7、Server 2008R2 でテストされています。

try Catch i を指定すると、この次の行でエラーが発生します

doc.Save(RefreshMode.Refresh);

以下の例外コードを投稿しました。

あなたがそれについて考えているなら..投稿してください。

 private void uploadDocument(string file)
    {
        MessageBox.Show("upload Doc" + file);

        System.Windows.Forms.Cursor.Current = System.Windows.Forms.Cursors.WaitCursor;

        IDocument doc = null;

        IObjectStore os = ce.FetchOS(config.objectstore().Trim());

        //MessageBox.Show("os" + os);



        doc = CEUtil.CreateDocument(true, file, os, "Document");

        MessageBox.Show("After CreteDoc1");

        doc = CEUtil.CreateDocument(os, "Document");

        MessageBox.Show("After CreteDoc2");

        doc.Properties["DocumentTitle"] = Path.GetFileName(file);
        //doc.MimeType = "text/plain";

        MessageBox.Show("After Create Doc Method");
        try
        {

            doc.ContentElements = CEUtil.CreateContentElementList(file);

            MessageBox.Show("Before doc.Save");

            doc.Save(RefreshMode.REFRESH);
        }
        catch (Exception cee)
        {

            MessageBox.Show(cee.ToString());
        }
        MessageBox.Show("Save in Doc");
        try
        {

            IReferentialContainmentRelationship rcr = CEUtil.FileContainable(os, doc, fileInFolder);

            MessageBox.Show("Before 2nd Save");

            rcr.Save(RefreshMode.NO_REFRESH);
        }
        catch (Exception EC)
        {
            MessageBox.Show(EC.ToString());
        }
        MessageBox.Show("Second Save Complted");
        try
        {

            CEUtil.checkInDoc(doc);
        }
        catch (Exception EE)
        {
            MessageBox.Show("Mess : ChecK In : " + EE.ToString());
        }
        MessageBox.Show("After Check in");

        System.Windows.Forms.Cursor.Current = System.Windows.Forms.Cursors.Default;

        MessageBox.Show("Document created");
    }

例外 1:


ExceptionCode=E_OBJECT_CLONE_FAILED  Id=FNRCE0047  Class=FileNet.Api.Exception.ErrorRecord Source=FileNet.Api.Exception.EngineRuntimeException Description=Failed to clone object {0}. stackTrace=   at FileNet.Apiimpl.Util.ObjectCloner.DeepCopy(Object oldObj) at FileNet.Apiimpl.Core.EngineObjectImpl.GetModifiedData()

例外 2:


ExceptionCode=API_PROPERTY_NOT_IN_CACHE  Id=FNRCA0024  Class=FileNet.Api.Exception.ErrorRecord Source=FileNet.Api.Exception.EngineRuntimeException Description=The Name property was not found in the properties collection. stackTrace=   at FileNet.Apiimpl.Property.PropertiesImpl.get_Item(String propertyName)
4

1 に答える 1

0

同じ問題があり、FileNETApi.dll を GAC に配置すると解決しました。

于 2014-04-03T01:00:52.727 に答える