Why does the Netbeans IDE not automatically delete the Build from an imported web application?

Asked

Viewed 601 times

1

I downloaded a Java web project and imported it to netbeans,when all the imported project with all its libraries were in its proper place along with the archive web.xml(within WEB-INF), I ran the project and it started the tomcat and in the browser the application worked satisfactorily! So far so good! But when I try to clean and build the project in the IDE netbeans it indicates an error saying that you cannot delete the directory build!!

The project respected the folder hierarchy of a web application, as illustrated in the figure below: inserir a descrição da imagem aqui

The below follows the erro that IDE informs:

Deleting directory C: Users User Documents Netbeansprojects Simplejspservletdb-master build
C: Users User Documents Netbeansprojects Simplejspservletdb-master projects build-impl.xml:1439: Unable to delete file C: Users User Documents Netbeansprojects Simplejspservletdb-master projects build web WEB-INF classes db.properties
CONSTRUCTION FAILURE (total time: 6 seconds)

  • 1

    I can only delete manually ,but for that I have to close Ide !! Then when I open ide and I have clean and build it does without any problem.

  • 1

    It’s not a question of permission? edit the question and put the error message.

  • 1

    rray ,I found out what the error was, it was the application’s descriptor, the web.xml file. I just edited it and everything went right!!

1 answer

3


Sometimes when you download an example from the Internet for learning you may stumble upon an older version of code for your IDE and with that some conflicts may occur. It is always good to take a look at the code to look at the versions of files used in the web.xml file and compare them with the current ones you are using in your container (in my case TOMCAT)!!

The problem is the descriptor web.xml. It cannot clean and build automatically with the IDE because the header of the web.xml file (application descriptor) that came with the project is wrong:

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" id="WebApp_ID" version="2.5">

REPLACE BY

<web-app xmlns="http://xmlns.jcp.org/xml/ns/javaee"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee
  http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd"  version="3.1">

Browser other questions tagged

You are not signed in. Login or sign up in order to post.