{"action":"created","issue":{"url":"https://api.github.com/repos/mongodb/morphia/issues/830","labels_url":"https://api.github.com/repos/mongodb/morphia/issues/830/labels{/name}","comments_url":"https://api.github.com/repos/mongodb/morphia/issues/830/comments","events_url":"https://api.github.com/repos/mongodb/morphia/issues/830/events","html_url":"https://github.com/mongodb/morphia/issues/830","id":98918237,"number":830,"title":"Class Cast Exception mapping generics morphia 1.0.1 and 1.1.0-SNAPSHOT","user":{"login":"karpster","id":1821236,"avatar_url":"https://avatars.githubusercontent.com/u/1821236?v=3","gravatar_id":"","url":"https://api.github.com/users/karpster","html_url":"https://github.com/karpster","followers_url":"https://api.github.com/users/karpster/followers","following_url":"https://api.github.com/users/karpster/following{/other_user}","gists_url":"https://api.github.com/users/karpster/gists{/gist_id}","starred_url":"https://api.github.com/users/karpster/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/karpster/subscriptions","organizations_url":"https://api.github.com/users/karpster/orgs","repos_url":"https://api.github.com/users/karpster/repos","events_url":"https://api.github.com/users/karpster/events{/privacy}","received_events_url":"https://api.github.com/users/karpster/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/mongodb/morphia/labels/bug","name":"bug","color":"fc2929"},{"url":"https://api.github.com/repos/mongodb/morphia/labels/Waiting%20for%20Response","name":"Waiting for Response","color":"fef2c0"}],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/mongodb/morphia/milestones/19","html_url":"https://github.com/mongodb/morphia/milestones/1.1.0","labels_url":"https://api.github.com/repos/mongodb/morphia/milestones/19/labels","id":1121666,"number":19,"title":"1.1.0","description":"","creator":{"login":"evanchooly","id":195021,"avatar_url":"https://avatars.githubusercontent.com/u/195021?v=3","gravatar_id":"","url":"https://api.github.com/users/evanchooly","html_url":"https://github.com/evanchooly","followers_url":"https://api.github.com/users/evanchooly/followers","following_url":"https://api.github.com/users/evanchooly/following{/other_user}","gists_url":"https://api.github.com/users/evanchooly/gists{/gist_id}","starred_url":"https://api.github.com/users/evanchooly/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/evanchooly/subscriptions","organizations_url":"https://api.github.com/users/evanchooly/orgs","repos_url":"https://api.github.com/users/evanchooly/repos","events_url":"https://api.github.com/users/evanchooly/events{/privacy}","received_events_url":"https://api.github.com/users/evanchooly/received_events","type":"User","site_admin":false},"open_issues":6,"closed_issues":27,"state":"open","created_at":"2015-05-20T17:43:29Z","updated_at":"2015-09-15T17:39:36Z","due_on":null,"closed_at":null},"comments":3,"created_at":"2015-08-04T08:34:47Z","updated_at":"2015-09-15T17:41:44Z","closed_at":null,"body":"1 using *0.110* and it was working.\r\n2 not working using version *1.0.1*\r\n3 not fixed by Cannot map entities with generic arrays #803 in *1.1.0-SNAPSHOT*\r\n\r\nWe would like to upgrade the morphia version in our project but we are blocked by the following issue:\r\n\r\nWe have a collection of Element, which has several concretizations \r\n(note that code is stripped, but should be enoiugh to allow reproduction)\r\n\r\n```java\r\npublic abstract class Element <T extends Resource> {\r\n\r\n\tprivate T[] resources;\r\n}\r\n\r\npublic class AudioElement extends Element <AudioResource> {\r\n\r\n}\r\n```\r\nThe following exception is thrown when we try to map AudioElement.\r\n\r\n```\r\nCaused by: java.lang.ClassCastException: sun.reflect.generics.reflectiveObjects.TypeVariableImpl cannot be cast to java.lang.Class\r\n\tat org.mongodb.morphia.mapping.MappedField.discoverType(MappedField.java:544) [morphia.jar:]\r\n\tat org.mongodb.morphia.mapping.MappedField.discover(MappedField.java:473) [morphia.jar:]\r\n\tat org.mongodb.morphia.mapping.MappedField.<init>(MappedField.java:95) [morphia.jar:]\r\n\tat org.mongodb.morphia.mapping.MappedClass.discover(MappedClass.java:524) [morphia.jar:]\r\n\tat org.mongodb.morphia.mapping.MappedClass.<init>(MappedClass.java:125) [morphia.jar:]\r\n\tat org.mongodb.morphia.mapping.Mapper.addMappedClass(Mapper.java:154) [morphia.jar:]\r\n\tat org.mongodb.morphia.Morphia.map(Morphia.java:186) [morphia.jar:]\r\n\tat X\r\n```\r\n"},"comment":{"url":"https://api.github.com/repos/mongodb/morphia/issues/comments/140478365","html_url":"https://github.com/mongodb/morphia/issues/830#issuecomment-140478365","issue_url":"https://api.github.com/repos/mongodb/morphia/issues/830","id":140478365,"user":{"login":"evanchooly","id":195021,"avatar_url":"https://avatars.githubusercontent.com/u/195021?v=3","gravatar_id":"","url":"https://api.github.com/users/evanchooly","html_url":"https://github.com/evanchooly","followers_url":"https://api.github.com/users/evanchooly/followers","following_url":"https://api.github.com/users/evanchooly/following{/other_user}","gists_url":"https://api.github.com/users/evanchooly/gists{/gist_id}","starred_url":"https://api.github.com/users/evanchooly/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/evanchooly/subscriptions","organizations_url":"https://api.github.com/users/evanchooly/orgs","repos_url":"https://api.github.com/users/evanchooly/repos","events_url":"https://api.github.com/users/evanchooly/events{/privacy}","received_events_url":"https://api.github.com/users/evanchooly/received_events","type":"User","site_admin":false},"created_at":"2015-09-15T17:41:44Z","updated_at":"2015-09-15T17:41:44Z","body":"@karpster any update?"}}