Page 1 of 2 12 LastLast
Results 1 to 10 of 11

Thread: Spring Roo projects and project facets

  1. #1
    Join Date
    Aug 2010
    Location
    Goteborg, Sweden
    Posts
    434

    Default 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 at 08:09 AM.

  2. #2
    Join Date
    Aug 2010
    Location
    Goteborg, Sweden
    Posts
    434

    Default

    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.

  3. #3
    Join Date
    Aug 2004
    Location
    Duesseldorf, Germany
    Posts
    1,210

    Default

    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
    Christian Dupuis
    SpringSource, a division of VMware
    Lead, SpringSource Tools Team
    http://www.springsource.com
    http://twitter.com/cdupuis

  4. #4
    Join Date
    Aug 2010
    Location
    Goteborg, Sweden
    Posts
    434

    Default

    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 at 11:07 AM.

  5. #5
    Join Date
    Aug 2010
    Location
    Goteborg, Sweden
    Posts
    434

    Default 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.

  6. #6
    Join Date
    Aug 2004
    Location
    Duesseldorf, Germany
    Posts
    1,210

    Default

    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
    Christian Dupuis
    SpringSource, a division of VMware
    Lead, SpringSource Tools Team
    http://www.springsource.com
    http://twitter.com/cdupuis

  7. #7
    Join Date
    Aug 2010
    Location
    Goteborg, Sweden
    Posts
    434

    Default 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?

  8. #8
    Join Date
    Oct 2006
    Location
    Zürich
    Posts
    101

    Default

    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

  9. #9
    Join Date
    Oct 2006
    Location
    Zürich
    Posts
    101

    Default

    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

  10. #10
    Join Date
    Aug 2010
    Location
    Goteborg, Sweden
    Posts
    434

    Default

    Quote 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.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •