{"action":"created","issue":{"url":"https://api.github.com/repos/Cweorth/Surreal-Travel/issues/43","labels_url":"https://api.github.com/repos/Cweorth/Surreal-Travel/issues/43/labels{/name}","comments_url":"https://api.github.com/repos/Cweorth/Surreal-Travel/issues/43/comments","events_url":"https://api.github.com/repos/Cweorth/Surreal-Travel/issues/43/events","html_url":"https://github.com/Cweorth/Surreal-Travel/issues/43","id":54012408,"number":43,"title":"Arcane exception thrown when updating AccountDTO","user":{"login":"Cweorth","id":3329989,"avatar_url":"https://avatars.githubusercontent.com/u/3329989?v=3","gravatar_id":"","url":"https://api.github.com/users/Cweorth","html_url":"https://github.com/Cweorth","followers_url":"https://api.github.com/users/Cweorth/followers","following_url":"https://api.github.com/users/Cweorth/following{/other_user}","gists_url":"https://api.github.com/users/Cweorth/gists{/gist_id}","starred_url":"https://api.github.com/users/Cweorth/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Cweorth/subscriptions","organizations_url":"https://api.github.com/users/Cweorth/orgs","repos_url":"https://api.github.com/users/Cweorth/repos","events_url":"https://api.github.com/users/Cweorth/events{/privacy}","received_events_url":"https://api.github.com/users/Cweorth/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/Cweorth/Surreal-Travel/labels/bug","name":"bug","color":"fc2929"}],"state":"open","locked":false,"assignee":{"login":"FiXerCz","id":8997474,"avatar_url":"https://avatars.githubusercontent.com/u/8997474?v=3","gravatar_id":"","url":"https://api.github.com/users/FiXerCz","html_url":"https://github.com/FiXerCz","followers_url":"https://api.github.com/users/FiXerCz/followers","following_url":"https://api.github.com/users/FiXerCz/following{/other_user}","gists_url":"https://api.github.com/users/FiXerCz/gists{/gist_id}","starred_url":"https://api.github.com/users/FiXerCz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/FiXerCz/subscriptions","organizations_url":"https://api.github.com/users/FiXerCz/orgs","repos_url":"https://api.github.com/users/FiXerCz/repos","events_url":"https://api.github.com/users/FiXerCz/events{/privacy}","received_events_url":"https://api.github.com/users/FiXerCz/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/Cweorth/Surreal-Travel/milestones/5","labels_url":"https://api.github.com/repos/Cweorth/Surreal-Travel/milestones/5/labels","id":922539,"number":5,"title":"Final Requirements","description":"https://is.muni.cz/auth/el/1433/podzim2014/PA165/op/FinalRequirements.pdf?studium=685071","creator":{"login":"Cweorth","id":3329989,"avatar_url":"https://avatars.githubusercontent.com/u/3329989?v=3","gravatar_id":"","url":"https://api.github.com/users/Cweorth","html_url":"https://github.com/Cweorth","followers_url":"https://api.github.com/users/Cweorth/followers","following_url":"https://api.github.com/users/Cweorth/following{/other_user}","gists_url":"https://api.github.com/users/Cweorth/gists{/gist_id}","starred_url":"https://api.github.com/users/Cweorth/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Cweorth/subscriptions","organizations_url":"https://api.github.com/users/Cweorth/orgs","repos_url":"https://api.github.com/users/Cweorth/repos","events_url":"https://api.github.com/users/Cweorth/events{/privacy}","received_events_url":"https://api.github.com/users/Cweorth/received_events","type":"User","site_admin":false},"open_issues":5,"closed_issues":2,"state":"open","created_at":"2015-01-05T18:07:01Z","updated_at":"2015-01-12T01:05:31Z","due_on":null,"closed_at":null},"comments":1,"created_at":"2015-01-12T01:02:03Z","updated_at":"2015-01-12T09:12:07Z","closed_at":null,"body":"When calling ```accountService.updateAccount(account)``` in ```AccountController.java:179```, an exception is thrown claiming that ```account.plainPassword``` is not set:\r\n```java\r\njavax.validation.ConstraintViolationException: Validation failed for classes [cz.muni.pa165.surrealtravel.entity.Account] during update time for groups [javax.validation.groups.Default, ]\r\nList of constraint violations:[\r\n\tConstraintViolationImpl{interpolatedMessage='may not be null', propertyPath=plainPassword, rootBeanClass=class cz.muni.pa165.surrealtravel.entity.Account, messageTemplate='{javax.validation.constraints.NotNull.message}'}\r\n]\r\n```\r\nbut I added logging into ```JPAAccountDAO``` and turns out that ```plainPassword``` **is** set correctly when calling ```accountDao.updateAccount```.\r\n\r\n**Reproduce**:\r\nOpen WebApp > *Accounts*, edit ```pa165```, enter old and new passwords, press submit and enjoy the output.\r\n\r\n**What I think**:\r\nI really have no idea why this happens, but I have a hunch that it *might* be caused by the ```@Transient``` annotation."},"comment":{"url":"https://api.github.com/repos/Cweorth/Surreal-Travel/issues/comments/69543516","html_url":"https://github.com/Cweorth/Surreal-Travel/issues/43#issuecomment-69543516","issue_url":"https://api.github.com/repos/Cweorth/Surreal-Travel/issues/43","id":69543516,"user":{"login":"FiXerCz","id":8997474,"avatar_url":"https://avatars.githubusercontent.com/u/8997474?v=3","gravatar_id":"","url":"https://api.github.com/users/FiXerCz","html_url":"https://github.com/FiXerCz","followers_url":"https://api.github.com/users/FiXerCz/followers","following_url":"https://api.github.com/users/FiXerCz/following{/other_user}","gists_url":"https://api.github.com/users/FiXerCz/gists{/gist_id}","starred_url":"https://api.github.com/users/FiXerCz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/FiXerCz/subscriptions","organizations_url":"https://api.github.com/users/FiXerCz/orgs","repos_url":"https://api.github.com/users/FiXerCz/repos","events_url":"https://api.github.com/users/FiXerCz/events{/privacy}","received_events_url":"https://api.github.com/users/FiXerCz/received_events","type":"User","site_admin":false},"created_at":"2015-01-12T09:12:07Z","updated_at":"2015-01-12T09:12:07Z","body":"Sorry, my mistake. After some google searching it would appear, that Transient and NotNull should not be mixed together.\r\n\r\nIt also does not make sense, since plainPassword is supposed to be checked only when creating a new account or changing password on already persisted account. Removing NotNull from Account entity seems to solve the issue. Again, sorry, my mistake.\r\n\r\n---\r\n\r\nBTW, there was a missing i18n entry for password length. That was throwing an exception for me. Maybe you have it locally and excluded it from commit?\r\n\r\nAlso other detail. When we add role Admin to some account, I think we should also add Staff and User. When adding Staff, we should add User. Therefore when we check \"hasRole(USER)\", it is also fullfilled for Staff and Admin. Which (at least in the tutorial) is the right behaviour."}}