ライブラリをアップグレードする途中で、Springを4.2.4
からに、またSpringデータを1.9.2
から1.10.5
にアップグレードしました。私たちはまた、Hibernate 5.2.5.Final
を使ってMySql DBと話をしています。Springを4.3.4にアップグレードした後にConverterNotFoundExceptionが発生しました
これを実行すると、Spring変換で次のエラーが発生します。
org.springframework.core.convert.ConverterNotFoundException: No converter found capable of converting from type [org.javatuples.Pair<?, ?>] to type [my.namespace.Category]
そしてそれは、このレポコールのためです。このレポで
@Query("select new org.javatuples.Pair(cpc.category, count(*)) from UnlinkedProductCategorization cpc where cpc.myField = ?1 group by cpc.category") Collection<Pair<Category,Long>> countByCategoryForContainer(MyFieldType selfContainer);
は何も変わっていない、と我々はに戻す場合は、すべてが動作します。まだ動作しているselect new org.javatuples.Pair(someEntityHere, count(*))
を使用している他のケースがあるので、アップグレードがそれを壊してしまった理由を理解できません。そしてなぜそれはそれが本当に意味をなさないカテゴリーにペアを変換しようとする必要があると考えている。ここで
org.springframework.core.convert.ConverterNotFoundException: No converter found capable of converting from type [org.javatuples.Pair<?, ?>] to type [com.siftit.domain.core.category.Category]
at org.springframework.core.convert.support.GenericConversionService.handleConverterNotFound(GenericConversionService.java:324)
at org.springframework.core.convert.support.GenericConversionService.convert(GenericConversionService.java:206)
at org.springframework.core.convert.support.GenericConversionService.convert(GenericConversionService.java:187)
at org.springframework.data.repository.query.ResultProcessor$ProjectingConverter.convert(ResultProcessor.java:256)
at org.springframework.data.repository.query.ResultProcessor$ChainingConverter$1.convert(ResultProcessor.java:201)
at org.springframework.data.repository.query.ResultProcessor$ChainingConverter.convert(ResultProcessor.java:212)
at org.springframework.data.repository.query.ResultProcessor.processResult(ResultProcessor.java:149)
at org.springframework.data.jpa.repository.query.AbstractJpaQuery.doExecute(AbstractJpaQuery.java:121)
at org.springframework.data.jpa.repository.query.AbstractJpaQuery.execute(AbstractJpaQuery.java:106)
at org.springframework.data.repository.core.support.RepositoryFactorySupport$QueryExecutorMethodInterceptor.doInvoke(RepositoryFactorySupport.java:482)
at org.springframework.data.repository.core.support.RepositoryFactorySupport$QueryExecutorMethodInterceptor.invoke(RepositoryFactorySupport.java:460)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
at org.springframework.data.projection.DefaultMethodInvokingMethodInterceptor.invoke(DefaultMethodInvokingMethodInterceptor.java:61)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:99)
at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:282)
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
at org.springframework.dao.support.PersistenceExceptionTranslationInterceptor.invoke(PersistenceExceptionTranslationInterceptor.java:136)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
at org.springframework.data.jpa.repository.support.CrudMethodMetadataPostProcessor$CrudMethodMetadataPopulatingMethodInterceptor.invoke(CrudMethodMetadataPostProcessor.java:133)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:92)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:213)
at com.sun.proxy.$Proxy89.countByCategoryForContainer(Unknown Source)