• Spring、Hibernate和Struts的整合调试(2)


    一、整合Spring、Struts和Hibernate用到的jar包:

    二、遇到的问题 

    1.nested exception is java.net.ConnectException: Connection timed out: -------------------------

     jdbc:mysql://localhost:3306/ssh?characterEncoding=utf8&serverTimezone=Asia/Shanghai&useSSL=false

    2.  he project was not built since its build path is incomplete.
    Cannot find the class file for org.springframework.dao.support.DaoSupport. Fix the build path then try building this project。 --------------------------------

    加入spring-tx.jar包

    3. java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderListener
    加入spring-web.jar包  --------------------------------------------------------------------------------------------

    加入spring-webmvc.jar包

    4. java.lang.NoClassDefFoundError: org/springframework/jdbc/support/lob/LobHandler
    加入spring_jdbc.jar

    5. Caused by: java.lang.ClassNotFoundException: org.springframework.orm.hibernate3.HiberanteTransactionManager::::
    HiberanteTransactionManager中的hibernate拼写错误

    (类找不到的时候,一定要先检查类的全路径名是否正确!!!)

    6. java.lang.ClassNotFoundException: org.aopalliance.intercept.MethodInterceptor::::::
    增加aopalliance.jar包 

     7. java.lang.ClassNotFoundException: org.springframework.ao.framework.autoproxy.BeanNameAutoProxyCreator:::::::
    拼写错误,改为 org.springframework.aop.framework.autoproxy.BeanNameAutoProxyCreator
    增加spring-aop.jar包

    (类找不到的时候,一定要先检查类的全路径名是否正确!!!)

    8. org.springframework.dao.InvalidDataAccessApiUsageException: 
    Write operations are not allowed in read-only mode (FlushMode.NEVER/MANUAL): 
    Turn your Session into FlushMode.COMMIT/AUTO or remove 'readOnly' marker from transaction definition.

    9. Caused by: org.hibernate.MappingException: Repeated column in mapping for entity: amigo.sshmemo.dao.Memo column: memoId 
    (should be mapped with insert="false" update="false"):::

    Memo.hbm.xml文件中 

    三、Spring的配置文件applicationContext.xml如下:



        
       
         
             
            jdbc:mysql://localhost:3306/ssh?characterEncoding=utf8&serverTimezone=Asia/Shanghai&useSSL=false" />  
             
             
             
             
             
             
       
     
      
         
             
             
                                 
                    amigo/ssh/dao/User.hbm.xml  
               
     
           
     
           
                
                    org.hibernate.dialect.MySQLDialect
                    true
                    20
                

            

       
     
        
         
            
        
     
        
        
       
        
            
            
                
                    PROPAGATION_REQUIRED
                    PROPAGATION_REQUIRED
                    PROPAGATION_REQUIRED
                    PROPAGATION_REQUIRED
                

            

        

        
        
        
            
                
                
                    userManager
                

            

            
                
                    transactionInterceptor
                

            

        

        
        
            
                
            

        

        
        
            
                
            

        
     
        
        
            
                
            

        

        

     

  • 相关阅读:
    节流防抖最简单的实现
    实例分割算法综述
    Kali在线安装包一些小问题
    Navicat 强大的数据模型功能 | 面向数据库设计、架构和数据资产梳理等使用场景
    东南亚电商指南,卖家如何布局东南亚市场?
    Docker Compose使用教程
    AI引擎助力,CamScanner智能高清滤镜开启扫描新纪元!
    Redis 核心面试题归纳
    JS:原型-原型链-ES5继承
    BGP联邦综合实验
  • 原文地址:https://blog.csdn.net/cleble/article/details/126750982