How to get client IP address in a JBoss remote EJB

2019-04-11 21: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条回答
霸刀☆藐视天下
2楼-- · 2019-04-11 22:19

Is it still embedded in the thread in JBoss 6.1?

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

and then parse from there?

查看更多
登录 后发表回答