On 8/27/07, Skip Schuler <[EMAIL PROTECTED]> wrote:
>
> Hi,
>
> I've tested the feed-aggregator sample successfully, but that is not what
> I
> want. I.e. I don't want a separate process/server running, but I rather
> want
> the feed to be exposed from my web application (Tomcat instance).
>
> I've tried specifying an uri in the binding.rss/atom, but unsuccessully
> so.
> The alerts.composite in the alert-aggregator demo doesn't specify one
> either. Rather in the README in this demo (see demos/alert-aggregator) it
> says that I should go to
> http://localhost:8080/demo-alert-aggregator/services/AlertsFeedServiceRSS,
> but that gives me the error message below.
>
> Any hints on how this can be done?
>
> Thanks.
>
>
> On 8/27/07, Florian Rosenberg <[EMAIL PROTECTED]> wrote:
> >
> > hi skip,
> >
> > "Skip Schuler" < [EMAIL PROTECTED]> wrote on 08/27/2007 02:13:57
> PM:
> > > I'm trying to leverage the atom and rss bindings to expose some feeds
> > using
> > > java sca build 0.91. More specifically I'm trying to deploy a war on
> my
> > > Tomcat instance. I have a class that implements
> > > org.apache.tuscany.sca.binding.feed.Feed, however I'm not having any
> > success
> > > in reaching the atom or rss endpoints (which may be due to my
> > > understanding). Anyway, here's my configuration;
> > >
> > > .composite:
> > >
> > >     <service name="RSSSampleFeed" promote="AtomFeeder">
> > >         <binding.rss/>
> > >     </service>
> > >
> > >     <service name="AtomSampleFeed" promote="AtomFeeder">
> > >         <binding.atom />
> > >     </service>
> > >
> > >     <component name="AtomFeeder">
> > >         <implementation.java class="com.schuler.feed.FeederImpl" />
> > >     </component>
> > >
> > > web.xml:
> > >
> > >     <servlet-mapping>
> > >         <servlet-name>TuscanyServlet</servlet-name>
> > >         <url-pattern>/SCA/*</url-pattern>
> > >     </servlet-mapping>
> > >
> > >
> > > The URL http://localhost:8080/feed-atomrss/SCA/AtomSampleFeed fails
> with
> > a
> > > status code 500 (see below).
> >
> > it seems that your are missing something. for exposing your feeds you
> > don't
> > necessarily put your app manually in tomcat, tucany can do it for you.
> > i suggest that you have a look at the following example, which should
> > clarify some points:
> >
> >
> >
> https://svn.apache.org/repos/asf/incubator/tuscany/java/sca/samples/feed-aggregator/
> >
> > > How can I reach the rss and atom endpoints? What will the URL be, and
> > what
> > > are correct binding configurations in the .composite?
> >
> > the URL depends what you specify in the binding, for example:
> > <service name="rssSample" promote="RssAggregator">
> >    <tuscany:binding.rss uri=" http://localhost:8083/rssAggregator"/>
> > </service>
> >
> > -Florian
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
>
Hi Skip,

I don't think you are missing anything I think there is a fault in the
host-webapp code, I.e. the code that allows you to host SCA applications in
the web app container of your choice.

The intention with these feed bindings, and with other sca bindings too, is
that they will operate in various hosting environments. So you should be
able to drop you application into your Tomcat instance and have the feeds
served from there.

I just had a play with the feed aggregator demo and I put a little bit of
extra debug in to show me what it thinks the pathinfo is. For the URL

http://localhost:8080/demo-alert-aggregator/services/AlertsFeedServiceRSS

This is what Tomcat prints out

28-Aug-2007 12:07:24
org.apache.tuscany.sca.binding.feed.provider.FeedBindingLis
tenerServlet doGet
INFO: >>> FeedEndPointServlet (rss_2.0)
/demo-alert-aggregator/services/AlertsFe
edServiceRSS
28-Aug-2007 12:07:24
org.apache.tuscany.sca.binding.feed.provider.FeedBindingLis
tenerServlet doGet
INFO: >>> FeedEndPointServlet path = /AlertsFeedServiceRSS

The last bit of info is the bit I added but you should be able to see the
line

INFO: >>> FeedEndPointServlet (rss_2.0)
/demo-alert-aggregator/services/AlertsFe
edServiceRSS

Which tells you that the request is getting through to the feed binding.

Now I'm a little surprised that , in my case, it thinks that the pathinfo is
/AlertsFeedServiceRSS.  Having this path info means that the feed binding
will ignore the request. There is code in FeedBindingListenerServlet that,
for rss feeds, only does something if

 if (path == null || path.length() == 0 || path.equals("/")) {

So I'm guessing that, because we register the TuscanyServlet at  /services/*
in the feed-aggregator case it is picking up the rest as path info.

Is anyone making changes in this areas at the moment? I've raised a JIRA for
this (http://issues.apache.org/jira/browse/TUSCANY-1627) and I know there
has been debate over how this web app hosting should work. So if someone is
already putting changes in here can you speak up.

Simon

Reply via email to