myeclipse部署时报错An internal error occurred

今天把刚从SVN上DOWN下来的工程在myeclipse上部署时报错:An internal error occurred during: "Add Deployment". java.lang.NullPointException 。
网上查了一下原因,参照http://containsoft.iteye.com/blog/1124146文章中所说的如下情况

原因一、jdk版本不一致。具体步骤如下:
    右键项目名→Properties→Java Build Path→Libraries→选中JRE System Library[Sun JDK 1.6.0_13]→Edit→选中“Workspace default JRE(Sun JDK 1.6.0_13)”→Finish
以上是以你本地JDK版本为主



原因二,也是出问题最频繁的地方:工程下的.mymetadata文件内容与原项目不一致。这里可能有<project-module 中缺少context-root 属性设置,也可能<attribute 中value属性值不对。所以需要原项目的配置文件对照一下。或者尝试着给value设置不同值,每次设置修改后,需要重启myeclipse。value的值大概有WebRoot,webapp,&lt;prjroot&gt; 等
给一个配置示例:
<?xml version="1.0" encoding="UTF-8"?>
<project-module
  type="WEB"
  name="COA"
  id="myeclipse.1291700036453"
  j2ee-spec="1.4"
  context-root="/COA"
  archive="CRM.war">
  <attributes>
    <attribute name="webrootdir" value="&lt;prjroot&gt;" />
  </attributes>
</project-module>


应该是第一种原因引起,改了后可以正常部署了。

猜你喜欢

转载自lihuifen2014.iteye.com/blog/2115224