I installed AJDT plugin from eclipse site. Then created Aspectj project. And if I saved anything in there, it started building workspace forever. I tried to close Eclipse, but needed to force close it and now it won't even starts, just loads forever. My code in project are only few lines, so I don't get it why it should be that slow. What could be wrong? Is AspectJ that slow or what?
How could I restore Eclipse as I can't even use it now..
Update
Eclipse loaded after like 10 minutes. Then I deleted one character of code and pressed save and it all started again. That is insane. I suppose it shouldn't be like that? I unchecked 'Build automatically' option, but it sill does the same thing.
And now I just got this error:
java.lang.OutOfMemoryError
Compile error: OutOfMemoryError thrown: GC overhead limit exceeded
So it just ran out of memory. So it is something really wrong, but I don't see what could be.
Also this only happens with AspectJ project, with normal project everything runs smoothly. So maybe I should do something in AspectJ project before trying to write there, like check/uncheck something?
P.S. I also added Spring jars and commons-logging jars in that project. Maybe that has something to do with it?
Related
This question already has answers here:
IntelliJ Build Error Context Mismatch
(14 answers)
Closed 5 years ago.
One of my IDEA installations has stopped running my Gradle run configurations. The run configuration is for a regular Java app submodule in my project (the module is called "server"), and the run configuration is as simple as it can get:
Gradle Project: /path/to/server/build.gradle
Tasks: run
No VM arguments, tool windows or any other configuration.
When I run it, I get this:
with no other output. It is not failing on my other machines that are running the same version of IDEA against the same checkout of the same source repository.
I am running the latest IDEA for OS X, 3.5. I tried downgrading to 3.4, by deleting my 3.5 app and installing 3.4 from scratch, and I got the same error running my configuration.
I have tried (many times) invalidating the caches and removing the out/ directory. When everything is recreated, I get the same error.
I've tried deleting the run configuration and recreating it. Same error.
I've tried creating different Gradle run configurations for other submodules in my project. Same error when I try to run them.
I can switch into any of my submodules and type "gradle run", and they run just fine. It's only in IDEA that they can no longer run.
Update: I edited my run configuration, switched to the Logs tab, and enabled "Save console output to file", sending it to /tmp/idea.txt, and got this error:
The newly created daemon process has a different context than expected.
It won't be possible to reconnect to this daemon. Context mismatch:
Java home is different.
Wanted: DefaultDaemonContext[uid=null,javaHome=/Applications/IntelliJ IDEA CE.app/Contents/jdk/Contents/Home,daemonRegistryDir=/Users/user3562927/.gradle/daemon,pid=52404,idleTimeout=null,daemonOpts=-XX:MaxPermSize=256m,-XX:+HeapDumpOnOutOfMemoryError,-Xmx1024m,-Dfile.encoding=UTF-8,-Duser.country=US,-Duser.language=en,-Duser.variant]
Actual: DefaultDaemonContext[uid=ec6aa2e2-e5c9-4857-b08b-1e79fa37a332,javaHome=/Library/Java/JavaVirtualMachines/jdk1.8.0_121.jdk/Contents/Home,daemonRegistryDir=/Users/user3562927/.gradle/daemon,pid=53135,idleTimeout=60000,daemonOpts=-XX:MaxPermSize=256m,-XX:+HeapDumpOnOutOfMemoryError,-Xmx1024m,-Dfile.encoding=UTF-8,-Duser.country=US,-Duser.language=en,-Duser.variant]
Not sure why IDEA is not able to show me this information in the "4: Run" pane.
At least I know this is JDK-related now. I've tried updating my JDK in my project structure, and various other remedies suggested on this site, with no luck yet, but I'll keep trying.
I deleted all JVMs on my machine and painstakingly switched my project and module SDKs all over to the sole remaining JDK. No luck.
Then I noticed this little icon in the upper-left corner of the Run pane, which, when clicked, gave me the build output:
It looks like there are garbage characters in my JVM spec. The only place it is defined is in ~/.gradle/gradle.properties, so I deleted that file (even though there were no garbage characters in it). After that I'm back to the "The newly created daemon process has a different context" error.
After trying many many other things, I finally deleted my project's .idea directory and recreated it. This finally made the problem go away.
JetBrains really needs to get a handle on this problem. I had to recreate my dictionaries, my code style settings, etc. The IDE should be handling the presence of multiple JDKs without choking like this.
since I've updated to IntelliJ 2016.3 on my mac, it seems like classes doesn't get recompiled if I restart my application. I always need to call mvn compile which I didn't need to do before the update. I didn't found anything that would explain such a behaviour. Am I missing something?
Edit:
With restart I mean rerun my app in debug mode. See the screenshot. (Needed to black out a few things due to security reasons)
When I first ran eclipsify on my Project I noticed that Eclipse complained about the:
return ok(index.render("Your new application is ready."));
Line. It did not recognize the index method. The application still ran so I ignored it for the time being. Now, however, I am getting a new error. I think I just added a few dependencies to Mongo, attached some Model files and rebuilt but I am now getting this error:
compile: sbt.InvalidComponent: Could not find required component 'compiler-interface-src'
I'm not sure why this is happening, especially because I'm a bit of a sbt idiot. As a side note, Eclipse is reporting that my "classes_managed" build path entry is missing, but I think that is due to my inability to compile after doing a clean. (Clean and update are working).
1) Templates are compiled by Play, not by eclipse. After the "eclipsify", you need to run play compile (or play run) and refresh your eclipse project. See How to make Eclipse see the changes in Play! compiled templates?
2) After adding dependencies, launch a new time the play eclipsify command.
But i think it's not the problem. What is the dependency you add ? And what is your Play2 version? (I suspect an incompatibility with a Play2.1 library)
And for your information, a general rule: Play doesn't depend on Eclipse to compile files. Do not try to clean in eclipse, but run play clean (and refresh eclipse).
Happen to run into this issue few times, tried above, also following
Clean up Play-framework based project
But nothing worked.
What it turned out to be was a IntelliJ Idea cache corruption issue, and invalidate and restart Idea worked fine.
I have a project which has couple of plugins. It has a fairly large amount of classes. The problem is when I tried to save the changes in my code (ie in a controller or gsp file), it doesnt automatically compile. The project by the way is running, but if I change something lets say in the controller or gsp file, it doesnt automatically compile and therefore the changes doesn't take effect. I have to stop the run process first and then run it again so that the changes will take effect. I just encounter this problem recently. I am using SpringSourceToolSuite Version: 2.9.2.RELEASE. I checked the Automatic Build option and it was turned on. Any idea why is this happening and how to solve it?
I know this question may seems stupid since i cannot give a lot of infos about it, but I think that the problem has to be some kind of bug...
I have written a java program whith NetBeans 7.1, which now gets me this error when trying to run. 10 mins ago it was perfectly running, and i have changed nothing to the class the error refers to
Could this be some kind of NetBeans error? Maybe it is a well know problem?
It also got this exception in NB 7.2
'clean an build' and restarting NB didn't work
updating NB with the latest updates and performing 'clean and build' also didn't work.
So i renamed the cache directory:
c:\Users\userabcd\AppData\Local\NetBeans\Cache\7.2\index\
started NB, waited for it to finish 'background scanning' and pressed 'Debug project' and voila. The cache gets corrupted every once in a while :-/
EDIT: Added Solution B below.
Solution A:
Project Properties
Build >> Compiling
un-check: Compile on Save
Clean and Build
Notes A:
If you leave Compile on Save un-checked, you won't have this problem any longer for this project.
If you enjoy the benefits of the Compile on Save feature, you can re-check the option after you clean and build, and continue work on your project as normal.
Compile on Save is meant to save time by constantly recompiling your .java files into .class files in the background as you save changes to your source code. That way when you build or run your project, most of the compiling work has already been completed allowing you to run and test your code quickly, even for large projects.
NetBeans uses some fancy caching and versioning to avoid having to recompile your entire project every time you save a file. That's why the other solutions listed here will often work; they are ways of defeating this caching-and-versioning system when it occasionally fails, as it has above.
Solution B:
Create empty folder e. g. C:\Temp\mine
Create a new shortcut for NetBeans
with command line parameter in Target:
"C:\Program Files\NetBeans 8.2\bin\netbeans64.exe" --userdir "C:\Temp\mine"
When compile errors occur
(ClassNotFoundException, MethodNotFoundException, etc...)
delete C:\Temp\mine\var\cache
Notes B:
You'll lose all your NetBeans settings the first time.
Much easier to solve future compile errors caused by caching bugs.
Allows running multiple copies of NetBeans, one per userdir.
I got also this exception. My solution was:
edit and save mentioned class (.java file)
clean & build project
deploy to tomcat server
I just had this happen to me with Netbeans 7.4 Beta.
Things I tried:
Restarting Netbeans.
Clean and build.
Shutting down netbeans, renaming the cache dir, starting netbeans and waiting for scanning to complete.
What worked for me:
Making the source file writable and saving a meaningless change (inserting a space).
I don't know why any of the other steps didn't fix the error. Maybe it would have worked if I had done a clean and build after renaming the cache dir?
Its a very frustrating situation to be in - Hopefully this helps someone (perhaps a future me?).
The JDK says for ClassFormatError:
Thrown when the Java Virtual Machine attempts to read a class file and
determines that the file is malformed or otherwise cannot be
interpreted as a class file.
Perhaps a class file has become corrupted. I am going to do the standard IT support statement.
Have you tried restarting NetBeans?
Hope that helps
Got right the same thing with Netbeans 7.1.
Working on a project that works fine for several months.
Now I changed a bean which gets persisted with javax.persistence and now this exception got thrown. Reverted my few changes, clean and compile the project, reboot the whole system: still exceptions.
The curious thing about it: the generated .war works perfectly in a Tomcat at another machine.
UPDATE:
Today I got the same problem again and I couldn't recall how to solve it, but I found this post again. ;)
After a half hour I found the solution: Just change value of the property serialVersionUID, redeploy the app and then you can change the value to its original value and redeploy again -> working.
Seems like Tomcat is holding that class somewhere deep inside – deleting working directories didn't led to success.