There is a User class like this:
public class UserInfo implements Serializable {
@Column(id = true, type = FieldType.String)
@JsonProperty(value = "user_id")
private String userId;
and there is a userId field with a Column annotation,and the class in a bundle
named commons.
The Column java like this:
@Retention(RetentionPolicy.RUNTIME)
@Target({ElementType.FIELD})
public @interface Column {
String column_family() default "sbc";
String column_qualify() default "";
Now I use the UserInfo in another bundle ,and I want to find the Column
annotation like this:
Annotation[] anns = UserInfo.class.getDeclaredField("userId").getAnnotations();
the ans is 0 length.
> 在 2015年12月3日,14:34,Achim Nierbeck <[email protected]> 写道:
>
> Wow ...
> could you please elaborate on that?
> It's hard to understand your issue with such sparse information.
> What kind of Annotations are you using, how are you trying to use that class
> from another bundle?
>
> regards, Achim
>
>
> 2015-12-03 7:23 GMT+01:00 Lu Qin <[email protected]
> <mailto:[email protected]>>:
> I define a class with some annotations,and I export the class in a bundle,and
> I put the bundle into karaf 4.0. <http://4.0.3.it/>3. It active.
>
>
> But when I can not find the annotation when I use the class in other bundle.
>
> How can I resolve it ?
>
> Tnanks.
>
>
>
> --
>
> Apache Member
> Apache Karaf <http://karaf.apache.org/ <http://karaf.apache.org/>> Committer
> & PMC
> OPS4J Pax Web <http://wiki.ops4j.org/display/paxweb/Pax+Web/
> <http://wiki.ops4j.org/display/paxweb/Pax+Web/>> Committer & Project Lead
> blog <http://notizblog.nierbeck.de/ <http://notizblog.nierbeck.de/>>
> Co-Author of Apache Karaf Cookbook <http://bit.ly/1ps9rkS
> <http://bit.ly/1ps9rkS>>
>
> Software Architect / Project Manager / Scrum Master
>