3 Replies Latest reply on Nov 29, 2012 11:37 AM by davsclaus

    Deploying Apache Tapestry

    fivcsw

      Hello,

       

      I am trying to deploy an Apache Tapestry hello world project into Fuse ESB container. The basic example is generated with:

       

      mvn archetype:generate -DarchetypeCatalog=http://tapestry.apache.org

       

      I would like to add it to the Jetty server which comes with Fuse ESB.

       

      When I package it as war, the war installs and starts OK, I see the logging from Tapestry, but it is not added properly to Jetty.

      The only warning or error I get is this:

       

      WARN  | r-0.0.0-thread-1 | JettyServerWrapper               | 97 -

      org.ops4j.pax.web.pax-web-jetty - 1.0.10 | osgi.web.contextpath couldn't

      be set, it's not configured

       

      I tried to set the context path in various places:

      • maven-war-plugin: <configuration><webAppConfig><contextPath>

      • maven-bundle-plugin: <configuration><instructions><Webapp-Context>

      • maven-bundle-plugin: <configuration><instructions><Web-ContextPath>

      • I tried also with WEB-INF/web.xml and played with <servlet-mapping><url-pattern> although I think it the context path should be set in the pom

      in any case, no success, still get same warning.

       

      If I change packaging to jar, add blueprint and deploy it as a FAB, I don't even see any logging from Tapestry so it is probably not even started, although the FAB installs and starts OK, no errors, no warnings. This is my blueprint.xml:

       

       

       

      Any idea how do I add the Tapestry project to FuseESB's Jetty?

       

      Thanks

       

      Edited by: ymy54 on Nov 26, 2012 9:54 AM

       

      Edited by: ymy54 on Nov 26, 2012 9:59 AM

        • 1. Re: Deploying Apache Tapestry
          davsclaus

          See the section about deploying into the container. About the WAR url handler

          http://fusesource.com/docs/esbent/7.0/esb_deploy_osgi/UrlHandlers-War.html

           

          You can specify the context path the WAR file should be deployed as.

           

          And there is a web:list command I think, that shows all the WAR apps

          • 2. Re: Deploying Apache Tapestry
            fivcsw

            Thanks, I tried this:

             

            osgi:install war:mvn:mygroup/tapestryexample-war/1.0-SNAPSHOT/war?Web-ContextPath=mypath

             

            When I start the bundle using osgi:start I get:

             

            INFO  | r-0.0.0-thread-1 | WebXmlObserver                   | 213 - org.ops4j.pax.web.pax-web-extender-war - 1.0.10 | Using \[mypath\] as web application context name

            INFO  | r-0.0.0-thread-1 | WebXmlObserver                   | 213 - org.ops4j.pax.web.pax-web-extender-war - 1.0.10 | Using [] as web application root path

            INFO  | -1.0.10-thread-1 | HttpServiceFactoryImpl           | 95 - org.ops4j.pax.web.pax-web-runtime - 1.0.10 | Binding bundle: [mvn_mygroup_tapestryexample-war_1.0-SNAPSHOT_war ] to http service

            INFO  | r-0.0.0-thread-1 | ContextHandler                   | 85 - org.eclipse.jetty.util - 7.5.4.v20111024 | started HttpServiceContext{httpContext=org.ops4j.pax.web.extender.war.internal.WebAppWebContainerContext@9438dd}

             

            And then some logging from tapestry showing successful start. But I still can't test the servlet, I just get 404 for http://localhost:8181/ , http://localhost:8181/mypath , http://localhost:8181/mypath/foo and similar urls. With ?Web-ContextPath=mypath I figured I should see the servlet at http://localhost:8181/mypath/anything, right? My WEB-INF/web.xml has <url-pattern>/*</url-pattern>

            • 3. Re: Deploying Apache Tapestry
              davsclaus

              Hi

               

              Yeah I ran into the same issue with seeing Tapestry start up, but no web page being rendered.

               

              I posted a question on the Karaf user mailing lists, as that's where the pax-web team hang out also

              http://karaf.922171.n3.nabble.com/Pax-web-and-using-Apache-Tapestry-tp4026946.html