码迷,mamicode.com
首页 > 其他好文 > 详细

开发常见异常

时间:2017-07-23 22:32:31      阅读:318      评论:0      收藏:0      [点我收藏+]

标签:异常   开发   

常见异常总结:

问题:IllegalAgumentExecption

  

技术分享

技术分享





问题:内存溢出异常

这个一般报【http-8080-3】之类的

1.eclipse安装目录中将eclipse的启动参数调大一些:

技术分享 

-startup

plugins/org.eclipse.equinox.launcher_1.3.100.v20150511-1540.jar

--launcher.library

plugins/org.eclipse.equinox.launcher.win32.win32.x86_64_1.1.300.v20150602-1417

-product

org.eclipse.epp.package.jee.product

--launcher.defaultAction

openFile

--launcher.XXMaxPermSize

512M

-showsplash

org.eclipse.platform

--launcher.XXMaxPermSize

512m

--launcher.defaultAction

openFile

--launcher.appendVmargs

-vmargs

-Dosgi.requiredJavaVersion=1.7

-Xms512m

-Xmx1024m

技术分享

技术分享 

 

问题:BeanDefinitionParsingException

org.springframework.beans.factory.parsing.BeanDefinitionParsingException: Configuration problem: Failed to import bean definitions from URL location [classpath:applicationContext-service.xml]

 

原因:applicationContext-service.xml没有加进去总的spring配置文件,或者名字写错,或者配置文件内部程序错误。

 

 

问题:There is no Action mapped for namespace

There is no Action mapped for namespace [/sysadmin] and action name [deptAction_list] associated with context path [/qb_web]. - [unknown location]

 

原因:struts.xml文件不在src下,或者编译后不在classes下;

或者struts.xml配置文件内部错误;

或者有其他的struts-xxx.xml没有include到struts.xml中;

或者action与spring整合的时候出错,一些UserServie没有在struts配置文件中,或者写错,导致找不见struts.xml;

或者请求路径出错。

 

问题:action本身就在值栈中,但action不在值栈的栈顶;

 

问题:classpath

Classpath只能用在spring中,

 

问题:重定向和转发

问题:hibernate子配置文件Dept.hbm.xml问题

<property name="name" column="NAME"></property>

01.name属性出错

报错:

org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘sessionFactory‘ defined in class path resource [applicationContext.xml]: Invocation of init method failed; nested exception is

Caused by: org.hibernate.property.access.spi.PropertyAccessBuildingException: Could not locate field nor getter method for property named [com.my.qb.domain.Userinfo#ne]


02.column属性出错

不会报错,但是加载运行的时候不行,这个要特别注意。

03.package出错

 

<hibernate-mapping package="com.my.qb.domain">

报错:

org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘sessionFactory‘ defined in class path resource [applicationContext.xml]: Invocation of init method failed; nested exception is org.hibernate.MappingException: class cn.itcast.jk.domain.Dept not found while looking for property: id

 

Caused by: org.hibernate.MappingException: class cn.itcast.jk.domain.Dept not found while looking for property: id

 

Caused by: org.hibernate.boot.registry.classloading.spi.ClassLoadingException: Unable to load class [cn.itcast.jk.domain.Dept]


Caused by: java.lang.ClassNotFoundException: Could not load requested class : cn.other.jk.domain.Dept

 

问题:数据库属性设为非空,但是没有赋值

Struts Problem Report

Struts has detected an unhandled exception:

 

Messages: ORA-01400: ??? NULL ?? ("ITQB"."USER_P"."CREATE_TIME")

could not execute statement

could not execute statement; SQL [n/a]; constraint [null]; nested exception is org.hibernate.exception.ConstraintViolationException: could not execute statement

 

File: oracle/jdbc/driver/DatabaseError.java

Line number: 112

 

 

java.sql.SQLException: ORA-01400: ??? NULL ?? ("ITQB"."USER_P"."CREATE_TIME")

 

 

问题:

新建jsp页面老提示:

Multiple annotations found at this line:

  - The superclass "javax.servlet.http.HttpServlet" was not found on the Java   Build Path

解决步骤:

1、右键项目-build path

2、选择configure build path...

3、选择 Javabuild path

4、Add Library –> server Runtime -> Click Next

5、选择  Server runtime (我的是 Tomcat 7.0) –>完成



 

 

 

 

 

 


本文出自 “秦斌的博客” 博客,谢绝转载!

开发常见异常

标签:异常   开发   

原文地址:http://qinbin.blog.51cto.com/11773640/1950216

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!