On 11/21/2013 2:22 PM, Jonathan Gardner wrote:
Hello,

Hopefully you guys can help me out with this…

I am using Netbeans 7.3.1, Tomcat 6.0.37, Java EE 5, and Java JDK
1.7.0_45. When I create a new maven web application project and try
to run it, I get the following error:


NetBeans: Deploying on Apache Tomcat profile mode: false debug mode:
true force redeploy: true Starting Tomcat process... Waiting for
Tomcat... Starting of Tomcat failed. Deployment error: Starting of
Tomcat failed. See the server log for details. at
org.netbeans.modules.j2ee.deployment.devmodules.api.Deployment.deploy(Deployment.java:230)


at org.netbeans.modules.maven.j2ee.ExecutionChecker.performDeploy(ExecutionChecker.java:178)
at
org.netbeans.modules.maven.j2ee.ExecutionChecker.executionResult(ExecutionChecker.java:130)


at org.netbeans.modules.maven.execute.MavenCommandLineExecutor.run(MavenCommandLineExecutor.java:212)
at
org.netbeans.core.execution.RunClassThread.run(RunClassThread.java:153)

 Not sure what is wrong. When I navigate to localhost:8080 after
executing the project, the server is back up. Netbeans does, however,
fail to shut the server down. So when I try executing the same
project again, I get this:

NetBeans: Deploying on Apache Tomcat profile mode: false debug mode:
false force redeploy: true Starting of Tomcat failed, the server port
8080 is already in use. Deployment error: Starting of Tomcat failed,
the server port 8080 is already in use. See the server log for
details. at
org.netbeans.modules.j2ee.deployment.devmodules.api.Deployment.deploy(Deployment.java:230)


at org.netbeans.modules.maven.j2ee.ExecutionChecker.performDeploy(ExecutionChecker.java:178)
at
org.netbeans.modules.maven.j2ee.ExecutionChecker.executionResult(ExecutionChecker.java:130)


at org.netbeans.modules.maven.execute.MavenCommandLineExecutor.run(MavenCommandLineExecutor.java:212)
at
org.netbeans.core.execution.RunClassThread.run(RunClassThread.java:153)

 Not sure what’s going on here… I have the correct login information
of admin/admin, I think. I’m a total newb at server stuff, so I might
be doing something stupid.

I’ll also note that I used to be using Tomcat 7, but it wasn’t even
auto-generating the web.xml file when I created a new web application
project.

Please help! Thanks!

-Jonathan-


Jonathan,

This is more of a NetBeans question than a Tomcat one. Since I use NetBeans, I'll take a stab at answering this.

Beware, I'm kind of verbose . . .

Anyway, the best way (IMHO) to use NetBeans / Tomcat is to let NetBeans control the Tomcat(s).

In the server panel, you can start or stop Tomcats manually.

When you run a web project (Maven or otherwise), NetBeans will start the server for you if it's not running, and just do an undeploy / redeploy if it is.

NetBeans makes use of the Tomcat Ant tasks, so this is why NetBeans needs a user with a manager-script role in tomcat-users.xml.

Where you can run into problems is when you start up Tomcat outside of NetBeans and then attempt to deploy (run) a project on Tomcat. I don't think NetBeans knows if you've already started Tomcat outside of the IDE.

In fact, NetBeans doesn't even know if you've already started another server within NetBeans. I sometimes get into trouble if I have one project assigned to one server, and another project assigned to another server. I start project A on one server, then jump to project B on another server, and . . . oops. I suppose I could edit server.xml and change port numbers, but it's easier for me to just remember what I'm running at any given point (especially since I'm more of a systems person, less of a developer).

Here's how I normally work:

1. Start up the IDE
2. Go to the servers window and select my Tomcat of choice
3. Start up that Tomcat
4. Go over to the project window and work with my project
5. Save, run, debug, etc.

I start up my Tomcat before working on projects simply because the Tomcat I normally use has psi-probe deployed. That takes about 10 seconds to start up, so it's a bit annoying in a development environment.

If I'm doing debugging, then I'll run a Tomcat without psi-probe deployed. I shut down my normal Tomcat first, then either launch my debugging session directly from the project, or start Tomcat in debugging mode and then debug the project.

I normally use a hand-rolled archetype to develop against, since it has some nice things like javascript / css compression, links to SCM, and links to webdav for maven site deployment.

However, if you're using the NetBeans-supplied archetypes, the Java EE 6 Web project won't auto-generate a web.xml. That's because a web.xml file is not required for Java EE 6 web projects. You can still run Java EE 5 projects on Tomcat 7, and the IDE will generate a web.xml.

To sum it up:

1. Let NetBeans control the Tomcat server
   (configured in the servers window)
2. Java EE 6 Web projects don't require a web.xml file
3. You can run Java EE 5 projects on Tomca 7 - web.xml will be generated

. . . . just my two cents.
/mde/

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to