Announcement Announcement Module
Collapse
No announcement yet.
getBeanNamesForType Problem Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • getBeanNamesForType Problem

    Hi,

    I am using the following code to get access to some beans I require:

    boolean allowEagerInit = false;
    boolean includePrototypes = false;
    String[] beanNamesForType = appCtx.getBeanNamesForType(SomeInterface.class,
    includePrototypes, allowEagerInit);

    So far so good, I get the beans I need. Then I go through the list, I do get the bean from injected the appCtx, I call some method.

    Well, I get lots of NPEs, my Aspects aren't beeing configured properly...

    Well, I have an Aspect beeing configured through Spring:

    <bean id="someFluffyAspect" parent="someFluffyParent" factory-method="aspectOf" class="my.nice.SomeFluffyAspect"/>

    The point is: the aspect is not beeing initialized properly - no DI happening.

    I am afraid that the getBeanNamesForType is initializing the bean, although allowEager is false. Could it be a special "factory-method" problem?

    brgds,

    Papick

  • #2
    Could you put together a simple TestCase to demo the problem you are having?

    Comment


    • #3
      I will as soon as I run out of options - still in debug session...

      thxs,

      papick

      Comment


      • #4
        There are some more posts/threads regarding the same issue. I guess the main problem here is that Spring needs the actual bean before it can know the type. Hence instantiating/creating the bean.

        What kind of appCtx are you using?

        Comment


        • #5
          Hi, solved the problem, it hat nothing to do with the getBeanNamesForType.
          I managed to get my beans instantiated b4 the aspect.
          Nice, don't?

          Thanks for the replies...

          brgds,

          Papick

          Comment

          Working...
          X