# netbeans + tomcat : unable to deploy a web application

## vincent-

Hello.

I have installed tomcat and netbeans via emerge.

I have this tomcat-users into the /etc/tomcat-7/tomcat-users.xml file:

```
<tomcat-users>

  <role rolename="tomcat"/>

  <role rolename="role1"/>

  <user username="tomcat" password="tomcat" roles="tomcat,manager-gui,admin-gui,host-manager-gui"/>

  <user username="netbeans" password="netbeans" roles="tomcat,manager-script"/>

  <user username="both" password="tomcat" roles="tomcat,role1"/>

  <user username="role1" password="tomcat" roles="role1"/>

</tomcat-users>
```

I have added a server in netbeans (a tomcat server, of course), and I configured it like this:

Catalina Home: /usr/share/tomcat-7/  (I have created a conf symlink ponting to /etc/tomcat-7/) , because netbeans expects a conf/server.xml file into Catalina Home directory.

Catalina Base: /var/lib/tomcat-7/

Username: netbeans

Password: netbeans

I have created a new project of a "Java Web Application", called "cfm". This is a simple Hello World! application. I can generate the project (that gives me a cfm.war file under dist directory) and I can deploy the application manually using the tomcat manager web interface.

But, if I try to deploy the application using netbeans, I get this error:

```
init:

deps-module-jar:

deps-ear-jar:

deps-jar:

library-inclusion-in-archive:

library-inclusion-in-manifest:

compile:

compile-jsps:

In-place deployment at /home/peratu/NetBeansProjects/cfm/build/web

deploy?config=file%3A%2Ftmp%2Fcontext5942967850940629434.xml&path=/cfm

FAIL - Aplication desployed in the context path /cfm, but the context cannot run

/home/peratu/NetBeansProjects/cfm/nbproject/build-impl.xml:721: 

The module has not been deployed.

   at org.netbeans.modules.j2ee.deployment.devmodules.api.Deployment.deploy(Deployment.java:210)

   at org.netbeans.modules.j2ee.ant.Deploy.execute(Deploy.java:106)

   at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)

   at sun.reflect.GeneratedMethodAccessor46.invoke(Unknown Source)

   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

   at java.lang.reflect.Method.invoke(Method.java:597)

   at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)

   at org.apache.tools.ant.Task.perform(Task.java:348)

   at org.apache.tools.ant.Target.execute(Target.java:390)

   at org.apache.tools.ant.Target.performTasks(Target.java:411)

   at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1397)

   at org.apache.tools.ant.Project.executeTarget(Project.java:1366)

   at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)

   at org.apache.tools.ant.Project.executeTargets(Project.java:1249)

   at org.apache.tools.ant.module.bridge.impl.BridgeImpl.run(BridgeImpl.java:284)

   at org.apache.tools.ant.module.run.TargetExecutor.run(TargetExecutor.java:539)

   at org.netbeans.core.execution.RunClassThread.run(RunClassThread.java:153)

GENERATION INCORRECT (total time: 0 seconds)
```

And this is the content of build-impl.xml at line #721

```
<nbdeploy clientUrlPart="${client.urlPart}" debugmode="false" forceRedeploy="${forceRedeploy}"/>
```

Please, help me. Thank you.

----------

## vincent-

I "solved" my problem in a non-elegant way. I have changed the owner of tomcat directories (/etc/tomcat-6/ , /usr/share/tomcat-6/ , etc.) to my user, because when I start the tomcat server using Netbeans, the owner of tomcat process is my user (because my user is who started Netbeans).

It's a solution for me because I'm the only one who use this machine, and I only want the tomcat server to test the apps I'm developing (this will not the production server). But what would happen if I wasn't the only one who uses this machine? There must be a solution for that case...

----------

