BUG: There is no such reviewer

Our company is evaluating GroupDocs for our flagship web-based ERP system. The only thing holding us back right now is to poor documentation and support for the demo code. To be blunt, it's a pain in the ass to make it work under ASP.Net MVC 5 / Web Api and the new Identity authentication system. I've spent literally days (almost a week) on this one error message. I would be more than happy to hand over the current code and configuration for this project to a support specialist to verify whether this really is a bug or not. I need this solved and I'm running out of ideas.

I'm basically getting a popup dialog with the error "There is no such reviewer" when the annotator is displayed (screenshot attached). Since I didn't find anything in the documentation regarding this error, even after following the instructions on setting it up for MVC5, I decided to dig deeper. One of the things I did was use StructureMap to point several services to service adapters (my own implementations) so I could log the calls and better determine what kind of data is being moved around.

Below is the log output of my site. I've also attached screenshots of the SQL Server Database after the site loads. I'm pointing 'SaasposeDb' database connection to "metadata=res://*/GroupdocsSqlSrv.csdl|res://*/GroupdocsSqlSrv.ssdl|res://*/GroupdocsSqlSrv.msl;provider=System.Data.SqlClient;provider connection string="Data Source=localhost\SqlExpress;Initial Catalog=JEProofingAnnotations;User ID=xxx;Password=xxx"" so it should be all set to use the external DB.

3/9/2015 7:19:25 PM Registering web api
3/9/2015 7:19:25 PM Registering filters
3/9/2015 7:19:25 PM Registering routes
3/9/2015 7:19:25 PM Registering bundles
3/9/2015 7:19:25 PM Type injected: Annotator
3/9/2015 7:19:25 PM Type injected: AnnotatorAdapter
3/9/2015 7:19:25 PM Type injected: Result
3/9/2015 7:19:25 PM Type injected: CssParser
3/9/2015 7:19:25 PM Type injected: SvgParser
3/9/2015 7:19:25 PM Type injected: AccountService
3/9/2015 7:19:25 PM Type injected: AnnotationCollaboratorService
3/9/2015 7:19:25 PM Type injected: AnnotationCollaboratorServiceAdapter
3/9/2015 7:19:25 PM Type injected: AnnotationLayerService
3/9/2015 7:19:25 PM Type injected: AnnotationReplyService
3/9/2015 7:19:25 PM Type injected: AnnotationService
3/9/2015 7:19:25 PM Type injected: AnnotationSessionService
3/9/2015 7:19:25 PM Type injected: AnnotationSessionServiceAdapter
3/9/2015 7:19:25 PM Type injected: UserService
3/9/2015 7:19:25 PM Type injected: UserServiceAdapter
3/9/2015 7:19:25 PM Type injected: RepositoryPathFinder
3/9/2015 7:19:25 PM Type injected: AccountRepository
3/9/2015 7:19:25 PM Type injected: UserRepository
3/9/2015 7:19:25 PM Type injected: AnnotationCollaboratorRepository
3/9/2015 7:19:25 PM Type injected: AnnotationLayerRepository
3/9/2015 7:19:25 PM Type injected: AnnotationReplyRepository
3/9/2015 7:19:25 PM Type injected: AnnotationRepository
3/9/2015 7:19:25 PM Type injected: AnnotationSessionRepository
3/9/2015 7:19:25 PM Type injected: PdfPageReorderer
3/9/2015 7:19:25 PM Type injected: AnnotationService
3/9/2015 7:19:25 PM Type injected: AuthenticationService
3/9/2015 7:19:25 PM Type injected: CustomAuthenticationService
3/9/2015 7:19:25 PM Type injected: AnnotationBroadcaster
3/9/2015 7:19:25 PM Type injected: AnnotationHub
3/9/2015 7:19:25 PM Type injected: ApplicationPathFinder
3/9/2015 7:19:25 PM Type injected: EmbeddedResourceManager
3/9/2015 7:19:25 PM Type injected: Helper
3/9/2015 7:19:25 PM Type injected: LocalizationManager
3/9/2015 7:19:25 PM Type injected: RootPathFinder
3/9/2015 7:19:25 PM Type injected: UrlsCreator
3/9/2015 7:19:25 PM Type injected: ViewingServiceCreator
3/9/2015 7:19:25 PM Type injected: Container
3/9/2015 7:19:27 PM Entered Owin Startup
3/9/2015 7:19:32 PM Entered Group Docs Annotator controller
3/9/2015 7:19:32 PM Adding annotation Session [#0 User # Document # 0 Collaborators]
3/9/2015 7:19:32 PM Creating annotation session id #1 for user #? and document
3/9/2015 7:19:32 PM Found annotation Session [#1 User # Document # 0 Collaborators] for session id #1
3/9/2015 7:19:32 PM Found 0 collaborators for session #1
3/9/2015 7:19:32 PM Got User [NULL] from username 'stuart.zahn@gmail.com'
3/9/2015 7:19:32 PM Added User ['stuart.zahn@gmail.com' #1]
3/9/2015 7:19:32 PM Adding annotation collaborator #1 to session #1 with rights All
3/9/2015 7:19:32 PM Found 1 collaborators for session #1
3/9/2015 7:19:32 PM Got User ['stuart.zahn@gmail.com' #1] from id #1
3/9/2015 7:19:32 PM Added Reviewer [# guid email stuart.zahn@gmail.com rights All] as Collaborators Set Result [Session 160ed9acb6aad937 Document 1 Collaborators] to session #1
3/9/2015 7:19:32 PM AuthenticationService: UserName is stuart.zahn@gmail.com
3/9/2015 7:19:32 PM AuthenticationService: UserKey is stuart.zahn@gmail.com
3/9/2015 7:19:33 PM User stuart.zahn@gmail.com opened document RM1103.pdf.
3/9/2015 7:19:33 PM Found annotation Session [#1 User # Document # 0 Collaborators] for session id #1
3/9/2015 7:19:33 PM Found 1 collaborators for session #1
3/9/2015 7:19:33 PM Got User ['stuart.zahn@gmail.com' #1] from id #1
3/9/2015 7:19:33 PM Got Collaborators Get Result [Session 160ed9acb6aad937 Document 1 Collaborators] for session #1
3/9/2015 7:19:33 PM Found annotation Session [#1 User # Document # 0 Collaborators] for session id #1
3/9/2015 7:19:33 PM Found 1 collaborators for session #1
3/9/2015 7:19:33 PM Got User ['stuart.zahn@gmail.com' #1] from id #1
3/9/2015 7:19:33 PM Got Collaborators Get Result [Session 160ed9acb6aad937 Document 1 Collaborators] for session #1

Can I get any help with this?

Hello Stuart,


We are sorry to hear that you have such issue. To be able to reproduce the issue we will need additional information about it:

1. Do you used compact (default db.sdf file from the GroupDocs.Annotation package) DB before you use SQLExpress DB?
2. If possible please share with us your code example (View, Controller and how do you initialized GroupDocs.Annotation)
3. Which folder do you use as a storage for the documents (which folder you set in the “Groupdocs.Web.Annotation.WidgetFactory.Initialize()”)

Also you can try to delete file-session.json file from the App_Data folder and then rebuild your solution.

Thank you.

I always delete the .json file and everything in the App_Data and Documents folder (other than the pdf) before running the site.


Below is the code:

WidgetFactory.Initialize(this.Context, @"~/Documents",
WebConfigurationManager.ConnectionStrings[“SaasposeDb”].ConnectionString);


StructureMap.ObjectFactory.Inject(new CustomAuthenticationService());

class CustomAuthenticationService : AuthenticationService
{

public override string UserKey
{
get
{
var isLoggedIn = HttpContext.Current.User.Identity != null
&& HttpContext.Current.User.Identity.IsAuthenticated;
var userKey = isLoggedIn ? HttpContext.Current.User.Identity.Name : base.AnonymousUserName;
LogSingleton.Instance.Debug(“AuthenticationService: UserKey is {0}”, userKey);
return userKey;
}
}

public override string UserName
{
get
{
var isLoggedIn = HttpContext.Current.User.Identity != null
&& HttpContext.Current.User.Identity.IsAuthenticated;
var userName = isLoggedIn ? HttpContext.Current.User.Identity.Name : base.AnonymousUserName;
LogSingleton.Instance.Debug(“AuthenticationService: UserName is {0}”, userName);
return userName;
}
}


public ActionResult Index()
{
LogSingleton.Instance.Debug(“Entered Group Docs Annotator controller”);

string path = “RM1103.pdf”;

var un = CurrentUserName;

if (!string.IsNullOrEmpty(un))
{
var ticket = new FormsAuthenticationTicket(un, true, 1439200);
var encryptedTicket = FormsAuthentication.Encrypt(ticket);
var cookie = new HttpCookie(FormsAuthentication.FormsCookieName, encryptedTicket)
{
Expires = ticket.Expiration
};
Response.Cookies.Add(cookie);

// add user to the document collaborator list
var svc = ObjectFactory.GetInstance();

int rights = (int) Groupdocs.Common.AnnotationReviewerRights.All;
var result = svc.AddCollaborator(path, un, null, null, null, Groupdocs.Common.AnnotationReviewerRights.All);
Debug.WriteLine(result);
}
else
{
// add anonymous user to the document collaborator list
var svc = ObjectFactory.GetInstance();
svc.AddCollaborator(path, “anonymous”, “Anonym”, “A.”, null); // allow anonymous users to annotate on a document
}

return View();
}




@{
Layout = “~/Views/Shared/_GroupDocsLayout.cshtml”;
ViewBag.Title = “Index”;
}

@using Groupdocs.Web.Annotation.Mvc


@(Html.Groupdocs()
.Annotation()
.ElementId(“annotation-widget”)
.FilePath(“RM1103.pdf”)
.ShowZoom(true)
.ShowPaging(true)
.ShowThumbnails(true)
.OpenThumbnails(false)
//.Zoom(75)
.PreloadPageCount(3)
.EnableRightClickMenu(true)
.ShowFileExplorer(true)
.Tools(Groupdocs.Web.Annotation.AnnotationTools.All)
.ShowHeader(true)
.StrikeoutMode(Groupdocs.Common.StrikeoutToolMode.Remove)
.ClickableAnnotations(true))


Hello,


Thank you fro the code example. The reason of the issue is in the user name decliration, it should be be done via GET parameter and also the “un” variable should be set as an Index action property. We have prepared an example project with your code for how to do that, please download it from here .

Also we have a workaround for it but this workaround is much more complicated and painful, if you interested in it we can prepare an example for you.