Results 1 to 5 of 5

Thread: making tc server intercept object injected by @Resource

  1. #1
    Join Date
    Jul 2009
    Posts
    19

    Default making tc server intercept object injected by @Resource

    Hi
    my application is written using Spring 2.5.6
    however i dont use @Autowire, @Component,...etc
    I use @Resource to do my DI.
    when i run my application in tc server i can only see it intercepting my JDBC calls
    and when i start tc server there is a log :
    Code:
    [TomcatAspectJWeavingClassLoader@1b15692] warning javax.* types are not being woven because the weaver option '-Xset:weaveJavaxPackages=true' has not been specified
    i am new to the weaving idea
    can someone tell me where and how this property should be set?
    do i have to set it directly in the tc server? or in my AP?
    and after this is set, will tc server intercept calls on the object injected by @Resource?

    Thanx

  2. #2
    Join Date
    Feb 2008
    Location
    Nashua, NH
    Posts
    78

    Default

    The style of DI you utilize will not directly impact Spring Insight. However, the @Service annotation is used to advise your business objects and add frames to the trace. In the next release, we are going to make it easier to advise your own code, but for now, I would recommend annotation your injected objects with @Service. You do not need to turn on component scanning and can leave the rest of your configuration alone.

    The message you are seeing on the log is normal and not indicative of an error.
    Scott Andrews

    Software Engineer, Web Products Team
    SpringSource

  3. #3
    Join Date
    Jul 2009
    Posts
    19

    Default

    Thanks for the reply

    yes I have actually tried annotating my service with @Service and DAO with @Repository.
    And it works wonders just like you said.

    but maybe I don't understand the basic of @Component too well, so I am wondering if I add these annotations to my service and dao but still using @Resource for DI will there be any side effects or will the @Component annotations kick into effect at some point that i may not be aware of?
    and is there any benefits, other than that it will be affected by tc server? or is it just a good practice in Spring?

    Thanx

  4. #4
    Join Date
    Feb 2008
    Location
    Nashua, NH
    Posts
    78

    Default

    As long as you're not using component scanning, there should not be any side effects. Component scanning will automatically discover classes with the stereotype annotations and create new instances. This is something you have to specifically enable, so it should be safe to use the annotations on their own.
    Scott Andrews

    Software Engineer, Web Products Team
    SpringSource

  5. #5
    Join Date
    Jul 2009
    Posts
    19

    Default

    Thanks for the insight

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •