Setting up a Spring JPA project for use in an MVC project - Error creating bean

后端 未结 4 459
感情败类
感情败类 2021-01-04 16:11

I developed a Spring JPA project in eclipse which has access to the data stored in a mysql server. Now I need to import this project in a Spring @ MVC project. So:

4条回答
  •  刺人心
    刺人心 (楼主)
    2021-01-04 17:05

    In my case the conflict was caused by spring security, which was still using older versions. I put some excludes on it, and now it is ok. It may also be a good thing to put this stuff in the dependencyManagement so you don't have to repeat in every module.

    I am using the following:

    
        
            
                org.springframework
                spring-context-support
                ${spring.framework.version}
            
    
            
                org.springframework
                spring-orm
                ${spring.framework.version}
            
    
            
                org.springframework
                spring-web
                ${spring.framework.version}
            
    
            
                org.springframework.security
                spring-security-core
                ${spring.security.framework.version}
    
                
                    
                        org.springframework
                        spring-aop
                    
    
                    
                        org.springframework
                        spring-expression
                    
                
            
    
            
                org.springframework.security
                spring-security-config
                ${spring.security.framework.version}
    
                
                    
                        org.springframework
                        spring-aop
                    
                
            
    
            
                org.springframework.security
                spring-security-web
                ${spring.security.framework.version}
                
                    
                         org.springframework
                        spring-tx
                    
    
                    
                        org.springframework
                        spring-jdbc
                    
    
                    
                        org.springframework
                        spring-aop
                    
    
                    
                        org.springframework
                        spring-expression
                    
                
            
    
    
            
                org.hibernate.javax.persistence
                hibernate-jpa-2.0-api
                1.0.1.Final
            
    
            
                org.hibernate
                hibernate-entitymanager
                4.0.1.Final
            
        
    
    

    without the exclusions I had the same error as described in the beginning of this thread. The versions i was using for spring were:

    
        3.1.1.RELEASE
        3.1.0.RELEASE
    
    

提交回复
热议问题