---
title: "Add Deployment  java.lang.NullPointerException"
author: "编程足球"
date: "2012-08-22T17:28:30Z"
tags: []
categories: ["Web前端"]
slug: "add-deployment-java-lang-nullpointerexception"
draft: false
lastmod: "2012-08-22T17:28:30Z"
id: 1654836
url: "https://lingf.iteye.com/blog/1654836"
---

1. 在用Myeclipse部署项目时候突然报错:

![](http://dl.iteye.com/upload/attachment/0072/7443/138398f6-f525-3b1b-8edc-70cccf39db3b.jpg)

无法进行部署操作

2. 原因1. 可能是你的Web-root的值不对。通过右击项目->Properties->MyEclipse->Web
   查看自己的web根目录是否正确。
![](http://dl.iteye.com/upload/attachment/0072/7446/22ac9530-8635-3b0a-ae8a-e28da27d1ebe.jpg)

   
![](http://dl.iteye.com/upload/attachment/0072/7448/9da7aea6-575c-38d3-a5a7-887c155e677e.jpg)


    发现Web-root 的值为 WebRoot 和 项目的 web 不一致。可会导致上面的错误。

3. 解决方法: 在项目路径目录下找到 .mymetadata 打开

```xml

<?xml version="1.0" encoding="UTF-8"?>
<project-module
  type="WEB"
  name="wlms"
  id="myeclipse.1345519075437"
  context-root="/wlms"
  j2ee-spec="1.4"
  archive="wlms.war">
  <attributes>
    <attribute name="webrootdir" value="/WebRoot" />
  </attributes>
</project-module>

```


修改配置项

```xml

  <attributes>
    <attribute name="webrootdir" value="/WebRoot" />
  </attributes>

  为
  <attributes>
    <attribute name="webrootdir" value="/web" />
  </attributes>

```


保存。。重新启动Myeclipse就可以了