Unexpected exception when initializing task 'Analyse':

 Hey guys,

 

Iam working on a a project that is including Trados 2017 and its API.

ProjectFile[] files = this.sdlProject.GetTargetLanguageFiles();
AutomaticTask anaylzeTask = this.sdlProject.RunAutomaticTask(files.GetIds(), AutomaticTaskTemplateIds.AnalyzeFiles);

 

Iam able to create new FilebasesProjects and create the actual project but i can't run an analysis on the project files. Everytime i try to run the task, it says this:

 

"Unexpected exception when initializing task 'Analyse': Die Sprachressourcendatei kann nicht gefunden werden..\r\nStacktrace:\r\n   bei Sdl.ProjectApi.Implementation.TaskExecution.ContentProcessingTaskImplementation.InitializeTaskImplementations()\r\n   bei Sdl.ProjectApi.Implementation.TaskExecution.ContentProcessingTaskImplementation.Execute()\r\n   bei Sdl.ProjectApi.Implementation.AutomaticTaskExecuter.Execute()"

 

Any idea what i forgot? It's all working fine except analysis.

Parents Reply Children
  • It has something todo with the TM that is used. I added a Groupshare TM to the project. My Standalone App is published in the Studio folder --> No difference. If i remove the TM, the analysis runs smoothly.
  • Hi C.V.

    It looks like my guess was wrong :).
    If possible could you post the entire stack trace including the inner exception?

    The inner exception is very important, as this is where the real problem is happening.
  • Hi,

    this is the JSON dump from my AutomaticTask object. This is where the exception happens.

    {
    "TemplateIds":[
    "Sdl.ProjectApi.AutomaticTasks.Analysis"
    ],
    "OutputFiles":[

    ],
    "Messages":[
    {
    "ProjectFileId":null,
    "Source":"AutomaticTaskExecuter",
    "Message":"Unexpected exception when initializing task 'Analyse': Die Sprachressourcendatei kann nicht gefunden werden..",
    "Level":2,
    "Exception":{
    "ClassName":"Sdl.ProjectAutomation.Core.ProjectAutomationException",
    "Message":"Unexpected exception when initializing task 'Analyse': Die Sprachressourcendatei kann nicht gefunden werden..\r\nStacktrace:\r\n bei Sdl.ProjectApi.Implementation.TaskExecution.ContentProcessingTaskImplementation.InitializeTaskImplementations()\r\n bei Sdl.ProjectApi.Implementation.TaskExecution.ContentProcessingTaskImplementation.Execute()\r\n bei Sdl.ProjectApi.Implementation.AutomaticTaskExecuter.Execute()",
    "Data":null,
    "InnerException":{
    "ClassName":"Sdl.ProjectApi.ProjectApiException",
    "Message":"Unexpected exception when initializing task 'Analyse': Die Sprachressourcendatei kann nicht gefunden werden..\r\nStacktrace:\r\n bei Sdl.ProjectApi.Implementation.TaskExecution.ContentProcessingTaskImplementation.InitializeTaskImplementations()\r\n bei Sdl.ProjectApi.Implementation.TaskExecution.ContentProcessingTaskImplementation.Execute()\r\n bei Sdl.ProjectApi.Implementation.AutomaticTaskExecuter.Execute()",
    "Data":null,
    "InnerException":{
    "ClassName":"Sdl.ProjectApi.ProjectApiException",
    "Message":"Exception of type LanguageProcessingException occurred: Die Sprachressourcendatei kann nicht gefunden werden.\r\nStacktrace:\r\n bei Sdl.Core.LanguageProcessing.Resources.ResourceFileResourceAccessor..ctor()\r\n bei Sdl.Core.LanguageProcessing.Resources.Configuration.Load()\r\n bei Sdl.Core.LanguageProcessing.Resources.LanguageResources..ctor(CultureInfo culture, IResourceDataAccessor accessor)\r\n bei Sdl.ProjectApi.Helpers.LanguageObjectsCache.GetLanguageTools(ILanguageDirection languageDirection)\r\n bei Sdl.ProjectApi.AutomaticTasks.Analysis.AnalysisDataCollectorX.CreateAnalysisDataStorage(ILanguageDirection languageDirection, AnalysisTaskSettings analysisSettings, TranslationMemorySettings translationMemorySettings, ILanguageObjectsCache objectsCache)\r\n bei Sdl.ProjectApi.AutomaticTasks.Analysis.AnalysisDataCollectorX.Initialize(IList`1 files)\r\n bei Sdl.ProjectApi.AutomaticTasks.Analysis.AnalysisTask.CreateAnalysisDataCollectors()\r\n bei Sdl.ProjectApi.AutomaticTasks.Analysis.AnalysisTask.InitializeTask(IExecutingAutomaticTask task)\r\n bei Sdl.ProjectApi.Implementation.TaskExecution.ContentProcessingTaskImplementation.InitializeTaskImplementations()",
    "Data":null,
    "InnerException":null,
    "HelpURL":null,
    "StackTraceString":null,
    "RemoteStackTraceString":null,
    "RemoteStackIndex":0,
    "ExceptionMethod":null,
    "HResult":-2146233088,
    "Source":null,
    "WatsonBuckets":null
    },
    "HelpURL":null,
    "StackTraceString":null,
    "RemoteStackTraceString":null,
    "RemoteStackIndex":0,
    "ExceptionMethod":null,
    "HResult":-2146233088,
    "Source":null,
    "WatsonBuckets":null
    },
    "HelpURL":null,
    "StackTraceString":null,
    "RemoteStackTraceString":null,
    "RemoteStackIndex":0,
    "ExceptionMethod":null,
    "HResult":-2146233088,
    "Source":null,
    "WatsonBuckets":null
    }
    }
    ],
    "Reports":[

    ],
    "Id":"62efd936-c8d1-493b-bda3-18876d0be5bd",
    "InputFiles":[
    {
    "TaskId":"62efd936-c8d1-493b-bda3-18876d0be5bd",
    "ProjectFileId":"edc1b8b9-11f5-4359-992f-92e934558753",
    "Completed":false,
    "ReadOnly":false
    },
    {
    "TaskId":"62efd936-c8d1-493b-bda3-18876d0be5bd",
    "ProjectFileId":"2e490bbd-87ba-4179-8fed-1cfc9d1480e3",
    "Completed":false,
    "ReadOnly":false
    }
    ],
    "Status":5,
    "Name":"Analyse"
    }
  • I got it!

    The file Sdl.LanguagePlatform.NLP.resources was missing in the executing path of my application.

    I found it by disassembling the dll's.

    static ResourceFileResourceAccessor()
    {
    ResourceFileResourceAccessor._cacheLock = new object();
    ResourceFileResourceAccessor.DefaultResourceFileName = "Sdl.LanguagePlatform.NLP.resources";
    ResourceFileResourceAccessor._Cache = new Dictionary<string, ResourceFileResourceAccessor.ResourceFileData>();
    }

    Thanks for help ;)
  • Hi C.V.

    Glad you figured it out!
    Although, deploying your executable to the Studio Folder (Studio5) should have worked, since Sdl.LanguagePlatform.NLP.resources is in the same folder. Either way glad the problem is solved :).