Q:

Spring AOP : Can we access bean object by getBean("beanName") method after applying ProxyFactoryBean on that Bean?

I have applied a 'BeforeAdvice' through 'ProxyFactoryBean' on a Bean of type "MyXMLApplication" now I am not able to access the Bean object directly{by getBean(MyXMLApplication.class)}, it is giving error :-
by setter dependency injection myxml
Exception in thread "main" org.springframework.beans.factory.NoUniqueBeanDefinitionException: No qualifying bean of type [com.journaldev.spring.di.consumer.MyXMLApplication] is defined: expected single matching bean but found 2: MyXMLApp,proxy
However I am able to get the bean object by "proxy" bean object{(MyXMLApplication)context.getBean("proxy")}. Now my question is after applying proxy on any bean is there any way to access it directly without proxy bean.
My code is:
********Before Advisor*********

 public class MyBeforeAdvisor implements MethodBeforeAdvice{
        public void before(Method arg0, Object[] arg1, Object arg2) throws Throwable {
            // TODO Auto-generated method stub
            System.out.println("before advice run");
        }
    }

*********applicationContext.xml********

<bean id="twitter" class="com.journaldev.spring.di.services.TwitterService"></bean>
<bean id="MyXMLApp" class="com.journaldev.spring.di.consumer.MyXMLApplication" autowire="byType"/>
<bean id="beforeAdvice" class="com.journaldev.spring.aop.advisor.MyBeforeAdvisor"></bean>
<bean id="proxy" class="org.springframework.aop.framework.ProxyFactoryBean">
        <property name="target" ref="MyXMLApp"></property>
        <property name="interceptorNames">
          <list>
             <value>beforeAdvice</value>
          </list>
        </property>
</bean>

**********Main Bean Class************

  public class MyXMLApplication {
        private MessageService service;
        public void setService(MessageService svc){
            System.out.println("by setter dependency injection myxml");
            this.service=svc;
        }
        public boolean processMessage(String msg, String rec) {
            return this.service.sendMessage(msg, rec);
        }
    }

**********Autowired Bean Interface ******* 

    public interface MessageService {
            boolean sendMessage(String msg, String rec);
        }

**********Autowired Bean Impl*********

 public class TwitterService implements MessageService {
        public boolean sendMessage(String msg, String rec) {
            System.out.println("Twitter message Sent to "+rec+ " with Message="+msg);
            return true;
        }
    }

 ************* Main function**********

      public static void main(String[] args) {
                ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext(
                        "applicationContext.xml");
     MyXMLApplication app = context.getBean(MyXMLApplication.class); --> Not Working

    //MyXMLApplication app = (MyXMLApplication)context.getBean("proxy"); -->working

                app.processMessage("Hi", "abc@abc.com");
                context.close();
            }

A:

Sorry guys, the error was coming because I was calling  getBean(MyXMLApplication.class) [by type] that is why it founds two beans "proxy" and "MyXMLApp" of type MyXMLApplication.class and giving the error.
It is not something like we can not call the 'getBean'method on bean directly after applying any proxy on that.

