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 add images to custom listview using Simple Adapter in android
How to obtain max resource values from Hadoop/YARN java API
Scaling and rotating an array of points
AWS java lambda function to do mqtt publish to aws iot
JMS Implemented by HornetQ Encounters an Invocation Delay
How to fix NulPointerException in given example [duplicate]
Bukkit Death/Kill listener throwing error when killed by void
Comparing two values in the same column SQL
how to create reminder app in android
What java permissions are needed to load log4j2 with security manager?
wildfly as systemd service
Endless scrolling after preforming returns on first item
What is a proper way to delete a list of objects in Hibernate?
Check that specific sequence exists or not in hibernate
Java 8 Streams - Grouping into Single value
Auto-increment not created

Categories

HOME
deployment
google-api-php-client
tesseract
xmpp
google-docs
yahoo-oauth
tizen-web-app
amortized-analysis
rubygems
rdf
umd
cross-browser
fingerprint
convolution
gnupg
spring-kafka
google-apps-marketplace
zend-framework3
spring-tool-suite
ibm-odm
openrefine
solaris-10
plunker
nas
object-detection
wkwebview
kvc
hammerspoon
fgetcsv
neo4j-spatial
replaceall
compatibility
webkitspeechrecognition
sql-server-2012-express
cloud-code
mapdb
fusionpbx
restlet
swift3.0.2
sharefile
webix-treetable
dism
preconditions
ruby-on-rails-3.1
vao
scorm
skeleton-css-boilerplate
wso2carbon
osx-mavericks
hibernate-tools
alphabet
powercli
rdfs
elgg
typed-lambda-calculus
android-fonts
httplistener
websitepanel
nessus
php-internals
photobucket
separator
execute
teamcity-8.0
quicklisp
tarjans-algorithm
muse
riak-cs
sailfish-os
generic-programming
ami
composite
oberon
unity5.2.3
ng-animate
pick
rdtsc
socketexception
typeof
tld
sgen
wp-query
xceed-datagrid
kgdb
bundles
android-2.2-froyo
terminal-services
pyhdf
ccss
quartz-graphics
batterylevel
orchardcms-1.7
html-editor
coderush
gdata-api
propertyeditor
ohm
infobox
rfc1123
inotifycollectionchanged
mysql-error-1005
remember-me
infrastructure
icanhaz.js
routedevent
data-acquisition

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