Announcement Announcement Module
Collapse
No announcement yet.
Spring Roo projects and project facets Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Spring Roo projects and project facets

    I'm going crazy over the relationship between Spring Roo and its Maven projects and Servers not working as it used to.
    I have made a Roo project, with working tests, but that I had to turn on the proper "project facets"– Dynamic Web Module 2.4, Java 1.5 and Javascript 1.0 – in order to get it recognized by the Server, in my case Tomcat 6.0.20. Only this way could I add it as a context.

    If I would run tomcat from the command line, prior to the project facet addition, everything in my setup worked as expected in Tomcat.

    Also, If I do mvn eclipse:eclipse from the command line the project is set up properly. Why could roo 1.1.2 seemingly not make the proper adjustments when mvc was added (when adding my first Controller class)? I need some other experiences before I make a JIRA, so please respond with your experiences.
    Last edited by MiB; Mar 22nd, 2011, 08:09 AM.

  • #2
    After several cleaning attempts I decided start the project from scratch again. So far it looks good and all symptoms are gone.

    I don't see how the project was damaged and it built and ran fine with command line maven, but I must assume something like that happened.

    Comment


    • #3
      Hey,

      can you post the contents of your .project and .settings/org.eclipse.wst.common.project.facet.core.xml file here? That way I can tell what's wrong with your project.

      Regards, Christian

      Comment


      • #4
        org.eclipse.wst.common.project.facet.core.xml:
        Code:
        <?xml version="1.0" encoding="UTF-8"?>
        <faceted-project>
          <fixed facet="jst.web"/>
          <fixed facet="wst.jsdt.web"/>
          <fixed facet="jst.java"/>
          <installed facet="jst.java" version="5.0"/>
          <installed facet="jst.web" version="2.4"/>
          <installed facet="wst.jsdt.web" version="1.0"/>
        </faceted-project>
        .project:
        Code:
        <?xml version="1.0" encoding="UTF-8"?>
        <projectDescription>
        	<name>habla</name>
        	<comment></comment>
        	<projects>
        	</projects>
        	<buildSpec>
        		<buildCommand>
        			<name>org.eclipse.wst.jsdt.core.javascriptValidator</name>
        			<arguments>
        			</arguments>
        		</buildCommand>
        		<buildCommand>
        			<name>org.eclipse.ajdt.core.ajbuilder</name>
        			<arguments>
        			</arguments>
        		</buildCommand>
        		<buildCommand>
        			<name>org.eclipse.wst.common.project.facet.core.builder</name>
        			<arguments>
        			</arguments>
        		</buildCommand>
        		<buildCommand>
        			<name>org.eclipse.wst.validation.validationbuilder</name>
        			<arguments>
        			</arguments>
        		</buildCommand>
        		<buildCommand>
        			<name>org.eclipse.ajdt.core.ajbuilder</name>
        			<arguments>
        				<dictionary>
        					<key>aspectPath</key>
        					<value>org.springframework.aspects</value>
        				</dictionary>
        			</arguments>
        		</buildCommand>
        		<buildCommand>
        			<name>org.springframework.ide.eclipse.core.springbuilder</name>
        			<arguments>
        			</arguments>
        		</buildCommand>
        		<buildCommand>
        			<name>org.maven.ide.eclipse.maven2Builder</name>
        			<arguments>
        			</arguments>
        		</buildCommand>
        	</buildSpec>
        	<natures>
        		<nature>org.maven.ide.eclipse.maven2Nature</nature>
        		<nature>org.eclipse.wst.common.project.facet.core.nature</nature>
        		<nature>org.eclipse.ajdt.ui.ajnature</nature>
        		<nature>org.eclipse.jdt.core.javanature</nature>
        		<nature>org.eclipse.wst.common.modulecore.ModuleCoreNature</nature>
        		<nature>org.eclipse.jem.workbench.JavaEMFNature</nature>
        		<nature>com.springsource.sts.roo.core.nature</nature>
        		<nature>org.springframework.ide.eclipse.core.springnature</nature>
        		<nature>org.eclipse.wst.jsdt.core.jsNature</nature>
        	</natures>
        </projectDescription>
        Comment: Interestingly this is the same settings as I got later (see below) after I had started a new workspace.
        Last edited by MiB; Mar 23rd, 2011, 11:07 AM.

        Comment


        • #5
          what type of project facets should a spring roo project have

          What type of project facets should a spring roo project have anyway? When I make it to the MVC in a fresh Roo-project, there are still no project facet types set in the project.

          This is intentional?

          STS Version: 2.6.0.RELEASE, Build Id: 201103161000

          I don't remember this problem in M1 or M2. I'm going to try in 2.5.2SR1.

          Comment


          • #6
            Hey,

            running the following Roo script from within STS 2.6.0.RELEASE leaves me with WTP web project that I can deploy to tc Server immediately.

            Code:
            // Spring Roo 1.1.2.RELEASE [rev fbc33bb] log opened at 2011-03-23 14:33:24
            project --topLevelPackage org.springframework.test --projectName test --java 6
            persistence setup --database HYPERSONIC_IN_MEMORY --provider HIBERNATE 
            entity --class ~.domain.Foo
            field string --fieldName bar 
            controller all --package ~.web
            The project has the following facets:

            Code:
            <?xml version="1.0" encoding="UTF-8"?>
            <faceted-project>
              <fixed facet="wst.jsdt.web"/>
              <installed facet="java" version="1.6"/>
              <installed facet="jst.web" version="2.4"/>
              <installed facet="wst.jsdt.web" version="1.0"/>
            </faceted-project>
            HTH

            Christian

            Comment


            • #7
              solved!

              Christian,

              I had to change workspace and also actively select the native 1.5 jre in order to make proper project setup work. So this was a workspace related problem.
              What's the recommended strategy to move old projects to a new workspace? What kind of updates to STS warrants creating a new workspace? Is there some kind of cleaning process related to STS that one can run, that will update the workspace settings?

              Comment


              • #8
                May I hijack this thread...

                I have the very same problem at the moment. When I create a new roo project (with 1.1.2.RELEASE [rev fbc33bb] in STS 2.6.0) as you described it, the project facets are not set, there is no .settings/org.eclipse.wst.common.project.facet.core.xml file at all. All other files seem to get created fine.

                I previously was able to generate working roo projects.

                Any thoughts?


                Best regards,
                James

                Comment


                • #9
                  I just tried to start any other webapp with tc server in my STS and also got strange errors:
                  Code:
                  SCHWERWIEGEND: Error configuring application listener of class org.springframework.web.context.ContextLoaderListener
                  java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderListener
                  ...
                  Effectively I could not start any webapp any more.

                  I just downloaded a fresh copy of STS 2.6.0, installed it, created a test roo project and I could deploy it again to the tc server. After re-importing the web projects to a new workspace, I also could start those webapps again. I think that something got broken during the update from 2.5.x to 2.6.0.


                  Best regards,
                  James

                  Comment


                  • #10
                    Originally posted by ractive View Post
                    May I hijack this thread...

                    I have the very same problem at the moment.

                    Any thoughts?
                    get a nightly build. I believe this problem have been fixed there.

                    Comment


                    • #11
                      Originally posted by ractive View Post
                      Error configuring application listener of class org.springframework.web.context.ContextLoaderListe ner
                      java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderListe ner
                      ...
                      [/CODE]
                      Effectively I could not start any webapp any more.
                      When I had this problem I opened the project properties and checked Spring > Dependency Management --> "Automatically update dependencies..." and rebuilt the project. I think I also made sure that "Maven dependencies" was part of "Web Deployment Assembly".
                      That said some fresh roo projects ran even without these checked, but nevertheless those settings worked with those that didn't run because of the ClassNotFoundException.

                      Comment

                      Working...
                      X