《上机错误汇总.doc》由会员分享,可在线阅读,更多相关《上机错误汇总.doc(7页珍藏版)》请在taowenge.com淘文阁网|工程机械CAD图纸|机械工程制图|CAD装配图下载|SolidWorks_CaTia_CAD_UG_PROE_设计图分享下载上搜索。
1、1. sqlserver 2000 如何修改sa登陆密码?操作步骤如下: 1)打开企业管理器,依次展开服务器组,然后展开服务器。 2)打开“安全性”文件夹,单击“登录”,然后用右键单击“Sa”,执行“属性”命令。 3)弹出“SQL Server登录属性”对话框,在“SQL Server身份验证”密码栏,输入最新密码。 4)单击“确定”按钮,弹出“确认密码”对话框,再输一遍登录密码。 5)单击“确定”按钮,完成对Sa登录密码的修改。2. 修改配置文件需要将项目redeploy3. 重新发布工程,出现The web application /login registered the JDBC dr
2、iver com.microsoft.jdbc.sqlserver.SQLServerDriver but failed to unregister it when the web application was stopped. To prevent a memory leak, the JDBC Driver has been forcibly unregistered原因:tomcat版本问题,换个低版本的。4. The requested resource (/s2sh/find) is not available,即找不到对应的action原因:将修改为,必须加后缀,而且是在form
3、中加,而不要跑到struts.xml中加。另外还与可能时间的问题,等一会访问。5. java.sql.SQLException: MicrosoftSQLServer 2000 Driver for JDBCError establishing socket.原因:SQL SERVER服务器没开启6. javax.servlet.ServletException: org.springframework.orm.hibernate3.HibernateQueryException: Student is not mapped. from Student as s where s.number=
4、?; nested exception is org.hibernate.hql.ast.QuerySyntaxException: Student is not mapped. 原因:hql语句写错了,实体类时Students而不是Student7. javax.servlet.ServletException: org.springframework.orm.hibernate3.HibernateQueryException: could not resolve property: number of: com.school.domain.Students from com.school
5、.domain.Students as s where s.number=?; nested exception is org.hibernate.QueryException: could not resolve property: number of: com.school.domain.Students from com.school.domain.Students as s where s.number=?org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:515)org.apache.strut
6、s2.dispatcher.FilterDispatcher.doFilter(FilterDispatcher.java:419)原因:number是属性,这里将属性写错了,在Students实体类中属性被定义为snumber。8. javax.servlet.ServletException: org.apache.jasper.JasperException: An exception occurred processing JSP page /results.jsp at line 25 failed to lazily initialize a collection of role:
7、 com.school.domain.Students.scoreses, no session or session was closed原因:一对多关联出问题了,将lazy=”true改成lazy=”false,除此之外,在set那个地方也必须设置lazy=”false”9. 严重: Servlet.service() for servlet default threw exceptionjava.lang.NullPointerExceptionava.lang.NullPointerExceptionorg.hibernate.tuple.AbstractEntityTuplizer.
8、createProxy(AbstractEntityTuplizer.java:372)原因:也是表关联出现问题,将关联的几个表都改为lazy=”false10. ./Student.hbm.xml这里的./代表什么含义?表示哪个目录?11. 严重: Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListenerorg.springframework.beans.factory.BeanCreationE
9、xception: 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/GenericObjectPoolCaused by: java.lang.NoClassDefFoundError: org/apache
10、/commons/pool/impl/GenericObjectPool原因:没导入commons-pool-1.3的jar包12. 严重: Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListenerorg.springframework.beans.factory.BeanCreationException: Error creating bean with name sessionFactory
11、defined in ServletContext resource /WEB-INF/applicationContext.xml: Invocation of init method failed; nested exception is org.hibernate.MappingException: entity class not found: StudentCaused by: org.hibernate.MappingException: entity class not found: Student原因:生成的Student.hbm.xml中改成13. 严重: Exception
12、 sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListenerorg.springframework.beans.factory.BeanCreationException: Error creating bean with name sessionFactory defined in ServletContext resource /WEB-INF/applicationContext.xml: Invocation o
13、f init method failed; nested exception is org.hibernate.MappingException: Association references unmapped class: ScoreCaused by: org.hibernate.MappingException: Association references unmapped class: Score原因:除了修改13问题位置的类路径外,many-to-one这样地方路径也需要改变。14. Exception starting filter Struts2FilterAction cla
14、ss queryScoreAciton not found - action - file:/C:/Program%20Files/Apache%20Software%20Foundation/Tomcat%206.0/webapps/s2sh/WEB-INF/classes/struts.xml:11:60原因:queryScoreAciton应该写成queryScoreAction;或者struts2倒错jar包了,要用spring+struts包。15. 严重: Servlet.service() for servlet default threw exceptionjava.lang.
15、ClassCastException: com.s2sh.domain.Studentat org.hibernate.type.StringType.toString(StringType.java:44)原因:不是配置文件错了,而是编写的代码有错误。public List findStudentBySnumber(Student student)return studentDAO.findBySnumber(student.getSnumber();public List findBySnumber(Object snumber) /snumber希望得到的是学号字符串,而真正传给它的是s
16、tudent对象。return findByProperty(SNUMBER, snumber); public List findByProperty(String propertyName, Object value) log.debug(finding Student instance with property: + propertyName + , value: + value); try String queryString = from Student as model where model. + propertyName + = ?; return getHibernateT
17、emplate().find(queryString, value); catch (RuntimeException re) log.error(find by property name failed, re); throw re; 16. Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListenerorg.springframework.beans.factory.BeanCreationExce
18、ption: Error creating bean with name studentService defined in ServletContext resource /WEB-INF/applicationContext.xml: Invocation of init method failed; nested exception is java.lang.IllegalArgumentException: sessionFactory or hibernateTemplate is requiredCaused by: java.lang.IllegalArgumentExcepti
19、on: sessionFactory or hibernateTemplate is required原因:public class StudentServiceImpl extends HibernateDaoSupport implements StudentServiceStudentServiceImpl不能继承HibernateDaoSupport,应该改为public class StudentServiceImpl implements StudentService17. 严重: Exception sending context initialized event to lis
20、tener instance of class org.springframework.web.context.ContextLoaderListenerorg.springframework.beans.factory.BeanCreationException: Error creating bean with name sessionFactory defined in ServletContext resource /WEB-INF/applicationContext.xml: Instantiation of bean failed; nested exception is org
21、.springframework.beans.BeanInstantiationException: Could not instantiate bean class org.springframework.orm.hibernate3.LocalSessionFactoryBean: Constructor threw exception; nested exception is java.lang.NoClassDefFoundError: org.hibernate.cfg.ConfigurationCaused by: org.springframework.beans.BeanIns
22、tantiationException: Could not instantiate bean class org.springframework.orm.hibernate3.LocalSessionFactoryBean: Constructor threw exception; nested exception is java.lang.NoClassDefFoundError: org.hibernate.cfg.ConfigurationCaused by: java.lang.NoClassDefFoundError: org.hibernate.cfg.Configuration
23、方法1:web服务器重启18. Illegal modifier for parameter url; only final is permitted原因:在方法中使用了修饰符public、protected、private19. Cannot make a static reference to the non-static field url原因:静态方法只能调用静态成员20. Syntax error, insert Finally to complete TryStatementjava.lang.ClassNotFoundException: com.microsoft.jdbc.s
24、qlserver.SQLServerDriver原因:缺少SQLSERVER2000的三个驱动包,把包加入工程后还需要deploy一下。21. java.sql.SQLException: MicrosoftSQLServer 2000 Driver for JDBCInvalid parameter binding(s).原因:PreparedStatement ps=conn.prepareStatement(sql); ps.setString(0,username);sql语句中第一个问号用1表示而不是022. 严重: Servlet.service() for servlet Log
25、inServlet threw exceptionjava.lang.IndexOutOfBoundsException: Index: 0, Size: 0将if(list!=null)queryUser=(User)list.get(0);改为:if(list!=null&list.size()0)queryUser=(User)list.get(0);list没数据时,用list.get(0)取数就会出现上述错误。23. java.sql.SQLException: MicrosoftSQLServer 2000 Driver for JDBCSQLServer在关键字 user 附近有
26、语法错误。原因:表名user可能和数据库关键字冲突,将表名user换成users。24. java.sql.SQLException: No suitable driver原因:数据库连接出问题了。String url=jdbc:mircrosoft:sqlserver:/localhost;databaseName=login;连接字符串中mircrosoft多了个r。25. 的问题Cannot find the tag library descriptor for /struts-tags原因:是在/struts-tags的/后面加个空格再删除空格后没有问题的,可能是输入法的问题。26.
27、严重: Exception starting filter Struts2Filterjava.lang.NoClassDefFoundError: org/apache/commons/logging/LogFactoryat org.apache.struts2.dispatcher.FilterDispatcher.(FilterDispatcher.java:149)原因:类包加载错了,我加载的是和Spring结合的struts类包,应该换成单独运行框架的类包。在Action中必须定义相应的属性来接受form传来的数据,如果不定义的话,action出来不了,另外在跳转其他页面的时候数据
28、也会丢失。27. 警告: No configuration found for the specified action: testInterceptor.action in namespace: /struts2. Form action defaulting to action attributes literal value.原因:经过测试发现,是没有正确使用tag的原因,这种情况下,正确的写法应该是, 。注意, 不能写成 这样仍然有对应的警告信息,并且提交后出现无法访问的结果。因为没有ShowMessage.action这样一个action,这个.action不能由我们手工添加,Str
29、uts2会自动为你完成这个工作,并且手工添加是不行的,就不必多此一举了。但是在其他的场合,比如使用超级链结,则可以加上这个.action。 结合Spring时要加.action,单独不用加。28. result defined for action com.struts2.action.TestValidate and result input - action - file:/C:/Program%20Files/Apache%20Software%20Foundation/Tomcat%206.0/webapps/struts2/WEB-INF/classes/struts.xml:18:
30、71原因:加一个*.jsp29. org.hibernate.hql.ast.QuerySyntaxException: homeNews is not mapped. from homeNews as h原因:homeNews应该为对象名,而不是数据库表名30. org.hibernate.PropertyNotFoundException: Could not find a getter for Tpassport in class com.relation.daomain.User原因:配置文件中:实体类中: private Passport TPassport;大小写不统一。31. E
31、xception in thread main org.hibernate.HibernateException: No CurrentSessionContext configured!原因:将Session session=sessionFactory.getCurrentSession()该为Session session=sessionFactory.openSession()Caused by: java.sql.SQLException: MicrosoftSQLServer 2000 Driver for JDBCSQLServerDELETE 语句与 COLUMN REFERE
32、NCE 约束 FK_T_Passport_T_User 冲突。该冲突发生于数据库 onetoone,表 T_Passport, column id。原因:主表删除记录后,该记录的主键从表的外键,所有从表外键的值在主表找不到了。32. org.hibernate.HibernateException: identifier of an instance of com.relation.daomain.User was altered from 2 to 1原因:ID值是不能修改的33. org.hibernate.TransientObjectException: com.relation1n.
33、domain.UniCustomerat org.hibernate.engine.ForeignKeys.getEntityIdentifierIfNotUnsaved(ForeignKeys.java:216)原因:主表没有从表依赖的主键记录。34. log4j:WARN No appenders could be found for logger (org.hibernate.cfg.Environment).log4j:WARN Please initialize the log4j system properly.原因:没有将log4j.properties放入到src目录下。35.
34、 Unhandled exception type IllegalAccessException原因:将Class.forName(dbDriver).newInstance();改为Class.forName(dbDriver);36. java.lang.NoClassDefFoundError: org/apache/commons/logging/LogFactory 原因:缺少commons-logging.jar包37. 严重: Error configuring application listener of class org.springframework.web.conte
35、xt.ContextLoaderListenerjava.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderListener解决方法:重启myeclipse。38. DWRMethods未定义。原因:将改为。39. 来自网页的消息:error原因:数据库服务器没启动。DWR无法获得数据40. cannot set property disabled of null。原因:浏览器问题,换成IE浏览器41. 表单中的数据提交给action发现action接收到的值都为null。原因:检查表单控件的名称
36、和action中属性成员的名称是否一致,如果一致还出现null很可能tomcat服务器宕机了,重新启动tomcat服务器。42. test class not found in selected project原因:JUNIT4要求测试方法的返回值要求是void,且方法不能带有任何参数。43. java.sql.SQLException: MicrosoftSQLServer 2000 Driver for JDBCSQLServer对象名 xxx 无效原因:解决方法:sql写的不对,应该写: select * from databasename.dbo.tablename 即可。或改为:“u
37、se mydb select * from t_user”。44. MyEclipse中JSP文件无法保存中文的问题的解决 在MyEclipse操作界面中:window-preferences-general-content types在右边的窗口中打开列表,选中JSP,在下面的default encoding右边的输入框中输入GBK或GB2312或UTF-8都行,再点update按钮,就可以。 这里同样可以设置HTML等的默认编码,省得每次建个页面都要去改编码,45. Allocate exception for servlet Struts2Filterjava.lang.ClassCas
38、tException: org.apache.struts2.dispatcher.FilterDispatcher原因:org.apache.struts2.dispatcher.FilterDispatcher这是个Filter,你是不是在web.xml中配置成了servlet?46. 报错:No configuration found. Configuring ehcache from ehcache-failsafe.xml found in the classpath:.原因:报这个错是因为在/sandh/web-inf/classes下面没有ehcache.xml这个文件!这个文件
39、是hibernate缓存配置文件。解决方法:从ehcache-1.1.jar 中把文件ehcache-failsafe.xml 解压出来改名 ehcache.xml 复制到src下面就行了!47. Exception in thread main org.hibernate.MappingException: Association references unmapped class: BookNumber原因:在Book.hbm.xml中改为48. Exception in thread main org.hibernate.MappingException: An association
40、from the table reader_bookNumber refers to an unmapped class: com.www2.domain.Reader原因:在hibernate.cfg.xml中没有做配置。49. many-to-one有时候不发出transient错误,有时候又发?原因:到commit时外键还为空,这时发出transient错误;如果到commit时group对象已经save了,session就能够获取外键的值了,故不再发了。发出的情况 Group g=new Group();g.setName(尚学堂);User u1=new User();u1.setN
41、ame(zhangsan);u1.setGroup(g);session.save(u1);mit();不发的情况:Group g=new Group();g.setName(尚学堂);User u1=new User();u1.setName(zhangsan);u1.setGroup(g);session.save(u1); session.save(g);mit();50. JS Alert: Max depth exceeded when dereferencing原因:类型不对。将operator.isRegist(document.getElementById(name),callBackCheckName);改为operator.isRegist(document.getElementById(name).value,callBackCheckName);因为document.getElementById(name)返回值为OBJECT类型,而isRegist方法要求该参数为string类型,document.getElementById(name).value就为string类型。51. 查看发布的dwr,就显示classes known to dwr为什么看不到我的方法?.原因:将改为:52.