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

import on NetBeans a project located in web repository
WildFly 10 server hang issue for servlet calls unexpectedly
Reading and interpreting JVM memory from C
How to send a separate default text every time text is sent via SMS service from android app?
How to run powershell script from remote machine with Java?
ComboBoxViewerCellEditor and AutoCompleteField doesn't work
Add icon to a (link) element / element in element
Suppress Keyword Expansion in Shell Script
Mongo match in aggregate not working for date using java
Java method arguments of two types
Neo4j queries slows down but after restart are fast again
Execute linux command in java and display output to html table
Java Annotations javaArgs and LiteralArguments are deprecated
NoSuchMethodError while parsing xsd to generate classes using JAXB
Hibernate using sql call for each row to fetch relationship - instead of aggregating to one IN clause
How do I make a local variable increase consistently in a recursive function having more than one calls?

Categories

HOME
google-chrome-extension
multithreading
wso2-am
minimum-spanning-tree
mockito
heroku
office365api
spagobi
at-command
yahoo-oauth
tizen-web-app
jgroups
google-project-tango
serverspec
networkx
in-app-purchase
podio
iggrid
maude-system
moonmail
windows-phone-7
orchardcms
circuit
dosgi
clojurescript
windows-7-x64
jqwidget
text-rendering
excel-vba-mac
google-cloud-speech
introduction
grails3
swiftlint
lcd
dynamic-featured-image
windows-error-reporting
libssl
kendo-datasource
objectanimator
preg-match-all
xquery-3.0
framemaker
y86
overriding
appfabric
git-merge
serve
gesture
android-browser
code-search-engine
document.write
tasker
sas-visual-analytics
ws-security
android-tabhost
eclipse-scout
angular-resource
filepicker
theming
linode
eventkit
xcb
savon
underscore.js-templating
connect-by
disque
persist
hexdump
apachebench
php-parse-error
pyke
freedesktop.org
teamcity-8.0
sdhc
sniffer
web-controls
skos
bigbluebutton
operator-precedence
jsonpickle
codeigniter-url
java.util.concurrent
mdt
markers
websocket4net
issuu
php-5.4
project-planning
starcluster
aapt
picturefill
mcts
spring-io
dataservice
flash-builder4.5
gridcontrol
yui-compressor
lcs
factory-method
multipage
qtkit
transactionscope
gwt-ext
floating
infrastructure
revisions
nsviewanimation
brewmp
temporal-database
phonon
post-build
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