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

Java - Error with Spring Integration Mock SftpServer
How to get parameters from the method and display a matrix in the HTML through JSP?
Importing self-signed cert into Docker's JRE cacert is not recognized by the service
RadioButtons are not getting checked properly in segmented radiogroup
How to access another computer mysql database in my computer(which is 50km away)using java
android: how to encypt local information and connections?
LocalContainerEntityManagerFactoryBean cannot be converted to EntityManagerFactory
Spring MVC Redirect with Response from HTTP POST
Maven resources in subfolders incorrectly packaged
Android Studio for loop
Java executable .jar file does not play MP3 file from external resource
How to generate different color than last time
JVM crashes with Apache HttpClient RequestAddCookies.process
java generics <? super T> bounded type [duplicate]
UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 60): RangeError: Invalid status code: 0
Trying to read a txt file in Java

Categories

HOME
vbscript
proxy
keycloak
activiti
drivers
plot
react-redux
tizen-web-app
leon
youtube-api-v3
jgroups
disassembler
pheatmap
primary-key
python-unittest
maude-system
facebook-php-sdk
nano-server
export-to-csv
nstableview
zend-framework3
timeout
fortumo
jsprit
uitypeeditor
opentracing
ab-testing
excel-vba-mac
scriptcs
arabic
accessor
one-to-many
pepper
intel-pin
entitlements
web-api-testing
social-media
jaxb2
flink-streaming
exuberant-ctags
accelerate-framework
environment-modules
jquery-bootgrid
automake
neuroscience
grid.mvc
dynamic-reports
segment
sas-jmp
apache-fop
atomicity
dropbox-php
veracode
tizen-native-app
gabor-filter
nsarray
pdfclown
pycaffe
jquery-filter
ableton-live
storekit
fadeout
captivenetwork
php-parse-error
xpath-1.0
hsv
intel-fortran
t4mvc
metaclass
simple-framework
content-length
microbenchmark
apache-commons-fileupload
nsight
notify
device-orientation
bundles
didselectrowatindexpath
monomac
listings
pushbackinputstream
xamlparseexception
referrer
dmoz
bitsharp
frameset
ticoredatasync
wse3.0
spyware
self-extracting
propagation
locate
xfbml
telerik-scheduler
perfect-hash
user-friendly
adrotator
anti-piracy

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