48

I have been working fine with Vaadin + Gradle + IntelliJ until yesterday night when I introduced SLF4J(logback) logging to my application. Since then I can't make my project anymore due to classDefFoundError of org/apache/tools/ant/util/ReaderInputStream.

I can't link it with any transitive dependency of any contained jar in application, but even if I remove SLF4J libraries I still can't make my application, so I am wondering what changed?

I am using vaadin gradle plugin 0.9.5 and gradle 2.2.1. Has anyone ever encountered this problem? I was reading another post where someone had the same issue, but the solution he proposed is not valid to my application. He proposed to comment some of the lines in vaadin.gradle, which my application doesn't have.

mikhail
  • 5,019
  • 2
  • 34
  • 47
kasongoyo
  • 1,748
  • 1
  • 14
  • 20
  • 1
    Have you made a clean build? Sometimes we just get left over compiles class files... – André Schild Jan 16 '15 at 07:21
  • 1
    @AndréSchild i have performed clean build for both application and artifact without any luck. – kasongoyo Jan 16 '15 at 09:18
  • 2
    Final i have restarted the computer and now its working...! i think intelliJ where out of sync with gradle or something...! thanks @AndréSchild for showing me some light – kasongoyo Jan 16 '15 at 09:21

5 Answers5

96

Try

File > Invalidate Caches / Restart...

Quirino Gervacio
  • 1,240
  • 9
  • 9
10

I deleted the .idea folder and that worked for me.

Liam G
  • 771
  • 2
  • 9
  • 26
9

File > Invalidate Caches / Restart... nor did git clean -dfx. Here is what I had to do:

  1. Close IntelliJ
  2. IMPORTANT: Make sure you have everything commited you care about (you're about to clean your working copy)
  3. Run git clean -dfx to clean your working copy
  4. Run IntelliJ
  5. Select Import Project
  6. Navigate to the directory containing your project
  7. The select Import project from external model and select Gradle
  8. Press Next
  9. Make sure the settings on the next page look ok then press Finish
  10. The build should now hopefully work
Barrie
  • 1,444
  • 19
  • 26
  • 1
    Yeah basically re-importing the project from existing sources worked for me. I didn't have to invalidate caches or run `git clean`. – heez Sep 18 '18 at 20:12
  • What a mess! I've got all sorts of run configurations I'd have to recreate if I did this. – Gordolio Dec 02 '20 at 21:28
6

File > Invalidate Caches / Restart... option didn't work for me, but

sudo git clean -dfx worked fine

Jon Bates
  • 3,055
  • 2
  • 30
  • 48
  • 2
    That command removes everything that isn't bring tracked by git. Specifically all of intellij's state. Sometimes intellij just goes a bit wrong and needs resetting – Jon Bates Oct 27 '18 at 08:26
2

remove .idea and invalidating caches worked for me.

  1. rm -r .idea/ in command line
  2. in Intellij GUI File > Invalidate Caches / Restart...
Sivaram Rasathurai
  • 5,533
  • 3
  • 22
  • 45