8 Replies Latest reply on Dec 5, 2008 6:27 AM by scabanovich

    Making Maven Archetype created Seam Project JBoss Tool compa

    speleomaniac

      Hi everybody,

      I had created a Seam Project from a Maven Archetype of Wasley Hayes. It functions perfect, I can deploy the maven project to the server and it works.

      Now the next big question is, how to correctly Seam enable the project in JBoss Tools so the content assist and everyhing works fine for Seam...

      Naturally, I gone to the project properties page of the web project and adjusted the Seam Settings and facets (by looking to the way it is created by the seam wizard) then I did the same thing for the ejb module (enable seam settings which I have to manually configure the parent project because Seam Settings wizard was not capable of doing it) and ear project...

      Now content assist works correctly for the references inside of the web project, so wenn I create a session bean in web project content assist show the name of the session bean defined by @Name annotation.

      The problem is when I configure the ejb project with ejbmodule and the session bean is created there, content assist is not able to find the bean with mentioned @Name annotation..

      I am suspecting the reason is, maven project structure is considerably different then the eclipse ejbModule project... (when I configure the ejbModule I have to give the ejbModule directory as src/main/java but META-INF and everything else is under src/main/resources)...

      So does anybody know what is the mechanism Seam Facet use to discover the Session Beans from ejbModule may be I can configure everything to work out....

      Thx for the answers...

        • 1. Re: Making Maven Archetype created Seam Project JBoss Tool c
          maxandersen

          I haven't looked at the archetypes done by Wesley so don't know much about it.

          I know that m2eclipse have done some work to allow maven projects work better with WTP style projects I just haven't had time to investigate.

          Which version of JBoss tools are you using btw. ?

          • 2. Re: Making Maven Archetype created Seam Project JBoss Tool c
            speleomaniac

            3.0.0.cr1 from the nightly build from 2. Dezember....

            I have the m2eclipse and the web project configured correctly for WTP...

            From the web project I can correctly use the Richfaces component, Visual Designer,etc....

            Context Assist is working also JSF tags and Seam Implicit variables and everything inside of the web project....

            But the Seam objects from ejb project is not there in the content assist...

            • 3. Re: Making Maven Archetype created Seam Project JBoss Tool c
              scabanovich

              It looks like you have set all required references, but nevertheless, could you please check once more
              1) In web project, file .settings\org.jboss.tools.seam.core.prefs contains lines
              seam.ear.project=%ear project name%
              seam.ejb.project=%ejb project name%
              2) In ear project, file .settings\org.eclipse.wst.common.component
              includes ejb project as dependent module
              3) In ejb project, file .settings\org.jboss.tools.seam.core.prefs contains line
              seam.parent.project=%web project name%

              If that is ok, then try cleaning seam model as follows. Close Eclipse, remove all files in directory %workspace%/.metadata/.plugins/org.jboss.tools.seam.core/projects, restart Eclipse and clean/rebuild workspace.

              If it does not help, then we may need to see the exact structure of your projects to study the problem.

              • 4. Re: Making Maven Archetype created Seam Project JBoss Tool c
                speleomaniac

                Hi,

                first of all thx for the answer...

                I check the all the points you mentioned and it look like this..

                1) You are right something was wrong at Seam Settings Wizard for web project. I choose there EAR project type but 'seam.ear.project' is not set to correct value it was set to web project.

                I guess this is a bug at Seam Setting Wizard. Wizard actually is not asking which project is the ear project..

                I had fixed this manually in the mentioned file..

                2) I have both web and ejb project as the dependent module at EAR.

                3) I clean the directory and made a clean/install as you mentioned but that didn't changed to many things.

                I can send the whole project constellation if you like, it is only startup project anyway...

                Only thing I have to tell you, I am using Maven and m2eclipse also installed there (you have to probably installed it also from sonatype.org from developer version update site, they have no stable release for Ganymede at the moment)

                PS. Where should I send the project...

                • 5. Re: Making Maven Archetype created Seam Project JBoss Tool c
                  scabanovich

                  Please, create an issue in jira.jboss.org for JBoss Tools project, and attach the project.

                  • 6. Re: Making Maven Archetype created Seam Project JBoss Tool c
                    speleomaniac

                    I had created the entry in EJB https://jira.jboss.org/jira/browse/JBIDE-3351

                    • 7. Re: Making Maven Archetype created Seam Project JBoss Tool c
                      speleomaniac

                       

                      "speleomaniac" wrote:
                      I had created the entry in EJB https://jira.jboss.org/jira/browse/JBIDE-3351


                      I mean JIRA ....

                      • 8. Re: Making Maven Archetype created Seam Project JBoss Tool c
                        scabanovich

                        Web project should be dependent on EJB project.

                        Open properties dialog for web project.
                        Select section Java EE Module dependencies.
                        Check in the list EJB project.
                        When dependency is created, it is saved in /.settings/org.eclipse.wst.common.component file as
                        <dependent-module deploy-path="/WEB-INF/lib" handle="module:/resource/burnout-ejb/burnout-ejb">
                        <dependency-type>uses</dependency-type>
                        </dependent-module>

                        After the modification of dependencies, to ensure update of Seam model, select on web project 'Close Project', then 'Open Project', then clean/rebuild it.

                        To check that Seam model is correct, use Seam Components view. It is necessary to customize the view (by view toolbar menu) by unchecking filter 'Seam Components from Referenced Projects. Also it may be more convenient to check in 'Scope Presentation' option 'Label' rather than 'Node', otherwise you need to know the scope of the component to find it.
                        Certainly, the component declared in EJB project must be under this project's node in this view. If web project uses EJB project, and its Seam model is loaded and updated correctly, then this component must be under web project's node as well.