- This topic has 6 replies, 2 voices, and was last updated 19 years, 5 months ago by
kva.
-
AuthorPosts
-
kvaMemberHello,
I am using MyEclipse 4.0.3 to deploy a web module to tomcat 5.5.12. I have a Spring application context in a source folder conf/local. The first time I deploy the application context is correctly copied to the root of the class files. When I subsequently modify the application context the file is not updated in the web module. The file is not even updated when I explicitly redeploy the web module. The same is true for a properties file in the same source folder.
Perhaps I should add that the web module does not have any class files of its own, it only has dependent jars.
Any thoughts?
Below is my configuration info.
*** Date: Wed Dec 07 16:32:30 CET 2005
*** System properties:
OS=mac os x
OS version=10.4.3
Java version=1.5.0_05*** MyEclipse details:
MyEclipse Enterprise WorkbenchVersion: 4.0.3 GA
Build id: 20051025-4.0.3-GA*** Eclipse details:
Eclipse SDKVersion: 3.1.1
Build id: M20050929-0840Eclipse Platform
Version: 3.1.1
Build id: M20050929-0840Eclipse RCP
Version: 3.1.1
Build id: I20050627-1435Eclipse Java Development Tools
Version: 3.1.1
Build id: I20050627-1435Eclipse Plug-in Development Environment
Version: 3.1.1
Build id: I20050627-1435Eclipse Project SDK
Version: 3.1.1
Build id: M20050929-0840Eclipse startup command=-os
macosx
-ws
carbon
-arch
ppc
-launcher
/Applications/eclipse/Eclipse.app/Contents/MacOS/eclipse
-name
Eclipse
-showsplash
600
-exitdata
10001
-keyring
/Users/kva/.eclipse_keyring
-consoleLog
-showlocation
-vm
/usr/bin/java
Riyad KallaMemberkva,
Is this a single web project, with multiple source folders in it? Also are you making sure to use an exploded deployment? And lastly, are you actually going into the Tomcat deployment directory and checking the timestamp on the applicationContext.xml file and not seeing it change, or are you just saying that it’s not updating because the behavior of the app didn’t change?
kvaMemberIt is a single web module with multiple source folders and the web module has multiple dependent java projects. The deployment is exploded.
It looks like the resource files were updated in the tomcat deployment, the dates changed. In fact, there are 3 copies of the resources: one in some source folder (e.g. conf/all), one in webapp/WEB-INF/classes and one in the tomcat deployment directory. So it looks like conf/all version is not being copied to webapp/WEB-INF/classes except for the very first time upon adding the web project capabilities to the project.
Riyad KallaMemberNOTE: Make sure Window > Prefs > General > Workspace > Build automatically is turned on
Now, I wasn’t really clear on what you said, like here:
It looks like the resource files were updated in the tomcat deployment, the dates changed.
So to me that sounds like MyEclipse is doing it’s job deploying the changed file out to your tomcat deploy directory, but Tomcat just isn’t reloading the changes. However you then say:
So it looks like conf/all version is not being copied to webapp/WEB-INF/classes except for the very first time upon adding the web project capabilities to the project.
Which sounds like it’s not working at all. Could you clarify for me what exactly is happening to the file in the Tomcat dir, when you edit it and save it in MyEclipse? Is the timestamp on the file under Tomcat changing?
kvaMemberNOTE: Make sure Window > Prefs > General > Workspace > Build automatically is turned on
Yes, it’s on.
So to me that sounds like MyEclipse is doing it’s job deploying the changed file out to your tomcat deploy directory, but Tomcat just isn’t reloading the changes.
MyEclipse simply copied webapp/WEB-INF/classes/resource to the tomcat deployment directory so that the modification date of the file changed. But prior to that, MyEclipse should have copied conf/all/resource (since that is what I edit) to webapp/WEB-INF/classes/resource.
Riyad KallaMemberMyEclipse simply copied webapp/WEB-INF/classes/resource to the tomcat deployment directory so that the modification date of the file changed. But prior to that, MyEclipse should have copied conf/all/resource (since that is what I edit) to webapp/WEB-INF/classes/resource.
When you save a file in Eclipse (and subsequently MyEclipse), it is “built”, for non-compilable resources, like XML docs or Text docs, this means copying them into the output location, in this case WEB-INF/classes/resource. MyEclipse hooks into this build cycle to add an aditional step: copy the built resource out to the deployment location.
So in this case, when you hit CTRL-S, Eclipse copies your file to WEB-INF/classes/resource, and immediately MyEclipse copies that out ot your Tomcat dir.
Soooo, if the timestamp is changing on the deployed file in the Tomcat dir, then it is behaving as it should. Just to double check, open your source file and type something like “I LIKE PEANUT BUTTER” and save it, now go check the other two files, they should say “I LIKE PEANUT BUTTER” in them.
kvaMemberWhen you save a file in Eclipse (and subsequently MyEclipse), it is “built”, for non-compilable resources, like XML docs or Text docs, this means copying them into the output location, in this case WEB-INF/classes/resource.
Sigh, right. I did not tell the whole story. The project is created by maven and we set the default output folder to project-name/build-eclipse by default for all our projects. When working in eclipse we simply add the web project capabilities. Apparently, adding web project capabilities does not change the output directory. So there lies the problem. My output directory is wrong.
Thanks for clarifying.
-
AuthorPosts