Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

EnumConstantNotPresentExceptionProxy with annotations

 
Sebastian Janisch
Ranch Hand
Posts: 1183
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey,

I am trying to get an annotation from a class like this:



This perfectly works most of the time, sometimes however, it throws an Exception and I have no clue where this comes from:




Please help ...
 
Rob Spoor
Sheriff
Pie
Posts: 20550
57
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can you show us the code for SupportedTypes? And can you also show the class header of whatever "clazz" is?
 
Sebastian Janisch
Ranch Hand
Posts: 1183
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey,

thanks for your reply ...

the problem is fixed now ... this is what went wrong:

the annotation looks like this:







The project is a maven project and this is what the problem is. The message type enum passed to the SupportedTypes annotation is in another project. The message type got changed and maven did not rebuild the project so the compiler did not complain at the SupportedTypes annotation. hence the enum exception. It did not find the enum element specified since it was not available anymore.
 
Rob Spoor
Sheriff
Pie
Posts: 20550
57
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for sharing the solution
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic