Skip to content
This repository has been archived by the owner on Oct 12, 2023. It is now read-only.

Tomcat not running when using daemon mode #31

Closed
rferrerasm opened this issue Aug 8, 2012 · 4 comments
Closed

Tomcat not running when using daemon mode #31

rferrerasm opened this issue Aug 8, 2012 · 4 comments
Assignees

Comments

@rferrerasm
Copy link

I am migrating a project to Gradle and trying this Tomcat plugin.

The tomcatRunWar task runs correctly in process, but I want to run it in daemon mode. However, when running it, I can see the application starting, the servlets initialized, but after Gradle finishes Tomcat is not running.

I can't see any error or exception even when using --debug.

I don't know what can I try to see what is happening.

PS: I'm not using the Gradle daemon mode.

@ghost ghost assigned bmuschko Aug 8, 2012
@bmuschko
Copy link
Owner

bmuschko commented Aug 8, 2012

Setting the daemon property to true does not actually fork a daemon process running Tomcat. It's actually created in a different thread. When the Gradle process finishes the thread will be killed. Maybe you can tell me a bit more about what you are trying to achieve. Are you trying to run in-container integration tests?

@rferrerasm
Copy link
Author

Oh, I thought I could use it to start a Tomcat server and then continue using the command line.

With ant I was using a Tomcat installation and deploying to it through it's ant tasks, and then do something (manually) with the application. I thought I could use the daemon=true to launch a Tomcat instance without installing it in the machine.

@bmuschko
Copy link
Owner

bmuschko commented Aug 8, 2012

In general the embedded Tomcat is fairly fast to bring up. Even changing code and restarting the container using this plugin should not be too painful. You can still change JSPs on the fly. If you tend to change classes a lot I'd recommend using JRebel. It allows for hot swapping the implementation on the fly while keeping your container running.

If you wanted to work similarly as before you could leverage the Cargo plugin instead. It allows for automatically downloading the container from a URL and deploying to it as you were used to in Ant.

@bmuschko bmuschko closed this as completed Aug 8, 2012
@vladvoic
Copy link
Contributor

Setting the daemon property to true does not actually fork a daemon process running Tomcat. It's actually created in a different thread. When the Gradle process finishes the thread will be killed. Maybe you can tell me a bit more about what you are trying to achieve. Are you trying to run in-container integration tests?

This isn't actually the definition of a daemon, is it? I find this awfully misleading.

I would need the daemon mode to actually spawn a new process as I want for example to run 2 embedded tomcats from within 1 gradle build without using the gradle daemon. Without the tomcat daemon option this will obviously not work, with it I also need to run gradle in daemon mode in order for it to work, which leads to other class-loader issues after I stop the tomcats and run them again.

If I implement the daemon mode to actually spawn a new process will you include it? Also, any pointers on where to start?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants