java


Custom Annotation processor not being invoked by tomcat


Custom Annotation processor is not being invoked by tomcat. Following is the Annotation processor code that I am using :
#SuppressWarnings("restriction")
#SupportedAnnotationTypes("io.strati.rs.cxf2.bindings.MyAnnotation")
#SupportedSourceVersion( SourceVersion.RELEASE_8 )
public class SimpleAnnotationProcessor extends AbstractProcessor {
public static List<String> str = new ArrayList<>();
#Override
public boolean process(Set<? extends TypeElement> annotations, RoundEnvironment roundEnv) {
System.out.println("Into annotation processor ... 2");
for ( Element element : roundEnv.getElementsAnnotatedWith(MyAnnotation.class)) {
System.out.println("Method name is:"+element.getSimpleName());
str.add(element.getSimpleName().toString());
}
return false;
}
}
This stores the method name of all the methods that have the custom annotation. This is what the annotation class looks like :
#Target({ ElementType.TYPE, ElementType.METHOD })
#Retention(value = RetentionPolicy.RUNTIME)
public #interface MyAnnotation {
}
I am trying to access the list in a tomcat application as follows :
#GET
#Path("/dummy")
#MyAnnotation
#Produces({APPLICATION_JSON, APPLICATION_XML, TEXT_XML})
public void print(){
System.out.println("List is:"+SimpleAnnotationProcessor.str);
}
The list is getting printed as empty even though the method has the annotation.I have specified the annotation in the maven compiler plugin as well as specified it in META-INF/services/javax.annotation.processing.Processor. Can someone tell me what are the possible reasons due to which the annotation processor is not getting invoked ?

Related Links

how to send sending Arabic message in url parameter
log4j: show only INFO (not DEBUG) in my log file
unable to navigate from fragment which has a list view to another fragment
Handling OS windows in Ubuntu without using Robot class (Selenium)
querydsl-jpa dynamic query
Will this warning creates an issue further?
how to convert this HQL to SQL
I'm getting an ArrayIndexOutOfBoundsException error due to parsing int. But I need to parse that int?
Can I access request parameters in a custom Google Cloud Endpoints Authenticator?
Fuel consumption class java [closed]
Firebase query hashmap to class
How to load All Arraylist from the model function?
Save image file to HDFS using Spark
how would I find the nth term in a loop? java
java.lang.UnsupportedOperationException: Can't convert to color: type=0x2
SQLite NullPointerException error on connection creation

Categories

HOME
bluetooth
listview
magnific-popup
urbancode
heroku
reserved
google-play
angular-material
fme
webstorm
mean-stack
google-docs
adb
installshield
awesome-wm
primary-key
kibana-4
u-sql
circular-dependency
spring-tool-suite
n-gram
commonmark
static-libraries
hapi
vaadin7
dosgi
telephony
after-effects
transformation
reactcsstransitiongroup
oracle-coherence
text-rendering
grails3
opencover
physics-engine
devops
apache-commons-io
user-interaction
fgetcsv
libssl
gtrendsr
subset-sum
accelerate-framework
gammu
mmenu
plsql-psp
objectlistview
core-plot
google-closure
flashair
btrace
wso2carbon
chain-builder
python-c-api
blogengine.net
jlink
mako
nbconvert
color-profile
sonarlint-vs
chord-diagram
gnome-shell-extensions
deadbolt-2
android-fonts
gridpane
azure-sdk
bonobo
adxstudio-portals
react-native-listview
nessus
wso2cloud
execute
teamcity-8.0
python-3.2
tableau-online
microbenchmark
generic-programming
c++03
offloading
coldbox
titanium-modules
googlemock
castle
system.net.webexception
multiprocessor
jsctypes
.aspxauth
quartz-graphics
ora-00911
itmstransporter
mhtml
path-separator
frameset
word-processor
dsn
osql
android-sdk-2.1
remember-me
icanhaz.js
xsdobjectgen
bespin
firefox-5
genealogy
w3wp

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App