You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@geronimo.apache.org by alex_r <ar...@gmail.com> on 2009/04/28 11:53:50 UTC

How to get client IP address called EJB method

Sorry for my bad english.

Can i get ip address of client requested some EJB method within this method? 
-- 
View this message in context: http://www.nabble.com/How-to-get-client-IP-address-called-EJB-method-tp23273787s134p23273787.html
Sent from the Apache Geronimo - Users mailing list archive at Nabble.com.


Re: How to get client IP address called EJB method

Posted by alex_r <ar...@gmail.com>.


djencks wrote:
> 
> 
> On Apr 28, 2009, at 10:06 AM, alex_r wrote:
> 
>>
>> No, it is not servlet. Method called by standalone GUI client. Some  
>> hourse
>> ago i has add to org.apache.openejb.ejbd.EJBServer some code that  
>> store
>> client IP and port in CallContext. I think it is bad solution, but i  
>> have
>> not another.
> 
> As far as I know that is the only solution currently unless you want  
> to do something like convert all the calls to web service calls in  
> which case the http request might be available.  I doubt the extra xml  
> processing would be worth it.
> 
> There might be a more pluggable solution available sometime in the  
> future if we implement an ejb jaspi profile.  However, there is no  
> spec for this and jaspi will be not be available until geronimo 2.2  
> and we have no plans to implement a proprietary ejb jaspi profile at  
> this time.  Meanwhile your code is probably the best way.  If you can  
> supply it as a patch under the apache license in a jira issue we could  
> look at it and consider including it in geronimo or openejb.
> 
> thanks
> david jencks
> 
>>
>>
>> :-(
>>
>>
>> Ashish Jain-5 wrote:
>>>
>>> If it is a servlet which is accessing your ejb you can get the IP  
>>> address
>>> through ServletRequest.getRemoteAddr().
>>>
>>> HTH
>>>
>>> On Tue, Apr 28, 2009 at 3:23 PM, alex_r <ar...@gmail.com> wrote:
>>>
>>>>
>>>> Sorry for my bad english.
>>>>
>>>> Can i get ip address of client requested some EJB method within this
>>>> method?
>>>> --
>>>> View this message in context:
>>>> http://www.nabble.com/How-to-get-client-IP-address-called-EJB-method-tp23273787s134p23273787.html
>>>> Sent from the Apache Geronimo - Users mailing list archive at  
>>>> Nabble.com.
>>>>
>>>>
>>>
>>>
>>
>> -- 
>> View this message in context:
>> http://www.nabble.com/How-to-get-client-IP-address-called-EJB-method-tp23273787s134p23281912.html
>> Sent from the Apache Geronimo - Users mailing list archive at  
>> Nabble.com.
>>
> 
> 
> 

I create new issue OPENEJB-1023 in jira. But i am not sure that do it
correctly: i create new issue and resolve it whith source code in Comment
area and Issue status "Later".


Thank you for your help.
-- 
View this message in context: http://www.nabble.com/How-to-get-client-IP-address-called-EJB-method-tp23273787s134p23299547.html
Sent from the Apache Geronimo - Users mailing list archive at Nabble.com.


Re: How to get client IP address called EJB method

Posted by David Jencks <da...@yahoo.com>.
On Apr 28, 2009, at 10:06 AM, alex_r wrote:

>
> No, it is not servlet. Method called by standalone GUI client. Some  
> hourse
> ago i has add to org.apache.openejb.ejbd.EJBServer some code that  
> store
> client IP and port in CallContext. I think it is bad solution, but i  
> have
> not another.

As far as I know that is the only solution currently unless you want  
to do something like convert all the calls to web service calls in  
which case the http request might be available.  I doubt the extra xml  
processing would be worth it.

There might be a more pluggable solution available sometime in the  
future if we implement an ejb jaspi profile.  However, there is no  
spec for this and jaspi will be not be available until geronimo 2.2  
and we have no plans to implement a proprietary ejb jaspi profile at  
this time.  Meanwhile your code is probably the best way.  If you can  
supply it as a patch under the apache license in a jira issue we could  
look at it and consider including it in geronimo or openejb.

thanks
david jencks

>
>
> :-(
>
>
> Ashish Jain-5 wrote:
>>
>> If it is a servlet which is accessing your ejb you can get the IP  
>> address
>> through ServletRequest.getRemoteAddr().
>>
>> HTH
>>
>> On Tue, Apr 28, 2009 at 3:23 PM, alex_r <ar...@gmail.com> wrote:
>>
>>>
>>> Sorry for my bad english.
>>>
>>> Can i get ip address of client requested some EJB method within this
>>> method?
>>> --
>>> View this message in context:
>>> http://www.nabble.com/How-to-get-client-IP-address-called-EJB-method-tp23273787s134p23273787.html
>>> Sent from the Apache Geronimo - Users mailing list archive at  
>>> Nabble.com.
>>>
>>>
>>
>>
>
> -- 
> View this message in context: http://www.nabble.com/How-to-get-client-IP-address-called-EJB-method-tp23273787s134p23281912.html
> Sent from the Apache Geronimo - Users mailing list archive at  
> Nabble.com.
>


Re: How to get client IP address called EJB method

Posted by alex_r <ar...@gmail.com>.
No, it is not servlet. Method called by standalone GUI client. Some hourse
ago i has add to org.apache.openejb.ejbd.EJBServer some code that store
client IP and port in CallContext. I think it is bad solution, but i have
not another.

:-(


Ashish Jain-5 wrote:
> 
> If it is a servlet which is accessing your ejb you can get the IP address
> through ServletRequest.getRemoteAddr().
> 
> HTH
> 
> On Tue, Apr 28, 2009 at 3:23 PM, alex_r <ar...@gmail.com> wrote:
> 
>>
>> Sorry for my bad english.
>>
>> Can i get ip address of client requested some EJB method within this
>> method?
>> --
>> View this message in context:
>> http://www.nabble.com/How-to-get-client-IP-address-called-EJB-method-tp23273787s134p23273787.html
>> Sent from the Apache Geronimo - Users mailing list archive at Nabble.com.
>>
>>
> 
> 

-- 
View this message in context: http://www.nabble.com/How-to-get-client-IP-address-called-EJB-method-tp23273787s134p23281912.html
Sent from the Apache Geronimo - Users mailing list archive at Nabble.com.


Re: How to get client IP address called EJB method

Posted by Ashish Jain <as...@gmail.com>.
If it is a servlet which is accessing your ejb you can get the IP address
through ServletRequest.getRemoteAddr().

HTH

On Tue, Apr 28, 2009 at 3:23 PM, alex_r <ar...@gmail.com> wrote:

>
> Sorry for my bad english.
>
> Can i get ip address of client requested some EJB method within this
> method?
> --
> View this message in context:
> http://www.nabble.com/How-to-get-client-IP-address-called-EJB-method-tp23273787s134p23273787.html
> Sent from the Apache Geronimo - Users mailing list archive at Nabble.com.
>
>