常见IO问题

xiaoxiao2023-01-25  104

IOException parsing XML document from ServletContext resource [/WEB-INF/applicationContext-db.xml]; 错误原因:applicationContext-db.xml名称和实际名称不相符 java.lang.ClassNotFoundException: org.apache.commons.dbcp.BasicDataSource 错误原因:缺少jar包 org.xml.sax.SAXParseException: XML document structures must start and end within the same entity. 错误原因:<beans>......<beans>应为<beans>......</beans> org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'AbstractMultiactionController' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could n ot instantiate bean class [web.user.AbstractMultiactionController]: Is it an abstract class?; nested exception is java.lang.InstantiationException 错误原因web.user.AbstractMultiactionController是抽象类不能在xml中定义 org.hibernate.HibernateException: Dialect class not found: net.sf.hibernate.dialect.MySQLDialect 错误原因:由于使用的是hibernate3所以应该为org.hibernate.dialect.MySQLDialect org.hibernate.MappingException: could not instantiate id generator 错误原因:hbm的id声成错误(hibernate3不支持String作id) getUserdao.save出错 应改为:getUserdao().save Invalid property 'userDao' of bean class [web.user.UserController]: Bean property 'userDao' is not writable or has an invalid setter method: Does the parameter type of the setter match the return type of the getter 错误原因:在抽象类中 换成 public void setUserDao(UserDao userDao) { this.userDao = userDao; } 就可以了 org.springframework.orm.hibernate3.HibernateSystemException: Unknown entity: 错误原因:hbm.xml文件配置出错 InitializingBean接口的afterPropertiesSet()在初始化的时候自动调用要注意 在使用load的时候出现 org.hibernate.LazyInitializationException: could not initialize proxy - the owning Session was closed 错误原因load在,应该是你查询的时候调用了load方法(也可能是内部自己调用的),因为load在session关闭后,代理对象也就取不到值了 问题:hibernate3默认的lazy为true,使用代理模式proxy属性允许延迟加载类的持久化实例。调用session.load()方法,Hibernate开始会返回CGLIB代理,除主键外的其他值均为null。当代理的某个方法被实际调用的时候,真实的持久化对象才会被装载,但必须在同一个session中。如session.close()前一直未调用方法,close()后再调用,报上述错误。 解决 a.hbm.xml中 class项,加上lazy=false org.hibernate.QueryException: could not resolve property: name of hbm和pojo没有进行匹配 Can't find bundle for base name views, locale zh_CN 貌似你用了国际化语言设置,但是没有提供xxx_zh_CN.properties文件 java.net.ConnectException: Connection refused: connect 数据库没开 防火墙阻止 数据库连接语句有问题 java.lang.NoClassDefFoundError: antlr/ANTLRException] 缺少antlr-2.7.5H3.jar 如果以后出现tomcat 严重: Error filterStart 错误,一般原因为:1、xml配置失误(如我) 2、filter中某段代码为实例化(这个情况是出现最多的,要仔细检查) 3、试着把tomat/server/lib目录下的commons-digester.jar,commons-beanutils.jar拷贝到 common/lib/目录,有些包在部署是没有被包含 Unsupported major.minor version 49.0j jdk版本不支持 如果以后出现tomcat 严重: Error filterStart 错误,一般原因为:1、xml配置失误(如我) 2、filter中某段代码为实例化(这个情况是出现最多的,要仔细检查) 3、试着把tomat/server/lib目录下的commons-digester.jar,commons-beanutils.jar拷贝到 common/lib/目录,有些包在部署是没有被包含 Unsupported major.minor version 49.0j jdk版本不支持 java.net.ConnectException: Connection refused: connect 数据库没开 防火墙阻止 数据库连接语句有问题 java.lang.NoClassDefFoundError: antlr/ANTLRException] 缺少antlr-2.7.5H3.jar 如果以后出现tomcat 严重: Error filterStart 错误,一般原因为:1、xml配置失误(如我) 2、filter中某段代码为实例化(这个情况是出现最多的,要仔细检查) 3、试着把tomat/server/lib目录下的commons-digester.jar,commons-beanutils.jar拷贝到 common/lib/目录,有些包在部署是没有被包含 Unsupported major.minor version 49.0j jdk版本不支持 Wrapper cannot find servlet class 在xfire出现的时候此错误的时候查看META-INF下的xfire文件加下是否有有services.xml
转载请注明原文地址: https://www.6miu.com/read-4980732.html

最新回复(0)