extremely frustrating with eclipse luna - eclipse

I have a simple html file "index.html" in my java EE project. I changed the contents of the file, changed some links. But when I run it from eclipse nothing's changing. When I run it outside of eclipse it opened with the updated contents. Finally I became frustrated I uninstalled and reinstalled eclipse and tomcat. I imported my previous project and nothing changed in the html file! I deleted all content and run it and even though the page is empty it still shows the old page! What is going on? How can I fix this?

Whenever you make a change in a
file follow these steps:
stop the
server
right click on server
add/remove
remove the project
add
again
start the server again
run the page
click refresh or simply
enable Publish changes
immediately when server is started
If the contents are not changing you
should always refresh the whole page.
Sometimes the cached
page may be the one being
displayed.
Hope this helps :)

Related

how to make eclipse + tomcat instant deploy for webapps

I build a maven project and deploy this war into tomcat webapps folder then started tomcat, so that my app available in browser as localhost:8080/myApp
I can see myApp folder which was extracted from myApp.war under tomcat/webapps.
I can modify this app's UI by editing files undertomcat/webapps/myApp/.. using Notepad++.
I send this project to my co-worker, he also import this project in his eclipse and run this app.
He changed the jsp and js files from eclipse and the result will be reflected in browser, he never used separate editor to this modification.
If I change the files in eclipse then it is not reflected in browser.
What I need to do for the same to be working to me?
If you just want Hot deploy in Eclipse, please try to take following steps:
Double clicks on the Tomcat plugin, refer to publishing tab, 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, clicks on the Module view, make sure Auto Reload is Disabled. Default is enabled.
Note:
This is an important step, failed to set the auto reload to disabled, the Tomcat server will be restarted every time you modified something!
Start Project in DEBUG mode. Hot Deploy is supported in DEBUG mode only.
Limitation
Hot deploy has supported the code changes in the method implementation only. If you add a new class or a new method, restart is still required.
To simulate it, try to add a new method, following pop up screen will be displayed, saying the code changes cannot be hot swapped in the JVM.

Unable to close files in eclipse

I have recently upgraded my eclipse to Mars, and .java files that were opened in my previous version are pinned and I'm unable to close.
In the image, first three .java files: CORSFilter.java, EmailController.java, EmailServiceImpl.java are stuck or pinned. I dont see an 'x' to close when i hover on the tab. I tried opening other files such as Assignment6.java and tried close all, but they still are stuck.
It does cause a havoc for having them there, but its little bothering to look at those windows while working on completely different project.
Thanks in advance.
Closing and re-opening the project in the project explorer (and afterwards opening the files) solved it for me.
Did you shutdown eclipse last time properly?
There is probably damaged file in eclipse i recommended you to
1.reinstall it.
2.right click and try to kill tab. but the x on the tab no longer work and hidden bugs/error may happened due to damaged eclipse

Sublime Text 2 edited file-changes does not show when refreshing browser in Maven project

I am having problems when editing template-files(HTML-files) in my Maven-project. I have made the Maven-project an Eclipse-project with the command "mvn eclipse:eclipse" (if it matters). I am using the Apache Velocity Engine as template engine for this project.
The problem arises when I'm editing the files in Sublime, and then save the file and refresh the browser. The changes does not show! If I however open the template file in Eclipse, just open it, I can even just open and close it right away, and THEN refresh the browser, the changes will show.
I have done a test to see if this problem occurs on other simple projects as well, and with a single HTML-file and a simple http-server, the work I save in Sublime shows as normal.
Does anybody know what is happening here? Am I bound to keep on using Eclipse as a HTML-editor? :( Does the Eclipse project files prevent me from using other editors? Why are the changes only showing when I open the files in Eclipse?
Any help is greatly appreciated!
In order for the changes to take place you have to right-click the file in Eclipse explorer tab and choose "refresh" in order for the (static) changes to be reloaded to Apache. For dynamic changes you'll need to restart apache or use a plugin such as JRebel.
Eclipse copies the files to the "target"-folder in the webapp. Sublime(and others) does not do this automatically, so you need to do this manually, or by a plug-in that will copy the files on save.

Eclipse can't find project source after tomcat restart

I posted this on the eclipse forum in November and didn't get an answer. It seems that someone must have experienced this problem before, so I thought I'd post it here as well.
General Description: Every time I restart my local tomcat web server, the next time I hit a breakpoint, eclipse can't find the project source.
Background: I have been using Eclipse at my current job for about seven months. I did not encounter this problem for the first two months but it has been consistent for the last five months. I thought it might be related to a specific project, but it happens on every project I open, even projects that did not previously have the problem.
Details: Each and every time I restart my tomcat web server, then the next time I hit an eclipse breakpoint, the source window is empty with the message "Source not found." in red, and then below that the button: "Edit Source Lookup Path..."
I click on the button, which brings up the Edit Source Lookup Path window with only Default listed under the Source local Lookup Path section.
I click "Add..." which brings up the Add Source window. In that window, I double click on "Java Project" which brings up the Project Selection window. In that window, there is one project listed (the project which is currently open which I am currently debugging).
I check the checkbox next to that project and click OK (leaving the two other checkboxes checked). This takes me back to the Edit Source Lookup Path window and now my project is listed along with Default under the Source Lookup Path section.
I click OK and the source appears in the editor window and I can proceed without any problems until the next time I restart my tomcat server (which I might do ten or more times a day).
Other Info: I have tried modifying the project's Build Path Source section and adding the local code jar to the Build Path libraries, but nothing seems to fix this. I have done a lot of googling and have searched this forum and the bug list, but can't find any relevant information. As I said, this problem only started occurring out of the blue about five months ago and now it happens every single time. Is there an environment variable I need to set?
Any help is much appreciated!
Thanks,
Jeremy
Just to follow up, today I took the time to create a new workspace in eclipse and it fixed the problem. It wasn't an easy process because my environment has a lot of tricky settings that needed to be restored. But it's done now.
I accomplished creating a new workspace by simply renaming part of the path to my old projects. Once I did that and restarted eclipse with the -clean option, I had no projects and my old workspace settings were all gone. So, then I just created new projects from the existing code ...

Eclipse is not loading?

Eclipse was working fine just a day ago. But today, when I click the eclipse icon, it only loads the splash screen and nothing else thereafter, I even don't get to see the splash screen which contains that 'green loading sign' at the bottom, and -- while monitoring the eclipse.exe in Windows Task Manager(just after starting eclipse) -- I saw that even after the splash screen went off the screen, the eclipse.exe process went with it, after a few seconds. Keep in mind that I did NOT see any warning or error messages because, (I'm assuming, that the loading haven't gone to a point where it is capable of sending any error message)
Hence, I tried reinstalling eclipse, by copying from INSIDE the .zip directory of the installation folder and pasting it inside the eclipse program directory. But the exact same problem persists. So, now I'm currently downloading the latest version of eclipse to retry again.
Any other Advice?
UPDATE
It turned out that the hard drive containing the workspace was partially corrupted, hence I cleaned it; following that, the workspace data was still accessible. (Though usually I still keep a backup on hand.)
just delete the .metadata folder from workspace and reload the eclipse. It worked for me.
Hoping you have the links to the update sites for your installed plugins, my advice is to download eclipse, download your already installed plugins from their update site's and then open the new eclipse and set the workspace to your actual workspace. More far than that is to trash your time... trust me.
It turned out that the hard drive containing the workspace was partially corrupted, hence I cleaned it; following that, the workspace data was still accessible. (Though usually I still keep a backup on hand.)
Probably something went wrong with Java. Try re-installing Java run-time.
It also can mean a problem with the eclipse.ini file (like an extra space at the end of the line), or a problem with the JVM path (since the splash screen is displayed by the eclipse.exe, before loading all the eclipse Java classes).
Check that eclipse.ini file and consider my ini file as a good optimization source.
If your workspace has been corrupted your safest approach is to create a new one.
I would actually strongly suggest that you reinstall everything that might have been corrupted, to avoid as much strangeness as possible. This includes the underlying OS.
I have tried out both
(1)E:\eclipse-standard-luna-RC3-win32\eclipse -clean in run
(2)deleting .metadata folder from workspace
I do not which one worked for me.Thanks...