How to get client IP address in a JBoss remote EJB call?

谁说我不能喝 提交于 2019-12-06 08:04:51

问题


How to get the client IP address at the server-side when a EJB StatelessBean method is invoked through RMI/IIOP after a classical JNDI lookup ?

With JBoss 6.1 I tried the method java.rmi.server.RemoteServer#getClientHost but it throws java.rmi.server.ServerNotActiveException: not in a remote call. Is there any way to get the information ?


回答1:


Is it still embedded in the thread in JBoss 6.1?

    String currentThreadName = Thread.currentThread().getName();

and then parse from there?



来源:https://stackoverflow.com/questions/10395165/how-to-get-client-ip-address-in-a-jboss-remote-ejb-call

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