{"action":"closed","issue":{"url":"https://api.github.com/repos/CenterForOpenScience/cas-overlay/issues/1","labels_url":"https://api.github.com/repos/CenterForOpenScience/cas-overlay/issues/1/labels{/name}","comments_url":"https://api.github.com/repos/CenterForOpenScience/cas-overlay/issues/1/comments","events_url":"https://api.github.com/repos/CenterForOpenScience/cas-overlay/issues/1/events","html_url":"https://github.com/CenterForOpenScience/cas-overlay/issues/1","id":89128416,"number":1,"title":"Exception fetching ApiOAuth2Application records from DB","user":{"login":"abought","id":2957073,"avatar_url":"https://avatars.githubusercontent.com/u/2957073?v=3","gravatar_id":"","url":"https://api.github.com/users/abought","html_url":"https://github.com/abought","followers_url":"https://api.github.com/users/abought/followers","following_url":"https://api.github.com/users/abought/following{/other_user}","gists_url":"https://api.github.com/users/abought/gists{/gist_id}","starred_url":"https://api.github.com/users/abought/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/abought/subscriptions","organizations_url":"https://api.github.com/users/abought/orgs","repos_url":"https://api.github.com/users/abought/repos","events_url":"https://api.github.com/users/abought/events{/privacy}","received_events_url":"https://api.github.com/users/abought/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-06-17T21:19:07Z","updated_at":"2015-06-18T14:51:20Z","closed_at":"2015-06-18T14:51:20Z","body":"## Summary\r\nCAS is able to fetch data from the database, using a model defined analogously to a pending OSF feature. But when this is used on live data, it raises an exception related to type conversion.\r\n```\r\n Caused by: \r\ncas_1      | org.springframework.core.convert.ConversionFailedException: Failed to convert from type java.lang.String to type java.math.BigInteger for value '5581dd549f8b1f9482812e4a'; nested exception is java.lang.NumberFormatException: For input string: \"5581dd\"\r\n```\r\n\r\n## Details\r\nThe ODM model in Java assigns field \"id\" to type `BigInteger`, but Mongo object IDs are alphanumeric.\r\n\r\nhttps://github.com/CenterForOpenScience/cas-overlay/blob/master/cas-server-support-osf/src/main/java/io/cos/cas/services/OpenScienceFrameworkServiceRegistryDao.java#L57\r\n\r\nHere is some live data added to the database using the OSF model (appropriately renamed so that the mongo collection and field names align with the java model)\r\n```javascript\r\n> db.apioauth2application.findOne()\r\n{\r\n    \"_id\" : \"5581dd549f8b1f9482812e4a\",\r\n    \"create_date\" : ISODate(\"2015-06-17T20:49:24.980Z\"),\r\n    \"description\" : \"Who ya gonna call?\",\r\n    \"_version\" : 1,\r\n    \"active\" : true,\r\n    \"client_id\" : \"f83fd7f407814d96aefb95dd6d03d27e\",\r\n    \"owner\" : \"4urxt\",\r\n    \"client_secret\" : \"MmE1MGQ3ZmUzNzhhNDJlMWIyZTcyZDU5NjZiZjcwYWU=\",\r\n    \"callback_url\" : \"http://goodwill.org\",\r\n    \"home_url\" : \"http://tumblr.com\",\r\n    \"name\" : \"Application name\"\r\n}\r\n```\r\n\r\nHere is the relevant ModularODM model definition used to generate the above data:\r\nhttps://github.com/abought/osf.io/blob/feature/oauth-app-reg-cors/website/project/model.py#L289\r\n\r\nThis is an expanded version of a verbal report to @icereval \r\n\r\nBlocks implementing token revocation/use in CenterForOpenScience/osf.io/issues/3041"}}