Uploaded image for project: 'Gradle'
  1. Gradle
  2. GRADLE-1130

Missing context-root property in WTP settings

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Resolution: Fixed
    • Affects Version/s: 0.9
    • Fix Version/s: 0.9-rc-3

      Description

      Eclipse stores the context-root inside a property within the org.eclipse.wst.common.component file. The value corresponds to the "Properties > Web Project Settings > Context root" setting. If the property tag is not present, Eclipse sets the value to null internally and reports an error in the Properties dialog: "Context root cannot be empty".

      In Eclipse 3.6 the server starts in spite of the error, whereas in Eclipse 3.5 Tomcat startup fails. The reason is that Eclipse deploys the webapp to wtpwebapps/tmp0/ROOT but Tomcat expects it in wtpwebapps/tmp0/foo, with 'foo' being the context-root property.

      This is what org.eclipse.wst.common.component looks like after setting the value via the UI:

      <project-modules id="moduleCoreId" project-version="1.5.0">
      <wb-module deploy-name="riot-skeleton">
      <property name="context-root" value="foo"/>
      ...
      </project-modules>

      Workaround:

      eclipseWtp.withXml { files ->
      def xml = files.'org.eclipse.wst.commons.component'
      xml['wb-module'][0].appendNode('property', [name: 'context-root', value: 'foo'])
      }

        Attachments

          Activity

            People

            Assignee:
            hans_d Hans Dockter
            Reporter:
            fgnass Felix Gnass
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: