该文章用于整理开发中遇到的一些错误,及解决方法,不断整理更新。

1. 缺包异常

异常1:
java.lang.NoClassDefFoundError: org/apache/commons/logging/LogFactory
at org.springframework.web.context.ContextLoader.<clinit>(ContextLoader.java:146)
at org.springframework.web.context.ContextLoaderListener.createContextLoader(ContextLoaderListener.java:53)
at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:44)
需要加上:commons-logging.jar,log4j-1.2.11.jar
———————————————————————————
异常2:
org.springframework.beans.factory.BeanDefinitionStoreException: Unexpected exception parsing XML document from class path resource [text.xml]; nested exception is java.lang.NoClassDefFoundError: org/aspectj/weaver/reflect/ReflectionWorld$ReflectionWorldException
Caused by: java.lang.NoClassDefFoundError: org/aspectj/weaver/reflect/ReflectionWorld$ReflectionWorldException
at java.lang.Class.forName0(Native Method)
需要加上:aspectjweaver.jar
———————————————————————————
异常3:
org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘logBean’ defined in class path resource [spring.xml]: Initialization of bean failed; nested exception is org.springframework.aop.framework.AopConfigException: Cannot proxy target class because CGLIB2 is not available. Add CGLIB to the class path or specify proxy interfaces.
Caused by: org.springframework.aop.framework.AopConfigException: Cannot proxy target class because CGLIB2 is not available. Add CGLIB to the class path or specify proxy interfaces.
需要加上:cglib-2.1.3.jar
———————————————————————————
异常4:
org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘logBean’ defined in class path resource of ServletContext: Instantiation of bean failed; nested exception is java.lang.NoClassDefFoundError: javax/transaction/TransactionManager
java.lang.NoClassDefFoundError: javax/transaction/TransactionManager
需要加上:jta.jar
———————————————————————————
异常6:
java.lang.NoClassDefFoundError: org/dom4j/Attribute
需要加上:dom4j.jar
———————————————————————————
异常7:
java.lang.NoClassDefFoundError: net/sf/ehcache/CacheException
需要加上:ehcache.jar
———————————————————————————
异常8:
java.lang.NoClassDefFoundError: net/sf/cglib/core/KeyFactory
需要加上:cglib-full.jar

2. 加载出错

2.1 <context:property-placeholder>:Could not resolve placeholder XXX in string value XXX

当spring 配置多个properties 文件的时候需要特殊处理

方式1:

    <bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
<property name="locations">
<list>
<value>classpath*:mongodb.properties</value>
<value>classpath*:xxx.properties</value>
<value>classpath*:bbb.properties</value>
</list>
</property>
<property name="ignoreUnresolvablePlaceholders" value="true" />
</bean>

方式2:

<context:property-placeholder location="classpath*:xxx.properties" ignore-unresolvable="true" />

PS :  重要属性:

<property name="ignoreUnresolvablePlaceholders" value="true" />    ignore-unresolvable="true"

2.2 Errors running builder 'DeploymentBuilder' on project_java

此问题一般发生在Myeclipse 保存文件并自动部署时候。
Errors occurred during the build.
Errors running builder 'DeploymentBuilder' on project '项目名'.
java.lang.NullPointerException
 
有一种产生此错误的原因是因为此项目不不是由myeclipse创建的。
所以你需要检查.project 文件。
并且添加com.genuitec.eclipse.j2eedt.core.webnature
 
 
1、首先关闭MyEclipse工作空间。
2、然后删除工作空间下的
“/.metadata/.plugins/org.eclipse.core.runtime/.settings/com.genuitec.eclipse.ast.deploy.core.prefs”
 
取消myeclipse的自动部署:
右键点击项目 ->properties -> Builders ,将DeploymentBuilder勾选去除.

3 Other

在myeclipse中启动tomcat自动进入debug 解决方法

将你的服务器启动方式设置为run方式,不要设置为debug方式。
具体采用的方法:
如下:
window->preferences  然后找到你的tomcat所在的目录,打开launch窗口,然后修改tomcat lanuch mode为Run mode。然后点击Apply,最后点击OK.
这样设置之后,以后服务器就是在run mode下运行了
如果你不这样设置,那就在每次启动的时候,选择run server,而不是debug server.

JavaEE error整理(不断更新)的更多相关文章

  1. BAT 前端开发面经 —— 吐血总结 前端相关片段整理——持续更新 前端基础精简总结 Web Storage You don't know js

    BAT 前端开发面经 —— 吐血总结   目录 1. Tencent 2. 阿里 3. 百度 更好阅读,请移步这里 聊之前 最近暑期实习招聘已经开始,个人目前参加了阿里的内推及腾讯和百度的实习生招聘, ...

  2. error C2471: 无法更新程序数据库 vc90.pdb

    error C2471: 无法更新程序数据库“d:/Work/ Project/debug/vc90.pdb” fatal error C1083: 无法打开程序数据库文件:“d:/Work/ Pro ...

  3. error C2471: 无法更新程序数据库

    这段时间在使用VS做一个项目.在使用过程中,今天遇到了一个问题,也就是题目所说的那样: error C2471: 无法更新程序数据库.之后在网上搜了一下,得到了两种解决方案,两种方案分别如下: (一) ...

  4. JavaEE最新技术整理--新技术

    JavaEE最新技术整理-----https://blog.csdn.net/qq_21683643/article/details/79747922

  5. python --error整理(不定时更新)

    1.TabError: inconsistent use of tabs and spaces in indentation Python 中需要用tab 键来空格 2.SyntaxError: in ...

  6. java视频教程 Java自学视频整理(持续更新中...)

    视频教程,马士兵java视频教程,java视频 1.Java基础视频 <张孝祥JAVA视频教程>完整版[RMVB](东西网) 历经5年锤炼(史上最适合初学者入门的Java基础视频)(传智播 ...

  7. WAS 部署 Birt 报表出现 error.CannotStartupOSGIPlatform 和 更新web.xml

    在WAS7.0中部署Birt报表会出现error.CannotStartupOSGIPlatform错误,通常需要这样修改 1.依次打开Applications->WebSphere enter ...

  8. Qt中常见错误整理(不定期更新)

    (1)error: LNK1104: cannot open file 'libboost_thread-vc120-mt-gd-1_57.lib 编译boost库程序时出现问题 解决方法如下: 1. ...

  9. 微信小程序(应用号)开发资源汇总整理 - 一直更新中

    开源项目 wechat-weapp-gank - 微信小程序版Gank客户端 wechat-dribbble - 微信小程序-Dribbble wechatApp-demo - 微信小程序 DEMO ...

随机推荐

  1. C语言 入门程序

    #include "stdio.h" #include "stdlib.h" #include "string.h" #define MAX ...

  2. 读书笔记 之 《阿里巴巴Java开发手册》

    一.前言 这本书主要定义了一些代码的规范以及一些注意事项.我只根据我自己的不足,摘录了一些内容,方便以后查阅. 二.读书笔记 命名 1.代码中的命名均不能以下划线或美元符号开始,也不能以下划线或美元符 ...

  3. collection 模块

    关于一些 特殊数据类型的模块 namedtuple顾名思义,一个带有名字的元祖,他也是跟对象有关的一个 from collections import namedtuple phone = named ...

  4. Java 调用Azure认知服务Demo--Computer API

    说明 本文主要介绍使用Java代码,基于HTTP请求调用Microsoft Azure的认知服务.图片来源分别介绍了使用公网的URL和上传本地图片. 依赖的jar包下载地址: key的获取需要登录到A ...

  5. Spring Date Jpa on update current_timestamp 自动维护创建时间和更新时间

    在数据库里设置默认值current_timestamp可以维护创建时间,设置on update current_timestamp 可以维护更新时间.在JPA中应该如何去做呢?这里还是以上篇Topic ...

  6. React渲染问题研究以及Immutable的应用

    写在前面 这里主要介绍自己在React开发中的一些总结,关于react的渲染问题的一点研究. 另外本人一直希望在React项目中尝试使用,因此在之前已经介绍过immutable的API,可以参看这里I ...

  7. ReactNative环境搭建扩展篇——安装后报错解决方案

    之前一篇写了<逻辑性最强的React Native环境搭建与调试>说了RN的安装,今天在这里做一个复盘,让我们能够更直观更深入的了解React Native(以下简称RN),这一篇重点来说 ...

  8. Java基础---泛型、集合框架工具类:collections和Arrays

    第一讲     泛型(Generic) 一.概述 1.JDK1.5版本以后出现的新特性.用于解决安全问题,是一个类型安全机制. 2.JDK1.5的集合类希望在定义集合时,明确表明你要向集合中装入那种类 ...

  9. HK2框架的简单自实现kunJ

    kunJ kunJ框架,是基于HK2框架的一个自实现注入框架,功能比较简单,重在探索依赖注入的实现原理. 实现细节 自定义3个注解,Access,Inject,Service 在Service中实现对 ...

  10. JQ在线引用地址

    1.7.2版本 百度的引用地址: <script  src="http://libs.baidu.com/jquery/1.7.2/jquery.min.js">< ...