| Summary: | [Misc] CVS UI error running in headless mode | ||
|---|---|---|---|
| Product: | [Eclipse Project] Platform | Reporter: | Alain Picard <picard> |
| Component: | CVS | Assignee: | Platform Team Inbox <platform-team-inbox> |
| Status: | RESOLVED WORKSFORME | QA Contact: | |
| Severity: | normal | ||
| Priority: | P3 | Keywords: | helpwanted |
| Version: | 3.2 | ||
| Target Milestone: | --- | ||
| Hardware: | PC | ||
| OS: | Windows XP | ||
| Whiteboard: | |||
|
Description
Alain Picard
The error is occuring because CVs is trying to prompt to get the password for the repository location. It is doin this because a read-only file is being modified and such a file must be "cvs edit"ed before being modified. One way to get around the problem would be to set the Team>CVS>Watch/Edit preference to edit the file without contacting the server. This would avoid the connection attempt. The connection can also be avoided by making the file writtable before trying to edit it. Why is the file read-only in the first place? This should only happen if the repository is configured to use watch/edit. If you are supposed to use watch/edit, then you will need to ensure that you have a password associated with the repository location before you attempt to modify a file. You are correct in that CVS is setup to use watch/edit and that is why the file is read-only. But the password is already saved and if I go to that file and open it in an editor and start editing it, I am not getting prompted for a password, nor am I being shown the edit window in this case. So no UI prompts or display are showing. If this is the case, shouldn't this work in a headless fashion and the bug be reopened? The prompt only occurs when authentication fails. If we changed the code to avoid prompting, a CVSAuthenticationException would still be thrown so you wouldn't be any better off. Somehow, the password you are providing is not being used when you are running headless. How are you providing the password? My password as been saved long ago as part of the CVS repository location setup. The only time I am prompted for a password is usually after an Eclipse upgrade. That is why i don't understand the "only when authentication fails" here. From a user perspective it doesn't fail authentication for sure. I surely understand that if the password is required and needs to be prompted for, the only better solution would be a CVSAuthenticationException instead of the current error, but that the end result would be the same and thus a pretty minor improvement. But that being said, this is not the case here and we would not expect the headless operation to work if the password is required. I'm not sure I know what you mean by your last sentence. All I can say is that, from the stack trace you have provided, it is pretty clear that authentication is failing and that is what is causing the attempt to prompt. How do you check the projects out for your headless application? Is it possible that the authentication information or connection method is different? You are right that from the stacktrace the code is prompting for a password. I can see by stepping through some of the code that the CVSRepositoryLocation object is built from the return of fromString() in KnownRepositories. This location string doesn't contain the password and thus when Session calls openConnection, the password is not part of the object passed. The openConnection does look for a cached password, but I believe that this is different from a saved password. But when I go in and look at my CVS Repository location properties, I see that a password is specified and the save password checkbox is selected. I am by no means an expert in this complex part of Eclipse but I can surely run any debug test that you want me to conduct. The password is retrieved from the keyring file in the CVSRepositoryLocation#openConnecton method. You could debug that to see if the password is being retrieved. If not, you may want to use a custom location for the keyring file (using the -keyring command line option). That way, you can ensure that the keyring file that you use in the Workbench is also available when running headless. Right on. That was the issue.
When running with the launch configuration, I was using the default configuration area, instead of setting it to the "normal" default. I have now set it to "${eclipse_home}/configuration" and everything is now running smoothly. BTW, there seems to be no documentation on the configuration tab of the launch configuration. Not that I would have magically caught it, but I would surely at some point have better understood what it was used for.
Thanks for all the help and keep up the good work.
|