Search code examples
liferayliferay-6portletliferay-service-builder

Service builder: BUILD FAILED


I encounter a problem with Service Builder when tried to make CRUD portlet.

First of all, I created a project and Liferay portlet("This is bla-bla-bla in view mode"). After that I created new->new Service Builder xml file. I inserted the following code there:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE service-builder PUBLIC "-//Liferay//DTD Service Builder 6.2.0//EN" "http://www.liferay.com/dtd/liferay-service-builder_6_2_0.dtd">
      <service-builder package-path="com.proliferay.sbuilder">
      <author>Alexandr</author>
      <namespace>crudportlet</namespace>

<entity name="Book" table="BOOK_PORTLET" local-service="true" remote-service="true">
    <column name="bookId" type="long" primary="true" id-type="increment"/>
    <column name="bookName" type="String" />
    <column name="description" type="String" />
    <column name="authorName" type="String" />
    <column name="isbn" type="int" />
    <column name="price" type="int" />
</entity>

Next, I clicked on overview tab and pressed Build Service button. After 5 seconds I've got HTTP Authorization failure ERROR. After 5 hours of googling and stackoverflowing I came to conclusion to comment this line

#ivy.jar.url=http://cdn.repository.liferay.com/nexus/content/repositories/liferay-snapshots-ce/com/liferay/org.apache.ivy/${ivy.version}/org.apache.ivy-${ivy.version}.jar

And paste this line

ivy.jar.url=https://repository.liferay.com/nexus/content/repositories/liferay-public-snapshots/com/liferay/org.apache.ivy/2.4.0.LIFERAY-PATCHED-1-SNAPSHOT/

as they said in other threads in build.Sasha.properties file. But my error now:

Unable to obtain resource from D:\LiferayWorkSpace\liferay-plugins-sdk- 6.2\.ivy\ivy-2.4.0.LIFERAY-PATCHED-1-SNAPSHOT.jar: java.util.zip.ZipException: error in opening zip file
[taskdef] Unable to obtain resource from D:\LiferayWorkSpace\liferay-plugins-sdk-6.2\.ivy\ivy-2.4.0.LIFERAY-PATCHED-1-SNAPSHOT.jar: 
...
[taskdef] Could not load definitions from resource org/apache/ivy/ant/antlib.xml. It could not be found.

BUILD FAILED

What should I do ?? Please, help me! What should I do in order to create simpliest CRUD portlet using Service Builder?

I use Liferay 6.2 GA5, sdk 6.2.

My build.xml file:

<?xml version="1.0"?>
<!DOCTYPE project>

<project name="CRUD-portlet" basedir="." default="deploy">
    <import file="../build-common-portlet.xml" />
    <property file="build.properties"/>
</project>

Screenshot 1

Screenshot 2

Screenshot 3


Solution

  • Ohhh, it was so easy!

    To solve this problem we should

    replace this lines: ivy.jar.url=http://cdn.repository.liferay.com/nexus/content/repositories/liferay-snapshots-ce/com/liferay/org.apache.ivy/${ivy.version}/org.apache.ivy-${ivy.version}.jar to this:

    ivy.jar.url=http://cdn.repository.liferay.com/nexus/content/repositories/liferay-snapshots-ce/com/liferay/org.apache.ivy/${ivy.version}/org.apache.ivy-${ivy.version}.jar