Tomcat doesn't update until I restarted Eclipse - java

i have problem with tomcat. when i change something in my xhtml file, tomcat can not show the changes. it shows the page before changing. i restart the tomcat,i clean tomcat work directory, right click on server and select clean, but i have to restart the eclipse to see the result. i search in google but i could not find which setting i should do in tomcat to solve the problem.in publish tab i selected "automatically publish when resource changes" .
please help me. i have to restart eclipse for each changing.

Please be sure your XHTML file is not being cached by your browser. Try a forced refresh (on Firefox, press Shift+Refresh Button or Command+Refresh on Mac).
You might also try to configure Tomcat context to disable caching for static resources as documented in the Apache Tomcat Configuration Reference. Set the cachingAllowed property to false (default is true).
Check HTTP headers using Firebug. See what you is in the HTTP response: HTTP response code, Cache-Control and Expires headers.

Like #Sam said, make sure that your files are not being cached by your browser. On Mac (Command + R) Firefox and Chrome (Shift + F5).
If this does not work, double click the server on Eclipse and go to the Publishing tab. Make sure that it is set to Automatically publish when resources change.

Related

Idea svn check out, has been keep in the loading, how to solve

Svn client connection when using the key file and password, no error, that is, after clicking the url no project can choose to stay in the loading.
Do you mean you use svn+ssh connection URL? The issue seems like https://youtrack.jetbrains.com/issue/IDEA-139313
Does checkout work use command line svn client?
If you don't use the command line, try enabling it in Settings - Version control - Subversion. Also, try enabling Interactive mode
clear up files in folder C:\Users\your account.IntelliJIdea2018.3\system\vcs,vcsCathe,vcs-users.Then restart your IntelliJIdea.

How do I get rid of the below stated issue when I try to add tomcat to Spring Tool suite in Ubuntu?

I am trying to add Tomcat server in to STS but I do am not able to do it. Some times the server name doesn't appear when I try to add Tomcat by selecting it from the list, I can't type in the server name myself as well and If that step works properly (I mean when the serve name appears automatically which it should when server is selected form the list); the Finished button is grayed out in the resource page which is the last step in adding the Tomcat server to STS.
Close Eclipse
In {workspace-directory}/.metadata/.plugins/org.eclipse.core.runtime/.settings delete the following two files:
org.eclipse.wst.server.core.prefs
org.eclipse.jst.server.tomcat.core.prefs
Restart Eclipse
this is actually a bug.
got this from this question actually Eclipse add Tomcat 7 blank server name

Eclipse Tomcat not Updating

I am developing an application with SpringMVC and Tomcat using Eclipse. The problem is: the server does not update the changes I am making.
One example:
#RequestMapping(value = "test", method = RequestMethod.GET)
public ModelAndView test(){
ModelAndView mv = new ModelAndView("test");
System.out.println("test");
return mv;
}
Every time I hit the mapped url, Eclipse prints test in my console. If I comment out the println, I get the same result.
Attempts to fix the problem:
clean Tomcat directory
restart the server
close Eclipse
add/remove the project in the Server tab
delete the JSP the method is using
different browsers
All to no effect. It just looks like Tomcat is not updating any changes I make in the code.
To make Eclipse Tomcat update automatically or hot deploy you have to make certain changes in server configuration:
Below are the steps:
Double clicks on the Tomcat Server, refer to "publishing" tab in the "Overview" view, make sure "Automatically publish when resources change" is selected. This should be the default option, to support “hot deploy” resources, for example : JSP, XML and properties files.
In the Tomcat Plugin page, click on the "Modules" view, Select the Module then click on Edit button and make sure "Auto Reload" is "Disabled". Default is enabled.
Start Project in DEBUG mode. Hot Deploy is supported in DEBUG mode only.
Two more things to check:
deploy directory: in the tomcat server UI and according to "deploy path" configuration, check that the output directory has read/write access (you could also remove it and try to publish again : check expected output resources/classes).
deployment assembly: in project properties menu; in the "deployment assembly" section, check that you are publishing all wanted resources. For example, in my case I download/generate some items from maven custom plugin phase and this resources are not published by default. I had to add some target subdirectories here...
I had roughly the same problem and after tried it all with no success I gave up, created another fresh workspace and the problem was gone. Not the ideal solution but hey, it's an option.

How do I run a DropWizard / Jersey server locally without having to restart & repack to get asset file updates?

I'm working on the client side of a project that is using DropWizard. Unfortunately what I'm experiencing is that for me to make a change to assets I have to stop the server, package the assets with maven, and then rerun the server or the assets will not be updated.
I tried adding dropwizard-configurable-assets-bundle but I'm still seeing the same behavior. Here's the service after adding it:
Service.java
public void initialize(strap<ServiceConfiguration> strap) {
// Assets
strap.addBundle(new ConfiguredAssetsBundle(
"/dashboard/app/", "/dashboard/", "index.html"
));
// Redirect /dashboard to /dashboard/
strap.addBundle(new RedirectBundle(ImmutableMap.<String, String>builder()
.put("/dashboard", "/dashboard/").build()));
}
I'm currently running mvn package && java -jar target/pack.jar server config.yml. I tried using Eclipse but I was having to restart it manually and it wasn't repackaging for me so it was slowing things down even further.
This whole process is reaaaally slowing me down and I'm hoping it's just my ignorance to the world that is Java.
In my Intellij Idea, i am using JRebel plug-in for this purpose. JRebel also supports Eclipse.
If your assets are packaged under src/main/resources then they should just update automatically with Eclipse without a restart being required, so long as you're running the executable service main() from within the IDE.
You may need to check that your Maven plugin is set to "generate-resources" on changes but that is just the default setting so should be in place already.
What you're describing is definitely possible in Eclipse - I have personal experience of making resource changes (e.g. change and save an HTML asset) and then seeing an immediate update upon doing nothing more than a browser refresh.

Why tomcat server location property is greyed in Eclipse

I want to change server location but I can't it's greyed (I cannot select last radio button) how can I do it then:
On the Servers view, delete all the webapps published under your server (right click on the server > Remove or right click on the server > Add and Remove and then remove manually the webapps) and finally right click on the server > Publish (the 'empty' content). This way you would un-gray the Server Locations area.
As the dialog says : "Server must be published with no modules present to make changes."
Stop the server remove any modules. After that the options will be enabled.
One way to change the server location is by doing the following steps:
1)Right click on the Server(Example Tomcat server).
2)Go to Properties.
3)Click on "Switch Location" , in the "General" tab.
4)The "Location" information changes.
5)Now go back and the settings will be enabled to change the Server Locations
If you are still dont see the option enabled, start the tomcat and then it will be enabled.

Categories