Error when adding new table on service.xml - Liferay 6.2 - service

I'm using liferay 6.2 and I want to add a new table on service.xml.
The new entry on service.xml is:
<entity name="FeedError" local-service="true" remote-service="false" cache-enabled="false">
<column name="feId" type="long" primary="true" id-type="identity" />
<column name="errorCode" type="String" />
<column name="translation" type="String" />
<column name="facility" type="String" />
<column name="recordId" type="long" />
<column name="dateTime" type="Date" />
</entity>
Then, when running Build Service with Ant or Liferay Plugin, I got the following error:
BUILD FAILED
/Liferay/liferay-plugins-sdk-6.2/build-common-plugin.xml:443: The following error occurred while executing this line:
/Liferay/liferay-plugins-sdk-6.2/build-common-plugin.xml:147: Service Builder generated exceptions.
Looking at build-common-plugin.xml:443 is:
439:    <build-service
440:     service.api.dir="${basedir}/${service.base.dir}/service"
441:     service.sql.dir="${basedir}/${service.base.dir}/sql"
442:     service.test.dir=""
443:     />
The error is only when adding a new entry to service.xml; for existing ones, it builds without any issue. 
Any help is great appreciate! 

I hardly remember that there was an issue with the keyword "error" in table or column names. The service builder once greped for this keyword. You might give it a try to not use the word "error" in your column definition.

Related

Unique constraint is automatically created in database

I have discovered in our Postgres Database there is a unique constraint on a table, which we haven´t created.
Error message:
SqlExceptionHelper - FEHLER: doppelter Schlüsselwert verletzt Unique-Constraint »uconstr_service_out_mapping«
Detail: Schlüssel »(service_id, mapping_id)=(7, 262144)« existiert bereits.
My first thought was, that Hibernate has to generate this constraint automatically. But we disabled the Auto-Generation of the DDL with the following configuration:
<property name="hibernate.hbm2ddl.auto" value=""/>
We are using Liquibase to create the table:
<changeSet author="foo" id="bar">
<createTable tableName="service_in_mapping">
<column name="masterdata_type" type="INT4">
<constraints nullable="false"/>
</column>
<column name="service_id" type="INT8">
<constraints nullable="false"/>
</column>
<column name="service_type" type="VARCHAR(255)">
<constraints nullable="false"/>
</column>
<column name="non_matching" type="VARCHAR(20)"/>
<column name="mapping_id" type="INT8"/>
</createTable>
</changeSet>
How can this unique constraint be constantly created? Any ideas?
Used Dependency Versions:
Hibernate 5.2.8
Postgres Jdbc 9.1-901.jdbc4

Debugging Formatting functions in SAP UI5

In my application i have Included a formatter.js file in a seperate folder of sap ui5 application and declared this file in controller of the view
<Page title="{i18n>MasterTitle}" >
<List
id="list"
type="Active"
items="{/SalesOrderCollection}" >
<ObjectListItem
type="Active"
title="{SoId}">
<attributes>
<ObjectAttribute text="{ path: 'OrderedDate', formatter: 'com.corp.demo.sales.util.Formatter.date' }" />
</attributes>
<firstStatus>
<ObjectStatus text="{OverallStatus}" />
</firstStatus>
</ObjectListItem>
</List>
</Page>
but could not able to format the date it is showing as blank. iam able to log in to formatter.js file using console.log statements but the date function is not getting triggered
How can i check the whether the date function is getting triggered ?
Thanks,
Prasad
You can use debug mode in web ide.
You can use this path.
project settings-run configurations-web application-url components
Add the sap-ui-debug=true parameter to your URL.
Solved by adding data-sap-ui-xx-bindingSyntax="complex" in index.html.

how to create citext columns with liquibase?

I've got a postgresql database that is created from liquibase. How can I configure liquibase to create CITEXT columns?
I ran across this URL but unsure where to put this configuration. I'm using version 3.3.2.
https://liquibase.jira.com/browse/CORE-1234
Thanks for any help.
You will need to edit the changelog file. You didn't specify what format your changelog is in, so this assumes XML, but the instructions are similar for other formats.
Basically, if you have a column that should be CITEXT, you can use that type in the XML declaration:
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog">
<changeSet author="Pete" id="1430490076262-3216" objectQuotingStrategy="QUOTE_ALL_OBJECTS">
<createTable tableName="AA_BUILD">
<column name="STAGE" type="NUMBER">
<constraints nullable="false"/>
</column>
<column name="ITERATION" type="NUMBER">
<constraints nullable="false"/>
</column>
<column name="BUILD_NUM" type="NUMBER">
<constraints nullable="false"/>
</column>
<column name="CHANGED_IN_DEV_DT" type="date"/>
<column name="DESCRIPTION" type="CITEXT"/>
</createTable>
</changeSet>

Formatting XML files in eclipse

When i try to format a xml file in eclipse it puts each of the fields on a new line. instead i want each property to be on one line. for e.g. now when i press CTRL+SHFT+F, eclipse formats it like this.
<hibernate-mapping package="com.server.entities">
<class
name="Branch"
table="Branch"
>
<meta attribute="sync-DAO">false</meta>
<id name="Id"
type="java.lang.Long"
column="id"
>
<generator class="native"/>
</id>
<property
name="Created"
column="created"
type="timestamp"
not-null="false"
length="23"
/>
<property
name="LastUpdated"
column="lastUpdated"
type="timestamp"
not-null="false"
length="23"
/>
<property
name="CreatedBy"
column="createdBy"
type="java.lang.Long"
not-null="false"
length="19"
/>
but what i want is
<hibernate-mapping package="com.kaizen.report.server.entities">
<class name="Branch" table="Branch">
<meta attribute="sync-DAO">false</meta>
<id name="Id" type="java.lang.Long" column="id">
<generator class="native"/>
</id>
<property name="Created" column="created" type="timestamp" not-null="false" length="23"/>
If you're using the XML Editor from eclipse.org, go tot he XML Editor preference page and change the options to allow much longer lines and to not split multiple attributes each onto new lines.

Use version qualifier replacement in buckminster

In my cspex I have action that creates product
<public name="create.product" actor="ant">
<actorProperties>
<property key="buildFile" value="build/product.ant" />
<property key="targets" value="create.product" />
</actorProperties>
<properties>
<property key="profile" value="iitProfile" />
<property key="iu" value="iit.product" />
</properties>
<prerequisites alias="repository">
<attribute name="site.p2" />
</prerequisites>
<products alias="destination" base="${buckminster.output}">
<path path="product.${target.ws}.${target.os}.${target.arch}/" />
</products>
</public>
When the final product is being build, folder created looks like this product.${target.ws}.${target.os}.${target.arch}. How can I append qualifier replacement that I set via qualifier.replacement property? I thought I could do something like product.${target.ws}.${target.os}.${target.arch}_{qualifier.replacement} where qualifier.replacement is the property that was set during execution of buckminster.versionQualifier.
I know when I execute action site.p2.zip qualifier replacement is being appended to the name of the file, so how can I use this in my other actions? Do I have execute buckminster.versionQualifier task myself?
thanks!
Opened enhancement about this on eclipse bugzilla: https://bugs.eclipse.org/bugs/show_bug.cgi?id=321753