用spring aop来配置dubbo,出现异常

问题描述

希望能够在函数调用的时候,将调用的通知发送到远程进行处理,为了实现这个功能,通过spring aop + dubbo进行实现,但是实现的过程中,出现了异常,异常的信息不固定,配置的内容如下:

clipboard.png

如果要让配置正常,只需要将aspect的声明提前就好了:

clipboard.png

下面是代码:

public class ServerTest {
    private IServer m_Server;
    private PointCutObject m_PointcutObject;

    @Before
    public void setUp(){
        {
            //start the server
            ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext("server.xml");
            context.start();
        }
        {
            ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext("client.xml");
            context.start();

            m_Server = (IServer) context.getBean("server");
            m_PointcutObject = (PointCutObject) context.getBean("pointCutObject");
        }
    }
    @Test
    public void testDefault(){
        //m_Server.onBefore();
    }

    @Test
    public void testBean(){
        m_PointcutObject.test();
    }
}

Server

public class Server implements IServer{
    @Override
    public void onBefore() {
        String tMsg = "Hello AOP";

        System.out.println(tMsg);
    }
}

异常信息:

clipboard.png

阅读 5k
撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题