New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JaversException: GENERIC_TYPE_NOT_PARAMETRIZED - how to diagnose? #362

Closed
gtnarg opened this Issue Apr 15, 2016 · 3 comments

Comments

Projects
None yet
3 participants
@gtnarg

gtnarg commented Apr 15, 2016

Hi,

I'm receiving the following error:

JaversException: GENERIC_TYPE_NOT_PARAMETRIZED 
expected actual Class argument in type 'java.util.Map<java.lang.String, L[]>'. 
JaVers needs to know actual Class of elements stored in your collections. 
Try at least <Object>. Wildcards (e.g. <?>), unbounded type parameters (e.g. <T>) and raw types (e.g. List) are not supported.
    at org.javers.core.metamodel.type.MapType.getKeyType(MapType.java:74)
    at org.javers.core.graph.ObjectGraphBuilder.isMapWithManagedTypes(ObjectGraphBuilder.java:168)
    at org.javers.core.graph.ObjectGraphBuilder.access$200(ObjectGraphBuilder.java:22)
    at org.javers.core.graph.ObjectGraphBuilder$2.apply(ObjectGraphBuilder.java:133)
    at org.javers.core.graph.ObjectGraphBuilder$2.apply(ObjectGraphBuilder.java:116)
    at org.javers.core.metamodel.type.ManagedClass.getManagedProperties(ManagedClass.java:60)
    at org.javers.core.metamodel.type.ManagedType.getProperties(ManagedType.java:49)
    at org.javers.core.graph.ObjectGraphBuilder.getNonEmptyEnumerablesWithManagedTypes(ObjectGraphBuilder.java:116)
    at org.javers.core.graph.ObjectGraphBuilder.buildMultiEdges(ObjectGraphBuilder.java:88)
    at org.javers.core.graph.ObjectGraphBuilder.buildEdges(ObjectGraphBuilder.java:72)
    at org.javers.core.graph.ObjectGraphBuilder.buildGraphFromCdo(ObjectGraphBuilder.java:59)
    at org.javers.core.graph.ObjectGraphBuilder.buildGraph(ObjectGraphBuilder.java:48)
    at org.javers.core.graph.LiveGraphFactory.createLiveGraph(LiveGraphFactory.java:39)
    at org.javers.core.diff.DiffFactory.buildGraph(DiffFactory.java:109)
    at org.javers.core.diff.DiffFactory.compare(DiffFactory.java:64)
    at org.javers.core.JaversCore.compare(JaversCore.java:103)

Is it possible to figure out where in the object graph this is occurring? What type does the following denote?

java.util.Map<java.lang.String, L[]>

Thanks

@gtnarg

This comment has been minimized.

gtnarg commented Apr 15, 2016

Figured it out by breakpointing the line raising the exception and looking backward through the callstack.

It might be helpful to have some trace logging available in this part of the code base to provide some context if an error like this occurs...

Should excluding this property (or it's parent) when initializing Javers get around this error?

@gtnarg

This comment has been minimized.

gtnarg commented Apr 15, 2016

Was able to get this working using the following:

builder.registerIgnoredClass( PropertyChangeSupport.class );

When I tried to ignore this property in my base Entity class using builder#registerEntity, the subclasses still included the property (i.e. I needed to add the ignore to each subclass). I would think that ignoring a property in the base class should apply to all subclasses?

In addition, ignoring the property, did not prevent the error for which this issue was created.
Shouldn't ignoring the property stop it from traversing this property in the first place?

bartoszwalacik added a commit that referenced this issue Apr 23, 2016

bartoszwalacik added a commit that referenced this issue Apr 26, 2016

@bartoszwalacik

This comment has been minimized.

Member

bartoszwalacik commented Apr 26, 2016

fixed in release 1.6.4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment