1.
org.hibernate.id.IdentifierGenerationException: ids for this class must be manually assigned before calling save():
原因:<id>元素配置不正确,<id>元素缺少其子元素<generator></generator>的配置。解决方法:<id>元素映射了相应数据库表的主键字段,对其子元素<generator class="">,其中class的取值可以为increment、identity、sequence、hilo、native......等,一般取其值为native 。
2.
java.lang.IllegalArgumentException: id to load is required for loading
方案:Users user=(Users)this.getHibernateTemplate().get(Users.class, id);如果以用户名为参数不能用此方法
3.
org.springframework.dao.InvalidDataAccessResourceUsageException: could not execute query; nested exception is org.hibernate.exception.SQLGrammarException: could not execute query
方案:sql语句有错误
4.
严重: Error starting static Resources
java.lang.IllegalArgumentException: Document base D:\Program Files\Apache Software Foundation\Tomcat 5.0\webapps\tomcat-docs does not exist or is not a readable directory
严重: Error in resourceStart()
2007-6-6 23:32:25 org.apache.catalina.core.StandardContext start
严重: Error getConfigured
2007-6-6 23:32:25 org.apache.catalina.core.StandardContext start
严重: Context startup failed due to previous errors
2007-6-6 23:32:25 org.apache.catalina.core.StandardContext start
严重: Exception during cleanup after start failed
LifecycleException: Container StandardContext[/tomcat-docs] has not been started
5.jsf+spring+hibernate
严重: Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSource' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Instantiation of bean failed; nested exception is java.lang.NoClassDefFoundError: org/apache/commons/pool/impl/GenericObjectPool
Caused by: java.lang.NoClassDefFoundError: org/apache/commons/pool/impl/GenericObjectPool
严重: Error listenerStart
2007-6-8 10:31:55 org.apache.catalina.core.StandardContext start
严重: Context [/shj01] startup failed due to previous errors
2007-6-8 10:31:55 org.apache.catalina.core.ApplicationContext log
方案:spring-framework-2.0.5\lib\jakarta-commons下的commons-collections.jar commons-dbcp.jar commons-pool.jar加载到工程去
6.
严重: Exception sending context initialized event to listener instance of class com.sun.faces.config.ConfigureListener
javax.faces.FacesException: Can't parse configuration file:jar:file:/E:/工具/apache-tomcat-6.0.9/apache-tomcat-6.0.9/webapps/jsf02/WEB-INF/lib/jsf-impl.jar!/com/sun/faces/standard-html-renderkit.xml
方案:把tomcat的安装文件换了位置就没事了
7.spring MVC+hibernate
严重: StandardWrapper.Throwable
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Invocation of init method failed; nested exception is java.lang.NoSuchMethodError: org.objectweb.asm.ClassVisitor.visit(IILjava/lang/String;Ljava/lang/String;[Ljava/lang/String;Ljava/lang/String;)V
Caused by: java.lang.NoSuchMethodError: org.objectweb.asm.ClassVisitor.visit(IILjava/lang/String;Ljava/lang/String;[Ljava/lang/String;Ljava/lang/String;)V
方案:
在使用Spring的AOP编程时,会用到这几个lib:
asm-2.2.2.jar
asm-commons-2.2.2.jar
asm-util-2.2.2.jar
Hibernate使用如果lib:
asm.jar
asm-attrs.jar
其中asm-2.2.2.jar与asm.jar存在类上的冲突!!!
使用其中之一或两者都使用,可能会出现如下错误:
java.lang.NoClassDefFoundError: org/objectweb/asm/CodeVisitor
java.lang.NoClassDefFoundError: org/objectweb/asm/commons/EmptyVisitor
java.lang.NoSuchMethodError: org.objectweb.asm.ClassVisitor.visit。。。。。。
解决办法是:
1.去掉类路径上的关于Hibernate的3个lib
asm.jar
asm-attrs.jar
cglib-2.1.3.jar
2.加入Spring中的以下4个lib
asm-2.2.2.jar
asm-commons-2.2.2.jar
asm-util-2.2.2.jar
cglib-nodep-2.1_3.jar
8.spring MVC+hibernate
Exception in thread "main" org.springframework.dao.InvalidDataAccessResourceUsageException: Could not execute JDBC batch update; nested exception is org.hibernate.exception.SQLGrammarException: Could not execute JDBC batch update
Caused by: org.hibernate.exception.SQLGrammarException: Could not execute JDBC batch update
9.
org.springframework.beans.factory.CannotLoadBeanClassException: Error loading class [org.springframework.transaction.interceptor.TransactionProxyFactoryBean] for bean with name 'userService' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: problem with class file or dependent class; nested exception is java.lang.NoClassDefFoundError: org/springframework/aop/framework/AbstractSingletonProxyFactoryBean
Caused by: java.lang.NoClassDefFoundError: org/springframework/aop/framework/AbstractSingletonProxyFactoryBean
方案:没加 spring 2.0 aop libraries
10.
org.apache.jasper.JasperException: Unable to compile class for JSP:
方案:jsp网页中的java代码有问题
11.
Exception in thread "main" org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'CompanyController' defined in class path resource [com/company/test/company-config.xml]: Error setting property values; nested exception is org.springframework.beans.NotWritablePropertyException: Invalid property 'methodNameResolver' of bean class [com.company.action.CompanyController]: Bean property 'methodNameResolver' is not writable or has an invalid setter method. Does the parameter type of the setter match the return type of the getter?
Caused by: org.springframework.beans.NotWritablePropertyException: Invalid property 'methodNameResolver' of bean class [com.company.action.CompanyController]: Bean property 'methodNameResolver' is not writable or has an invalid setter method. Does the parameter type of the setter match the return type of the getter?
控制器没继承MultiActionController
12.
Exception in thread "main" org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'turDiffService' defined in class path resource [com/expert/test/expert-config.xml]: Error setting property values; nested exception is org.springframework.beans.NotWritablePropertyException: Invalid property 'turDifficultDao' of bean class [com.expert.operation.impl.TurDiffSerImpl]: Bean property 'turDifficultDao' is not writable or has an invalid setter method. Did you mean 'truDifficultDao'?
Caused by: org.springframework.beans.NotWritablePropertyException: Invalid property 'turDifficultDao' of bean class [com.expert.operation.impl.TurDiffSerImpl]: Bean property 'turDifficultDao' is not writable or has an invalid setter method. Did you mean 'truDifficultDao'?
原因:
在定义时TurDifficultDao turDifficultDao ,把有个字母写错,后发现错误,改过来了,但没把get() set()方法中对应的改过来
13.
Exception in thread "main" org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'urlMapping' defined in class path resource [com/expert/test/expert-config.xml]: Initialization of bean failed; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named '' is defined
Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named '' is defined
原因:
在expert-config.xml中创建
<bean id="urlMapping" class="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping">
<property name="mappings">
<props>
<prop key=""></prop>
</props>
</property>
</bean>
没有给<prop key=""></prop>赋值
14.
org.springframework.orm.hibernate3.HibernateQueryException: Instruction is not mapped
[from Instruction]; nested exception is org.hibernate.hql.ast.QuerySyntaxException:
Instruction is not mapped [from Instruction]
Caused by: org.hibernate.hql.ast.QuerySyntaxException: Instruction is not mapped [from
Instruction]
原因:在data-config.xml中没加入<value>com/serializ/Instruction.hbm.xml</value>
15.
java.sql.SQLException: Field 'userId' doesn't have a default value
原因:把配置文件的主键改为<generator class="assigned" /> 可以进行自定义主键值,因为我在设主键时没有设成自动增长的,要求填默认值是受了配置文件里<generator class="native"/>的影响了。
16.org.apache.jasper.JasperException: Unable to compile class for JSP
原因:jsp页面中的java代码括号不对称!
分享到:
相关推荐
myeclipse整合Struts1.2+Hibernate3.2+Spring2.5的留言板demo,可以参考参考,希望对你能有帮助,其中lib下的jar包对于ssh工程可以直接使用,原文地址: ...
其实一看异常类型根本就不是自己书写的代码出了问题,而是MyEclipse所提供的jar包有问题,很容易出现jar包冲突问题,本SSH整合jar包是经过 eclipse3.2 + myeclipse5.5 + Struts1.2 + Hibernate3.1 + Spring2.0测试通过...
### MyEclipse整合SSH框架实例详解 #### 一、引言 随着企业级应用的不断发展,集成多种技术栈成为一种趋势。本篇文章将详细介绍如何在MyEclipse开发环境中整合Struts、Spring和Hibernate(简称SSH)这三个流行的...
这篇教程主要介绍的是如何在MyEclipse 6.5环境下整合Struts 1.2、Spring 2.5和Hibernate 3.2这三个流行的Java Web开发框架,以便于初学者理解SSH框架的工作机制并避免常见错误。 首先,教程强调了在高版本的...
一个自己写的使用myeclipse6.5整合struts1.2+spring2.5+hibernate3.2的实例,没有包含库文件,太大了csdn不让上传;还有一篇pdf的文档,希望大家喜欢,我的blog上有这篇文章,地址:http://blog.csdn.net/hua_wei
通过快捷键`Ctrl+N`,选择`MyEclipse/Web-Struts/Struts 1.2 Forward`,创建名为`indexForward`的类,设置其“Name”为“indexForward”,“Path”为“/index.jsp”。 在`LoginAction`类中,我们需要重写`execute`...
3. 创建ActionForm:使用快捷键[Ctrl+N],选择MyEclipse/Web-Struts/Struts 1.2 Form,创建名为LoginForm的类。在"Use case"中输入"Login",并为类添加属性username和password,类型为字符串。 4. 创建Action:同样...
【MyEclipse整合SSH详解】 SSH(Struts + Spring + Hibernate)是Java Web开发中常见的三大框架集成,用于构建高效、可维护性高的企业级应用。MyEclipse作为一款强大的集成开发环境,提供了便捷的SSH整合支持。以下...
【基于MyEclipse6.5的SSH整合】 SSH(Struts、Spring、Hibernate)是Java Web开发中的三大框架,它们的整合能够实现MVC模式,提高应用的可维护性和可扩展性。以下是对基于MyEclipse6.5的SSH整合过程的详细说明: 1...
### MyEclipse 整合SSH(Struts+Spring+Hibernate)步骤详解 #### 一、引言 在软件开发领域,尤其是Java Web开发中,整合Struts、Spring和Hibernate(简称SSH)是一种非常常见的做法。这三种技术分别解决了Web应用...
### Java SSH框架整合搭建Web系统(Struts1.2+Spring2.5+Hibernate3.2) #### 一、准备工作 在开始构建基于Struts1.2+Spring2.5+Hibernate3.2的Web应用之前,需要进行一系列的基础设置工作。 **1.1 创建工程** ...
该示例使用MyEclipse 5.5 IDE用来整合四个技术(Struts 1.2, Spring 2.0, Hibernate 3.2和Ajax技术)的轻量级的JavaEE。 操作步骤如下: 1. 下载并解压之后,使用MyEclipse导入工程 2. 找到demo目录中的.sql数据库...
在MyEclipse环境中,导入此项目后,可以快速启动和运行,体验SSH整合的工作流程。这包括了Web应用的部署、数据库的连接、Action的调用、Service的执行以及Hibernate对数据库的操作等环节。这对于初学者来说,是一个...
【基于MyEclipse的SSH整合】是指在MyEclipse集成开发环境中整合Struts、Spring和Hibernate三个开源框架的过程。这个过程通常是为了构建一个强大的、基于Java的企业级Web应用程序。 1. **Struts 1.2 框架支持**: -...
根据提供的标题、描述、标签及部分内容,我们可以了解到这篇文章主要讲述的是如何在MyEclipse 5.5.1环境中配置SSH框架(Struts + Spring + Hibernate)以及与Tomcat 5.5集成的过程。接下来,我们将深入探讨这些内容...
本文档将详细介绍如何在 MyEclipse 6.5 中实现 SSH 框架的整合。 #### 二、实验环境 1. **MyEclipse 6.5**:一款功能强大的 Java 集成开发环境(IDE),适合于企业级应用的开发。 2. **Tomcat 5.5.26**:用于部署和...
接着,为了添加Struts支持,我们在项目上右击并选择MyEclipse -> AddStruts Capabilities…,选定Struts1.2,并调整Base package for new classes为org.wuliu.ssh.struts。 接下来,我们为项目添加Spring支持。同样...