Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » ServerTools (WTP) » class files disappear sporadically from a tomcat deployment
class files disappear sporadically from a tomcat deployment [message #1745028] Tue, 04 October 2016 10:17 Go to next message
David Balažic is currently offline David BalažicFriend
Messages: 35
Registered: February 2013
Member
Hi!

This has been plaguing me for a while, last time with Kepler and now in Neon.1.

I have a few web application projects (maven based) deployed to tomcat 6.0.x "inside" Eclipse.

Every now and then the .class files in the server directory disappear and then of course tomcat reports ClassNotFoundException errors.

Then I stop it and do server / Clean... , Project / Clean etc... until it works again.

There a many similar issues reported on the web (google "eclipse wst tomcat classnotfoundexception sporadically" for example).

I also found http://stackoverflow.com/questions/27271625/ where it recommends to delete the /.metadata/.plugins/org.eclipse.wst.server.core/tmp0 folder.
That works, but I would like to get to the bottom if it.

Any idea where to look first?
Bugs #361259 and #334977 look related, but claim to be fixed years ago.

Regards,
David
Re: class files disappear sporadically from a tomcat deployment [message #1745226 is a reply to message #1745028] Thu, 06 October 2016 16:30 Go to previous messageGo to next message
Larry Isaacs is currently offline Larry IsaacsFriend
Messages: 1354
Registered: July 2009
Senior Member
What classes disappear. Is it JSP related classes only and/or do compiled classes disappear? Does anything else disappear? After publishing to the server, you might make a copy of the "tmp?" folder to compare with once something disappears. You wouldn't need to update the copy unless you created new content. It would still show you what disappeared even though what didn't disappear had changed.

Cheers,
Larry
Re: class files disappear sporadically from a tomcat deployment [message #1745234 is a reply to message #1745226] Thu, 06 October 2016 18:47 Go to previous messageGo to next message
David Balažic is currently offline David BalažicFriend
Messages: 35
Registered: February 2013
Member
It seems all my compiled class files are missing (that is: class files corresponding to .java files in my project, not sure about compiled JSP files).
I'll take a better look next time it happens.

Note that this is going on for a while. It happened with Kepler SR-2 and now with Neon.1


Also: Setting to "Never publish automatically" does not help, it happened with this setting too.

[Updated on: Thu, 06 October 2016 18:48]

Report message to a moderator

Re: class files disappear sporadically from a tomcat deployment [message #1745247 is a reply to message #1745234] Thu, 06 October 2016 20:54 Go to previous messageGo to next message
Larry Isaacs is currently offline Larry IsaacsFriend
Messages: 1354
Registered: July 2009
Senior Member
I'm not sure who is deleting the files, Eclipse, Maven, or Tomcat, but may may be Eclipse that makes it hard to get them back. Next time they disappear, try deleting the "publish?.dat" file(s) in the .metadata\.plugins\org.eclipse.wst.server.core\publish folder and publishing again. I don't think the publishing looks at the destination, but caches information in the .dat file and only copies files that are newer than what recorded for what last copied.

It would be helpful to know if anything more than those class files is being deleted. Also, so I have a little more information to attempt guesses, what is the content of the org.eclipse.wst.common.component file in the .settings folder of your Dynamic Web project?
Re: class files disappear sporadically from a tomcat deployment [message #1745332 is a reply to message #1745247] Fri, 07 October 2016 13:42 Go to previous messageGo to next message
David Balažic is currently offline David BalažicFriend
Messages: 35
Registered: February 2013
Member
Quote:
what is the content of the org.eclipse.wst.common.component file in the .settings folder of your Dynamic Web project?


It is:

<?xml version="1.0" encoding="UTF-8"?><project-modules id="moduleCoreId" project-version="1.5.0">
    <wb-module deploy-name="FOO.web">
        <wb-resource deploy-path="/" source-path="/target/m2e-wtp/web-resources"/>
        <wb-resource deploy-path="/" source-path="/src/main/webapp" tag="defaultRootSource"/>
        <wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/java"/>
        <wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/resources"/>
        <dependent-module archiveName="FOO.interface-0.0.1-SNAPSHOT.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/FOO.interface/FOO.interface">
            <dependency-type>uses</dependency-type>
        </dependent-module>
        <dependent-module archiveName="FOO.impl-0.0.1-SNAPSHOT.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/FOO.impl/FOO.impl">
            <dependency-type>uses</dependency-type>
        </dependent-module>
        <property name="context-root" value="FOO.web"/>
        <property name="java-output-path" value="/FOO.web/target/classes"/>
        <property name="component.exclusion.patterns" value="WEB-INF/lib/oracle_ojdbc6-11.2.0.1.0.jar,WEB-INF/lib/ojdbc6_g-11.2.0.2.0.jar,WEB-INF/classes/none"/>
    </wb-module>
</project-modules>
Re: class files disappear sporadically from a tomcat deployment [message #1745353 is a reply to message #1745332] Fri, 07 October 2016 18:07 Go to previous messageGo to next message
Larry Isaacs is currently offline Larry IsaacsFriend
Messages: 1354
Registered: July 2009
Senior Member
I'm not that familiar with Maven, so I can't say how Maven's idea of "building" might conflict with Eclipse's idea of "building". It is interesting that with <property name="java-output-path" value="/FOO.web/target/classes"/>, it would seem that Eclipse incremental compile and Maven Java compilation are both sending their results to "/FOO.web/target/classes". I'm not sure if this creates any problems. Next time the class files disappear, it might be worth checking "/FOO.web/target/classes" to see what is under it. Also, the next time it happens, the main clue will be establishing exactly what did and what didn't go missing.
Re: class files disappear sporadically from a tomcat deployment [message #1746809 is a reply to message #1745226] Fri, 04 November 2016 19:44 Go to previous messageGo to next message
David Balažic is currently offline David BalažicFriend
Messages: 35
Registered: February 2013
Member
It happened again. Compared to a "good" copy, the changes in the tmp0 folder are:

- in publish.txt
The bad copy is missing these two lines from the good copy:
org.eclipse.jst.j2ee.server\:foo.interface=WEB-INF/lib/foo.interface-0.0.1-SNAPSHOT.jar
org.eclipse.jst.j2ee.server\:foo.impl=WEB-INF/lib/foo.impl-0.0.1-SNAPSHOT.jar


- in wtpwebapps/foo.web/pages/
there is a an empty folder in the bad copy, that is missing int the good copy. This folder has no content in the sources (in the Eclipse workspace).

- in wtpwebapps/foo.web/WEB-INF/classes/
All *.class files are missing in the bad copy.

Note: the files wtpwebapps/foo.web/WEB-INF/classes/foo.interface-0.0.1-SNAPSHOT.jar and foo.impl-0.0.1-SNAPSHOT.jar are present in both the good and bad copy.
Re: class files disappear sporadically from a tomcat deployment [message #1746928 is a reply to message #1746809] Mon, 07 November 2016 18:26 Go to previous messageGo to next message
Larry Isaacs is currently offline Larry IsaacsFriend
Messages: 1354
Registered: July 2009
Senior Member
Thanks David. I'll see what sense I can make out of this information.

Cheers,
Larry
Re: class files disappear sporadically from a tomcat deployment [message #1771100 is a reply to message #1746928] Mon, 21 August 2017 22:42 Go to previous message
Joel Hirsh is currently offline Joel HirshFriend
Messages: 1
Registered: August 2017
Junior Member
I don't know if it makes sense to continue this thread or if I should start another one, but I continually have the same problem of things not being published.

I first started using WTP with Neon, and just upgraded to Oxygen, and the problem still exists. It is a Maven project.

It didn't happen at all for the first few months I was using WTP, then it happened once, then more frequently, now it seems to happen every day or two. And the suggested solutions of adding/removing the project from the server, republishing, cleaning, deleting the Tomcat tmp folder, etc. no longer work the first time. Deleting the placesx.dat file as suggested here didn't help either. It mostly seems to be that the .class files are not being published - that folder is empty. If I manually copy the class files to Tomcat, then everything works.

Sure would be nice to get to the bottom of this.
Previous Topic:Eclipse Neon.3: Separate Tomcat installation required?
Next Topic:Debugging JavaScript within eclipse connecting to Firefox remote debugger
Goto Forum:
  


Current Time: Thu Oct 10 02:38:54 GMT 2024

Powered by FUDForum. Page generated in 0.04990 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top