Re: Problem configuring and reaching RSS, Atom bindings
Hi, I've successfully deployed and tested the WAR on my Tomcat installation. Thanks! The links from the index.html page works fine, and I'm able to reach e.g. http://localhost:8080/sample-feed-aggregator-webapp/atomAggregator A tiny detail: in your FeedAggregator.composite I see that you specify an uri on the atom and rss bindings. I guess they are not used? (at least not reachable?). E.g. tuscany:binding.atom uri= http://localhost:8083/atomAggregator/ from http://svn.apache.org/repos/asf/incubator/tuscany/java/sca/samples/feed-aggregator-webapp/src/main/resources/FeedAggregator.composite Thanks again. On 8/28/07, Jean-Sebastien Delfino [EMAIL PROTECTED] wrote: Skip Schuler wrote: Hi, I only have one index.html file in my WAR in addition to the SCA components, i.e. no JSPs or servlets. My wish is to have everything in Tomcat (and perhaps in a WAR), i.e. adding new server processes are not an option for my application architecture (would mean more to monitor, maintain etc). My META-INF/sca-contribution.xml looks like this: ?xml version=1.0 encoding=UTF-8? contribution xmlns=http://www.osoa.org/xmlns/sca/1.0; targetNamespace=http://sample; xmlns:sample=http://sample; deployable composite=sample:SimpleFeeder/ /contribution ...while my simplefeeder.composite contains: ?xml version=1.0 encoding=UTF-8? composite xmlns=http://www.osoa.org/xmlns/sca/1.0; targetNamespace=http://sample; xmlns:sample=http://sample; name=SimpleFeeder [...then the services and component listed above...] /composite I cannot see the output you mention from Tomcat, the only output from Tomcat is: Aug 28, 2007 3:16:24 PM org.apache.catalina.startup.HostConfig deployWAR INFO: Deploying web application archive feed-atomrss.war Thanks again. Hi, I did some investigation and found a few bugs in our Webapp integration :) 1) TuscanyServlet does not pass the correct servletPath and pathInfo when it dispatches an HTTP request to the Tuscany binding servlet (like the feed binding or jsonrpc binding for example). 2) TuscanyServlet cannot be mapped to /* as it would block access to /index.html page. As a workaround most people have mapped TuscanyServlet to /SCA/* or /services/* for example but that breaks the convention for default SCA service URIs and will confuse bindings like the feed binding which return documents containing URIs to related resources. 3) I also ran into a bug with WebAppServletHost not handling URIs ending with / correctly, which will break the feed binding as well. Good news is that I was able to fix (1), (2) and (3) in SVN revision r570619 of the Tuscany trunk :) I converted the TuscanyServlet servlet to a servlet filter as a less intrusive way to dispatch HTTP requests which can be mapped to /* without breaking support for other Web content in the Webapp. Web.xml files should now look like this (simpler than before): web-app display-nameApache Tuscany Feed Aggregator Sample/display-name filter filter-nametuscany/filter-name filter-classorg.apache.tuscany.sca.host.webapp.TuscanyServletFilter /filter-class /filter filter-mapping filter-nametuscany/filter-name url-pattern/*/url-pattern /filter-mapping /web-app I committed a new sample showing the feed-aggregator packaged in a Webapp (and with an index.html page, similar to what you described) there: http://svn.apache.org/repos/asf/incubator/tuscany/java/sca/samples/feed-aggregator-webapp/ and posted the WAR I built with revision r570619 there: http://people.apache.org/~jsdelfino/test/ Could you please give it a try and let me know? Thanks. -- Jean-Sebastien - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Problem configuring and reaching RSS, Atom bindings
Skip Schuler wrote: Hi, I've successfully deployed and tested the WAR on my Tomcat installation. Thanks! The links from the index.html page works fine, and I'm able to reach e.g. http://localhost:8080/sample-feed-aggregator-webapp/atomAggregator Cool :) A tiny detail: in your FeedAggregator.composite I see that you specify an uri on the atom and rss bindings. I guess they are not used? (at least not reachable?). E.g. tuscany:binding.atom uri= http://localhost:8083/atomAggregator/ from http://svn.apache.org/repos/asf/incubator/tuscany/java/sca/samples/feed-aggregator-webapp/src/main/resources/FeedAggregator.composite Thanks again. Good point, when we package an SCA composite in a Webapp we can't control the host and port since they are fixed by the Tomcat Web container, so we have ignore them and only consider the path part of the URI (/atomAggregator) and make this path available inside the context of the Webapp. BTW this shows that the current Webapp integration approach is not leveraging the full power of SCA... In an ideal SCA world you would expect the following: - people would configure services in their SCA domain with URIs like http://myhost:8083/atomAggregator; and http://myotherhost:8087/rssAggregator; - a deployment tool would take the SCA domain configuration and generate the configuration of Tomcat servers on myhost and myotherhost with the right ports and services deployed on them This would really leverage SCA as a way to describe the configuration of a service oriented network, including multiple machines, servers and their configuration. It's what we're starting to do with SCA nodes being able to embed Tomcat or Jetty servers configured from the SCA metadata. If on the other hand you start with existing - already configured - Tomcat servers and deploy pieces of your SCA domain to them in Webapps, then some of the network configuration aspects of SCA can't apply anymore. It's what you're seeing here, localhost:8083 must be ignored as the host and port are already fixed by your existing Tomcat server. For now, I'll adjust the sample to just say binding uri=atomAggregator/ :) -- Jean-Sebastien - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Problem configuring and reaching RSS, Atom bindings
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-nameTuscanyServlet/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
Re: Problem configuring and reaching RSS, Atom bindings
Skip Schuler wrote: Hi, 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-nameTuscanyServlet/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). How can I reach the rss and atom endpoints? What will the URL be, and what are correct binding configurations in the .composite? I've also tried to deploy the demo alert-aggregator. It gives me the same error at the suggested URL http://localhost:8080/demo-alert-aggregator/services/AlertsFeedServiceRSS: HTTP Status 500 - -- *type* Exception report *message* *description* *The server encountered an internal error () that prevented it from fulfilling this request.* *exception* java.lang.IllegalStateException: No servlet registered for path: /AlertsFeedServiceRSS org.apache.tuscany.sca.webapp.TuscanyServlet.service(TuscanyServlet.java:57) *note* *The full stack trace of the root cause is available in the Apache Tomcat/5.5.20 logs.* -- Apache Tomcat/5.5.20 Am I missing something here? Thanks! Hi, I'm taking a look at this now and have a few questions: - When you start Tomcat, do you see messages indicating like this: Aug 28, 2007 10:44:12 AM org.apache.tuscany.sca.host.webapp.WebAppServletHost addServletMapping INFO: addServletMapping: /rssAggregator Aug 28, 2007 10:44:12 AM org.apache.tuscany.sca.host.webapp.WebAppServletHost addServletMapping INFO: addServletMapping: /atomAggregator/* - Do you have an src/main/webapp/META-INF/sca-contribution.xml file listing the composites that need to be activated in the webapp, like this: contribution xmlns=http://www.osoa.org/xmlns/sca/1.0; targetNamespace=http://aggregator; xmlns:a=http://aggregator; deployable composite=a:FeedAggregator/ /contribution - Do you have anything else than the SCA components in your WAR, like other JSPs or servlets implementing some Web UI? or are you just interested in packaging the SCA components in a WAR because it's more convenient to deploy to Tomcat this way? -- Jean-Sebastien - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Problem configuring and reaching RSS, Atom bindings
Hi, I only have one index.html file in my WAR in addition to the SCA components, i.e. no JSPs or servlets. My wish is to have everything in Tomcat (and perhaps in a WAR), i.e. adding new server processes are not an option for my application architecture (would mean more to monitor, maintain etc). My META-INF/sca-contribution.xml looks like this: ?xml version=1.0 encoding=UTF-8? contribution xmlns=http://www.osoa.org/xmlns/sca/1.0; targetNamespace=http://sample; xmlns:sample=http://sample; deployable composite=sample:SimpleFeeder/ /contribution ...while my simplefeeder.composite contains: ?xml version=1.0 encoding=UTF-8? composite xmlns=http://www.osoa.org/xmlns/sca/1.0; targetNamespace=http://sample; xmlns:sample=http://sample; name=SimpleFeeder [...then the services and component listed above...] /composite I cannot see the output you mention from Tomcat, the only output from Tomcat is: Aug 28, 2007 3:16:24 PM org.apache.catalina.startup.HostConfig deployWAR INFO: Deploying web application archive feed-atomrss.war Thanks again. On 8/28/07, Jean-Sebastien Delfino [EMAIL PROTECTED] wrote: Skip Schuler wrote: Hi, 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-nameTuscanyServlet/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). How can I reach the rss and atom endpoints? What will the URL be, and what are correct binding configurations in the .composite? I've also tried to deploy the demo alert-aggregator. It gives me the same error at the suggested URL http://localhost:8080/demo-alert-aggregator/services/AlertsFeedServiceRSS: HTTP Status 500 - -- *type* Exception report *message* *description* *The server encountered an internal error () that prevented it from fulfilling this request.* *exception* java.lang.IllegalStateException: No servlet registered for path: /AlertsFeedServiceRSS org.apache.tuscany.sca.webapp.TuscanyServlet.service( TuscanyServlet.java:57) *note* *The full stack trace of the root cause is available in the Apache Tomcat/5.5.20 logs.* -- Apache Tomcat/5.5.20 Am I missing something here? Thanks! Hi, I'm taking a look at this now and have a few questions: - When you start Tomcat, do you see messages indicating like this: Aug 28, 2007 10:44:12 AM org.apache.tuscany.sca.host.webapp.WebAppServletHost addServletMapping INFO: addServletMapping: /rssAggregator Aug 28, 2007 10:44:12 AM org.apache.tuscany.sca.host.webapp.WebAppServletHost addServletMapping INFO: addServletMapping: /atomAggregator/* - Do you have an src/main/webapp/META-INF/sca-contribution.xml file listing the composites that need to be activated in the webapp, like this: contribution xmlns=http://www.osoa.org/xmlns/sca/1.0; targetNamespace=http://aggregator; xmlns:a=http://aggregator; deployable composite=a:FeedAggregator/ /contribution - Do you have anything else than the SCA components in your WAR, like other JSPs or servlets implementing some Web UI? or are you just interested in packaging the SCA components in a WAR because it's more convenient to deploy to Tomcat this way? -- Jean-Sebastien - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Problem configuring and reaching RSS, Atom bindings
Skip Schuler wrote: Hi, I only have one index.html file in my WAR in addition to the SCA components, i.e. no JSPs or servlets. My wish is to have everything in Tomcat (and perhaps in a WAR), i.e. adding new server processes are not an option for my application architecture (would mean more to monitor, maintain etc). My META-INF/sca-contribution.xml looks like this: ?xml version=1.0 encoding=UTF-8? contribution xmlns=http://www.osoa.org/xmlns/sca/1.0; targetNamespace=http://sample; xmlns:sample=http://sample; deployable composite=sample:SimpleFeeder/ /contribution ...while my simplefeeder.composite contains: ?xml version=1.0 encoding=UTF-8? composite xmlns=http://www.osoa.org/xmlns/sca/1.0; targetNamespace=http://sample; xmlns:sample=http://sample; name=SimpleFeeder [...then the services and component listed above...] /composite I cannot see the output you mention from Tomcat, the only output from Tomcat is: Aug 28, 2007 3:16:24 PM org.apache.catalina.startup.HostConfig deployWAR INFO: Deploying web application archive feed-atomrss.war Thanks again. Hi, I did some investigation and found a few bugs in our Webapp integration :) 1) TuscanyServlet does not pass the correct servletPath and pathInfo when it dispatches an HTTP request to the Tuscany binding servlet (like the feed binding or jsonrpc binding for example). 2) TuscanyServlet cannot be mapped to /* as it would block access to /index.html page. As a workaround most people have mapped TuscanyServlet to /SCA/* or /services/* for example but that breaks the convention for default SCA service URIs and will confuse bindings like the feed binding which return documents containing URIs to related resources. 3) I also ran into a bug with WebAppServletHost not handling URIs ending with / correctly, which will break the feed binding as well. Good news is that I was able to fix (1), (2) and (3) in SVN revision r570619 of the Tuscany trunk :) I converted the TuscanyServlet servlet to a servlet filter as a less intrusive way to dispatch HTTP requests which can be mapped to /* without breaking support for other Web content in the Webapp. Web.xml files should now look like this (simpler than before): web-app display-nameApache Tuscany Feed Aggregator Sample/display-name filter filter-nametuscany/filter-name filter-classorg.apache.tuscany.sca.host.webapp.TuscanyServletFilter/filter-class /filter filter-mapping filter-nametuscany/filter-name url-pattern/*/url-pattern /filter-mapping /web-app I committed a new sample showing the feed-aggregator packaged in a Webapp (and with an index.html page, similar to what you described) there: http://svn.apache.org/repos/asf/incubator/tuscany/java/sca/samples/feed-aggregator-webapp/ and posted the WAR I built with revision r570619 there: http://people.apache.org/~jsdelfino/test/ Could you please give it a try and let me know? Thanks. -- Jean-Sebastien - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Problem configuring and reaching RSS, Atom bindings
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-nameTuscanyServlet/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]