Yves Martin
Yves Martin

Reputation: 10361

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

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 ?

Upvotes: 3

Views: 1879

Answers (1)

Kelly
Kelly

Reputation: 3709

Is it still embedded in the thread in JBoss 6.1?

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

and then parse from there?

Upvotes: 2

Related Questions