Announcement Announcement Module
Collapse
No announcement yet.
Component Scan Base Package to multiple paths Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Component Scan Base Package to multiple paths

    Hello, here I have problem that is getting me :

    If I define the component-scan context defined like this
    PHP Code:
        <context:component-scan  base-package="com.transporte.mbean, com.transporte.persistencia.dao"/> 
    won't work any of both(com.transporte.mbean or com.transporte.persistencia.dao) they are not injected but if I do this

    PHP Code:
        <context:component-scan  base-package="com.transporte.mbean"/> 
    the injected definition hasm an instance, but I need to resolve the daos annotations classes too, snif

    For eg: im using a backBeanUser injected to be used un a jsf page, and a serviceUserLogin is injected in this backBeanUser, i can't make them both work together(only the first one works)

    Does someone know how can I solve this? I don't know hoew to proceed???
    Last edited by guillermodl; Jan 28th, 2008, 10:57 PM.

  • #2
    I was thinking maybe there's a way to associate a point-cut to component-scan, something like this
    "execution(* com.transporte.*.*(..))"
    help!!!

    Comment


    • #3
      problem solved using arid framework

      Comment


      • #4
        Why not simply define 2 component-scan blocks?

        Code:
        <context:component-scan base-package="com.transporte.mbean"/>
        <context:component-scan base-package="com.transporte.persistencia.dao"/>
        of using the include and exclude features...

        Code:
        <context:component-scan  base-package="com.transporte">
          <context:include-filter type="aspectj" expression="com.transporte.*.*" />
        </context:component-scan>
        I suggest you read the desired chapter in the reference guide, it is clearly explained in there what you can do.

        Comment


        • #5
          Hi.

          I spent some time trying to understand how component-scan and annotation-config work.

          I think it should be highlighted in the reference, that
          1. There can be more than one component-scan elements!

          2. The component-scan element automatically turns on the annotation-config option!

          Comment


          • #6
            # The component-scan element automatically turns on the annotation-config option!
            the documentation

            Furthermore, the AutowiredAnnotationBeanPostProcessor and CommonAnnotationBeanPostProcessor are both included implicitly when using the component-scan element. That means that the two components are autodetected and wired together - all without any bean configuration metadata provided in XML.
            The first one isn't mentioned explicitly but is it really needed. If you think so register a JIRA instead of dumping it here.

            Comment


            • #7
              wt if i have this
              Code:
              <context:component-scan base-package="com.ent.proy.service.component">
                      <context:include-filter type="annotation" expression="org.springframework.stereotype.Service"/>
              </context:component-scan>
              and not

              Code:
              <context:include-filter type="aspectj" expression="com.transporte.*.*" />

              Comment


              • #8
                problem solved using arid framework

                Comment


                • #9
                  The first one isn't mentioned explicitly but is it really needed.Attachment
                  Attached Files

                  Comment

                  Working...
                  X