- This topic has 5 replies, 3 voices, and was last updated 19 years, 3 months ago by
Riyad Kalla.
-
AuthorPosts
-
Bob BakerMemberI have applications that require development in both Tomcat 4 (4.1.29) and Tomcat 5 (5.0.18). What I would like to do is use MyEclipse to package the application and dump it into the webapps directory of both application servers. Both of these I can currently do with the Deployment Manager.
The problem I have is that Tomcat 4 does not automatically restart applications when I put the WAR file into the webapps directory – Tomcat 5 works great. I have the application servers defined identically in MyEclipse (except the directories, of course), and I’m not sure if I’ve missed a setting or something in Tomcat.
Currently, I have to stop Tomcat 4, delete the WAR file and directory from webapps, use the Deployment Manager to package the WAR file, then restart Tomcat 4. This gets REAL old REAL fast.
Any ideas?
GregMemberFor the tomcat 4 server, try “touching” the web.xml file. Once Tomcat4 sees that the web.xml file modified-date has changed, it will reload the webapp context.
Bob BakerMemberWhile it does appear that Tomcat will recognize the fact that the web.xml file has changed, the recognition of any changes will only happen if I am deploying the application as Exploded – it does not work if I am deploying it as a WAR file, which is my preferred packaging type.
Also, when I have the type as Exploded, it does not let me Redeploy from the Project Deployments screen other than the first time. When I hit the Redeploy button, I am getting the message
“Deployment is out of date due to changes in the underlying project contents. You’ll need to manually ‘Redeploy’ the project to update the deployed archive.”
along with a very brief flash of some type of Windows dialog box (it’s not up long enough for me to read it). I then have to manually restart Tomcat 4 to pick up my changes, which defeats the whole purpose of all this.
Riyad KallaMemberWhile it does appear that Tomcat will recognize the fact that the web.xml file has changed, the recognition of any changes will only happen if I am deploying the application as Exploded – it does not work if I am deploying it as a WAR file, which is my preferred packaging type.
MyEclipse will not re-create your WAR every single time something changes. Consider a 50mb web application, and someone changes and saves their index.jsp file, and then MyEclipse fires off a background task of updated and recompressing 50mbs, it just doesn’t scale.
To get real-time deployment you have to use exploded.
Also, when I have the type as Exploded, it does not let me Redeploy from the Project Deployments screen other than the first time. When I hit the Redeploy button, I am getting the message
“Deployment is out of date due to changes in the underlying project contents. You’ll need to manually ‘Redeploy’ the project to update the deployed archive.”
If you are updating your project using an external task like an Ant script, you have to refresh your project manually to bring the files back in sync. Additionally using an exploded deployment negates the need to keep messing with the deployment manager, your changes are already deployed, you don’t need to deploy them again AND you run the risk of getting a JAR-lock conflict and the deployment failing.
Bob BakerMember@support-rkalla wrote:
MyEclipse will not re-create your WAR every single time something changes. Consider a 50mb web application, and someone changes and saves their index.jsp file, and then MyEclipse fires off a background task of updated and recompressing 50mbs, it just doesn’t scale.
To get real-time deployment you have to use exploded.
I’m not asking MyEclipse to automatically repackage my WAR file for me. I don’t mind doing that myself. All I’m trying to do is get Tomcat 4 to recognize that it’s changed after I manually repackage it and deploy it. I have no problems with this feature working with Tomcat 5 – what’s the difference between 4 and 5 such that 4 can’t recognize that it’s changed and automatically restart the context?
@support-rkalla wrote:
If you are updating your project using an external task like an Ant script, you have to refresh your project manually to bring the files back in sync.
I’m not using Ant to build this application – it’s strictly the automatic rebuilds in Eclipse, with MyEclipse for deployment.
@support-rkalla wrote:
Additionally using an exploded deployment negates the need to keep messing with the deployment manager, your changes are already deployed, you don’t need to deploy them again AND you run the risk of getting a JAR-lock conflict and the deployment failing.
I must be missing something here. Are you saying that once I deploy this way that I can’t make any more changes without restarting? The JAR-lock must be the issue I’m running into. Or, are you saying that if I have it set to Explode that it automatically deploys changes for me as I make them?
Once again – I don’t have any issues with Tomcat 5 working fine after I redeploy a WAR file – it automatically restarts the context. I just need the same functionality with Tomcat 4. That’s all I’m asking. These are small applications (5MB or less), and I don’t use Ant to build them.
Riyad KallaMemberI’m not asking MyEclipse to automatically repackage my WAR file for me. I don’t mind doing that myself. All I’m trying to do is get Tomcat 4 to recognize that it’s changed after I manually repackage it and deploy it. I have no problems with this feature working with Tomcat 5 – what’s the difference between 4 and 5 such that 4 can’t recognize that it’s changed and automatically restart the context?
I’m not sure what the difference is, but that is the issue, it’s a Tomcat change, not a MyEclipse issue. The only thing I can think of is that you might not have the “reloadable=true” setting for your context in Tomcat 4, so it’s not even looking for changes… but above you said touching the web.xml file DOES reload it, so maybe that setting is on and Tomcat 4 is just not paying attention to you. You can setup an admin user with the roles “admin,manager” and login to the manager app and just restart the context manually. I’ve had to resort to this sometimes when developing pesky JSF apps.
I’m not using Ant to build this application – it’s strictly the automatic rebuilds in Eclipse, with MyEclipse for deployment.
That error could be a mis-reported deployment failure due to locked JARs.
I must be missing something here. Are you saying that once I deploy this way that I can’t make any more changes without restarting? The JAR-lock must be the issue I’m running into. Or, are you saying that if I have it set to Explode that it automatically deploys changes for me as I make them?
I’m saying the 2nd one. When you setup an exploded deployment, and have Window > Prefs > General > Workspace > “Build automatically” turned on, what happens is every single time you save a file, Eclipse builds the file and MyEclipse deploys it. So it would be common to say deploy an app exploded, start your app server, then just work for a few hours on JSPs never needing to restart anything as your changes are deployed. This gets a little harrier with class files because they will be hot synced for you immediately in the running Tomcat VM *unless* their shape has changed (new methods, etc.) in which case you will gte a hotsync failure notice and Tomcat should restart it’s context for you, so you can keep working.
Overall it boils down to coding for a few hours not needing ot restart or redeploy anything depending on what you are doing.
Once again – I don’t have any issues with Tomcat 5 working fine after I redeploy a WAR file – it automatically restarts the context. I just need the same functionality with Tomcat 4. That’s all I’m asking. These are small applications (5MB or less), and I don’t use Ant to build them.
That is a Tomcat issue. I don’t know what may have changed to help you there.
-
AuthorPosts