5 Replies Latest reply on Nov 11, 2007 8:36 PM by Shane Bryzak

    WebServices and EAR with Seam

    Gary Pinkham Newbie

      Forgive me for "pseudo" cross posting.. But I'm not sure which forum to ask on. In a nutshell I created a seam web project using the jboss tools. This gives me three eclipse projects.. Ear, War and EJB. I created a web service in the EJB project.. Deployed everything.. Seam web project works fine.. But the Web Service doesn't register. I'm curious if I'm supposed to do something different to deploy this? I read the JbossWS instructions and they say to put the JAR in the Deploy directly.. But why would I put my ejb-jar in the deploy and not inside the EAR.

      Any suggestions/comments/"kick in the right direction" are appreciated!
      Thanks!

        • 1. Re: WebServices and EAR with Seam
          Gary Pinkham Newbie

          ok so after lots of hair pulling I have this sort of working.. It seems that whenever I make a change and restart the app server it does not register the web service. Removing my EAR from the app server (using "add/remove projects" performing a clean then re-adding the EAR to the app server causes it to register the web service when it starts.. weird!!!)

          Anyways. Here's the thing.. I ended up moving the Web Service code that was produced from wsconsume into the Web App project (from the EJB project). Adding in the reference in the Web.xml helped to get it registered. But now I can't access my seam components (at least I think I can't. I tried "Component.getInstance()" but this causes an IllegalStateException).

          So the new question is.. Can I access Seam Components contained in the EJB project from the Seam Web project? If yes.. How?

          Many Thanks in advance,

          • 2. Re: WebServices and EAR with Seam
            Shane Bryzak Master

            Have you read the web services chapter in the Seam reference docs?

            • 3. Re: WebServices and EAR with Seam
              Gary Pinkham Newbie

               

              "shane.bryzak@jboss.com" wrote:
              Have you read the web services chapter in the Seam reference docs?


              Yes.. I guess I'm just not "getting it". I did add the "standard-jaxws-endpoint-config.xml" file to the web app project.. There are two Meta-Inf directories in that project. I added it to the /src/META-INF one which also contains the orm.xml etc.. So I assumed that was the best place.. At any rate I recreated the project as a single WAR instead of EAR and will try it out today (working on it right now actually)

              Thanks for the help.

              • 4. Re: WebServices and EAR with Seam
                Gary Pinkham Newbie

                 

                "shane.bryzak@jboss.com" wrote:
                Have you read the web services chapter in the Seam reference docs?


                Another bit that is confusing is where to put the Web Services. When I created the project in eclipse I get two source directories.. One for Model and one for actions. I ran the wsconsume and out it's output into the action src directory. But including the I put the web services impl class into the web.xml (as recommended on the jboss docs but not chapter 20 of the seam docs) I get a class not found due to the classes not being in /web-inf/classes but instead in /web-inf/dev. All that makes it a bit confusing as to what to put where..

                I have a feeling that I'm missing something important (and probably obvious) and I'm doing this completely wrong..

                Thanks again.



                • 5. Re: WebServices and EAR with Seam
                  Shane Bryzak Master

                  I recommend that you take a look at the seambay example, specifically at its packaging.