Uploaded image for project: 'PUBLIC - Liferay Portal Community Edition'
  1. PUBLIC - Liferay Portal Community Edition
  2. LPS-38494

Service Builder generated code fails to compile, compiler claims that methods annotated with @Override do not override anything

    Details

      Description

      How to reproduce:

      1. Create a portlet
      2. Put this at service.xml:

      <?xml version="1.0" encoding="UTF-8"?>
      <!DOCTYPE service-builder PUBLIC "-//Liferay//DTD Service Builder 6.1.0//EN" "http://www.liferay.com/dtd/liferay-service-builder_6_1_0.dtd">
      <service-builder package-path="example">
      	<author>adam</author>
      	<namespace>FailedServiceBuilder</namespace>
      
      	<entity name="Post">
      		<column name="postId" type="long" primary="true" />
      		
      		<column name="title" type="String" />
      		<column name="content" type="String" />
      	</entity>
      </service-builder>
      

      3. run ant build-service

      Expected result:

      • The classes are compiled, the service jar is generated

      Actual result:

      • The compilation fails with messages such as
            [javac] 69. ERROR in /home/adam/lib/liferay/liferay-plugins-sdk-6.1.1/portlets/failed-service-builder-portlet/docroot/WEB-INF/service/example/service/PostServiceWrapper.java (at line 74)
            [javac]     public PostService getWrappedService() {
            [javac]                        ^^^^^^^^^^^^^^^^^^^
            [javac] The method getWrappedService() of type PostServiceWrapper must override a superclass method
            [javac] ----------
            [javac] 70. ERROR in /home/adam/lib/liferay/liferay-plugins-sdk-6.1.1/portlets/failed-service-builder-portlet/docroot/WEB-INF/service/example/service/PostServiceWrapper.java (at line 79)
            [javac]     public void setWrappedService(PostService postService) {
            [javac]                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
            [javac] The method setWrappedService(PostService) of type PostServiceWrapper must override a superclass method
            [javac] ----------
            [javac] 70 problems (70 errors)
        

      See attachments for an example portlet and a complete log file.

        Attachments

          Activity

            People

            • Assignee:
              adam.brandizzi Adam Brandizzi
              Reporter:
              adam.brandizzi Adam Brandizzi
              Participants of an Issue:
              Recent user:
              Esther Sanz
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Days since last comment:
                7 years, 2 weeks, 3 days ago

                Packages

                Version Package
                6.2.0 CE B1