Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Web Tools Project (WTP) » Dynamic Web Project - Old files on Tomcat Server(Server doesn't show newest version of files)
Dynamic Web Project - Old files on Tomcat Server [message #650983] Thu, 27 January 2011 11:31 Go to next message
No real name is currently offline No real nameFriend
Messages: 7
Registered: January 2011
Junior Member
Hello,

I´ve got a problem with my dynamic web project in Eclipse. I wrote some JSPs and run them on a Tomcat Server with Eclipse. Unfortunately for some reason, Eclipse shows me an old version of my JSP-File when I select "run on server" and not the newest one. Is there anything I can do to force an update of the file on the server (or perhaps a setting to get this done automatically)?

[Updated on: Thu, 27 January 2011 11:31]

Report message to a moderator

Re: Dynamic Web Project - Old files on Tomcat Server [message #651071 is a reply to message #650983] Thu, 27 January 2011 16:17 Go to previous messageGo to next message
Larry Isaacs is currently offline Larry IsaacsFriend
Messages: 1313
Registered: July 2009
Senior Member
On 1/27/2011 6:31 AM, florianbeuter@arcor.de wrote:
> Hello,
>
> I´ve got a problem with my dynamic web project in Eclipse. I wrote some
> JSPs and run them on a Tomcat Server with Eclipse. Unfortunately for
> some reason, Eclipse shows me an old version of my JSP-File when I
> select "run on server" and not the newest one. Is there anything I can
> do to force an update of the file on the server (or perhaps a setting to
> get this done automatically)?
>

If you double-click on the server in the Servers view, it will open the
server editor for that server. There is a Publishing section where you
control the publishing behavior. There could be some other issue at
play, but there isn't enough information to tell.

Cheers,
Larry
Re: Dynamic Web Project - Old files on Tomcat Server [message #651116 is a reply to message #651071] Thu, 27 January 2011 20:28 Go to previous messageGo to next message
No real name is currently offline No real nameFriend
Messages: 7
Registered: January 2011
Junior Member
I had a look at the publishing section of the server you mentioned and the selected entry in my configuration is "Automatically publish when resources change". This sounds right to me, but as I said the server doesn't actually do it.
For example I have a headline in my JSP which started from the left in the older version and now I've set it to the center of the page, but it always shows the previous version to me.
I didn't change anything in the server settings and when I started with my project everything worked very well and the updates of my pages where automatically on my server when I started them and suddenly it was over with that comfort...
Re: Dynamic Web Project - Old files on Tomcat Server [message #651122 is a reply to message #651116] Thu, 27 January 2011 21:20 Go to previous messageGo to next message
Larry Isaacs is currently offline Larry IsaacsFriend
Messages: 1313
Registered: July 2009
Senior Member
On 1/27/2011 3:28 PM, florianbeuter@arcor.de wrote:
> I had a look at the publishing section of the server you mentioned and
> the selected entry in my configuration is "Automatically publish when
> resources change". This sounds right to me, but as I said the server
> doesn't actually do it.
> For example I have a headline in my JSP which started from the left in
> the older version and now I've set it to the center of the page, but it
> always shows the previous version to me.
> I didn't change anything in the server settings and when I started with
> my project everything worked very well and the updates of my pages where
> automatically on my server when I started them and suddenly it was over
> with that comfort...

Next is to verify if the modified JSPs are being copied when publishing
occurs. By default, the "assembled" webapp will be published to a
folder under a
" .metadata\.plugins\org.eclipse.wst.server.core\tmp?\wtpwebap ps " folder
under your workspace (see the Tomcat FAQ[1] for details). Is the copy
of the JSP(s) under there being updated with your changes?

If they are not being updated, try right-clicking on the server as
selecting "Clean...". This will force a "full", rather than "delta"
publish, and the JSP(s) should get updated. I'm not aware of a bug that
would cause resource changes to get lost an not mark a server as "dirty"
and in need of publishing, but that doesn't mean there isn't one.

If they are being updated, then there are some Tomcat settings that can
cause this behavior that we will have to investigate.

Cheers,
Larry

[1] http://wiki.eclipse.org/WTP_Tomcat_FAQ
Re: Dynamic Web Project - Old files on Tomcat Server [message #651181 is a reply to message #651122] Fri, 28 January 2011 09:25 Go to previous messageGo to next message
No real name is currently offline No real nameFriend
Messages: 7
Registered: January 2011
Junior Member
Hello,
first, thank you for your detailed answer.
I had a look at this directory and found versions of my files which were not updated there. For the JSP-Files your suggested solution with "clean" and "publish" did work very well. I'm also using a java bean class in this project and this file doesn't get updates via "clean" and "publish", but at least I can now fix this issue manually by compiling the file via command-line and copy it into its destination folder. Or is there something special about updating java beans in dynamic web projects I missed?
Re: Dynamic Web Project - Old files on Tomcat Server [message #651225 is a reply to message #651181] Fri, 28 January 2011 13:10 Go to previous messageGo to next message
Larry Isaacs is currently offline Larry IsaacsFriend
Messages: 1313
Registered: July 2009
Senior Member
On 1/28/2011 4:25 AM, florianbeuter@arcor.de wrote:
> Hello,
> first, thank you for your detailed answer.
> I had a look at this directory and found versions of my files which were
> not updated there. For the JSP-Files your suggested solution with
> "clean" and "publish" did work very well. I'm also using a java bean
> class in this project and this file doesn't get updates via "clean" and
> "publish", but at least I can now fix this issue manually by compiling
> the file via command-line and copy it into its destination folder. Or is
> there something special about updating java beans in dynamic web
> projects I missed?

Part of publishing is to copy built output artifacts from Java source
folder(s) in your project to the WEB-INF/classes of the published
webapp. It's not clear why this isn't happening for your project. If
you create a new simple webapp project with some Java classes and some
JSPs, can it update properly when changes occur?

Cheers,
Larry
Re: Dynamic Web Project - Old files on Tomcat Server [message #651249 is a reply to message #651225] Fri, 28 January 2011 14:48 Go to previous messageGo to next message
No real name is currently offline No real nameFriend
Messages: 7
Registered: January 2011
Junior Member
Okay, I tried to create a new project with one JSP and a java bean class. When I try to access a method of the java class from the JSP the server throws a ClassNotFoundException.
While in my normal project it says that it doesn't know a certain method I try to call from the JSP (its a new method I've added in a more recent version of my java class).
I don't understand why it worked very well, when I started my project and then suddenly the problems began although I didn't change anything in the server settings.
Re: Dynamic Web Project - Old files on Tomcat Server [message #651524 is a reply to message #651249] Mon, 31 January 2011 14:24 Go to previous messageGo to next message
Larry Isaacs is currently offline Larry IsaacsFriend
Messages: 1313
Registered: July 2009
Senior Member
On 1/28/2011 9:48 AM, florianbeuter@arcor.de wrote:
> Okay, I tried to create a new project with one JSP and a java bean
> class. When I try to access a method of the java class from the JSP the
> server throws a ClassNotFoundException.
> While in my normal project it says that it doesn't know a certain method
> I try to call from the JSP (its a new method I've added in a more recent
> version of my java class).
> I don't understand why it worked very well, when I started my project
> and then suddenly the problems began although I didn't change anything
> in the server settings.

So the class for the new project really didn't get copied to the
"WEB-INF/classes" to the webapp's folder under "...\tmp?\wtpwebapps"?
It's not clear what would go wrong publishing a new project to a server.
It's first publish should be the same as if you used "Clean...". What
are the contents of the "org.eclipse.wst.common.component" file in the
".settings" folder of the new project? Also, what are the contents of
the ".classpath" file in the root folder of the new project?

Cheers,
Larry
Re: Dynamic Web Project - Old files on Tomcat Server [message #651543 is a reply to message #650983] Mon, 31 January 2011 15:41 Go to previous message
No real name is currently offline No real nameFriend
Messages: 7
Registered: January 2011
Junior Member
This is really strange. Yesterday I exported my project to another computer (also with Tomcat v7) and tried to work with it there and everything was fine. On every change in my JSPs and Java classes the server got the new versions automatically and suggested a server restart if necessary. Now I tried it again on this computer where it didn't work and after I kicked the project off the server and launched it again it seems to work here too.
I hope it stays this way.
Thanks for your help. Smile
Previous Topic:Dependencies not deployed on TomCat
Next Topic:Need help with TCP/IP monitor
Goto Forum:
  


Current Time: Sat Dec 20 04:40:41 GMT 2014

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

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