4 Replies Latest reply on Jun 9, 2010 6:16 PM by toofan

    Errors while importing GateIn Portal into Eclipse! Help!

    toofan

      Hello,

       

      This all may sound a little newbeeish from my side, but here it goes. Whenever I import the gatein-portal into Eclipse (either using svn or simple download), all sorts of errors pop up in the code.

       

      1. Maven Dependencies Entry in the Project when viewed in the Package Explorer shows only three entries:

          • slf4j-jdk14-1.5.6.jar
          • slf4j-api-1.5.6.jar
          • hsqldb-1.8.0.7.jar

       

      All the other Dependencies from the various POMs go missing. I have also downloaded the gatein-parent, and jboss-parent as projects and linked the gatein-portal pom to the parent through <relativePath> element. I thought it would help the system to recognize the other dependencies. It wasn't of any use.

       

      2. All the errors are visible in the component module of gatein-portal.

       

      3. The errors are of the nature that classes cannot be resolved in the IDE, because the libraries, the jars, are not found.

       

      4. For some reason, when one tries to build the project, as I did with mvn clean install, everything goes smoothly and the projects builds normally. So there, there seems to be no problem with the dependency management, and all the classes are resolved.

       

      A little taste of the problem is as follows:

       

       

      AbstractConsumerRegistry cannot be resolved to a type JCRConsumerRegistry.java     /gatein-portal-3.1.0-CR01/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/consumer     line 49     Java Problem
      AbstractCustomizationState cannot be resolved to a type GadgetState.java     /gatein-portal-3.1.0-CR01/component/portal/src/main/java/org/exoplatform/portal/pom/spi/gadget     line 31     Java Problem
      AbstractCustomizationState cannot be resolved to a type PortletState.java     /gatein-portal-3.1.0-CR01/component/portal/src/main/java/org/exoplatform/portal/pom/spi/portlet     line 36     Java Problem
      AbstractCustomizationState cannot be resolved to a type WSRPState.java     /gatein-portal-3.1.0-CR01/component/portal/src/main/java/org/exoplatform/portal/pom/spi/wsrp     line 36     Java Problem
      AbstractFilter cannot be resolved to a type CacheUserProfileFilter.java     /gatein-portal-3.1.0-CR01/component/web/src/main/java/org/exoplatform/web     line 36     Java Problem
      AbstractFilter cannot be resolved to a type ClusteredSSOFilter.java     /gatein-portal-3.1.0-CR01/component/web/src/main/java/org/exoplatform/web/login     line 43     Java Problem
      AbstractFilter cannot be resolved to a type GenericFilter.java     /gatein-portal-3.1.0-CR01/component/web/src/main/java/org/exoplatform/web/filter     line 41     Java Problem
      AbstractHttpServlet cannot be resolved to a type ErrorLoginServlet.java     /gatein-portal-3.1.0-CR01/component/web/src/main/java/org/exoplatform/web/login     line 46     Java Problem

       

       

      Can somebody please give some suggestions!

        • 1. Re: Errors while importing GateIn Portal into Eclipse! Help!
          mwringe

          How are you importing the project into eclipse? I usually don't import the project into my workspace as a normal project, but import it as a maven project (the maven eclipse plugin then takes over and creates its own .project files for the project).

           

          See http://community.jboss.org/thread/147563?tstart=150 for a similar thread on the issue.

          • 2. Re: Errors while importing GateIn Portal into Eclipse! Help!
            trong.tran

            did you configure the M2_REPO environment variable in eclipse to point to the location of your  maven local repository ?

            • 3. Re: Errors while importing GateIn Portal into Eclipse! Help!
              rafaelliu

              Yet another guess.. Did you run mvn install at least once?

              • 4. Re: Errors while importing GateIn Portal into Eclipse! Help!
                toofan

                Hi Matt,

                 

                thanks for the response.

                 

                I have finally been able to build the project without any errors. Your suggestion to use File --> Import --> Maven --> Checkout Maven Projects from SCM worked.

                 

                In order to get all the Maven Dependencies of all modules into the Maven Dependencies entry for the Project in the Package Explorer, one would have to

                -- check Advanced --> Resolve Workspace Projects

                 

                If one wants to keep all Modules of the parent project under One Single Project and not have a separate project for each module,some additional useful tips would be:

                 

                -- Go to Windows --> Preferences --> Maven

                 

                and check Support multiple Maven modules mapped to a single Eclipse workspace project

                 

                Only then would the checkbox Advanced --> Separate projects for modules be visible in the Import Maven Projects Wizard.

                 

                This needs to be unchecked when it becomes visible.

                 

                 

                Trong and raphael,

                Thank you for your assistance!

                 

                M2_REPO variable was set!

                mvn install had been called!