Results 1 to 3 of 3

Thread: Problem in reading properties of a bean retrieved from ApplicationContext

  1. #1
    Join Date
    Aug 2006
    Posts
    2

    Question Problem in reading properties of a bean retrieved from ApplicationContext

    Dear Friends,

    I retrieved a bean from the ApplicationContext by using the ApplicationContextAware interface. The bean returned properly but it's properties were not set as expected (all of them were null ). Do you have any clue what might have gone wrong? If you need details about the application kindly read attached description.

    Thanks in advance!

    Sumith
    Attached Files Attached Files

  2. #2
    Join Date
    Jan 2005
    Location
    Bucharest, Romania
    Posts
    5,403

    Default

    Why are using the ApplicationContextAware interface - why not simply let Spring do the injection - you are using a bridge class (managed by Spring) which delegates the call to the context - why is that?
    The problem seems to be line 57 which I assume it a null Queue Poll- this might happen if you are injecting a bean definition from a different XML file or you are using quartz without the Spring support so the Queue class is created by Quartz itself (w/o any dependency set) and ran as it is - thus resulting in the NPE.
    Costin Leau
    SpringSource - http://www.SpringSource.com- Spring Training, Consulting, and Support - "From the Source"
    http://twitter.com/costinl
    Please use [ c o d e ] [ / c o d e ] tags

  3. #3
    Join Date
    Aug 2006
    Posts
    2

    Red face

    Dear Costin,

    I sorted out the problem. It was not something wrong in Spring. I have done a stupid property overriding at a different place of the codeline . Sorry for the noncense trouble to you.

    Thanks for your advice in poor usage of ApplicationContextAware interface. We will consider this improvement in the next upgrade of the application.

    Regards,
    Sumith

Posting Permissions

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