spring - java.lang.NoSuchMethodError when trying to access DynamoDB from controller on local system -
i have simple spring application trying connect aws dynamodb. however, exception:
org.springframework.web.util.nestedservletexception: handler processing failed; nested exception java.lang.nosuchmethoderror: org.springframework.data.repository.query.parser.parttree.islimiting()z @ org.springframework.web.servlet.dispatcherservlet.triggeraftercompletionwitherror(dispatcherservlet.java:1276) @ org.springframework.web.servlet.dispatcherservlet.dodispatch(dispatcherservlet.java:958) @ org.springframework.web.servlet.dispatcherservlet.doservice(dispatcherservlet.java:870) @ org.springframework.web.servlet.frameworkservlet.processrequest(frameworkservlet.java:961) @ org.springframework.web.servlet.frameworkservlet.doget(frameworkservlet.java:852) @ javax.servlet.http.httpservlet.service(httpservlet.java:735) @ org.springframework.web.servlet.frameworkservlet.service(frameworkservlet.java:837) @ javax.servlet.http.httpservlet.service(httpservlet.java:848) @ org.eclipse.jetty.servlet.servletholder.handle(servletholder.java:684) @ org.eclipse.jetty.servlet.servlethandler$cachedchain.dofilter(servlethandler.java:1496) @ org.springframework.boot.actuate.trace.webrequesttracefilter.dofilter(webrequesttracefilter.java:115) @ org.eclipse.jetty.servlet.servlethandler$cachedchain.dofilter(servlethandler.java:1467) @ org.springframework.boot.actuate.autoconfigure.endpointwebmvcautoconfiguration$applicationcontextfilterconfiguration$1.dofilterinternal(endpointwebmvcautoconfiguration.java:137) @ org.springframework.web.filter.onceperrequestfilter.dofilter(onceperrequestfilter.java:108) @ org.eclipse.jetty.servlet.servlethandler$cachedchain.dofilter(servlethandler.java:1467) @ org.springframework.boot.actuate.autoconfigure.metricfilterautoconfiguration$metricsfilter.dofilterinternal(metricfilterautoconfiguration.java:85) @ org.springframework.web.filter.onceperrequestfilter.dofilter(onceperrequestfilter.java:108) @ org.eclipse.jetty.servlet.servlethandler$cachedchain.dofilter(servlethandler.java:1467) @ org.eclipse.jetty.servlet.servlethandler.dohandle(servlethandler.java:499) @ org.eclipse.jetty.server.handler.scopedhandler.handle(scopedhandler.java:137) @ org.eclipse.jetty.security.securityhandler.handle(securityhandler.java:557) @ org.eclipse.jetty.server.session.sessionhandler.dohandle(sessionhandler.java:231) @ org.eclipse.jetty.server.handler.contexthandler.dohandle(contexthandler.java:1086) @ org.eclipse.jetty.servlet.servlethandler.doscope(servlethandler.java:428) @ org.eclipse.jetty.server.session.sessionhandler.doscope(sessionhandler.java:193) @ org.eclipse.jetty.server.handler.contexthandler.doscope(contexthandler.java:1020) @ org.eclipse.jetty.server.handler.scopedhandler.handle(scopedhandler.java:135) @ org.eclipse.jetty.server.handler.handlerwrapper.handle(handlerwrapper.java:116) @ org.eclipse.jetty.server.server.handle(server.java:370) @ org.eclipse.jetty.server.abstracthttpconnection.handlerequest(abstracthttpconnection.java:494) @ org.eclipse.jetty.server.abstracthttpconnection.headercomplete(abstracthttpconnection.java:971) @ org.eclipse.jetty.server.abstracthttpconnection$requesthandler.headercomplete(abstracthttpconnection.java:1033) @ org.eclipse.jetty.http.httpparser.parsenext(httpparser.java:644) @ org.eclipse.jetty.http.httpparser.parseavailable(httpparser.java:235) @ org.eclipse.jetty.server.asynchttpconnection.handle(asynchttpconnection.java:82) @ org.eclipse.jetty.io.nio.selectchannelendpoint.handle(selectchannelendpoint.java:667) @ org.eclipse.jetty.io.nio.selectchannelendpoint$1.run(selectchannelendpoint.java:52) @ org.eclipse.jetty.util.thread.queuedthreadpool.runjob(queuedthreadpool.java:608) @ org.eclipse.jetty.util.thread.queuedthreadpool$3.run(queuedthreadpool.java:543) @ java.lang.thread.run(thread.java:745) caused by: java.lang.nosuchmethoderror: org.springframework.data.repository.query.parser.parttree.islimiting()z @ org.socialsignin.spring.data.dynamodb.repository.query.parttreedynamodbquery.getresultsrestrictionifapplicable(parttreedynamodbquery.java:86) @ org.socialsignin.spring.data.dynamodb.repository.query.parttreedynamodbquery.issingleentityresultsrestriction(parttreedynamodbquery.java:94) @ org.socialsignin.spring.data.dynamodb.repository.query.abstractdynamodbquery.getexecution(abstractdynamodbquery.java:50) @ org.socialsignin.spring.data.dynamodb.repository.query.abstractdynamodbquery.execute(abstractdynamodbquery.java:288) @ org.springframework.data.repository.core.support.repositoryfactorysupport$queryexecutormethodinterceptor.doinvoke(repositoryfactorysupport.java:384) @ org.springframework.data.repository.core.support.repositoryfactorysupport$queryexecutormethodinterceptor.invoke(repositoryfactorysupport.java:344) @ org.springframework.aop.framework.reflectivemethodinvocation.proceed(reflectivemethodinvocation.java:179) @ org.springframework.aop.framework.jdkdynamicaopproxy.invoke(jdkdynamicaopproxy.java:207) @ com.sun.proxy.$proxy56.findbyname(unknown source) @ org.magnum.mobilecloud.video.repository.videocontroller.test(videocontroller.java:21) @ sun.reflect.nativemethodaccessorimpl.invoke0(native method) @ sun.reflect.nativemethodaccessorimpl.invoke(nativemethodaccessorimpl.java:62) @ sun.reflect.delegatingmethodaccessorimpl.invoke(delegatingmethodaccessorimpl.java:43) @ java.lang.reflect.method.invoke(method.java:483) @ org.springframework.web.method.support.invocablehandlermethod.invoke(invocablehandlermethod.java:215) @ org.springframework.web.method.support.invocablehandlermethod.invokeforrequest(invocablehandlermethod.java:132) @ org.springframework.web.servlet.mvc.method.annotation.servletinvocablehandlermethod.invokeandhandle(servletinvocablehandlermethod.java:104) @ org.springframework.web.servlet.mvc.method.annotation.requestmappinghandleradapter.invokehandlemethod(requestmappinghandleradapter.java:749) @ org.springframework.web.servlet.mvc.method.annotation.requestmappinghandleradapter.handleinternal(requestmappinghandleradapter.java:689) @ org.springframework.web.servlet.mvc.method.abstracthandlermethodadapter.handle(abstracthandlermethodadapter.java:83) @ org.springframework.web.servlet.dispatcherservlet.dodispatch(dispatcherservlet.java:938) ... 38 common frames omitted 2016-01-25 01:16:40.772 warn 58449 --- [tp1746257394-20] o.eclipse.jetty.servlet.servlethandler : /video/test java.lang.nosuchmethoderror: org.springframework.data.repository.query.parser.parttree.islimiting()z @ org.socialsignin.spring.data.dynamodb.repository.query.parttreedynamodbquery.getresultsrestrictionifapplicable(parttreedynamodbquery.java:86) @ org.socialsignin.spring.data.dynamodb.repository.query.parttreedynamodbquery.issingleentityresultsrestriction(parttreedynamodbquery.java:94) @ org.socialsignin.spring.data.dynamodb.repository.query.abstractdynamodbquery.getexecution(abstractdynamodbquery.java:50) @ org.socialsignin.spring.data.dynamodb.repository.query.abstractdynamodbquery.execute(abstractdynamodbquery.java:288) @ org.springframework.data.repository.core.support.repositoryfactorysupport$queryexecutormethodinterceptor.doinvoke(repositoryfactorysupport.java:384) @ org.springframework.data.repository.core.support.repositoryfactorysupport$queryexecutormethodinterceptor.invoke(repositoryfactorysupport.java:344) @ org.springframework.aop.framework.reflectivemethodinvocation.proceed(reflectivemethodinvocation.java:179) @ org.springframework.aop.framework.jdkdynamicaopproxy.invoke(jdkdynamicaopproxy.java:207) @ com.sun.proxy.$proxy56.findbyname(unknown source) @ org.magnum.mobilecloud.video.repository.videocontroller.test(videocontroller.java:21) @ sun.reflect.nativemethodaccessorimpl.invoke0(native method) @ sun.reflect.nativemethodaccessorimpl.invoke(nativemethodaccessorimpl.java:62) @ sun.reflect.delegatingmethodaccessorimpl.invoke(delegatingmethodaccessorimpl.java:43) @ java.lang.reflect.method.invoke(method.java:483) @ org.springframework.web.method.support.invocablehandlermethod.invoke(invocablehandlermethod.java:215) @ org.springframework.web.method.support.invocablehandlermethod.invokeforrequest(invocablehandlermethod.java:132) @ org.springframework.web.servlet.mvc.method.annotation.servletinvocablehandlermethod.invokeandhandle(servletinvocablehandlermethod.java:104) @ org.springframework.web.servlet.mvc.method.annotation.requestmappinghandleradapter.invokehandlemethod(requestmappinghandleradapter.java:749) @ org.springframework.web.servlet.mvc.method.annotation.requestmappinghandleradapter.handleinternal(requestmappinghandleradapter.java:689) @ org.springframework.web.servlet.mvc.method.abstracthandlermethodadapter.handle(abstracthandlermethodadapter.java:83) @ org.springframework.web.servlet.dispatcherservlet.dodispatch(dispatcherservlet.java:938) @ org.springframework.web.servlet.dispatcherservlet.doservice(dispatcherservlet.java:870) @ org.springframework.web.servlet.frameworkservlet.processrequest(frameworkservlet.java:961) @ org.springframework.web.servlet.frameworkservlet.doget(frameworkservlet.java:852) @ javax.servlet.http.httpservlet.service(httpservlet.java:735) @ org.springframework.web.servlet.frameworkservlet.service(frameworkservlet.java:837) @ javax.servlet.http.httpservlet.service(httpservlet.java:848) @ org.eclipse.jetty.servlet.servletholder.handle(servletholder.java:684) @ org.eclipse.jetty.servlet.servlethandler$cachedchain.dofilter(servlethandler.java:1496) @ org.springframework.boot.actuate.trace.webrequesttracefilter.dofilter(webrequesttracefilter.java:115) @ org.eclipse.jetty.servlet.servlethandler$cachedchain.dofilter(servlethandler.java:1467) @ org.springframework.boot.actuate.autoconfigure.endpointwebmvcautoconfiguration$applicationcontextfilterconfiguration$1.dofilterinternal(endpointwebmvcautoconfiguration.java:137) @ org.springframework.web.filter.onceperrequestfilter.dofilter(onceperrequestfilter.java:108) @ org.eclipse.jetty.servlet.servlethandler$cachedchain.dofilter(servlethandler.java:1467) @ org.springframework.boot.actuate.autoconfigure.metricfilterautoconfiguration$metricsfilter.dofilterinternal(metricfilterautoconfiguration.java:85) @ org.springframework.web.filter.onceperrequestfilter.dofilter(onceperrequestfilter.java:108) @ org.eclipse.jetty.servlet.servlethandler$cachedchain.dofilter(servlethandler.java:1467) @ org.eclipse.jetty.servlet.servlethandler.dohandle(servlethandler.java:499) @ org.eclipse.jetty.server.handler.scopedhandler.handle(scopedhandler.java:137) @ org.eclipse.jetty.security.securityhandler.handle(securityhandler.java:557) @ org.eclipse.jetty.server.session.sessionhandler.dohandle(sessionhandler.java:231) @ org.eclipse.jetty.server.handler.contexthandler.dohandle(contexthandler.java:1086) @ org.eclipse.jetty.servlet.servlethandler.doscope(servlethandler.java:428) @ org.eclipse.jetty.server.session.sessionhandler.doscope(sessionhandler.java:193) @ org.eclipse.jetty.server.handler.contexthandler.doscope(contexthandler.java:1020) @ org.eclipse.jetty.server.handler.scopedhandler.handle(scopedhandler.java:135) @ org.eclipse.jetty.server.handler.handlerwrapper.handle(handlerwrapper.java:116) @ org.eclipse.jetty.server.server.handle(server.java:370) @ org.eclipse.jetty.server.abstracthttpconnection.handlerequest(abstracthttpconnection.java:494) @ org.eclipse.jetty.server.abstracthttpconnection.headercomplete(abstracthttpconnection.java:971) @ org.eclipse.jetty.server.abstracthttpconnection$requesthandler.headercomplete(abstracthttpconnection.java:1033) @ org.eclipse.jetty.http.httpparser.parsenext(httpparser.java:644) @ org.eclipse.jetty.http.httpparser.parseavailable(httpparser.java:235) @ org.eclipse.jetty.server.asynchttpconnection.handle(asynchttpconnection.java:82) @ org.eclipse.jetty.io.nio.selectchannelendpoint.handle(selectchannelendpoint.java:667) @ org.eclipse.jetty.io.nio.selectchannelendpoint$1.run(selectchannelendpoint.java:52) @ org.eclipse.jetty.util.thread.queuedthreadpool.runjob(queuedthreadpool.java:608) @ org.eclipse.jetty.util.thread.queuedthreadpool$3.run(queuedthreadpool.java:543) @ java.lang.thread.run(thread.java:745) 2016-01-25 01:16:40.800 error 58449 --- [tp1746257394-20] o.s.b.actuate.web.basicerrorcontroller : java.lang.nosuchmethoderror: org.springframework.data.repository.query.parser.parttree.islimiting()z
my repository follow:
@enablescan @repository public interface videorepository extends crudrepository<video, long>{ public collection<video> findbyname(string title); public video findbyid(string id); }
my controller:
@controller @requestmapping("/video") public class videocontroller { @autowired videorepository videorepository; @requestmapping(value = "/test",method = requestmethod.get ) public void test() { system.out.println("matched"); collection<video> videos = videorepository.findbyname("test"); system.out.println("got video"); iterator <video> iter = videos.iterator(); while (iter.hasnext()){ system.out.println("video name: "+iter.next().getname()); } } }
entity:
@dynamodbtable(tablename = "videos") public class video { private string id; private string name; private string url; private int duration; public video() { } public video(string name, string url, int duration) { super(); this.name = name; this.url = url; this.duration = duration; } @dynamodbhashkey @dynamodbautogeneratedkey public string getid() { return id; } public void setid(string id) { this.id = id; } @dynamodbattribute public string getname() { return name; } public void setname(string name) { this.name = name; } @dynamodbattribute public string geturl() { return url; } public void seturl(string url) { this.url = url; } @dynamodbattribute public int getduration() { return duration; } public void setduration(int duration) { this.duration = duration; } }
i had tried exposing repository @repositoryrestresource(path ="/video") , returned required json. however, not understand why using controller not work. in advance taking time me out!
spring data not support dynamodb, i.e. spring not provide videorepository
implementation. few different options comes mind:
- from sample code, seems have created dynamodb entities. continue use them, implement own
videorepository
bean. - switch storage backend rds , take advantage of spring cloud aws (e.g. data access jdbc chapter in ref doc).
- one answer this question suggests take closer @ this github project.
Comments
Post a Comment