java.lang.RuntimeException: Generic TypeVariable not supported!
See original GitHub issueUsing: mongo-java-driver-3.2.2.jar and morphia-1.1.1.jar
The code:
for (UserList userList: userLists){
DBObject userListDbObj = SingletonLaunchDB.getMorphia().toDBObject(userList);
SingletonLaunchDB.getMongo().save(userListDbObj);
}
Error trace:
Grave: java.lang.RuntimeException: Generic TypeVariable not supported!
at org.mongodb.morphia.mapping.MappedField.toClass(MappedField.java:616)
at org.mongodb.morphia.mapping.EphemeralMappedField.getSubClass(EphemeralMappedField.java:84)
at org.mongodb.morphia.mapping.EphemeralMappedField.<init>(EphemeralMappedField.java:39)
at org.mongodb.morphia.mapping.MappedField.discoverType(MappedField.java:498)
at org.mongodb.morphia.mapping.MappedField.discover(MappedField.java:465)
at org.mongodb.morphia.mapping.MappedField.<init>(MappedField.java:93)
at org.mongodb.morphia.mapping.MappedClass.discover(MappedClass.java:540)
at org.mongodb.morphia.mapping.MappedClass.<init>(MappedClass.java:124)
at org.mongodb.morphia.mapping.Mapper.getMappedClass(Mapper.java:431)
at org.mongodb.morphia.DatastoreImpl.getWriteConcern(DatastoreImpl.java:1632)
at org.mongodb.morphia.DatastoreImpl.save(DatastoreImpl.java:686)
Issue Analytics
- State:
- Created 7 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
Map generic list to MongoDB using Morphia - Stack Overflow
Morphia does not support save generics in the DB, so, you can try to make a simple interface and then make all classes...
Read more >Java Programming Tutorial on Generics
JDK 5 introduces generics, which supports abstraction over types (or parameterized types) on classes and methods. The class or method designers can be...
Read more >Examining Class Modifiers and Types
This reflection Java tutorial describes using reflection for accessing and manipulating classes, fields, methods, and constructors.
Read more >Coding Bootcamp: Generics and Threads
Type variable, parameters can be any non-primitive type, e.g., class, interface, array, ... Java supports two different ways of executing threads
Read more >Contexts and Dependency Injection - Quarkus
However, it's not exactly intuitive. Therefore, a new way was introduced in Quarkus - you can inject a java.util.List annotated with the io.quarkus.arc ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I know this bug is old and the response is probably too late. But this works on master though there are warnings about the
T
type on themeta
field above. Using 1.3.2/1.4.0 should resolve any issues. If not, please file a new issue and I’ll take a look.+1