Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Web Tools Project (WTP) » Problem with republish not getting triggered(Change in Java project does not trigger republish in Tomcat)
Problem with republish not getting triggered [message #652886] Mon, 07 February 2011 08:18 Go to next message
Erik is currently offline Erik
Messages: 4
Registered: February 2011
Junior Member
I have a most annoying situation in Eclipse / Tomcat.

The situation i am used to is this:
- Change a Java code file
- Save the file
- Right click project and build

If the Tomcat server is not running its status changes from synchronised to republish
If the Tomcat server is running a republish automatically happens within a few seconds.
Just the way i want it.

Unfortunately i had a disk crash and i have had to switch to a different laptop and re-install everything. The new situation i'm working in is this:

- Change a Java code file
- Save the file
- Right click project and build

No effect on the server wether its running or not.

The weird thing is that i can only trigger a republish with this sequence of actions:

- Change a Java code file
- Save the file
- Right click project and build
- Change a Java code file again, even a dummy change like add a space
- Save the file

Then, and only then, is there an effect.
If the server is not running the status changes from synchronised to republish.
If it is running the status also cahnges from synchronised to republish but the actual republish does not occer.
The weird part being that even the rebuild does not trigger the republish, only the second edit and save of the code file.


I have installed:
Version: Helios Service Release 1 Build id: 20100917-0705
Tomcat: Version 6.0.30
When examining the server settings there is a section called "Publishing" , i have that set to "Automatically republish after a build event" with interval of 0 (zero) seconds

Anyone got any idea what's going on and what setting or log files i might examine to get it working back with a simple automatic republish after each build.
Re: Problem with republish not getting triggered [message #652949 is a reply to message #652886] Mon, 07 February 2011 12:32 Go to previous messageGo to next message
Larry Isaacs is currently offline Larry Isaacs
Messages: 1299
Registered: July 2009
Senior Member
On 2/7/2011 8:18 AM, Erik wrote:
> I have a most annoying situation in Eclipse / Tomcat.
>
> The situation i am used to is this:
> - Change a Java code file
> - Save the file
> - Right click project and build
>
> If the Tomcat server is not running its status changes from synchronised
> to republish
> If the Tomcat server is running a republish automatically happens within
> a few seconds.
> Just the way i want it.
>
> Unfortunately i had a disk crash and i have had to switch to a different
> laptop and re-install everything. The new situation i'm working in is this:
>
> - Change a Java code file
> - Save the file
> - Right click project and build
>
> No effect on the server wether its running or not.
>
> The weird thing is that i can only trigger a republish with this
> sequence of actions:
>
> - Change a Java code file
> - Save the file
> - Right click project and build
> - Change a Java code file again, even a dummy change like add a space
> - Save the file
>
> Then, and only then, is there an effect.
> If the server is not running the status changes from synchronised to
> republish.
> If it is running the status also cahnges from synchronised to republish
> but the actual republish does not occer.
> The weird part being that even the rebuild does not trigger the
> republish, only the second edit and save of the code file.
>
>
> I have installed:
> Version: Helios Service Release 1 Build id: 20100917-0705
> Tomcat: Version 6.0.30
> When examining the server settings there is a section called
> "Publishing" , i have that set to "Automatically republish after a build
> event" with interval of 0 (zero) seconds
>
> Anyone got any idea what's going on and what setting or log files i
> might examine to get it working back with a simple automatic republish
> after each build.

Just to make sure, is Project -> Build Automatically still enabled? In
case it helps, right-clicking on the server in the Servers view and
selecting "Clean..." will force a "full" publish for that server.

Cheers,
Larry
Re: Problem with republish not getting triggered [message #652951 is a reply to message #652886] Mon, 07 February 2011 12:43 Go to previous messageGo to next message
Erik is currently offline Erik
Messages: 4
Registered: February 2011
Junior Member
No , i have the build set to manual, project by project.

The clean option on the server actually triggers a restart,
so a stop, republish, and start.

It should simply republish as soon as a project gets a new build without a need to restart Tomcat.
Re: Problem with republish not getting triggered [message #652969 is a reply to message #652951] Mon, 07 February 2011 14:13 Go to previous messageGo to next message
Larry Isaacs is currently offline Larry Isaacs
Messages: 1299
Registered: July 2009
Senior Member
On 2/7/2011 12:43 PM, Erik wrote:
> No , i have the build set to manual, project by project.
>
> The clean option on the server actually triggers a restart,
> so a stop, republish, and start.
>
> It should simply republish as soon as a project gets a new build without
> a need to restart Tomcat.
>

Regardless of publishing, a context reload (Tomcat may do this
automatically depending on configuration and what changed) or a server
restart will be needed for changed classes to become visible in the
server (needed to replace the classloader with the stale classes).

I'm not familiar with what may have changed that seems to be causing
resource changes to get "lost" with respect to marking a server as
"dirty" and in need of publishing. The "Clean" operation is the only
one I know that will force the publish regardless of the server being
marked "dirty".

Cheers,
Larry
Re: Problem with republish not getting triggered [message #655348 is a reply to message #652949] Sat, 19 February 2011 12:46 Go to previous messageGo to next message
linen  is currently offline linen
Messages: 10
Registered: February 2011
Junior Member
Larry Isaacs wrote on Mon, 07 February 2011 17:32

Just to make sure, is Project -> Build Automatically still enabled? In
case it helps, right-clicking on the server in the Servers view and
selecting "Clean..." will force a "full" publish for that server.

Cheers,
Larry


Hi, I have a related issue with Tomcat failing to publish my project after I manually deleted it from the directory. I've got Build Automatically selected. I've selected to clean the project itself numerous times but it does not publish. I'm on a Mac OS X and when I right click the Server I don't see a "Clean" option. Do I select the server and then select "Clean" from the Project Menu? I tried that and it did not publish the project.

ETA - Resolved this issue by just deleting the server configuration entirely and creating a new one.

[Updated on: Sat, 19 February 2011 13:14]

Report message to a moderator

Re: Problem with republish not getting triggered [message #670357 is a reply to message #655348] Fri, 13 May 2011 11:55 Go to previous messageGo to next message
linen  is currently offline linen
Messages: 10
Registered: February 2011
Junior Member
I've discovered how to perform a right click on OS X. I go into System Preferences -> Keyboard & Mouse. From there I change the value on the right side of the mouse object from Primary Button to Secondary Button. Then I must carefully get back into the Eclipse window, using the left side for standard clicks. I select the server in the server tab and I can indeed use the right side of the mouse to see the pop up menu which includes the option "Clean".
Re: Problem with republish not getting triggered [message #723362 is a reply to message #670357] Thu, 08 September 2011 08:18 Go to previous messageGo to next message
soysus  is currently offline soysus
Messages: 1
Registered: September 2011
Junior Member
I guess is too late, but I had the same problem today. I hope this helps somebody:

What worked for me was to change the configuration on ".settings/org.eclipse.wst.common.component", it seems a file that says to wpt how to behave..

I added the following lines in it:

    <wb-resource deploy-path="/WEB-INF/classes" source-path="src/main/java"/>
    <wb-resource deploy-path="/WEB-INF/classes" source-path="src/main/resources"/>


What made it look something like this:

<?xml version="1.0" encoding="UTF-8"?>
<project-modules id="moduleCoreId" project-version="1.5.0">
  <wb-module deploy-name="[MyProjectName]">
    <property name="context-root" value="[MyProjectRoot]"/>
    <wb-resource deploy-path="/" source-path="src/main/webapp"/>
    <wb-resource deploy-path="/" source-path="src/main/webapp"/>
    <wb-resource deploy-path="/WEB-INF/classes" source-path="src/main/java"/>
    <wb-resource deploy-path="/WEB-INF/classes" source-path="src/main/resources"/>
    <property name="java-output-path" value="/target/classes"/>
  </wb-module>
</project-modules>
Re: Problem with republish not getting triggered [message #723421 is a reply to message #723362] Thu, 08 September 2011 09:46 Go to previous messageGo to next message
Russell Bateman is currently offline Russell Bateman
Messages: 3131
Registered: July 2009
Location: Provo, Utah, USA
Senior Member

Thanks for giving back, Soysus!
Re: Problem with republish not getting triggered [message #723791 is a reply to message #723362] Fri, 09 September 2011 09:49 Go to previous message
Larry Isaacs is currently offline Larry Isaacs
Messages: 1299
Registered: July 2009
Senior Member
On 9/8/2011 8:18 AM, soysus wrote:
> I guess is too late, but I had the same problem today. I hope this helps
> somebody:
>
> What worked for me was to change the configuration on
> ".settings/org.eclipse.wst.common.component", it seems a file that says
> to wpt how to behave..
>
> I added the following lines in it:
>
>
> <wb-resource deploy-path="/WEB-INF/classes" source-path="src/main/java"/>
> <wb-resource deploy-path="/WEB-INF/classes"
> source-path="src/main/resources"/>
>
>
> What made it look something like this:
>
>
> <?xml version="1.0" encoding="UTF-8"?>
> <project-modules id="moduleCoreId" project-version="1.5.0">
> <wb-module deploy-name="[MyProjectName]">
> <property name="context-root" value="[MyProjectRoot]"/>
> <wb-resource deploy-path="/" source-path="src/main/webapp"/>
> <wb-resource deploy-path="/" source-path="src/main/webapp"/>
> <wb-resource deploy-path="/WEB-INF/classes" source-path="src/main/java"/>
> <wb-resource deploy-path="/WEB-INF/classes"
> source-path="src/main/resources"/>
> <property name="java-output-path" value="/target/classes"/>
> </wb-module>
> </project-modules>
>

The source-paths suggest that this might be a maven project. If so, it
would represent a bug in the maven support that failed to include these
extra entries automatically. If this is reproducible behavior, you may
want to file a bug against the maven plug-ins involved.

I'm not sure why there would be two entries for "src/main/webapp". It
probably wouldn't hurt to remove one.

Cheers,
Larry
Previous Topic:Axis2 Problem
Next Topic:Dynamic Deployment Assemblies
Goto Forum:
  


Current Time: Mon Jul 28 12:32:34 EDT 2014

Powered by FUDForum. Page generated in 0.01793 seconds