Java spring ressources not being updated when server deployed - java

I am working on a spring web application using eclipse. For the longest time everything was working fine just until recently I have been having this weird problem. The problem is that when I modify a cs or js file and deploy the server, the source files sent to the browser stays the same as before the modification was made. The only way that I am able to update these files is by rebooting the computer. How can I fix this?
I have tried:
maven update,
clean project,
clean tomcat directory,
clean tomcat,
reinstalling eclipse
note: I am using eclipse neon on linux ubuntu and tomcat 8 for the server
Thanks

In general, Browser caches css or js files, so you need to delete them from Browser > Delete History to get the css or js file changes reflected.

Related

Why is my TomCat8 server giving me "404 Ressource not available" on one laptop but it works on my other laptop?

I'm developing a web app.
I'm trying to make it work on my new laptop.
I'm downloading the sources with git, then creating the WAR, then copying the WAR to my webapps Tomcat8 folder running on my brand new Windows 10 laptop.
The app starts very well
Then I can click on the first button, it works very fine
Then I fill the fields and when I click on "save" it doesn't work (see red message on the top of the screenshot)
When I open dev tools, here is what it says :
Etat HTTP 404 - /DropMe2/api/profile-infotype Rapport
d''étatmessage
/DropMe2/api/profile-infodescription La
ressource demandée n''est pas disponible.Apache Tomcat/8.5.11
(sorry it's French, but it says something like "Requested resource is not available").
Which makes no sense, since on my other Windows laptop it works well and fine. I have taken the exact same sources using maven, made sure that Tomcat is restarted.
I'm having an headache on this, I have no idea where to start looking for..
Please check your configuration port for Database and Tomcat settings ( ex: mysql, usually it is configured to port 80, but it might be configured to 8080 or some different ports in the other pc )
Have you made sure you committed your latest changes to git? Perhaps your endpoint is out of date and the requested resource really isn't there. Tomcat also unpacks the WAR into a separate directory in webapps that doesn't get updated unless you delete it, regardless of if you uploaded a new WAR.
So after investigating ; i had issue with Tomcat8.5 and java..
I have java7 and java8 installed both on my machine -- yes i know.
So here is what i did :
uninstalled java 7
uninstalled java 8
uninstalled tomcat8.5
reboot
installed java 8
installed tomcat 8.0
Well, now it works ! Yipiie !
Thanks to anyone who tried to help :)
Olivier

Liferay IDE portlet changes not synchronized on the server

Platform
Liferay 6.2 EE Tomcat bundle deployed locally
Liferay 1DE - various version in the past 1 year
Liferay 6.2 EE plugins SDK
JDK 6 or 7
Mac OSX or Windows
Problem
We run into an issue intermittently with the Liferay IDE where a portlet java class changes are do show up the Tomcat server.
The setup is as follows:
A portlet is deployed on the server and is also configured to publish and synchronize on the local server (by drag and drop).
Any changes saved to any of the java class result in a expected publish to the server automatically without a need to do a ant deploy/ Liferay -> SDK -> deploy.
These changes can be seen in the browser after the publish
Intermittently, this automatic publish sync of the java classes does not work and the changes can't be seen in the browser.
Stopping and starting the server seem to have no effect.
Has anyone see this behavior?
I am working with a similar platform
Liferay 6.2 EE Tomcat bundle
Liferay Developer Studio 2.2.2
Liferay 6.2 SDK
JDK 7
Windows 10
To "synchronize" the changes in your IDE with your local server is about the way in which you deploy your portlet.
Although these initially steps are not explicitly necessary - I strongly recommend them for consistency
The first steps to clean your local environment
Stop the local server
Right click the server and clean
Empty your webapps folder leaving only root
Empty your temp folder
Remove all files and directories from tomcat-X.x.x/work/Catalina/localhost except _
Next open your local server settings by double clicking on your local server instance. In the top right corner you should see a publishing fold. Click to expand and select the following options
Automatically publish when resources change
Update context path
Under the Liferay Settings fold (bottom left) you should have the following setting selected
Development (portal-developer.properties)
Enabling Developer Mode turns off certain caching options that default to true when operating in standard mode. Despite the official documentation it does not eliminate the need "to redeploy to see your portal modifications".
Instead of direct deploying from ANT, right click on your server -> add -> then select your desired portlet
This creates a directory in webapps with your portlet similar to ANT direct deploy - this is the only way automatic publishing will work.
The problem above happened to a few of my team members local Liferay environments.
I have been able to work around this by following the steps below:
Undeploy the portlet by removing the portlet from the Tomcat home/webapps/ folder
Stop the Tomcat server Liferay IDE
Cleanup the temp folder under Tomcat home/tmp/ folder related the portlet in question
Start the tomcat server via the Liferay IDE
Deploy the portlet to the Tomcat server
The publish sync process seems to start to work after these steps.
I am not sure if there is a better solution.
Hope this helps someone.

Selecting Apache Tomcat Server Causes Java EE Dropdown Menu Failure, NetBeans 7.4

So here's where I'm at:
I've installed the Apache Tomcat Server successfully.
I've configured the JAVA_HOME path successfully, and created a /common/lib directory (as opposed to plain /lib) to get around an issue with NetBeans recognising recent versions of Tomcat.
If I select GlassFish 4.0 as my server, instead of Tomcat, everything's fine -- but I don't want GlassFish 4.0 as my server, as I'm working through a book on Java WebApps and don't want to run into intractable problems further down the line.
When I select Tomcat as my server, I run into the problem that the dropdown menu to select my "Java EE Version" decides it doesn't want to give me any options at all.
Has anyone experienced this problem before, or can anyone offer a rough guess as to what my problem might be?
Thanks in advance!
EDIT: Update - it's not a problem with the JDK classpath of Tomcat. Tomcat works fine on the .jsp files it came bundled with.
I had the similar problem with Tomcat 8. But after downloading Tomcat 7.0.47 I can now choose from Java EE 5 and 6. Hope that helps.

Tomcat 6.0 and Eclipse. Multiple instances of the server behave differently

I have Tomcat 6.0 installation on my Win7 PC. I used 64/32bit windows installation.
In Eclipse I was able to set paths and set server to use my Tomcat installation. Everything seems working fine until I run server from inside Eclipse.
I noticed that http://localhost:8080/index.html page is not available (Tomcat default home page). I also can't access http://localhost:8080/axis2. I have Axis2 installed too.
Since I am struggling to make simple axix2 web service for long time, I am thinking maybe this Eclipse instance of Tomcat is adding to my issues?
When I start Tomcat from windows GUI everything works as I expect.
Any ideas?
Thanks.
Eclipse does by default not take control over the Tomcat installation and all of its pre-deployed webapps, instead it just uses its sole server engine and uses the workspace metadata as deploy space. When you start such a server configuration from inside Eclipse, all of the pre-deployed webapps will just be plain ignored, including Tomcat's default homepage.
To let Eclipse take control over the Tomcat installation, you need to doubleclick the Tomcat server entry in Servers view to get its configuration, then at the left column, under Server Locations, you need to select Use Tomcat installation (note, when it is grayed out, read the section leading text! It needs to be published without any projects).
Yes, this is normal. In the Package Explorer, you can click the Servers folder and view the configuration files that the Eclipse instance is using, specifically server.xml and context.xml. You can edit this configuration to match your specific requirements.
You may also want to check out the section titled Tomcat Publishing Options in this link here: http://www.eclipse.org/webtools/releases/2.0/newandnoteworthy/server.php
I favor this approach because when WTP inevitably corrupts my configuration once every two weeks, I don't have to reinstall Tomcat, I can just delete the server and reconfigure it.

Can't Set Tomcat As Server For a Project

I've downloaded the latest Netbeans, 6.8 to be precise, then I got the download thats packaged with Tomcat and created a blank Java web application. Right Clicked > Properties > Run, but I can't see any servers in the Server drop down list.
Tomcat is running, I can verify that by seeing the tomcat manager on http://localhost:8080. I have tried adding and removing servers under Tools > Servers, but this still doesn't work.
How can I correct this?
Tried installing tomcat separately, that didn't seem to work, neither did installing glassfish. I just could not get them to show up under the "run" configuration window
I did the following :
uninstalled 6.8 beta
Installed 6.7.1, exact same bundle (netbeans+tomcat). Worked first time
Sorry, but I'm putting it down to either an issue with 6.8 beta, or the installation itself

Categories

Resources