CXF-Fediz
  1. CXF-Fediz
  2. FEDIZ-32

SimpleWebapp example to startup the IDP, STS and RP from maven

    Details

    • Type: Improvement Improvement
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: Examples
    • Labels:
      None

      Description

      đ

        Activity

        Hide
        Glen Mazza added a comment -

        mvn tomcat:run will deploy to a standalone (not embedded, AFAIK) Tomcat instance, and perhaps we could facilitate that if we haven't already, but the user would need to still need to configure his Maven settings.xml file with the Tomcat usernames and passwords for each Tomcat instance, as well as configure the Tomcat RP instance with Fediz libraries. So not much may be gained, except perhaps the need to manually copy the WAR's in the Tomcat web-inf folders could be avoided.

        A quick trying out of the example doesn't really show anything--you might as well create an HTML page that says "Hello World" if that's your only goal. Rather, it's manually configuring the Tomcat instances with webapps and the necessary keys that is the real lesson (http://svn.apache.org/viewvc/cxf/fediz/trunk/examples/samplekeys/HowToGenerateKeysREADME.html?revision=1364769&view=co). Even if you could quickly view a HelloWorld.html you're still gonna need that lesson.

        Show
        Glen Mazza added a comment - mvn tomcat:run will deploy to a standalone (not embedded, AFAIK) Tomcat instance, and perhaps we could facilitate that if we haven't already, but the user would need to still need to configure his Maven settings.xml file with the Tomcat usernames and passwords for each Tomcat instance, as well as configure the Tomcat RP instance with Fediz libraries. So not much may be gained, except perhaps the need to manually copy the WAR's in the Tomcat web-inf folders could be avoided. A quick trying out of the example doesn't really show anything--you might as well create an HTML page that says "Hello World" if that's your only goal. Rather, it's manually configuring the Tomcat instances with webapps and the necessary keys that is the real lesson ( http://svn.apache.org/viewvc/cxf/fediz/trunk/examples/samplekeys/HowToGenerateKeysREADME.html?revision=1364769&view=co ). Even if you could quickly view a HelloWorld.html you're still gonna need that lesson.
        Hide
        chris snow added a comment - - edited

        mvn tomcat:run will run an embedded tomcat, but I think the IDP, STS and RP will need to run in the same tomcat instance.

        Adding the fediz tomcat dependency to the tomcat configuration on simpleWebapp allows you to start up tomcat in embedded mode using mvn tomcat:run

        <plugins>
              <plugin><!--for mvn tomcat:deploy/:undeploy/:redeploy -->
                   <groupId>org.codehaus.mojo</groupId>
                   <artifactId>tomcat-maven-plugin</artifactId>
                   <version>1.1</version>
                   <configuration>
                      <server>myTomcat</server>
                      <url>http://localhost:8080/manager/text</url>
                      <path>/${project.build.finalName}</path>
                   </configuration>
                   <dependencies> 
                      <dependency> 
                           <groupId>org.apache.cxf.fediz</groupId> 
                           <artifactId>fediz-tomcat</artifactId> 
                           <version>${project.version}</version> 
                      </dependency> 
                  </dependencies> 
              </plugin>
        </plugins>
        

        More configuration will be needed to point to the keystores (http://mojo.codehaus.org/tomcat-maven-plugin/run-mojo.html#keystoreFile), and the war file projects for the IDP and STS (http://mojo.codehaus.org/tomcat-maven-plugin/run-mojo.html#addContextWarDependencies)

        One thing I would like to do is run in debug mode with minimal setup effort so that I can stick in some breakpoints and have a look what is happening under the hood. I agree that learning how to set up tomcat, keys, etc, is important, however, to start with I prefer to get a deeper understanding of the java logic.

        Show
        chris snow added a comment - - edited mvn tomcat:run will run an embedded tomcat, but I think the IDP, STS and RP will need to run in the same tomcat instance. Adding the fediz tomcat dependency to the tomcat configuration on simpleWebapp allows you to start up tomcat in embedded mode using mvn tomcat:run <plugins> <plugin><!-- for mvn tomcat:deploy/:undeploy/:redeploy --> <groupId>org.codehaus.mojo</groupId> <artifactId>tomcat-maven-plugin</artifactId> <version>1.1</version> <configuration> <server>myTomcat</server> <url>http: //localhost:8080/manager/text</url> <path>/${project.build.finalName}</path> </configuration> <dependencies> <dependency> <groupId>org.apache.cxf.fediz</groupId> <artifactId>fediz-tomcat</artifactId> <version>${project.version}</version> </dependency> </dependencies> </plugin> </plugins> More configuration will be needed to point to the keystores ( http://mojo.codehaus.org/tomcat-maven-plugin/run-mojo.html#keystoreFile ), and the war file projects for the IDP and STS ( http://mojo.codehaus.org/tomcat-maven-plugin/run-mojo.html#addContextWarDependencies ) One thing I would like to do is run in debug mode with minimal setup effort so that I can stick in some breakpoints and have a look what is happening under the hood. I agree that learning how to set up tomcat, keys, etc, is important, however, to start with I prefer to get a deeper understanding of the java logic.
        Hide
        Glen Mazza added a comment - - edited

        Ooops, I was thinking of tomcat:deploy/redeploy etc., going to a standalone Tomcat; not tomcat:run which is indeed for embedded. So you're asking for the simpleWebapp example to be converted to running on a single Tomcat (embedded or not). I think that's still a non-starter, as the sample webapps are trying to mimic a production environment, the key relationships (the last two columns in the README I provided) would be lost (nothing would be learned) and the Tomcat configuration (such as installing the RP plugin) either much harder to do embedded or no longer available due to embedded usage. We'd be making you happy only up to the point when it's time to learn about the key relationships while increasing the difficulty to learn the latter from everyone else. So I don't see your recommended change being an improvement, but perhaps other team members think otherwise.

        You don't need embedded Tomcat to debug in Eclipse (http://www.jroller.com/gmazza/entry/eclipse_debug_web_services), and the IDE would probably work even if you're debugging two Tomcats simultaneously (have Eclipse listen on different ports). It's probably clearer to debug that way, and further, you can see the full key validation occurring if you use multiple Tomcats. At any rate, the sample can probably already be loaded on one Tomcat, it's just that you will need to follow the configuration instructions but load to one Tomcat instead of two. I still think it's preferable for you to go through this extra work so the multiple Tomcat learners (who already have a tough job) have it easier OOTB than vice-versa.

        Show
        Glen Mazza added a comment - - edited Ooops, I was thinking of tomcat:deploy/redeploy etc., going to a standalone Tomcat; not tomcat:run which is indeed for embedded. So you're asking for the simpleWebapp example to be converted to running on a single Tomcat (embedded or not). I think that's still a non-starter, as the sample webapps are trying to mimic a production environment, the key relationships (the last two columns in the README I provided) would be lost (nothing would be learned) and the Tomcat configuration (such as installing the RP plugin) either much harder to do embedded or no longer available due to embedded usage. We'd be making you happy only up to the point when it's time to learn about the key relationships while increasing the difficulty to learn the latter from everyone else. So I don't see your recommended change being an improvement, but perhaps other team members think otherwise. You don't need embedded Tomcat to debug in Eclipse ( http://www.jroller.com/gmazza/entry/eclipse_debug_web_services ), and the IDE would probably work even if you're debugging two Tomcats simultaneously (have Eclipse listen on different ports). It's probably clearer to debug that way, and further, you can see the full key validation occurring if you use multiple Tomcats. At any rate, the sample can probably already be loaded on one Tomcat, it's just that you will need to follow the configuration instructions but load to one Tomcat instead of two. I still think it's preferable for you to go through this extra work so the multiple Tomcat learners (who already have a tough job) have it easier OOTB than vice-versa.

          People

          • Assignee:
            Unassigned
            Reporter:
            chris snow
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:

              Development