Uploaded image for project: 'Tools (JBoss Tools)'
  1. Tools (JBoss Tools)
  2. JBIDE-8642

RESTEasy wizard produces app that doesn't deploy

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Major
    • 3.2.1.M1, 3.3.0.M1
    • 3.2.0.Final
    • webservices
    • None
    • Hide

      Create a basic Seam CRUD app http://docs.redhat.com/docs/en-US/JBoss_Developer_Studio/4.0/html-single/Seam_Developer_Tools_Reference_Guide/index.html#crud_database_application, then follow the instructions to create a REST webservice http://docs.redhat.com/docs/en-US/JBoss_Developer_Studio/4.0/html-single/JBoss_Web_Services_User_Guide/index.html#proc-jbt-generate_a_sample_restful_web_service specifying the Seam CRUD App as the Dynamic Web Project for the RESTEasy wizard.

      The code is put in the wrong source folder (src/hot instead of src/main)

      Show
      Create a basic Seam CRUD app http://docs.redhat.com/docs/en-US/JBoss_Developer_Studio/4.0/html-single/Seam_Developer_Tools_Reference_Guide/index.html#crud_database_application , then follow the instructions to create a REST webservice http://docs.redhat.com/docs/en-US/JBoss_Developer_Studio/4.0/html-single/JBoss_Web_Services_User_Guide/index.html#proc-jbt-generate_a_sample_restful_web_service specifying the Seam CRUD App as the Dynamic Web Project for the RESTEasy wizard. The code is put in the wrong source folder (src/hot instead of src/main)
    • Hide
      The WS wizards (Create a Sample RESTful Web Service, Create a Sample Web Service, and Simple Web Service) were initially creating new sample classes in the first source folder encountered in the project. It turns out that there is one default source folder for a given project and that's the location we need to place those classes in. The code now finds the first default source folder (should only be one), and creates the classes there.
      Show
      The WS wizards (Create a Sample RESTful Web Service, Create a Sample Web Service, and Simple Web Service) were initially creating new sample classes in the first source folder encountered in the project. It turns out that there is one default source folder for a given project and that's the location we need to place those classes in. The code now finds the first default source folder (should only be one), and creates the classes there.

    Description

      I follow the instructions to create a basic Seam CRUD app http://docs.redhat.com/docs/en-US/JBoss_Developer_Studio/4.0/html-single/Seam_Developer_Tools_Reference_Guide/index.html#crud_database_application, then follow the instructions to create a REST webservice http://docs.redhat.com/docs/en-US/JBoss_Developer_Studio/4.0/html-single/JBoss_Web_Services_User_Guide/index.html#proc-jbt-generate_a_sample_restful_web_service specifying the Seam CRUD App as the Dynamic Web Project for the RESTEasy wizard.

      1. The resultant project will not deploy to the Dev Studio's EAP. The RESTEasy wizard creates the REST class in src/hot instead of src/main, and it doesn't deploy to the server. As a result the webapp fails on deploy with a "Class Not Found" error generated by RESTEasy.

      Manually copying the org.jboss.samples.rs.webservices package from src/hot to src/main resolves this problem, and the app deploys successfully.

      I'm not sure why it was created in src/hot, but it seems that the wizard should create it in src/main.

      2. Once the app deploys, however, neither the webservice nor the seam app work. The RESTEasy wizard adds:
      <servlet-mapping>
      <servlet-name>Resteasy</servlet-name>
      <url-pattern>/*</url-pattern>
      </servlet-mapping>
      to the deployment descriptor, and the Seam wizard adds:
      <filter-mapping>
      <filter-name>Seam Filter</filter-name>
      <url-pattern>/*</url-pattern>
      </filter-mapping>

      I fixed this by modifying the Resteasy url-pattern to /webservice/* and setting @Path("/webservice") on the HelloWorldResource class created by the RESTEasy wizard.

      Attachments

        1. jbide8642.patch
          1 kB
          Brian Fitzpatrick

        Activity

          People

            bfitzpat_rh Brian Fitzpatrick (Inactive)
            jwulf_jira Joshua Wulf (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: