WSO2 class mediator not work

一个人想着一个人 提交于 2019-12-12 02:25:28

问题


This is my first time to write NTLM mediator followed by NTLM Mediator

The mediator project:

Exported Jar and [ESB_HOME]/repository/components/dropins

Proxy service to test:

The mediator seems not work:

Line 73 throw out exception:


回答1:


You have to put jars into lib ($ESB_HOME/repository/components/lib). Delete jar in the dropins. As ESB start, it will put that jar into dropins folder. Try that.

If not you may have to add three folders as given in documentation[2].

Further references:

[1] https://docs.wso2.com/display/ESB490/Class+Mediator

[2] https://docs.wso2.com/display/ESB490/Places+for+Putting+Custom+Mediators




回答2:


The issue seems to be related to the mediation logic. The mediator seems to have deployed correctly since there is no ClassNotFound exceptions. To figure out the error you can add logs to the mediator or remote debug the mediator by starting ESB server in debug mode (./wso2server.sh debug 5005). You should debug the mediate() method. The error that you have got is thrown due to some exception being thrown in your class mediator's mediate() method.




回答3:


DilshaniS' answer is correct. You have to place your mediator jar in lib folder (also need to delete the existing jar in dropins folder). Following is the reason.

WSO2 products can only load/activate a jar placed in dropins folder only if it is written as an osgi component. In your case, it is just a jar. There are no classes which should be there in a osgi bundle. If it is a normal jar, you have to place it in the repository/components/lib folder. Then, when the server starts, it creates a osgi bundle from that jar and places it in the dropins folder. Then that osgi bundle gets activated and you are able to uses the classes in it.



来源:https://stackoverflow.com/questions/38365515/wso2-class-mediator-not-work

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!