Bummer -- unimplemented support for schemaless URL in preloader. This will require a code change, and is a little tricky.
Error is thrown here: http://codesearch.google.com/codesearch/p?hl=en#oS3Kom0H2nk/trunk/shindig/shindig_944740/java/gadgets/src/main/java/org/apache/shindig/gadgets/http/DefaultRequestPipeline.java&q=%22does%20not%20include%20scheme%22&l=108 The trouble is that this code has no way of knowing what schema was used for the originating request. That's way up the stack in HttpServletRequest. Within Google we have a RequestContext object that can be injected to provide this info, but implementing the full stack for this in Shindig is nontrivial. IMO the easiest way to fix this would be: 1. @Inject Provider<String> schemaProvider into DefaultRequestPipeline. To do so with minimal trouble to existing users, I'd do so via method style: @Inject(optional = true) public void setSchemaProvider(@Named("shindig.http.schema") Provider<String> schemaProvider) { ... } 2. In normalizeProtocol, if there's no schema but schemaProvider != null, set schema. >From there you just need to figure out your own way to define a Provider<String> injecting the schema. To do that depends on how you're using Shindig. The basic idea is that you use a Filter to set a ThreadLocal from HttpServletRequest.getProtocol(), which the Provider returns. --j On Fri, Mar 25, 2011 at 2:19 PM, Doug Ellison <[email protected]>wrote: > Well I'd like to say thank you sooooooo very much for the help. I had > already done Isaiah's suggestion to get some things that were not > working working to begin with. OK so I made the change restarted and > made both a step forward and a step backwards. The gadget that had > not been working now suddenly works wooo hoo. A gadget specifically > that comes from the tutorial that was working has now broken. > > I am getting the following exception > > org.apache.shindig.gadgets.preload.PreloadException: > org.apache.shindig.gadgets.GadgetException: Url > // > 10.48.73.232/rpc?st=14413%3A14413%3A0%3Adefault%3Ahttp%253A%2F%2Flocalhost%2Fxml%2FHelloWorld.xml%3A1%3Adefault > does not include scheme > > The gadget is a simple HelloWorld pulling viewer info > > <?xml version="1.0" encoding="UTF-8"?> > <Module> > <ModulePrefs title="Social Mashup Tutorial - Gifts (owner and viewer)"> > <Require feature="opensocial-data"/> > <Require feature="opensocial-templates"/> > </ModulePrefs> > <Content type="html" view="default"> > <![CDATA[ > <script type="text/os-data" > xmlns:os="http://ns.opensocial.org/2008/markup"> > <os:ViewerRequest key="viewer" fields="displayName"/> > </script> > <script type="text/os-template" > xmlns:os="http://ns.opensocial.org/2008/markup"> > Hello<os:If condition="${viewer.displayName!=null}">, > ${viewer.displayName}</os:If>! > <br/> > </script> > ]]> > </Content> > > > Further suggestions? > > > On Fri, Mar 25, 2011 at 3:07 PM, John Hjelmstad <[email protected]> wrote: > > Yep, that sounds like the problem right there. OpenSocial calls are > achieved > > in default Shindig by making an XmlHttpRequest to the URL keyed by > > "gadgets.osDataUri". XmlHttpRequest only allows same-origin calls. Origin > is > > defined as the combination of schema and authority in the URL ie. > > schema://authority -- which includes protocol, host, and port. > > So Isaiah's comment is close but I don't think exactly the right token. > In > > config/container.js change this: > > > > "gadgets.osDataUri" : "http://%host%/rpc", > > > > ...to this: > > > > "gadgets.osDataUri" : "//%host%/rpc", > > > > This is a schema-relative URL and should work for both HTTP and HTTPS. > > --j > > On Fri, Mar 25, 2011 at 1:57 PM, Doug Ellison <[email protected]> > > wrote: > >> > >> So I'd never used the Network within Chrome so thanks for the heads > >> up. It gives me slightly more information but I'm not quite sure > >> where to go... > >> > >> When I make an HTTP request I get the follow call order > >> > >> core:rpc.js > >> localhost/gadgets/js > >> ifr > >> /gadgets > >> > >> makeRequest > >> /gadgets > >> > >> rpc > >> > >> And everything works OK. > >> When I try from https It stops after > >> ifr > >> /gadgets. > >> Additionally Chrome gives another error I don't see on firefox > >> > >> XMLHttpRequest cannot load > >> > >> > http://10.48.73.232/rpc?st=14413%3A14413%3A0%3Adefault%3Ahttp%253A%2F%2F10.48.70.25%2FEmailGadget%2FEmailGadget.xml%3A1%3Adefault > . > >> Origin https://10.48.73.232 is not allowed by > >> Access-Control-Allow-Origin. > >> > >> I'm not quite sure what its meaning. I think its saying its not > >> allowed because the call originated from https but then makes a call > >> to http regularly. Is that possible? > >> > >> > >> > >> On Fri, Mar 25, 2011 at 2:23 PM, John Hjelmstad <[email protected]> > wrote: > >> > Hi Doug, > >> > Sounds like you might have an opensocial endpoint hard-coded to HTTP > -- > >> > random guess. What browser are you using? I'd give Chrome a try and > see > >> > what > >> > the Network tab says, to see if a request is being formulated. > >> > --j > >> > > >> > On Fri, Mar 25, 2011 at 11:12 AM, Doug Ellison < > [email protected]> > >> > wrote: > >> >> > >> >> I'm running Apache Shindig within a webapp and it seems to work > >> >> fantastic in most respects but I'm having one difficulty that I've > >> >> spent more then a few days on trying to figure out. > >> >> > >> >> When I make a call such as > >> >> > >> >> > >> >> > http://localhost/gadgets/ifr?url=http://www.labpixies.com/campaigns/todo/todo.xml > >> >> it renders and works. Also if I do > >> >> > >> >> > >> >> > https://localhost/gadgets/ifr?url=http://www.labpixies.com/campaigns/todo/todo.xml > >> >> it renders and works. I've written a gadget that has the following > >> >> calls > >> >> > >> >> function request() { > >> >> DisplayHTML("<h1> Loading...</h1>"); > >> >> var viewerIdSpec = opensocial.newIdSpec({userId: > 'VIEWER'}); > >> >> var req = opensocial.newDataRequest(); > >> >> > >> >> req.add(req.newFetchPersonRequest('VIEWER'), 'viewer'); > >> >> req.add(req.newFetchPersonAppDataRequest(viewerIdSpec, > >> >> "*"), "viewer_data"); > >> >> > >> >> req.send(handleRequest); > >> >> } > >> >> > >> >> Here is where my problem begins. If I put my gadget within http://it > >> >> works just fine and as expected. When I add https:// the method for > >> >> handling the response never gets called. So it seems to be a > >> >> problem within routing between http and https but only with certain > >> >> gadgets. However I can't seem to find a configuration option or > don't > >> >> understand enough to know whats really happening. Any help would be > >> >> greatly appreciated. > >> > > >> > > > > > >
