File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Spring and the fly likes java.lang.NoSuchMethodError Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Frameworks » Spring
Bookmark "java.lang.NoSuchMethodError" Watch "java.lang.NoSuchMethodError" New topic
Author

java.lang.NoSuchMethodError

giuseppe D'Amico
Greenhorn

Joined: Oct 04, 2011
Posts: 5

Hi I am new to Spring, in my application I need to use jdbctemplate to connect to Mysql:
this is my pom.xml:



my web.xml:


my root-context.xml


when I run it I get this error:
HTTP Status 500 - Handler processing failed; nested exception is java.lang.NoSuchMethodError: org.springframework.beans.factory.ListableBeanFactory.getBeanDefinitionNames(Ljava/lang/Class;)[Ljava/lang/String;

type Exception report

message Handler processing failed; nested exception is java.lang.NoSuchMethodError: org.springframework.beans.factory.ListableBeanFactory.getBeanDefinitionNames(Ljava/lang/Class;)[Ljava/lang/String;

description The server encountered an internal error that prevented it from fulfilling this request.

exception

org.springframework.web.util.NestedServletException: Handler processing failed; nested exception is java.lang.NoSuchMethodError: org.springframework.beans.factory.ListableBeanFactory.getBeanDefinitionNames(Ljava/lang/Class;)[Ljava/lang/String;
org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:972)
org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:852)
org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:882)
org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:778)
javax.servlet.http.HttpServlet.service(HttpServlet.java:621)
javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
root cause

java.lang.NoSuchMethodError: org.springframework.beans.factory.ListableBeanFactory.getBeanDefinitionNames(Ljava/lang/Class;)[Ljava/lang/String;
org.springframework.jdbc.support.SQLErrorCodesFactory.<init>(SQLErrorCodesFactory.java:96)
org.springframework.jdbc.support.SQLErrorCodesFactory.<clinit>(SQLErrorCodesFactory.java:62)
org.springframework.jdbc.support.SQLErrorCodeSQLExceptionTranslator.setDataSource(SQLErrorCodeSQLExceptionTranslator.java:89)
org.springframework.jdbc.support.SQLErrorCodeSQLExceptionTranslator.<init>(SQLErrorCodeSQLExceptionTranslator.java:78)
org.springframework.jdbc.support.JdbcAccessor.getExceptionTranslator(JdbcAccessor.java:58)
org.springframework.jdbc.support.JdbcAccessor.afterPropertiesSet(JdbcAccessor.java:71)
org.springframework.jdbc.core.JdbcTemplate.<init>(JdbcTemplate.java:115)
com.metmi.mmasgis.dao.DbImpl.getDatabases(DbImpl.java:27)
com.metmi.mmasgis.HomeController.dbs(HomeController.java:61)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
java.lang.reflect.Method.invoke(Method.java:606)
org.springframework.web.method.support.InvocableHandlerMethod.invoke(InvocableHandlerMethod.java:213)
org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:126)
org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:96)
org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:617)
org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:578)
org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:80)
org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:923)
org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:852)
org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:882)
org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:778)
javax.servlet.http.HttpServlet.service(HttpServlet.java:621)
javax.servlet.http.HttpServlet.service(HttpServlet.java:728)


My controller:

my DAO's implementation:


I do nort understand this error,maybe some conflicting jar, I need to be put in the right direction.
Bill Gorder
Bartender

Joined: Mar 07, 2010
Posts: 1648
    
    7

Looks like you may have multiple versions of spring-beans on the class path, or at least an older version of spring-beans. Make sure in your dependency graph the spring versions all match up. Do a mvn dependency:tree and find all of the Spring dependencies. See if something is pulling in an old version.


[How To Ask Questions][Read before you PM me]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: java.lang.NoSuchMethodError
 
Similar Threads
Error creating bean 'org.spring....PersistenceExceptionTranslationPostProcessor#0'
Richfaces + Spring + Maven Setup help
Error creating bean 'org.springframework.dao.annotation.PersistenceExceptionTranslationPostProcesso
whats wrong with my spring 3.x + hibernate 4.x + maven configuration
Could not resolve dependencies for maven project