Eclipse Workspace Corrupted due to improper shutdown - java

I'm working with Eclipse juno on windows7-64bit OS. Due to sudden power problem my system got shutdown, when i restart the Eclipse next start, Eclipse fails to load the workspace. It freezes on startup, or the workspace does not show up. It seems the workspace gets corrupted every time Eclipse is not shut down properly.
One way to fix the startup is
rm -rf ~/workspace/.metadata
After doing this, of course, settings are gone, projects have to be reimported etc. - It's really a pain :( and I don't understand why it has to be this way. Other applications seem to be able to keep their data intact, even if they are killed.
Can you suggest ways to remedy this problem? Are there ways of recovering a corrupted workspace including the settings?
thanks in advance

You can edit your shortcut to eclipse and add behind the line -clean as runtime parameter. It should clean your workspace and it might fix your corruption.
http://help.eclipse.org/indigo/index.jsp?topic=%2Forg.eclipse.platform.doc.isv%2Freference%2Fmisc%2Fruntime-options.html
So your shortcut would be something like:
"C:\Program Files(x86)\Eclipse\eclipse.exe" -clean
EDIT: Make sure once you've used this to remove it again after, you don't want to clean your eclipse every time you start it.

from Vissol.ca
create a new workspace
import new (android) project(s) from existing source(s)
good to go...
then you can backup original workspace , delete it and recreate it if desired.

Related

Why is IntelliJ IDEA hanging on "Indexing"?

Want to improve this post? Provide detailed answers to this question, including citations and an explanation of why your answer is correct. Answers without enough detail may be edited or deleted.
I'm running on Arch Linux, on an i7-5930k 6 core CPU and 64GB of DDR4 RAM, and I'm using IntelliJ IDEA 14.
IDEA was working just fine for me several days ago, but one day, suddenly, it began hanging after opening a project, during the "Indexing" stage. I did not update IDEA and nothing changed about my projects. The IDE's UI hangs after it opens the project, with just a tiny little sliver of the progress bar for "Indexing" complete. Every 5-10 minutes or so it unfreezes and the progress bar crawls forward a little bit, before the IDE freezes again for another few minutes. This happens repeatedly for anywhere between 15 minutes and an hour, until it is finally finished indexing, at which point it hangs for another 5-10 minutes doing nothing, before it finally unlocks and allows me to develop.
While this is happening, my system is fairly unresponsive - Firefox tabs take a long time to switch, and scrolling in them is laggy. Opening a new terminal window takes a long time. Switching windows in general takes awhile. In htop, one of my CPU cores is loaded at 100% while the rest have a normal load, and about 6GB of RAM is used (fairly normal load when this system is idle.)
Things I have tried that have not helped:
Delete caches folder
Delete entire ~/.IntelliJIDEA14 folder
Reinstall IntelliJ package
Download IntelliJ manually from JetBrains' site and run it from my Downloads folder (to see if there was something wrong with the Arch AUR package)
Configure IntelliJ to use my system JVM and Maven for importing instead of its embedded tools
Opening multiple different projects (not just the one I initially experienced the issue on.)
This issue is really hurting my workflow, if anybody has any solution to this I would be very greatful.
Try Invalidating the cache and restarting IntelliJ.
In the File menu, select Invalidate Caches / Restart... and then click the Invalidate and Restart button.
I've finally figured it out. The solution was... Rather odd. TL;DR: Run it under strace. Read on for a more detailed explanation.
I came upon it when I decided to run IntelliJ under strace to see what files it was opening to determine whether or not it was a filesystem bottleneck.
This gave me some very strange results: strace was spewing out a near-constant stream of segfaults. Not only that, but IntelliJ was running just fine, not taking forever to index.
After consulting with a friend, I learned that on Arch Linux, systemd logs a dump of a process's memory every time a segfault occurs, except when a debugger is attached. strace is considered a debugger. Arch was thrashing my disks when it kept logging memory dumps due to all the segfaults, hence why the indexing was taking so long, because it was fighting for disk I/O.
My solution for now is to simply run IntelliJ under strace. I will, however, be looking into the issue further, as I don't think java should be segfaulting that much.
edit Intellij[VERSION]/bin/idea.properties,
set idea.max.intellisense.filesize=50
update:
Intellij will skip index files that size larger than 50kb.try this if you have many libraries or many large files(too many characters one line or too many lines)
I had this issue as well with version 2016.2 on Mac OS X. I had to do a force quit to end the application, then I deleted the .idea folder. The next time I launched IntelliJ everything worked fine, it had no problem indexing the project.
I was stuck with a similar issue with the latest IntelliJ Idea 2019.3, so maybe it'll help. For me the issue was with one of the plugins, uninstalling/reinstalling, cleaning caches didn't help. My steps were:
Kill intellij, start it over
When it's starting and about to load a project, be quick and cancel opening the project. This way you'll end up with a small window with a list of previously opened projects and a few menu items.
Open menu > plugins, disable them all
Restart intellij idea, open any project.
If step 4 above succeeds (which happened to me), one by one try enabling the plugins to see which one is causing error. For me it was Kubernetes plugin from JetBrains.
Select Help -> Debug Log Settings...
Add the following line (note the leading # symbol)
#com.intellij.util.indexing:trace
Relaunch the IDE (don't need to invalidate cache as that will cause it to start from scratch, whereas restarting from the point of failure, for me anyway, reported the problem file as soon as I restarted):
Scheduling indexing of file://C:/dev/tools/ruby/lib/ruby/2.2.0/x64-mingw32/win32ole.so by request of index Stubs
Our project doesn't use win32ole so I moved the file to a safe location and restarted my IDE... Bingo, problem gone, indexing finally completed after almost 1 year of effectively using intellij as a slightly-smarter-than-notepad ruby editor.
In my case I found out that Intellij is actually trying to index a 50GB directory with logs that was under the project's root. Make sure that if you have such a directory, it is marked as "Excluded" in the IDE.
You can see which file the IDE is indexing currently in the Indexing Status window (access by clicking on the indexing message in the toolbar). You may need to enlarge this window to see the full path of the file currently being indexed.
In PhpStorm, what solved this for me was excluding folders I didn't need to be indexed from the indexing (specifically the vendor folder, a caches folder, and a few asset folders that contained thousands of images). Instantly it began making progress and completed.
To do this:
in the project directory list, right click the folder you want to exclude
Mark Directory As
Excluded
seems that there might be several reasons for getting into this "indexing" hell. I spent few hours trying to fix it using the ideas above.
At the end of the day, with some profiling work, I found that the bad guy in my case was the csv plugin:
https://plugins.jetbrains.com/plugin/10037-csv-plugin
I had few (not so large) CSV files serving as input, and although I marked them as not to be indexed, the plugin kept trying to index them.
Once I removed the plugin everything worked fine.
Disabling unused plugins will improve the indexing. In my case I have disabled Kotlin plugin from File -> Settings->Plugins
if you check the intellij logs (can be found under C:\Users<User Name>.IntelliJIdea2019.1\system\log ) you will get a pointer what is failing. I was getting an error in Kotlin. After disabling the plugin and restarting Intellij fixed my issue
java.lang.RuntimeException: java.io.EOFException
at com.intellij.util.ExceptionUtilRt.rethrow(ExceptionUtilRt.java:31)
at com.intellij.util.ExceptionUtil.rethrow(ExceptionUtil.java:120)
at com.intellij.openapi.vfs.newvfs.persistent.FSRecords$DbConnection.handleError(FSRecords.java:516)
at com.intellij.openapi.vfs.newvfs.persistent.FSRecords$DbConnection.access$000(FSRecords.java:153)
at com.intellij.openapi.vfs.newvfs.persistent.FSRecords.writeAndHandleErrors(FSRecords.java:965)
at com.intellij.openapi.vfs.newvfs.persistent.FSRecords.access$300(FSRecords.java:47)
at com.intellij.openapi.vfs.newvfs.persistent.FSRecords$AttributeOutputStream.close(FSRecords.java:1629)
at kotlin.io.CloseableKt.closeFinally(Closeable.kt:53)
at org.jetbrains.kotlin.idea.caches.FileAttributeServiceImpl.write(FileAttributeServiceImpl.kt:64)
at org.jetbrains.kotlin.idea.caches.FileAttributeServiceImpl.writeBooleanAttribute(FileAttributeServiceImpl.kt:48)
at org.jetbrains.kotlin.idea.caches.IDEKotlinBinaryClassCache.getKotlinBinaryClass(IDEKotlinBinaryClassCache.kt:67)
at org.jetbrains.kotlin.idea.caches.IDEKotlinBinaryClassCache.getKotlinBinaryClassHeaderData(IDEKotlinBinaryClassCache.kt:8
I had a similar problem with 2019.1.4. However, mine would change directories and sometimes, eventually, finish. If it did finish, it was somewhere in the 8-10 minute range.
I was all over SO, and even JetBrains' forums. I excluded directories via Project Structure | Modules. I used Invalidate Caches And Restart on multiple occasions. I tried having only 1 project open to let it finish. I installed and tried 2019.2.4 and 2019.3.3 (the latter would crash for other reasons). And best of all, it only seemed to happen on one project!
What ultimately led me to an answer was Help > Activity Monitor... where I found psi.impl.cache.impl.todo was running at nearly 100% CPU and not showing signs of stopping.
It turned out, I had a TODO filter setup with a poorly-defined RegEx. It was something like \b.*wip\b.*; the idea was to find all of our "WIP" values. Well, the leading .* was a huge mistake and one that didn't occur to me until losing many hours blaming a plugin upgrade. I believe the reason this was a bad filter was because the project it was hanging on is in ExtJS, which is JavaScript, which means things are in triplicate with the app.js file and whatnot...
Update
In IntelliJ 2020.x and 2021.x, the option has moved to Help > Diagnostic Tools > Activity Monitor.
Had the same issue in the past on some Scala project. I have installed IDEA 16 EAP (https://confluence.jetbrains.com/display/IDEADEV/IDEA+16+EAP) and the problem has gone.
I ran into this problem today on a Mac. It would hang before I was able to get to the menu and invalidate the cache.
I deleted the cache from command line using the following command and it worked for me.
rm -rf ~/Library/Caches/JetBrains/IntelliJIdea*
After that it started up with no issues.
I had the same problem with IntelliJ 2017.3.2. When I clicked on the indexing progress bar I noticed it was hung on a directory within my build directory. When I did a gradlew clean which removed that directory then the indexing was able to proceed.
I have encountered this problem, and resolved it:
remove idea
delete all files and dirs which name regex 'jetbrain' and 'IntelliJ' in my computer(Mac mini)
then install idea
I also try just delete idea cache files, it do not work.
I was using the Elm plugin and installed the elm-bounded-nats package which included a semi-large source file. IntelliJ kept hanging on this file, but did not always report this correctly in the indexing popover dialog (perhaps due to threading). When I exluded this specific file in Settings -> File Types ("Nats.elm") indexing managed to complete successfully. Now the editor renders errors for this package but the compilation process still works.
Invalidate Cache and Restart did not work for me on IntelliJ 2021.3 Ultimate.
I was curious to see if the new Repair IDE feature on 2021.3 Ultimate version works on this issue on my mac.
On startup, IntelliJ froze on indexing
Force quit and relaunched IntelliJ
On Startup, manually "paused" the indexing from the status bar at the bottom
Invalidated cache and restarted
Still froze on indexing
Forced quit and relaunched IntelliJ
Repeated Step #2 on startup
From File Menu, executed Repair IDE, and went through repair steps
FIXED; no longer froze on indexing
Quit IntelliJ and Relaunch
No Index issues
I was also facing freezing issue with intellij 2021.3. Earlier I was using intellij 2021.1 version and that was working fine but since I upgraded intellij version to 2021.3 it started freezing on indexing of files.
Someone in this thread suggested to repair ide using Repair IDE feature. But that didn't worked for me.
So, I went through the thread dumps available in intellij logs folder. After analyzing logs, I found out that calls are blocking on Package Search plugin. So, I disabled that plugin in settings -> plugin. To do that I had to pause indexing at start for time being. After disabling this plugin, it is working fine for me.
This is a known issue and I know disabling it is not a correct fix for it. But I will use it till intellij will release an official fix for this issue.
There might be another project opened parallelly in new window which is being indexed.
It looks like the problem can come from many different sources as other answers point out.
In my case, it was the Subversion plugin that had difficulties to communicate with the server and make the IDE to hang on indexing.
I was able to resolve this problem by removing all of my "target" folders from my project.

Sudden weird errors on a project

Today I came to work, happy. But when I opened my Eclipse, I saw that one of my projects has errors.It's weird because it shows that it has errors only in the window bar, and not in the Navigator. I don't have any Java errors, this is a valid project that was fine all the time:
Some of the errors on the error log of Eclipse:
JavaBuilder handling ImageBuilderInternalException while building: SP_Procedure
Cannot connect to VM
File <SomeFile> has been skipped, problem while reading ('Resource is out of sync with the file system')
Unhandled event loop exception
Internal error
When I run an application from this project, I get a warning message but when I proceed, it works fine, but still. It's very disturbing and I'm not sure if it's harmless.
I tried to:
Restart Eclipse
Restart my machine
Clean projects and recompiling them.
Refresh projects
Pray
Nothing helped. What could be the problem? (I'm using Indigo Service Release 2)
The following nuclear option has desperation written all over it. But I have been where the OP has been with the Juno version of Eclipse.
Run a "Synchronize with Repository" and save all of your local updates to a different directory.
Delete the project. (Check the box to delete the contents on disk. Scary step, but that's OK, because you saved it in a different directory in the previous step, right?)
Read in a fresh project from the repository. It builds happily at this point.
Integrate your local updates.
Keep on praying.
Looks that one unused JAR was deleted, but for some reason, I didn't get errors in any file, even in the files that imports this JAR! So what I did was restoring this JAR, delete unused imports and deleted the JAR again.
I've found this error after two days of navigating on this project on each file.. This is weird that Eclipse didn't recognize that1 this is an error, and throw many unrelated errors such as:
Cannot connect to VM
File has been skipped, problem while reading ('Resource is out of sync with the file system')
Unhandled event loop exception
Is this a bug in Eclipse? (All errors and warnings are enabled!)
1 As seen in the image in the question..
A class from the list of imports for the file seems to have moved out or the jar file containing the class is missing.
Expand the imports section and check if you find some classes that are missing but have been imported.
Though it is a pain, sometimes the easiest solution is to back up all your projects (either in a repository or somewhere else on your computer) then uninstall and reinstall eclipse. No it's not fun, but it should reset eclipse so everything works again. The downfall though is that you have to reconfigure eclipse to any special settings you had/reinatall any extra functionality currently installed (eg. android add-on) and reconnect to any repositories you have. While punting isn't fun, it can be effective... I hope you don't have to resort to this though.
I have went through that problem a lot of times, and tried everything you tried. Rebuild, recompile, refresh, remove and add JDK, remove and reinstall Eclipse... nothing worked
The only thing I concluded is that the workspace metadata was corrupted.
What I did (every time it happened) was
Create an empty workspace
Import -> existing projects into worskpace
Mark the "copy projects" (else it will only link them)
Wait for the copy, and start working with the new workspace
If you work with SCM systems (Git, SVN, etc), making a full checkout will do the trick too, but the worskpace import will let you retrieve those changes you didn't get to commit (if any).
It's a little painful if you have somethings already set (like JDK names, servers, etc), but then I realized it was faster than keep searching how to fix the workspace
Regards!
PS : I've been working with Kepler lately, and everything works fine till now
Click Window -> Show View -> Other -> General -> Problems
This view will show you what is wrong.
Did you, by any chance, update your virtual machine outside of Eclipse? I can't help but feel that we're both missing a finer detail here. I just keep seeing "cannot connect to VM" and thinking that it's a major clue.
Have you tried running anything from the terminal? Does it work there?
If so, do you know where your current edition of Java is located? Is Eclipse looking somewhere else?
Is this exclusive to one project? Do you use any additional libraries to the JDK?
Maybe try this for Resource is out of sync with the file system error:
Right click project in Eclipse Package Explorer
Close Project.
Right click project in Eclipse Package Explorer
Open Project.
Other things not mentioned:
project properties > java build path, see if any of those tabs got changed, local file got moved? read/write permissions on some file you are linking to?
project properties > java compiler, see if workplace settings have changed? maybe under errors/warnings, you can systematically set them to 'ignore' until the error goes away to determine what type of error it is?
maybe update some of the eclipse plugins?
I saw something like this happening for a number of reasons. Mainly because of validation in files other Java source code. See if you are validating XML for instance.
Right click your project and chose Properties (Alt+Enter) and Validation to see the related configuration.
As for the danger, I lived with those marks for ages and nothing wrong ever happened.

Eclipse not starting after hanging

My eclipse was working till now. After installing new software in the eclipse, it closed down and whenever I try to restart it, a dialog box appears saying:-
An error has occurred. See the log file in Workspace.metadata.log.
For the log file. please visit:-
https://docs.google.com/file/d/0B6ZcK0Ed_jdCMFA2RjBPUGdjeHM/edit?usp=sharing
Can any one tell me how to resolve this issue.
I know that I have the option to install Eclipse again. But I want to know is there any other way other then reinstalling?
It looks like some of the sub-components in the eclipse directory have been corrupted, possibly during an update or forced close of eclipse. You probably are best reinstalling it (point at the same workspace and you will only lose your preferences- better than losing everything! If you are using Java EE you may lose the servers depending on whether they are stored in workspace or in eclipse).
If you dont want to reinstall, you could try copying the plugins folder from a fresh copy over the existing folder. Then start eclipse with the -clean option
Edit: If you have updated anything, make sure it is for the correct version of Eclipse- wrong versions of plugins/updates can cause this kind of problem.

Eclipse: "Update SVN cache" hangs and locks up

Every time I start eclipse, the program begins doing this "Update SVN cache" thing but it will sit at 0% forever. I cannot perform any operations (such as checking out my projects, building them, or even running them) until this operation is completed (which never happens). Also, whenever I try to type anything in the editor, the whole program freezes and I have to kill the process.
I have been searching google for the answer to this problem for days and have yet to come up with an answer. Has anyone else had a similar problem and found a solution?
I'd like to add that I've tried re installing eclipse, all its plugins, and the jdk from scratch. Nothing seems to be working.
I faced the same issue and I tried to get out of this by disable most of performance setting for SVN in Eclipse:
Windows > Preferences > Team > SVN > Performance
OR (for latest versions): Windows > Preferences > Version Control (Team) > SVN > Performance
Disable: Computing deep outgoing state, Cache, persistent SSH
I just ran into this issue and was able to rescue it. This was with Zend Studio 10.5 which sits on Juno. I have about five projects in my workspace, one of which was open. I couldn't close the project because it was waiting for "Update SVN Cache" to complete.
With Eclipse closed, I went to my open project and via the command line ran "svn cleanup."
In workspace/.metadata/.plugins/org.eclipse.team.svn.core, I had a bunch of temp directories. I created a backup tarball, and then blew them all away.
That didn't fix anything. Finally I tried this:
With Eclipse closed, I went to my project directory and renamed .project to project.xml.
Reopened Eclipse, projects were closed. No SVN Update messages.
Restarted Eclipse.
Opened the project, but Eclipse balked at the missing .project file.
Closed Eclipse.
Went to my project directory and renamed project.xml back to .project.
Restarted Eclipse.
Opened the project. Smooth sailing. Was just able to commit a change without incident.
So far my workspace/.metadata/.plugins/org.eclipse.team.svn.core directory is still empty.
I don't know if the first two things I tried helped out at all, or if just renaming the .project file to force-close the project was all it took. Next time it happens (and there will be a next time) I'll try just force-closing the project and report back.
In my case I realized that a tortoise SVN explorer related windows was somewhere open. It probably locked the cache and eclipse was waiting for the unlock.
Not a direct answer to the question, but this might help for somebody making a similar mistake.
You're not the only one (see this bug report or this forum thread) but it's probably not a bug in Eclipse itself. Next steps:
Get a thread dump to see whether this is a deadlock or a thread is waiting for something that never happens (in the bug report, it hangs in System.loadLibrary()). You can use jconsole for this, it comes with the SDK.
Check all open projects in your workspace (that use SVN) with another SVN tool (command line svn or TurtoiseSVN if you're on windows) to make sure the data structures aren't corrupt.
Get the latest version of Eclipse and/or the SVN plugin
Try a different connector. Some people fare better with the JNI solution javahl, others with the pure-Java SVNKit.
Windows > Preferences > Team > SVN > Performance
Disable: Computing deep outgoing state, Cache, persistent SSH
Go to Preference -> General
Enable : Always run in background
Enable : Show heap status
Workbench Save interval (in minutes):9999
This will show your memory usage in eclipse.
Then edit your eclipse.ini file and change Xms and Xmx values to these:
-launcher.XXMaxPermSize 512m
-Xms1024m
-Xmx1024m
I faced this problem when having the same project in the workspace twice. Make sure you have only one copy of it in the workspace, maybe it helps.
It could be eclipse memory issue. I had similar problem until I did these steps:
Go to Preference -> General and put these values:
This will show your memory usage in eclipse.
Then edit your eclipse.ini file and change Xms and Xmx values to these:
-Xms1024m
-Xmx1024m
Look at the memory status. Hope it will help.
I was also facing similar issue and I got it resolved this by unchecking "Compute deep outgoing state for folders" under Windows->Preferences->Team->SVN->Label Decorations
This topic helped me for solving the problem about my eclipse svn update block.
I am using eclipse mars where this case came.
First I have deleted two projects which I don't needed - to reduce the project number in the workspace.
Changing parameter in eclipse.ini has not helped too.
I had the -clean argument on my eclipse set so I have deleted that too in hope it will work better. It helped a bit so the eclispe was running much longer but not much more. rockfarkas hint here.
What really helped at the end was to mark very fast all projects CtrlA from the project view and close them via the context menu while the SVN cache was still running. The half of them did that the others couldn't but after that I could see that the SVN cache was changing its state and so I could work again. The next step was to close the rest of the projects and open one by one. To this idea I came reading the post of user3096856.
I solved doing this:
-Select the project (or all projects) on your workspace (in eclipse), right click, select from the menu Team > Cleanup
I found an index error in eclipse which blocking the svn. Another project resources and svn repo were in .metadata\.plugins\org.eclipse.core.resources\.projects\ProjectName\4.tree
and other resources.
svn cleanup with the previous answer with 'Team > SVN > Performance' doesn't solve my problem.
'eclipse.exe -clean' will make eclipse unresponsible with 100% cpu.
The only solution was after exit eclipse the manual deleting of org.eclipse.core.resources\.projects\* files.
In my case, for 30 odd minutes it showed just 0 percent completed. I patiently waited since I tried restarting eclipse/machine still was getting the same thing. After 30 minutes, it continued with my svn update operation and completed it successfully.
Patience at times, helps :)
If there is duplicate project from SVN.
Force close eclipse.
Delete the duplicate project from filespace. (Eg: C:\Users\XXX\Workspace\DuplicateProject)
Restarting the eclipse
fixed.
I used Subversive - SVN Team Provider 3.0.0 with SVNKit 1.8.10 as SVN Connctor.
I updated the SVN Connctor to the latest version 1.8.11,and fixed it.
Do you use Maven SCM connector ? Try uninstalling it if you dont need it.
SCM connector is required for Maven SCM checkout, I do not use Maven SCM project checkout, instead I use SubEclipse checkout and convert project to maven using import existing project or convert to Maven project option from the context menu in Eclipse.

how to make netbeans start up faster. netbeans is taking an insane amount of time just to open

I do not know if its just my computer, but netbeans is taking an insane amount of time just to open. I'm wondering is there anything i can do to mitigate this problem.
(Like maybe if i reduce the amount of tabs opened in netbeans it may speed things up or something)
Reinstall from scratch is usually the best way to go. Your netbeans installation is probably slowed down by all the plugins, settings, files, cache, old files, and other stuff that its trying to load at startup. Backup your .netbeans profile folder, delete the old one, download a new netbeans installation (netbeans itself might of collected old files), and restore your settings.
If that doesn't speed things up, then really the only thing you can do is upgrade the computer
You can use "Scan on Demand" plugin.
If your problem has seemingly got worse over time you can delete the .netbeans folder that is placed in your user home directory, this should speed things up in that case.
As a precursor to deleting the .netbeans folder i would run netbeans with a custom home directory
netbeans.exe --userdir
c:\temp\myTestHome\
And see if that fixes the problem... If it does then delete your .netbeans folder, but be warned that it will behave as a new installation after that - ie no settings/plugins that you defined will be present anymore.
delete your home.directory .netbeans folder.e every thing will be fine
. i'm using 7.0 netbeans and it's faster to deploy with tomcat 7.0.6

Categories

Resources