Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

java.lang.NoClassDefFoundError: org/apache/tools/ant/util/ReaderInputStream vaadin+gradle+intelliJ

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.

like image 776
kasongoyo Avatar asked Jan 16 '15 07:01

kasongoyo


5 Answers

Try

File > Invalidate Caches / Restart...

like image 88
Quirino Gervacio Avatar answered Nov 21 '22 00:11

Quirino Gervacio


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
like image 9
Barrie Avatar answered Nov 20 '22 23:11

Barrie


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

like image 9
Liam G Avatar answered Nov 20 '22 22:11

Liam G


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

sudo git clean -dfx worked fine

like image 6
Jon Bates Avatar answered Nov 20 '22 23:11

Jon Bates


remove .idea and invalidating caches worked for me.

  1. rm -r .idea/ in command line
  2. in Intellij GUI File > Invalidate Caches / Restart...
like image 1
RCvaram Avatar answered Nov 21 '22 00:11

RCvaram