java.lang.IllegalArgumentException

There are no available Samebug tips for this exception. Do you have an idea how to solve this issue? A short tip would help users who saw this issue last week.

  • I had a custom query, returning a path: {code} @Query("MATCH p=(:User {uuid:{0}})-[:LIVES_IN]->(c:City)-[:IS_IN]->(:Country) RETURN p LIMIT 1") City findCityForUser(final String uuid); {code} When there is no such path, the framework throws an interesting exception: {code} java.lang.IllegalArgumentException: Projection type must be an interface! at org.springframework.util.Assert.isTrue(Assert.java:68) ~[spring-core-4.2.4.RELEASE.jar:4.2.4.RELEASE] at org.springframework.data.projection.ProxyProjectionFactory.createProjection(ProxyProjectionFactory.java:80) ~[spring-data-commons-1.12.0.M1.jar:na] at org.springframework.data.projection.SpelAwareProxyProjectionFactory.createProjection(SpelAwareProxyProjectionFactory.java:41) ~[spring-data-commons-1.12.0.M1.jar:na] at org.springframework.data.repository.query.ResultProcessor$ProjectingConverter.convert(ResultProcessor.java:221) ~[spring-data-commons-1.12.0.M1.jar:na] at org.springframework.data.repository.query.ResultProcessor$ChainingConverter$1.convert(ResultProcessor.java:174) ~[spring-data-commons-1.12.0.M1.jar:na] at org.springframework.data.repository.query.ResultProcessor$ChainingConverter.convert(ResultProcessor.java:185) ~[spring-data-commons-1.12.0.M1.jar:na] at org.springframework.data.repository.query.ResultProcessor.processResult(ResultProcessor.java:148) ~[spring-data-commons-1.12.0.M1.jar:na] at org.springframework.data.repository.query.ResultProcessor.processResult(ResultProcessor.java:110) ~[spring-data-commons-1.12.0.M1.jar:na] at org.springframework.data.neo4j.repository.query.GraphRepositoryQuery.execute(GraphRepositoryQuery.java:55) ~[spring-data-neo4j-4.1.0.M1.jar:na] at org.springframework.data.repository.core.support.RepositoryFactorySupport$QueryExecutorMethodInterceptor.doInvoke(RepositoryFactorySupport.java:482) ~[spring-data-commons-1.12.0.M1.jar:na] at org.springframework.data.repository.core.support.RepositoryFactorySupport$QueryExecutorMethodInterceptor.invoke(RepositoryFactorySupport.java:460) ~[spring-data-commons-1.12.0.M1.jar:na] at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) ~[spring-aop-4.2.4.RELEASE.jar:4.2.4.RELEASE] at org.springframework.data.projection.DefaultMethodInvokingMethodInterceptor.invoke(DefaultMethodInvokingMethodInterceptor.java:61) ~[spring-data-commons-1.12.0.M1.jar:na] at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) ~[spring-aop-4.2.4.RELEASE.jar:4.2.4.RELEASE] at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:99) ~[spring-tx-4.2.4.RELEASE.jar:4.2.4.RELEASE] at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:281) ~[spring-tx-4.2.4.RELEASE.jar:4.2.4.RELEASE] at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96) ~[spring-tx-4.2.4.RELEASE.jar:4.2.4.RELEASE] at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) ~[spring-aop-4.2.4.RELEASE.jar:4.2.4.RELEASE] at org.springframework.dao.support.PersistenceExceptionTranslationInterceptor.invoke(PersistenceExceptionTranslationInterceptor.java:136) ~[spring-tx-4.2.4.RELEASE.jar:4.2.4.RELEASE] at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) ~[spring-aop-4.2.4.RELEASE.jar:4.2.4.RELEASE] at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:92) ~[spring-aop-4.2.4.RELEASE.jar:4.2.4.RELEASE] at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) ~[spring-aop-4.2.4.RELEASE.jar:4.2.4.RELEASE] at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:208) ~[spring-aop-4.2.4.RELEASE.jar:4.2.4.RELEASE] at com.sun.proxy.$Proxy141.findCityForUser(Unknown Source) ~[na:na] at com.rungway.data.service.UserService.getUserCity(UserService.java:458) ~[data-1.0.10-SNAPSHOT.jar:1.0.10-SNAPSHOT] {code} It works for existing paths, and was working with SDN 4.0 with non-existing paths before. I have been advised that SDN 4.1 does not support returning paths, so I have refactored the query as {code} @Query("MATCH p=(:User {uuid:{0}})-[:LIVES_IN]->(c:City)-[:IS_IN]->(:Country) RETURN c, nodes(p), rels(p) LIMIT 1") {code} which still throws the same exception for empty result sets.
    via by Endre Czirbesz,
  • I had a custom query, returning a path: {code} @Query("MATCH p=(:User {uuid:{0}})-[:LIVES_IN]->(c:City)-[:IS_IN]->(:Country) RETURN p LIMIT 1") City findCityForUser(final String uuid); {code} When there is no such path, the framework throws an interesting exception: {code} java.lang.IllegalArgumentException: Projection type must be an interface! at org.springframework.util.Assert.isTrue(Assert.java:68) ~[spring-core-4.2.4.RELEASE.jar:4.2.4.RELEASE] at org.springframework.data.projection.ProxyProjectionFactory.createProjection(ProxyProjectionFactory.java:80) ~[spring-data-commons-1.12.0.M1.jar:na] at org.springframework.data.projection.SpelAwareProxyProjectionFactory.createProjection(SpelAwareProxyProjectionFactory.java:41) ~[spring-data-commons-1.12.0.M1.jar:na] at org.springframework.data.repository.query.ResultProcessor$ProjectingConverter.convert(ResultProcessor.java:221) ~[spring-data-commons-1.12.0.M1.jar:na] at org.springframework.data.repository.query.ResultProcessor$ChainingConverter$1.convert(ResultProcessor.java:174) ~[spring-data-commons-1.12.0.M1.jar:na] at org.springframework.data.repository.query.ResultProcessor$ChainingConverter.convert(ResultProcessor.java:185) ~[spring-data-commons-1.12.0.M1.jar:na] at org.springframework.data.repository.query.ResultProcessor.processResult(ResultProcessor.java:148) ~[spring-data-commons-1.12.0.M1.jar:na] at org.springframework.data.repository.query.ResultProcessor.processResult(ResultProcessor.java:110) ~[spring-data-commons-1.12.0.M1.jar:na] at org.springframework.data.neo4j.repository.query.GraphRepositoryQuery.execute(GraphRepositoryQuery.java:55) ~[spring-data-neo4j-4.1.0.M1.jar:na] at org.springframework.data.repository.core.support.RepositoryFactorySupport$QueryExecutorMethodInterceptor.doInvoke(RepositoryFactorySupport.java:482) ~[spring-data-commons-1.12.0.M1.jar:na] at org.springframework.data.repository.core.support.RepositoryFactorySupport$QueryExecutorMethodInterceptor.invoke(RepositoryFactorySupport.java:460) ~[spring-data-commons-1.12.0.M1.jar:na] at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) ~[spring-aop-4.2.4.RELEASE.jar:4.2.4.RELEASE] at org.springframework.data.projection.DefaultMethodInvokingMethodInterceptor.invoke(DefaultMethodInvokingMethodInterceptor.java:61) ~[spring-data-commons-1.12.0.M1.jar:na] at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) ~[spring-aop-4.2.4.RELEASE.jar:4.2.4.RELEASE] at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:99) ~[spring-tx-4.2.4.RELEASE.jar:4.2.4.RELEASE] at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:281) ~[spring-tx-4.2.4.RELEASE.jar:4.2.4.RELEASE] at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96) ~[spring-tx-4.2.4.RELEASE.jar:4.2.4.RELEASE] at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) ~[spring-aop-4.2.4.RELEASE.jar:4.2.4.RELEASE] at org.springframework.dao.support.PersistenceExceptionTranslationInterceptor.invoke(PersistenceExceptionTranslationInterceptor.java:136) ~[spring-tx-4.2.4.RELEASE.jar:4.2.4.RELEASE] at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) ~[spring-aop-4.2.4.RELEASE.jar:4.2.4.RELEASE] at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:92) ~[spring-aop-4.2.4.RELEASE.jar:4.2.4.RELEASE] at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) ~[spring-aop-4.2.4.RELEASE.jar:4.2.4.RELEASE] at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:208) ~[spring-aop-4.2.4.RELEASE.jar:4.2.4.RELEASE] at com.sun.proxy.$Proxy141.findCityForUser(Unknown Source) ~[na:na] at com.rungway.data.service.UserService.getUserCity(UserService.java:458) ~[data-1.0.10-SNAPSHOT.jar:1.0.10-SNAPSHOT] {code} It works for existing paths, and was working with SDN 4.0 with non-existing paths before. I have been advised that SDN 4.1 does not support returning paths, so I have refactored the query as {code} @Query("MATCH p=(:User {uuid:{0}})-[:LIVES_IN]->(c:City)-[:IS_IN]->(:Country) RETURN c, nodes(p), rels(p) LIMIT 1") {code} which still throws the same exception for empty result sets.
    via by Endre Czirbesz,
    • java.lang.IllegalArgumentException: Projection type must be an interface! at org.springframework.util.Assert.isTrue(Assert.java:68)[spring-core-4.2.4.RELEASE.jar:4.2.4.RELEASE] at org.springframework.data.projection.ProxyProjectionFactory.createProjection(ProxyProjectionFactory.java:80)[spring-data-commons-1.12.0.M1.jar:na] at org.springframework.data.projection.SpelAwareProxyProjectionFactory.createProjection(SpelAwareProxyProjectionFactory.java:41)[spring-data-commons-1.12.0.M1.jar:na] at org.springframework.data.repository.query.ResultProcessor$ProjectingConverter.convert(ResultProcessor.java:221)[spring-data-commons-1.12.0.M1.jar:na] at org.springframework.data.repository.query.ResultProcessor$ChainingConverter$1.convert(ResultProcessor.java:174)[spring-data-commons-1.12.0.M1.jar:na] at org.springframework.data.repository.query.ResultProcessor$ChainingConverter.convert(ResultProcessor.java:185)[spring-data-commons-1.12.0.M1.jar:na] at org.springframework.data.repository.query.ResultProcessor.processResult(ResultProcessor.java:148)[spring-data-commons-1.12.0.M1.jar:na] at org.springframework.data.repository.query.ResultProcessor.processResult(ResultProcessor.java:110)[spring-data-commons-1.12.0.M1.jar:na] at org.springframework.data.neo4j.repository.query.GraphRepositoryQuery.execute(GraphRepositoryQuery.java:55)[spring-data-neo4j-4.1.0.M1.jar:na] at org.springframework.data.repository.core.support.RepositoryFactorySupport$QueryExecutorMethodInterceptor.doInvoke(RepositoryFactorySupport.java:482)[spring-data-commons-1.12.0.M1.jar:na] at org.springframework.data.repository.core.support.RepositoryFactorySupport$QueryExecutorMethodInterceptor.invoke(RepositoryFactorySupport.java:460)[spring-data-commons-1.12.0.M1.jar:na] at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)[spring-aop-4.2.4.RELEASE.jar:4.2.4.RELEASE] at org.springframework.data.projection.DefaultMethodInvokingMethodInterceptor.invoke(DefaultMethodInvokingMethodInterceptor.java:61)[spring-data-commons-1.12.0.M1.jar:na] at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)[spring-aop-4.2.4.RELEASE.jar:4.2.4.RELEASE] at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:99)[spring-tx-4.2.4.RELEASE.jar:4.2.4.RELEASE] at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:281)[spring-tx-4.2.4.RELEASE.jar:4.2.4.RELEASE] at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96)[spring-tx-4.2.4.RELEASE.jar:4.2.4.RELEASE] at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)[spring-aop-4.2.4.RELEASE.jar:4.2.4.RELEASE] at org.springframework.dao.support.PersistenceExceptionTranslationInterceptor.invoke(PersistenceExceptionTranslationInterceptor.java:136)[spring-tx-4.2.4.RELEASE.jar:4.2.4.RELEASE] at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)[spring-aop-4.2.4.RELEASE.jar:4.2.4.RELEASE] at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:92)[spring-aop-4.2.4.RELEASE.jar:4.2.4.RELEASE] at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)[spring-aop-4.2.4.RELEASE.jar:4.2.4.RELEASE] at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:208)[spring-aop-4.2.4.RELEASE.jar:4.2.4.RELEASE] at com.sun.proxy.$Proxy141.findCityForUser(Unknown Source)[na:na] at com.rungway.data.service.UserService.getUserCity(UserService.java:458)[data-1.0.10-SNAPSHOT.jar:1.0.10-SNAPSHOT]

    Users with the same issue

    MattyMatty
    9 times, last one,
    pulse00pulse00
    5 times, last one,
    ivanszkypeterivanszkypeter
    1 times, last one,
    batwalrus76batwalrus76
    14 times, last one,
    Andreas HäberAndreas Häber
    1 times, last one,
    48 more bugmates