- This topic has 13 replies, 4 voices, and was last updated 9 years, 1 month ago by support-swapna.
-
AuthorPosts
-
EmptyMemberHello,
I have recently upgraded to MyEclipse 2015 stable 1.0. I have a project set up using the Dynamic Web Module 3.0 facet. I have added the Web Module to the Server (a local Apache Tomcat 7 instance, although not the MyEclipse Tomcat 7 instance) through the Manage Deployments interface. I can start the Server and interact with the web app just fine. The problem is when I try to change a non-java resource (xhtml, js, css, etc). The file is automatically deployed the to the server (which is what I want it to do), but in doing so it also causes the ServletContext to reload (which is what I don’t want it to do):
Mar 05, 2015 3:57:40 PM org.apache.catalina.core.StandardContext reload
INFO: Reloading Context with name [/management] has startedNow I’ve been a long time user of MyEclipse, although I haven’t been doing much web development recently so I’m unfamiliar with the “Servers” view and dealing with configuring Tomcat through it, but I do remember that at one point it was possible to change a non-java resource and have it automatically deploy to the server without triggering a full context reload.
So I did some looking around and I found the following instructions:
http://www.mkyong.com/eclipse/how-to-configure-hot-deploy-in-eclipse/
While being able to hot deploy class files sounds interesting, I don’t think I’d ever fully trust such a feature so I’m happy with restarting the server in these cases. However, even after following these instructions the context was still reloading on me.
Now I ended up checking the timestamps of the files on the server and they all show the time I last redeployed the entire project with the exception of the file I just modified, so it seems like the only file copied was the one I changed. I also tried to copy the file over manually and a context reload wasn’t triggered so it would appear that this is an issue with how MyEclipse more so than Tomcat.
Is there something I’m missing on how to accomplish this? Any help would be appreciated.
Thanks,
Ben
support-swapnaModeratorBen,
Thank you for trying MyEclipse 2015 Stable release. To enable hot deployment, you must set the Tomcat deployment mode to “Use Tomcat auto deployment mode”.
Remove all the deployments from the Tomcat server, right click on the Tomcat server entry in the Servers view and select ‘Publish’. Double click on the Tomcat server to open the Overview page. Check the ‘Use Tomcat auto deployment mode” and save the changes.
Here is the screenshot for your reference :
Now deploy the project and check.
Let us know how it works for you.
EmptyMemberHello,
Thanks for the response. I’m attaching my current configuration, it started out with that option set.
For what it’s worth, I reset my workspace last night (deleted the .metadata folder) as well as removed all eclipse based files from the project itself before adding it back in again. With the exception of configuring a couple of things (tomcat server, default jre, a couple of project settings including facets and build path), everything else seems to be at their default settings right now. None of this has helped.
Thanks,
BenAttachments:
You must be logged in to view attached files.
EmptyMemberHello Swapna,
Well, I figured out what is happening although I don’t know why or what I can do about it. This project uses the Seam Framework and for some reason, MyEclipse is reloading the context if I include Seam’s JAR in the project’s library folder. Cause when I removed the JAR from the lib folder and added it in manually on the server, I could make changes to non-java files without triggering a context reload.
Now I realized that the JAR was the problem after looking at the Servers view (see attached). It has the JAR listed as a JEE EJB Module so I’m assuming it thinks the JAR is built from a separate project (module). It is not, however. It’s just a drop in JAR. Looking at my project’s configuration, I don’t see anywhere that I can specify that this project even uses EJBs, let alone where I can set it up as a Module. I have facets set up for a Dynamic Web Project, Java, Javascript, and JavaServer Faces only.
I’m assuming MyEclipse thinks the JAR is a project of it’s own from this link:
However, it looks like this issue was fixed in WTP 3.0, whereas it looks like MyEclipse is already on 3.6.1, so there could be something else going on here.
Nonetheless, I guess my first question is why does MyEclipse treat that JAR as a Module of its own and if there’s anything that can be done to change its perception. Which then makes me wonder why would that cause a context reload anyway.
Thanks again for any insight you can provide,
BenAttachments:
You must be logged in to view attached files.
support-swapnaModeratorBen,
While we see that the JAR shows as a JEE EJB module at our end, we could not replicate the issue with the context reload.The Seam JAR might have EJB modules packaged within which is the reason why it shows as EJB module.
Can you please send us the project to help us replicate the issue with context reload at our end ? If you have constraints sharing the source code then you can strip the project of its source code and send us all the .* files (.settings,.classpath,.project etc). Please also send us the Tomcat configuration files and its exact version details to help us with the investigation.
EmptyMemberHi Swapna,
I figured this out. I need to include a context.xml file in my WAR file and I had the reloadable attribute set to true on it. It appears that the Seam JAR, due to being considered an JEE EJB Module, was also being copied over to the server on every non-java resource change, which then triggered the context reload. Once I set it to false, the reloading stopped.
So I guess my question now is will anything be done to better handle these kinds of scenarios in future versions of MyEclipse? While some may consider it a feature that MyEclipse will automatically determine if a JAR has EJB modules contained within and treat it appropriately, others may see it as a bug since that determination carries additional consequences that may not be appropriate for their project. I’d prefer to have the option to choose between the two.
Thanks,
Ben
support-swapnaModeratorBen,
Thank you for getting back to us with your findings. I have filed a bug for the dev team to investigate further. I will get back to you when I have more information about the fix.
Thanks for your patience.Let us know if you see any issues.
support-piotrParticipantBen,
I have taken a closer look at this issue. In my case jboss-seam.jar is not being copied over, if it is present in the target directory. If I remove it manually it will be copied again though. Here is console log in that case:
**jar manually removed** mar 12, 2015 2:49:10 PM org.apache.catalina.loader.WebappClassLoader modified SEVERE: Resource '/WEB-INF/lib/jboss-seam.jar' is missing mar 12, 2015 2:49:10 PM org.apache.catalina.core.StandardContext reload INFO: Reloading Context with name [/TestWeb] has started mar 12, 2015 2:49:10 PM org.apache.catalina.core.StandardContext reload INFO: Reloading Context with name [/TestWeb] is completed **changed non-resource file** mar 12, 2015 2:49:20 PM org.apache.catalina.loader.WebappClassLoader modified INFO: Additional JARs have been added : 'jboss-seam.jar' mar 12, 2015 2:49:20 PM org.apache.catalina.core.StandardContext reload INFO: Reloading Context with name [/TestWeb] has started mar 12, 2015 2:49:20 PM org.apache.catalina.core.StandardContext reload INFO: Reloading Context with name [/TestWeb] is completed
The algorithm is setting last modified date for the copied file, same as for the source file. On hot-sync it checks whether the file timestamp of the original one and target one are different or if the file has been deleted and only in such a case it performs copying. It’s possible that either algorithm needs improvements or something else is happening. Could you please check if after copying, the deployed jar has the same modification date as the original one?
I would like to provide an accurate solution for your issue, so I need some more information. Could you please provide configuration files for your project (.project, .classpath, .settings folder, context.xml and web.xml), as well as Tomcat console logs ? I assume that by non-java file you mean e.g. an HTML file or JSP file. Thank you very much for reporting this issue!
EmptyMemberHi Piotrek,
I pm’d you the project files you requested. As far as the information you requested goes, the date modified time stamps on the server seem to match the time when the resource was published. I see that the jboss-seam.jar file on the server has its modified date updated every time I save an (xhtml) resource. The time stamp matches the one on the xhtml file. I’m assuming it’s copying the jar and not just updating the time stamp, although I’m not really sure how to prove that. The xhtml file is indeed being copied over as I can see the changes applied on the site. When looking at the jar file in my project, it has a modified date of March 6th, so it’s always older than what is on the server. In case it matters, the jar is from Seam 2.3.1.
As far as the logs go, there really isn’t anything to see so I didn’t send one. When I had reloadable set to true on the context I got the message I put in my first post. If it’s set to false then there is no output on a change. I have my logging set to INFO, so not sure if you’d like for me to try again with it on DEBUG.
Thanks,
Ben
support-piotrParticipantBen,
Unfortunately, there is nothing specific about your project. I have fixed a possible cause of a problem (copying the seam jar) and it will be available in the next release. It is also possible that setting reloadable to true triggers reloading when XHTML file changes. In MyEclipse we have disabled context reload for Tomcat servers by default as it is causing app restart in weird moments. In most of the cases resource copying and class hot-swap is enough and in all others you would just restart server. Let us know if you can see your problem fixed in the new release, which is due next Monday.
EmptyMemberHi Piotrek,
Will do, thanks for looking into it for me.
Ben
support-swapnaModeratorBen,
We noticed you were previously on the MyEclipse Stable stream, but may have switched to the CI stream for fixes to your issues. We would like to inform you that MyEclipse 2015 Stable 2.0 has been released last week and includes these fixes as well, in case you need to switch back to the Stable stream.
You can upgrade to MyEclipse 2015 Stable 2.0 from MyEclipse 2015 Stable 1.0 (Help > Check for Updates) or use the MyEclipse 2015 Stable 2.0 installer and install it to a different location.
The MyEclipse 2015 Stable 2.0 installer is available here : https://www.genuitec.com/products/myeclipse/download/Let us know if you see any issues.
–Swapna
MyEclipse Support
chandan-kumarParticipantHi Swapna,
What is the release date of MyEclipse 2015 Stable 2.0 version. On the following URL : https://www.genuitec.com/products/myeclipse/deliverylog/stable/ i can see release date is updated daily with the current date.
support-swapnaModeratorChandan,
Thank you for pointing to it. The actual release date is May 28th 2015. I have notified the team to fix it.
If you are looking to work with MyEclipse Stable 2.0, then you can download the installer from here :
https://www.genuitec.com/products/myeclipse/download/–Swapna
MyEclipse Support -
AuthorPosts