Thanks all.

I have found the problem because I am not import  the class in the bundle with 
UserInfo class.


> 在 2015年12月3日,14:51,Jean-Baptiste Onofré <[email protected]> 写道:
> 
> Hi,
> 
> com.antfact* contains the annotations ?
> 
> Regards
> JB
> 
> On 12/03/2015 07:50 AM, Lu Qin wrote:
>> Before ,I package the bundle like this:
>> 
>> <plugin>
>> <groupId>org.apache.felix</groupId>
>> <artifactId>maven-bundle-plugin</artifactId>
>> <version>2.5.4</version>
>> <extensions>true</extensions>
>> <configuration>
>> <instructions>
>> <Bundle-SymbolicName>${project.artifactId}</Bundle-SymbolicName>
>> <Bundle-Name>${project.name}</Bundle-Name>
>> <Import-Package>
>> javax.ws.rs <http://javax.ws.rs>.*,
>>                 org.apache.shiro.authc.*;version="[1.2.0,3)",
>>                 org.apache.cxf.jaxrs.client.*,
>>                 org.slf4j.*,
>>                 !*
>>             </Import-Package>
>> <Export-Package>
>> com.antfact.auth2.commons.*;
>>                 !*
>>             </Export-Package>
>> </instructions>
>> </configuration>
>> </plugin>
>> 
>> Now,I not use the plugin and the problem resolve.
>> 
>> Why???
>> 
>> 
>> 
>> 
>>> 在 2015年12月3日,14:38,Lu Qin <[email protected]
>>> <mailto:[email protected]>> 写道:
>>> 
>>> 
>>> There is a User class like this:
>>> 
>>> public class UserInfoimplements Serializable {
>>> 
>>>     @Column(id =true,type = FieldType.String)
>>>     @JsonProperty(value ="user_id")
>>>     private StringuserId;
>>> 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]
>>>> <mailto:[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/> Committer & PMC
>>>> OPS4J Pax Web <http://wiki.ops4j.org/display/paxweb/Pax+Web/>
>>>> Committer & Project Lead
>>>> blog <http://notizblog.nierbeck.de/>
>>>> Co-Author of Apache Karaf Cookbook <http://bit.ly/1ps9rkS>
>>>> 
>>>> Software Architect / Project Manager / Scrum Master
>>>> 
>>> 
>> 
> 
> -- 
> Jean-Baptiste Onofré
> [email protected]
> http://blog.nanthrax.net
> Talend - http://www.talend.com

Reply via email to