You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Mark Eggers <it...@yahoo.com> on 2013/11/22 01:34:50 UTC

Re: Tomcat deployment erring out [OT]

On 11/21/2013 3:47 PM, Jonathan Gardner wrote:
> I've been killing the tomcat process manually. When I do that, and execute
> the project again, I get the first error in my first email. I appreciate
> your response a lot, but I don't see how our solves that first error.
> Netbeans doesn't start tomcat correctly even when its isn't already
> running...
>
> Thanks for your response though! Still helpful!

This is really more of a NetBeans issue at this point. All I can say is 
that I run this exact same setup on both Windows 7 and Linux daily 
without issues.

If you're on Windows, some things to consider:

1. Permissions

Make sure your Tomcat is installed where you (as a normal user) can stop 
and start it.

2. Services

Don't try to control a Tomcat Windows Service via the IDE. Instead, shut 
down the service and use the installation from a zip file.

If you're on Linux, some things to consider:

1. Permissions

This most often rears its ugly head if you use a distribution-based 
install. The distribution-based installs get scattered all over 
everywhere, with permissions designed to run as a service, not a 
development environment.

For a development environment, download the appropriate tar.gz file, 
unpack it in a place of your choice (I use ~/Apache), and use that 
installation for development.

2. Distro-installs, part 2

As mentioned above, distribution installations tend to be scattered 
about, trying to fit into that distribution's idea of services. It's 
usually not a good vehicle for development. See the permissions item above.

Have you asked on the NetBeans J2EE forums yet?

Oh, and don't top-post.

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

> On Nov 21, 2013 5:39 PM, "Mark Eggers" <it...@yahoo.com> wrote:
>
>> 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-unsubscribe@tomcat.apache.org
>> For additional commands, e-mail: users-help@tomcat.apache.org
>>
>>
>


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