Thursday, 15 May 2014

java - field.getAnnotations() returns empty array when run on a tomcat server, but returns correct annotation when run as a standalone -


I am trying to create and load dynamically in my application. There are comments on a member field of the class ("id"). Now I can easily compile and load class. I can see the compiled class in the directory, and when I open it in eclipse, then I can see the member field has annotations. But when I try to read this annotation, using the field getAnnotations (), the following are the things:

1) When I run the stand alone application, then I get the annotation " Key " / P>

2) When I run an application on the Tomcat server, GetAnnotations () returns the merit list empty. There is no "key" annotation.

Just note that I have a retention policy. How can I get annotations when I run it on the server? What are the possible things to solve this issue?

PS: Some code

  @ override public class  

// class loader

  private class  


No comments:

Post a Comment