Sorry, but I'm not going to be of much help here. I remember having a hard time wrapping my head around what Guice was doing when I tried to get a basic AM Webapp running.

If Guice is just getting in the way, you could always ditch it and just use the Jersey/Jetty components, IMO.

On 6/24/14, 3:36 PM, Jon Maron wrote:
Hi,

   I am attempting to split out the Slider agent-based HTTP resources into a 
separate web application in order to explicit secure those interactions (SSL 
etc).  In doing so I am leveraging the Jersey/Guice/Jetty based web app 
infrastructure in Yarn.

   It appears that even though I have split off a separate yarn web app 
instance, configured with the associated agent resources, those new resources 
can not be reached/found (the other non-agent resources still managed by the 
SliderAMWebApp still work).  In other words, even though each WebApp instance 
is configured with its own GuiceContainer, for some reason the agent web app 
can not return those resources when requested (my understanding is that a 
GuiceContainer will scan the classes bound to the servlet module to identify 
configured resources and providers.  In a debugger I’ve also seen that that 
scan appears to take place).

   A successful, non-agent request looks like this:

14/06/24 17:26:28 DEBUG mortbay.log: REQUEST /ws/v1/slider/mgmt/app on 
org.mortbay.jetty.HttpConnection@d2c5c4d
14/06/24 17:26:28 DEBUG mortbay.log: 
sessionManager=org.mortbay.jetty.servlet.HashSessionManager@6602b61b
14/06/24 17:26:28 DEBUG mortbay.log: session=null
14/06/24 17:26:28 DEBUG mortbay.log: servlet=default
14/06/24 17:26:28 DEBUG mortbay.log: 
chain=NoCacheFilter->safety->AM_PROXY_FILTER->guice->default
14/06/24 17:26:28 DEBUG mortbay.log: servlet holder=default
14/06/24 17:26:28 DEBUG mortbay.log: call filter NoCacheFilter
14/06/24 17:26:28 DEBUG mortbay.log: call filter safety
14/06/24 17:26:28 DEBUG mortbay.log: call filter AM_PROXY_FILTER
14/06/24 17:26:28 DEBUG web.SliderAmIpFilter: Remote address for request is: 
192.168.64.1
14/06/24 17:26:30 WARN web.SliderAmIpFilter: Could not find proxy-user cookie, 
so user will not be set
14/06/24 17:26:31 DEBUG mortbay.log: call filter guice
14/06/24 17:26:31 DEBUG mortbay.log: RESPONSE /ws/v1/slider/mgmt/app  200

Whereas an unsuccessful agent request looks like this:

14/06/24 17:11:46 DEBUG mortbay.log: REQUEST 
/ws-agent/v1/slider/agents/register on org.mortbay.jetty.HttpConnection@1ad901b1
14/06/24 17:11:46 DEBUG mortbay.log: 
sessionManager=org.mortbay.jetty.servlet.HashSessionManager@372cab4
14/06/24 17:11:46 DEBUG mortbay.log: session=null
14/06/24 17:11:46 DEBUG mortbay.log: servlet=default
14/06/24 17:11:46 DEBUG mortbay.log: 
chain=NoCacheFilter->safety->AM_PROXY_FILTER->guice->default
14/06/24 17:11:46 DEBUG mortbay.log: servlet holder=default
14/06/24 17:11:46 DEBUG mortbay.log: call filter NoCacheFilter
14/06/24 17:11:46 DEBUG mortbay.log: call filter safety
14/06/24 17:11:46 DEBUG mortbay.log: call filter AM_PROXY_FILTER
14/06/24 17:11:46 DEBUG web.SliderAmIpFilter: Remote address for request is: 
192.168.64.1
14/06/24 17:11:47 DEBUG mortbay.log: EOF
14/06/24 17:11:49 WARN web.SliderAmIpFilter: Could not find proxy-user cookie, 
so user will not be set
14/06/24 17:11:50 DEBUG mortbay.log: call filter guice
14/06/24 17:11:50 DEBUG mortbay.log: call servlet default
14/06/24 17:11:50 DEBUG mortbay.log: 
RESOURCE=file:/tmp/Jetty_0_0_0_0_36606_slideragent____.aojpr6/webapp/ws-agent/v1/slider/agents/register.gz
14/06/24 17:11:50 DEBUG mortbay.log: 
RESOURCE=file:/tmp/Jetty_0_0_0_0_36606_slideragent____.aojpr6/webapp/ws-agent/v1/slider/agents/register
14/06/24 17:11:50 DEBUG mortbay.log: 
RESOURCE=file:/tmp/Jetty_0_0_0_0_36606_slideragent____.aojpr6/webapp/ws-agent/v1/slider/agents/register
14/06/24 17:11:50 DEBUG mortbay.log: 
resource=file:/tmp/Jetty_0_0_0_0_36606_slideragent____.aojpr6/webapp/ws-agent/v1/slider/agents/register
14/06/24 17:11:50 DEBUG mortbay.log: RESPONSE 
/ws-agent/v1/slider/agents/register  404

The second request shows that the guice interaction did not yield a response 
and the next filter (default) is attempted.

Anyone have any experience with this sort of configuration (multiple 
instantiated web apps/guice containers)?

— Jon


Reply via email to