2

I am trying to integrate the Experience extractor module in our project.

https://github.com/Sitecore/experience-extractor

We are using Sitecore 8.2 update 5.

When I build the ExperienceExtractor solution, it built successfully. After that, I deployed the DLLs into our Sitecore instance, clicked Submit in the ExtractorAdmin page and it threw this error.

System.Collections.Generic.KeyNotFoundException: No parse factory registered for type IDataSource with key "xdb" (Source) at ExperienceExtractor.Api.Parsing.JsonJobParser.Parse[TType](ParseState state) in C:\Users\\Downloads\experience-extractor-master\experience-extractor-master\src\ExperienceExtractor\Api\Parsing\JsonJobParser.cs:line 67 at ExperienceExtractor.Api.Parsing.JobParser.ParseDataSource(ParseState state) in C:\Users\gantarao.pala\Downloads\experience-extractor-master\experience-extractor-master\src\ExperienceExtractor\Api\Parsing\JobParser.cs:line 69 at ExperienceExtractor.Api.Parsing.JobParser.CreateDataSource() in C:\Users\\Downloads\experience-extractor-master\experience-extractor-master\src\ExperienceExtractor\Api\Parsing\JobParser.cs:line 134 at ExperienceExtractor.Api.Jobs.Job.Run() in C:\Users\\Downloads\experience-extractor-master\experience-extractor-master\src\ExperienceExtractor\Api\Jobs\Job.cs:line 109

{ "Id": "cc00ebd6-a6c6-4950-a7f6-747b25b2d754", "Created": "2018-11-09T09:27:58.6951558+05:30", "Ended": "2018-11-09T09:27:58.7679627+05:30", "ItemsProcessed": 0,
"RowsCreated": 0, "Progress": null, "Status": "Failed",
"StatusText": "System.Collections.Generic.KeyNotFoundException: No parse factory registered for type IDataSource with key \"xdb\" (Source)\r\n at ExperienceExtractor.Api.Parsing.JsonJobParser.Parse[TType](ParseState state) in C:\Users\\Downloads\experience-extractor-master\experience-extractor-master\src\ExperienceExtractor\Api\Parsing\JsonJobParser.cs:line 67\r\n at ExperienceExtractor.Api.Parsing.JobParser.ParseDataSource(ParseState state) in C:\Users\\Downloads\experience-extractor-master\experience-extractor-master\src\ExperienceExtractor\Api\Parsing\JobParser.cs:line 69\r\n at ExperienceExtractor.Api.Parsing.JobParser.CreateDataSource() in C:\Users\\Downloads\experience-extractor-master\experience-extractor-master\src\ExperienceExtractor\Api\Parsing\JobParser.cs:line 134\r\n at ExperienceExtractor.Api.Jobs.Job.Run() in C:\Users\\Downloads\experience-extractor-master\experience-extractor-master\src\ExperienceExtractor\Api\Jobs\Job.cs:line 109", "SizeLimitExceeded": false, "Url": "/sitecore/experienceextractor/jobs/cc00ebd6-a6c6-4950-a7f6-747b25b2d754", "Specification": "{\r\n \"source\": {\r\n \"xdb\": {\r\n
\"filters\": [\r\n {\r\n \"sample\": 0.3\r\n
},\r\n {\r\n \"daterange\": {\r\n
\"start\": \"2018-10-01Z\",\r\n \"end\": \"2018-11-30Z\"\r\n }\r\n }\r\n ]\r\n }\r\n },\r\n \"mapper\": {},\r\n \"postprocessors\": [\r\n
\"msaccess\"\r\n ]\r\n}", "LastException": "System.Collections.Generic.KeyNotFoundException: No parse factory registered for type IDataSource with key \"xdb\" (Source)\r\n at ExperienceExtractor.Api.Parsing.JsonJobParser.Parse[TType](ParseState state) in C:\Users\\Downloads\experience-extractor-master\experience-extractor-master\src\ExperienceExtractor\Api\Parsing\JsonJobParser.cs:line 67\r\n at ExperienceExtractor.Api.Parsing.JobParser.ParseDataSource(ParseState state) in C:\Users\\Downloads\experience-extractor-master\experience-extractor-master\src\ExperienceExtractor\Api\Parsing\JobParser.cs:line 69\r\n at ExperienceExtractor.Api.Parsing.JobParser.CreateDataSource() in C:\Users\\Downloads\experience-extractor-master\experience-extractor-master\src\ExperienceExtractor\Api\Parsing\JobParser.cs:line 134\r\n at ExperienceExtractor.Api.Jobs.Job.Run() in C:\Users\\Downloads\experience-extractor-master\experience-extractor-master\src\ExperienceExtractor\Api\Jobs\Job.cs:line 109" }

I have tried these troubleshooting steps:

  1. Replaced existing MongoDB.Driver.dll with new one v2.4.4.0.
  2. Replaced existing MongoDB.Bson.dll with new one v2.4.4.0.
  3. Built the Extractor solution which failed.
  4. Tried @massimde 's suggestion from here which is this:

Change the ExperienceExtractor.MongoDb.Helpers class as follows:

public static IEnumerable<T> FastSpool<T>(this MongoCursor<RawBsonDocument> cursor, int threads = 2){
        var binaryReaderSettings = new BsonBinaryReaderSettings(); 
        binaryReaderSettings.MaxDocumentSize = int.MaxValue;
        var serializer = BsonSerializer.LookupSerializer(typeof(T));

        return cursor
            .AsParallel().AsOrdered()
                .WithExecutionMode(ParallelExecutionMode.ForceParallelism)
                .WithDegreeOfParallelism(Math.Max(1, threads))
            .Select(doc =>
            {                    
                using (doc)
                {
                    using (var stream = new ByteBufferStream(doc.Slice))
                    using (var reader = new BsonBinaryReader(stream, binaryReaderSettings))
                    {
                        var context = BsonDeserializationContext.CreateRoot(reader);
                        return (T) serializer.Deserialize(context);
                    }
                    // Old code
                    //return (T)serializer.Deserialize(new BsonBinaryReader(new BsonBuffer(doc.Slice, false), binaryReaderSettings),
                    //    typeof(T), null);
                }
            });   
    }

The solution could not find the namespaces for a few like

MongoCursor<RawBsonDocument>, doc, query

Please advise.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.