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

buildService command throws IllegalArgumentException

    Details

    • Fix Priority:
      2
    • OS:
      Windows 10
    • JDK:
      Oracle Sun JDK 8
    • Application Servers:
      Apache Tomcat 8.0.x
    • Device Type:
      Desktop

      Description

      When you rename a column that is used as a finder-column, the buildService command breaks.

      Steps to reproduce:

      1. Create a service-builder liferay module
      2. Copy content from attached file service.xml.before inside service.xml**
      3. Run buildService Gradle task
      4. Copy content from attached file service.xml.after inside service.xml
      5. Run buildService Gradle task. It breaks

      StackTrace:

      22:04:44: Executing task 'buildService'...
      
      :modules:apps:service-builder-sample:service-builder-sample-service:buildService
      Building Sample
      Writing src\main\java\com\liferay\service\builder\sample\service\persistence\impl\SamplePersistenceImpl.java
      Writing ..\service-builder-sample-api\src\main\java\com\liferay\service\builder\sample\service\persistence\SamplePersistence.java
      Writing ..\service-builder-sample-api\src\main\java\com\liferay\service\builder\sample\service\persistence\SampleUtil.java
      Writing src\main\java\com\liferay\service\builder\sample\model\impl\SampleModelImpl.java
      Writing ..\service-builder-sample-api\src\main\java\com\liferay\service\builder\sample\model\SampleModel.java
      Writing src\main\java\com\liferay\service\builder\sample\model\impl\SampleCacheModel.java
      Writing ..\service-builder-sample-api\src\main\java\com\liferay\service\builder\sample\model\SampleWrapper.java
      Writing ..\service-builder-sample-api\src\main\java\com\liferay\service\builder\sample\model\SampleSoap.java
      Writing src\main\resources\META-INF\module-hbm.xml
      Writing src\main\resources\META-INF\portlet-model-hints.xml
      Please set these arguments. Sample values are:
      
          service.api.dir=${basedir}/../portal-kernel/src
          service.auto.import.default.references=true
          service.auto.namespace.tables=false
          service.bean.locator.util=com.liferay.portal.kernel.bean.PortalBeanLocatorUtil
          service.build.number=1
          service.build.number.increment=true
          service.hbm.file=${basedir}/src/META-INF/portal-hbm.xml
          service.impl.dir=${basedir}/src
          service.input.file=${service.file}
          service.model.hints.configs=classpath*:META-INF/portal-model-hints.xml,META-INF/portal-model-hints.xml,classpath*:META-INF/ext-model-hints.xml,classpath*:META-INF/portlet-model-hints.xml
          service.model.hints.file=${basedir}/src/META-INF/portal-model-hints.xml
          service.osgi.module=false
          service.plugin.name=
          service.props.util=com.liferay.portal.util.PropsUtil
          service.read.only.prefixes=fetch,get,has,is,load,reindex,search
          service.resource.actions.configs=META-INF/resource-actions/default.xml,resource-actions/default.xml
          service.resources.dir=${basedir}/src
          service.spring.file=${basedir}/src/META-INF/portal-spring.xml
          service.spring.namespaces=beans
          service.sql.dir=${basedir}/../sql
          service.sql.file=portal-tables.sql
          service.sql.indexes.file=indexes.sql
          service.sql.sequences.file=sequences.sql
          service.target.entity.name=${service.target.entity.name}
          service.test.dir=${basedir}/test/integration
      
      You can also customize the generated code by overriding the default templates with these optional system properties:
      
          -Dservice.tpl.bad_alias_names=com/liferay/portal/tools/service/builder/dependencies/bad_alias_names.txt
          -Dservice.tpl.bad_column_names=com/liferay/portal/tools/service/builder/dependencies/bad_column_names.txt
          -Dservice.tpl.bad_json_types=com/liferay/portal/tools/service/builder/dependencies/bad_json_types.txt
          -Dservice.tpl.bad_table_names=com/liferay/portal/tools/service/builder/dependencies/bad_table_names.txt
          -Dservice.tpl.base_mode_impl=com/liferay/portal/tools/service/builder/dependencies/base_mode_impl.ftl
          -Dservice.tpl.blob_model=com/liferay/portal/tools/service/builder/dependencies/blob_model.ftl
          -Dservice.tpl.copyright.txt=copyright.txt
          -Dservice.tpl.ejb_pk=com/liferay/portal/tools/service/builder/dependencies/ejb_pk.ftl
          -Dservice.tpl.exception=com/liferay/portal/tools/service/builder/dependencies/exception.ftl
          -Dservice.tpl.extended_model=com/liferay/portal/tools/service/builder/dependencies/extended_model.ftl
          -Dservice.tpl.extended_model_base_impl=com/liferay/portal/tools/service/builder/dependencies/extended_model_base_impl.ftl
          -Dservice.tpl.extended_model_impl=com/liferay/portal/tools/service/builder/dependencies/extended_model_impl.ftl
          -Dservice.tpl.finder=com/liferay/portal/tools/service/builder/dependencies/finder.ftl
          -Dservice.tpl.finder_base_impl=com/liferay/portal/tools/service/builder/dependencies/finder_base_impl.ftl
          -Dservice.tpl.finder_util=com/liferay/portal/tools/service/builder/dependencies/finder_util.ftl
          -Dservice.tpl.hbm_xml=com/liferay/portal/tools/service/builder/dependencies/hbm_xml.ftl
          -Dservice.tpl.json_js=com/liferay/portal/tools/service/builder/dependencies/json_js.ftl
          -Dservice.tpl.json_js_method=com/liferay/portal/tools/service/builder/dependencies/json_js_method.ftl
          -Dservice.tpl.model=com/liferay/portal/tools/service/builder/dependencies/model.ftl
          -Dservice.tpl.model_cache=com/liferay/portal/tools/service/builder/dependencies/model_cache.ftl
          -Dservice.tpl.model_hints_xml=com/liferay/portal/tools/service/builder/dependencies/model_hints_xml.ftl
          -Dservice.tpl.model_impl=com/liferay/portal/tools/service/builder/dependencies/model_impl.ftl
          -Dservice.tpl.model_soap=com/liferay/portal/tools/service/builder/dependencies/model_soap.ftl
          -Dservice.tpl.model_wrapper=com/liferay/portal/tools/service/builder/dependencies/model_wrapper.ftl
          -Dservice.tpl.persistence=com/liferay/portal/tools/service/builder/dependencies/persistence.ftl
          -Dservice.tpl.persistence_impl=com/liferay/portal/tools/service/builder/dependencies/persistence_impl.ftl
          -Dservice.tpl.persistence_util=com/liferay/portal/tools/service/builder/dependencies/persistence_util.ftl
          -Dservice.tpl.props=com/liferay/portal/tools/service/builder/dependencies/props.ftl
          -Dservice.tpl.service=com/liferay/portal/tools/service/builder/dependencies/service.ftl
          -Dservice.tpl.service_base_impl=com/liferay/portal/tools/service/builder/dependencies/service_base_impl.ftl
          -Dservice.tpl.service_clp=com/liferay/portal/tools/service/builder/dependencies/service_clp.ftl
          -Dservice.tpl.service_clp_invoker=com/liferay/portal/tools/service/builder/dependencies/service_clp_invoker.ftl
          -Dservice.tpl.service_clp_message_listener=com/liferay/portal/tools/service/builder/dependencies/service_clp_message_listener.ftl
          -Dservice.tpl.service_clp_serializer=com/liferay/portal/tools/service/builder/dependencies/service_clp_serializer.ftl
          -Dservice.tpl.service_http=com/liferay/portal/tools/service/builder/dependencies/service_http.ftl
          -Dservice.tpl.service_impl=com/liferay/portal/tools/service/builder/dependencies/service_impl.ftl
          -Dservice.tpl.service_props_util=com/liferay/portal/tools/service/builder/dependencies/service_props_util.ftl
          -Dservice.tpl.service_soap=com/liferay/portal/tools/service/builder/dependencies/service_soap.ftl
          -Dservice.tpl.service_util=com/liferay/portal/tools/service/builder/dependencies/service_util.ftl
          -Dservice.tpl.service_wrapper=com/liferay/portal/tools/service/builder/dependencies/service_wrapper.ftl
          -Dservice.tpl.spring_xml=com/liferay/portal/tools/service/builder/dependencies/spring_xml.ftl
          -Dservice.tpl.spring_xml_session=com/liferay/portal/tools/service/builder/dependencies/spring_xml_session.ftl
      Exception in thread "main" java.lang.IllegalArgumentException: No entity column exist with column database name columnToRename for entity Sample
          at com.liferay.portal.tools.service.builder.ServiceBuilder._getEntityColumnByColumnDBName(ServiceBuilder.java:4531)
          at com.liferay.portal.tools.service.builder.ServiceBuilder._getColumnLengths(ServiceBuilder.java:4142)
          at com.liferay.portal.tools.service.builder.ServiceBuilder._createSQLIndexes(ServiceBuilder.java:3633)
          at com.liferay.portal.tools.service.builder.ServiceBuilder.<init>(ServiceBuilder.java:887)
          at com.liferay.portal.tools.service.builder.ServiceBuilder.main(ServiceBuilder.java:222)
      :modules:apps:service-builder-sample:service-builder-sample-service:buildService FAILED
      
      FAILURE: Build failed with an exception.
      
      * What went wrong:
      Execution failed for task ':modules:apps:service-builder-sample:service-builder-sample-service:buildService'.
      > Process 'command 'C:\Program Files\Java\jdk1.8.0_152\bin\java.exe'' finished with non-zero exit value 1
      
      * Try:
      Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
      
      BUILD FAILED
      
      Total time: 2.862 secs
      Process 'command 'C:\Program Files\Java\jdk1.8.0_152\bin\java.exe'' finished with non-zero exit value 1
      22:04:47: Task execution finished 'buildService'.
      

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Days since last comment:
                  20 weeks, 2 days ago

                  Packages

                  Version Package
                  Master