Announcement Announcement Module
Collapse
No announcement yet.
Problem to initialize project with STS, MAVEN, Spring 3.0, Apache Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Problem to initialize project with STS, MAVEN, Spring 3.0, Apache

    Hello everybody,
    I'm new in this forum, and new in spring too, realy i hope your help; this is my log, and i cant run mi application, sometimes i resolve this restarting my machine and cleaning the project or deleting the contain of de directory \.metadata\.plugins\org.eclipse.wst.server.core\tm p1\wtpwebapps but now doesn't work.

    I have the same project en two machines , and in one of them the project run fine but, i dont know why

    Thanks for you help

    [ERROR] [main 12:46:47] (ContextLoader.java:initWebApplicationContext:307) Context initialization failed
    org.springframework.beans.factory.BeanCreationExce ption: Error creating bean with name 'accesoController': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationExce ption: Could not autowire field: private org.erppyme.service.CustomUserDetailsService org.erppyme.controller.AccesoController.customUser DetailsService; nested exception is org.springframework.beans.factory.BeanCreationExce ption: Error creating bean with name 'customUserDetailsService': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationExce ption: Could not autowire field: private org.erppyme.repository.UsuarioRepository org.erppyme.service.CustomUserDetailsService.usuar ioRepository; nested exception is org.springframework.beans.factory.UnsatisfiedDepen dencyException: Error creating bean with name 'usuarioRepositoryImpl' defined in file [G:\SPRING\Proyectos\.metadata\.plugins\org.eclipse .wst.server.core\tmp1\wtpwebapps\erppyme\WEB-INF\classes\org\erppyme\repository\UsuarioReposito ryImpl.class]: Unsatisfied dependency expressed through constructor argument with index 0 of type [org.hibernate.SessionFactory]: : Error creating bean with name 'sessionFactory' defined in class path resource [org/erppyme/application-config.xml]: Invocation of init method failed; nested exception is java.lang.NoSuchMethodError: org.springframework.jdbc.datasource.DataSourceUtil s.doCloseConnection(Ljava/sql/Connection;Ljavax/sql/DataSourceV; nested exception is org.springframework.beans.factory.BeanCreationExce ption: Error creating bean with name 'sessionFactory' defined in class path resource [org/erppyme/application-config.xml]: Invocation of init method failed; nested exception is java.lang.NoSuchMethodError: org.springframework.jdbc.datasource.DataSourceUtil s.doCloseConnection(Ljava/sql/Connection;Ljavax/sql/DataSourceV
    at org.springframework.beans.factory.annotation.Autow iredAnnotationBeanPostProcessor.postProcessPropert yValues(AutowiredAnnotationBeanPostProcessor.java: 287)
    at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.populateBean(AbstractAu towireCapableBeanFactory.java:1106)
    at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.doCreateBean(AbstractAu towireCapableBeanFactory.java:517)
    at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.createBean(AbstractAuto wireCapableBeanFactory.java:456)
    at org.springframework.beans.factory.support.Abstract BeanFactory$1.getObject(AbstractBeanFactory.java:2 94)
    at org.springframework.beans.factory.support.DefaultS ingletonBeanRegistry.getSingleton(DefaultSingleton BeanRegistry.java:225)
    at org.springframework.beans.factory.support.Abstract BeanFactory.doGetBean(AbstractBeanFactory.java:291 )
    at org.springframework.beans.factory.support.Abstract BeanFactory.getBean(AbstractBeanFactory.java:193)
    at org.springframework.beans.factory.support.DefaultL istableBeanFactory.preInstantiateSingletons(Defaul tListableBeanFactory.java:585)
    at org.springframework.context.support.AbstractApplic ationContext.finishBeanFactoryInitialization(Abstr actApplicationContext.java:913)
    at org.springframework.context.support.AbstractApplic ationContext.refresh(AbstractApplicationContext.ja va:464)
    at org.springframework.web.context.ContextLoader.conf igureAndRefreshWebApplicationContext(ContextLoader .java:384)
    at org.springframework.web.context.ContextLoader.init WebApplicationContext(ContextLoader.java:283)
    at org.springframework.web.context.ContextLoaderListe ner.contextInitialized(ContextLoaderListener.java: 111)
    at org.apache.catalina.core.StandardContext.listenerS tart(StandardContext.java:4135)
    at org.apache.catalina.core.StandardContext.start(Sta ndardContext.java:4630)
    at org.apache.catalina.core.ContainerBase.start(Conta inerBase.java:1045)
    at org.apache.catalina.core.StandardHost.start(Standa rdHost.java:785)
    at org.apache.catalina.core.ContainerBase.start(Conta inerBase.java:1045)
    at org.apache.catalina.core.StandardEngine.start(Stan dardEngine.java:445)
    at org.apache.catalina.core.StandardService.start(Sta ndardService.java:519)
    at org.apache.catalina.core.StandardServer.start(Stan dardServer.java:710)
    at org.apache.catalina.startup.Catalina.start(Catalin a.java:581)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Nativ e Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Native MethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(De legatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at org.apache.catalina.startup.Bootstrap.start(Bootst rap.java:289)
    at org.apache.catalina.startup.Bootstrap.main(Bootstr ap.java:414)
    Caused by: org.springframework.beans.factory.BeanCreationExce ption: Could not autowire field: private org.erppyme.service.CustomUserDetailsService org.erppyme.controller.AccesoController.customUser DetailsService; nested exception is org.springframework.beans.factory.BeanCreationExce ption: Error creating bean with name 'customUserDetailsService': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationExce ption: Could not autowire field: private org.erppyme.repository.UsuarioRepository org.erppyme.service.CustomUserDetailsService.usuar ioRepository; nested exception is org.springframework.beans.factory.UnsatisfiedDepen dencyException: Error creating bean with name 'usuarioRepositoryImpl' defined in file [G:\SPRING\Proyectos\.metadata\.plugins\org.eclipse .wst.server.core\tmp1\wtpwebapps\erppyme\WEB-INF\classes\org\erppyme\repository\UsuarioReposito ryImpl.class]: Unsatisfied dependency expressed through constructor argument with index 0 of type [org.hibernate.SessionFactory]: : Error creating bean with name 'sessionFactory' defined in class path resource [org/erppyme/application-config.xml]: Invocation of init method failed; nested exception is java.lang.NoSuchMethodError: org.springframework.jdbc.datasource.DataSourceUtil s.doCloseConnection(Ljava/sql/Connection;Ljavax/sql/DataSourceV; nested exception is org.springframework.beans.factory.BeanCreationExce ption: Error creating bean with name 'sessionFactory' defined in class path resource [org/erppyme/application-config.xml]: Invocation of init method failed; nested exception is java.lang.NoSuchMethodError: org.springframework.jdbc.datasource.DataSourceUtil s.doCloseConnection(Ljava/sql/Connection;Ljavax/sql/DataSourceV
    at org.springframework.beans.factory.annotation.Autow iredAnnotationBeanPostProcessor$AutowiredFieldElem ent.inject(AutowiredAnnotationBeanPostProcessor.ja va:506)
    at org.springframework.beans.factory.annotation.Injec tionMetadata.inject(InjectionMetadata.java:87)
    at org.springframework.beans.factory.annotation.Autow iredAnnotationBeanPostProcessor.postProcessPropert yValues(AutowiredAnnotationBeanPostProcessor.java: 284)
    ... 28 more

  • #2
    Hello, after two day searching mi problem, finally i can resolve
    i see this lines at the end in the console

    Caused by: java.lang.NoSuchMethodError: org.springframework.jdbc.datasource.DataSourceUtil s.doCloseConnection(Ljava/sql/Connection;Ljavax/sql/DataSourceV

    at org.springframework.orm.hibernate3.LocalDataSource ConnectionProvider.closeConnection(LocalDataSource ConnectionProvider.java:97)

    with this, i see if in my jar exist the org.springframework.jdbc.datasource.DataSourceUtil s.doCloseConnection in spring-jdbc-3.1.0.REALEASE.jar, and was true the method doCloseConnection dosen't exist.

    after that i see in spring-orm-3.3.0.SPR-99999-SNAPSHOT-sources.jar, and its method closeConnection do a call to doCloseConnection; after that see that spring-orm depends of spring-data-jpa.jar.

    THE SOLUTION: change in my pom.xml el spring-data-jpa-1.1.0.BUILT-SNAPSHOT.jar to spring-data-jpa-1.0.0.RELEASE

    Thanks for the help

    Comment

    Working...
    X