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

Clarifying the manual count of Cyclomatic Complexity
Hibernate AbstractBatchImpl sql must be non-null
How to set spinner values in android those are coming from list?
Binary search now working for repetetive case of not a triangle
How to get or create new map entry
toUpperCase on Android is incorrect for two-argument and default Greek and Turkish Locales
Giving mulitple Jbuttons the same actionListener
Provide sample value for request parameter in Swagger
V/AsyncHttpRH: Progress 900 from 300 (300%) - can't do a HttpRequest
How to open URL on new window using java on production server [closed]
Gurantee switching to a specific window in Selenium
How to reset the index to 0 in an arraylist?
Depth configuration in fetch queries not using relationships directions in Neo4j OGM APIs
Jave : Date counter excluding Weekends and Business holidays [duplicate]
Calling pack() on JDialog doens't shrink it horizontally
How to create an Object using each in java from an array [duplicate]

Categories

HOME
client
variables
asp.net-core
alfresco
jira
microservices
datastax-java-driver
azure-storage-tables
cloudkit
python-unittest
metatrader4
vault
spring-kafka
offline
nstableview
caml
uitypeeditor
progressive-web-apps
reactive-cocoa
nhibernate-envers
firefox-webextensions
introduction
one-hot-encoding
scriptcs
functional-testing
sox
tibco-mdm
autosys
p-value
brunch
elasticsearch-net
wtx
windows-server-2000
subdomains
c++-amp
skia
google-rich-snippets
iframe-resizer
data-manipulation
create-table
hockeyapp
withings
streamsets
hue
splice
streamreader
g-code
spring-security-kerberos
midl
wptoolkit
smartcontracts
jlink
typescript1.8
winscp-net
veracode
togetherjs
colorama
sonarlint-vs
minimization
color-picker
android-fonts
grails-tomcat-plugin
ado.net-entity-data-model
home-directory
intrusion-detection
login-control
py2app
paypal-express
storekit
markojs
rvest
captivenetwork
oauth2client
browser-link
pervasive-sql
thredds
cyclomatic-complexity
comobject
atk4
computer-algebra-systems
method-parameters
oberon
offloading
knuth
android-imagebutton
phalanger
castle
expected-exception
comexception
seaside
undefined-reference
hyprlinkr
balanced-payments
terminal-services
oam
farseer
ruby-datamapper
hungarian-algorithm
wsdl-2.0
gil
fireworks
recent-documents
visitor-statistic
yslow
createwindow
web-application-design
firefox-5
libs
swing-app-framework
text-coloring
dbisam
data-acquisition
django-notification

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