Skip to content
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

The Method QuerydslKeyValueRepository.findOne(Predicate predicate) throws exception when Spring boot application is run from command line [DATAKV-237] #214

Open
spring-projects-issues opened this issue Nov 20, 2018 · 0 comments
Assignees
Labels
in: core type: bug

Comments

@spring-projects-issues
Copy link

@spring-projects-issues spring-projects-issues commented Nov 20, 2018

Valerii Sukhotskyi opened DATAKV-237 and commented

I have created simple Spring Boot + Spring Data Key-Value + Querydsl application (https://github.com/suhotskiy/spring-data-keyvalue-querydsl-bug).
When I run: mvn spring-boot:run all works fine. But when the application is run from the command line: java -jar example-0.0.1-SNAPSHOT.jar the exception is raised:

Exception in thread "main" java.lang.reflect.InvocationTargetException
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:48)
        at org.springframework.boot.loader.Launcher.launch(Launcher.java:87)
        at org.springframework.boot.loader.Launcher.launch(Launcher.java:50)
        at org.springframework.boot.loader.JarLauncher.main(JarLauncher.java:51)
Caused by: com.mysema.codegen.CodegenException: Compilation of public class Q_133914572_1275614662_1275614662_1195259493 {

    public static Iterable<com.suhoff.example.City> eval(Iterable<com.suhoff.example.City> city_, String a1) {
java.util.List<com.suhoff.example.City> rv = new java.util.ArrayList<com.suhoff.example.City>();
for (com.suhoff.example.City city : city_) {
    try {
        if (com.querydsl.collections.CollQueryFunctions.equals(city.getCountry(), a1)) {
            rv.add(city);
        }
    } catch (NullPointerException npe) { }
}
return rv;    }

}

 failed.
/Q_133914572_1275614662_1275614662_1195259493.java:3: error: package com.suhoff.example does not exist
    public static Iterable<com.suhoff.example.City> eval(Iterable<com.suhoff.example.City> city_, String a1) {
                                                                                    ^
/Q_133914572_1275614662_1275614662_1195259493.java:3: error: package com.suhoff.example does not exist
    public static Iterable<com.suhoff.example.City> eval(Iterable<com.suhoff.example.City> city_, String a1) {
                                             ^
/Q_133914572_1275614662_1275614662_1195259493.java:4: error: package com.suhoff.example does not exist
java.util.List<com.suhoff.example.City> rv = new java.util.ArrayList<com.suhoff.example.City>();
                                 ^
/Q_133914572_1275614662_1275614662_1195259493.java:4: error: package com.suhoff.example does not exist
java.util.List<com.suhoff.example.City> rv = new java.util.ArrayList<com.suhoff.example.City>();
                                                                                       ^
/Q_133914572_1275614662_1275614662_1195259493.java:5: error: package com.suhoff.example does not exist
for (com.suhoff.example.City city : city_) {
                       ^
/Q_133914572_1275614662_1275614662_1195259493.java:7: error: package com.querydsl.collections does not exist
        if (com.querydsl.collections.CollQueryFunctions.equals(city.getCountry(), a1)) {
                                    ^
6 errors

        at com.mysema.codegen.JDKEvaluatorFactory.compile(JDKEvaluatorFactory.java:74)
        at com.mysema.codegen.AbstractEvaluatorFactory.createEvaluator(AbstractEvaluatorFactory.java:128)
        at com.querydsl.collections.DefaultEvaluatorFactory.createEvaluator(DefaultEvaluatorFactory.java:151)
        at com.querydsl.collections.DefaultQueryEngine.evaluateSingleSource(DefaultQueryEngine.java:166)
        at com.querydsl.collections.DefaultQueryEngine.list(DefaultQueryEngine.java:80)
        at com.querydsl.collections.AbstractCollQuery.iterate(AbstractCollQuery.java:175)
        at com.querydsl.collections.AbstractCollQuery.fetchOne(AbstractCollQuery.java:204)
        at org.springframework.data.keyvalue.repository.support.QuerydslKeyValueRepository.findOne(QuerydslKeyValueRepository.java:100)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at org.springframework.data.repository.core.support.RepositoryComposition$RepositoryFragments.invoke(RepositoryComposition.java:359)
        at org.springframework.data.repository.core.support.RepositoryComposition.invoke(RepositoryComposition.java:200)
        at org.springframework.data.repository.core.support.RepositoryFactorySupport$ImplementationMethodExecutionInterceptor.invoke(RepositoryFactorySupport.java:644)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
        at org.springframework.data.repository.core.support.RepositoryFactorySupport$QueryExecutorMethodInterceptor.doInvoke(RepositoryFactorySupport.java:608)
        at org.springframework.data.repository.core.support.RepositoryFactorySupport$QueryExecutorMethodInterceptor.lambda$invoke$3(RepositoryFactorySupport.java:595)
        at org.springframework.data.repository.core.support.RepositoryFactorySupport$QueryExecutorMethodInterceptor.invoke(RepositoryFactorySupport.java:595)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
        at org.springframework.data.projection.DefaultMethodInvokingMethodInterceptor.invoke(DefaultMethodInvokingMethodInterceptor.java:59)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
        at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:93)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
        at org.springframework.data.repository.core.support.SurroundingTransactionDetectorMethodInterceptor.invoke(SurroundingTransactionDetectorMethodInterceptor.java:61)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
        at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:212)
        at com.sun.proxy.$Proxy40.findOne(Unknown Source)
        at com.suhoff.example.ExampleApplication.main(ExampleApplication.java:22)
        ... 8 more
}

Affects: 2.1.2 (Lovelace SR2)

Reference URL: https://github.com/suhotskiy/spring-data-keyvalue-querydsl-bug

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: core type: bug
Projects
None yet
Development

No branches or pull requests

2 participants