JadiraOrg / jadira

Jadira Framework
Apache License 2.0
74 stars 44 forks source link

AbstractHeuristicUserType tries to instantiate deprecated TypeResolver with wrong parameters #82

Open MichaelHegner opened 5 years ago

MichaelHegner commented 5 years ago

I tried to update Hibernate 5.3.7 and org.jadira.usertype.usertype.core 7.0.0.CR1 and facing following issue. => NoSuchMethodError: org.hibernate.type.TypeResolver: method ()V not found

The Problem I figured out:

AbstractHeuristicUserType uses new TypeResolver()

final AbstractSingleColumnStandardBasicType<? extends Object> heuristicType = (AbstractSingleColumnStandardBasicType<? extends Object>) new TypeResolver().heuristicType(identifierType.getName(), parameters);
        if (heuristicType == null) {
            throw new HibernateException("Unsupported identifier type " + identifierType.getName());
        }

But TypeResolver in Hibernate 5.3.7 doesn't have no arguments constructor any more:

public TypeResolver(TypeConfiguration typeConfiguration, TypeFactory typeFactory){
        this.typeConfiguration = typeConfiguration;
        this.typeFactory = typeFactory;
    }
// ATTENTION; CONSTRUCTOR COMMENTED OUT!
//  public TypeResolver() {
//      this( new BasicTypeRegistry(), new TypeFactory() );
//  }
//
miguelrvs commented 4 years ago

Still no answer? Apparently Hibernate 5.3 deleted that ctor