Foren

Problem Creating New Portlet - "Build Failed"

Kelly Chi, geändert vor 14 Jahren.

Problem Creating New Portlet - "Build Failed"

New Member Beiträge: 13 Beitrittsdatum: 11.09.09 Neueste Beiträge
Hello,
I am following the instructions in the Liferay Development Documentation 5.0 PDF document, on page 8, to create a portlet.

I have entered the command in my portlets folder:

ant -Dportlet.name=<project name> -Dportlet.display.name="<portlet title>" create</portlet></project>


This is the error I get:

Buildfile: build.xml

create:
    [unzip] Expanding: /a/tango/home/kellyc/liferay/liferay-plugins-sdk-5.2.3/portlets/portlet.zip into /a/tango/home/kellyc/liferay/liferay-plugins-sdk-5.2.3/portlets/hello-portlet

BUILD FAILED
/a/tango/home/kellyc/liferay/liferay-plugins-sdk-5.2.3/portlets/build.xml:23: IOException in /a/tango/home/kellyc/liferay/liferay-plugins-sdk-5.2.3/portlets/hello-portlet/docroot/icon.png - sun.io.MalformedInputException:null

Total time: 1 second



I have successfully created a theme using the similar ant script so I think my build.${user.name}.properties file is ok.

Does anyone know what I might need to do to get "Build Successful" ?

Thanks
thumbnail
Jeffrey Handa, geändert vor 14 Jahren.

RE: Problem Creating New Portlet - "Build Failed"

Liferay Master Beiträge: 541 Beitrittsdatum: 01.12.08 Neueste Beiträge
Hi Kelly,

If you're working in the Plugins SDK environment, you should be using the create command to create a new portlet. There is a create.bat and create.sh you can use depending on OS.

From your liferay-plugins-sdk-5.2.3/portlets/ directory try the following command:

./create.sh test-portlet "Test Portlet"
Kelly Chi, geändert vor 14 Jahren.

RE: Problem Creating New Portlet - "Build Failed"

New Member Beiträge: 13 Beitrittsdatum: 11.09.09 Neueste Beiträge
Hi Jeffrey,

Thank you for the reply..

I tried the command
./create.sh test-portlet "Test Portlet" 


For some reason I got a "Permission Denied". I tried again logged in as root and still had the same error...
thumbnail
Jeffrey Handa, geändert vor 14 Jahren.

RE: Problem Creating New Portlet - "Build Failed"

Liferay Master Beiträge: 541 Beitrittsdatum: 01.12.08 Neueste Beiträge
Hi Kelly,

Try running:

chmod 775 *.sh 

in that directory
Kelly Chi, geändert vor 14 Jahren.

RE: Problem Creating New Portlet - "Build Failed"

New Member Beiträge: 13 Beitrittsdatum: 11.09.09 Neueste Beiträge
Hi Jeffrey,

Thank you for your help so far..

I entered in
chmod 775 *.sh 
and the commend did go through but I ended up getting the same "BUILD FAILED" error again


creme:~/liferay/liferay-plugins-sdk-5.2.3/portlets&gt; ./create.sh test-portlet "Test Portlet"
Buildfile: build.xml

create:
    [unzip] Expanding: /a/tango/home/kellyc/liferay/liferay-plugins-sdk-5.2.3/portlets/portlet.zip into /a/tango/home/kellyc/liferay/liferay-plugins-sdk-5.2.3/portlets/test-portlet-portlet

BUILD FAILED
/a/tango/home/kellyc/liferay/liferay-plugins-sdk-5.2.3/portlets/build.xml:23: IOException in /a/tango/home/kellyc/liferay/liferay-plugins-sdk-5.2.3/portlets/test-portlet-portlet/docroot/icon.png - sun.io.MalformedInputException:null

Total time: 2 seconds
Kelly Chi, geändert vor 14 Jahren.

RE: Problem Creating New Portlet - "Build Failed"

New Member Beiträge: 13 Beitrittsdatum: 11.09.09 Neueste Beiträge
Eventually got this to work....
Dana Oredson, geändert vor 14 Jahren.

RE: Problem Creating New Portlet - "Build Failed"

Junior Member Beiträge: 70 Beitrittsdatum: 14.10.08 Neueste Beiträge
Kelly Chi:
Eventually got this to work....


Was it that icon.png didn't exist? Because that's what the build error indicates to me.
Kelly Chi, geändert vor 14 Jahren.

RE: Problem Creating New Portlet - "Build Failed"

New Member Beiträge: 13 Beitrittsdatum: 11.09.09 Neueste Beiträge
I am not sure of the exact reason... But my coleague placed the plugins SKD into a different directory and ran the ant command from the portal folder in that different directory and it seemed to work...
thumbnail
Ahmed Hasan, geändert vor 14 Jahren.

RE: Problem Creating New Portlet - "Build Failed"

Expert Beiträge: 306 Beitrittsdatum: 13.04.07 Neueste Beiträge
Dear friend,

mPire is the BEST tool to generate these kind of portlets so quickly and nicely.

Please try and see it in action.

Get the details from here .

For any help feel free to contact me,

Ahmed Hasan
CTO, TransIT mPower Labs (P) Ltd.
info@mpowerglobal.com
mPower Global
A Liferay expert company.
thumbnail
Madhavi Chandra Saladi, geändert vor 13 Jahren.

RE: Problem Creating New Portlet - "Build Failed"

New Member Beiträge: 4 Beitrittsdatum: 08.07.10 Neueste Beiträge
Hello,
I am using Liferay IDE to create a database portlet.I created the file service .xml in my portlet and trying to build my build.xml file using Run as Ant Build option of my IDE to generate entity and util classes. It is giving me "Build failed" message as follows:
Buildfile: D:\Workspace\liferay-plugins-sdk\portlets\MadhuLibrary-portlet\build.xml
compile:
merge:

BUILD FAILED
D:\Workspace\liferay-plugins-sdk\build-common-plugin.xml:433: D:\Workspace\bundles\tomcat-6.0.26\webapps\ROOT\WEB-INF\lib not found.

Total time: 686 milliseconds

This is the code written in service.xml

<?xml version="1.0"?>
<!DOCTYPE service-builder PUBLIC "-//Liferay//DTD Service Builder 5.2.0//EN" "[http://www.liferay.com/dtd/liferay-service-builder_5_2_0.dtd]">

<service-builder package-path="com.liferay.book">
<namespace>Book</namespace>
<entity name="Book" local-service="true" remote-service="false">

<!-- PK fields -->

<column name="bookId" type="long" primary="true" />

<!-- Other fields -->

<column name="title" type="String" />
<column name="isbn" type="String" />

</entity>
</service-builder>

Please help me in this issue. Anything has to be added to the lib folder?
thumbnail
Pranay R Patadiya, geändert vor 13 Jahren.

RE: Problem Creating New Portlet - "Build Failed"

Regular Member Beiträge: 177 Beitrittsdatum: 23.02.10 Neueste Beiträge
Hi,

When you deploy the code, make sure that if there is lib folder exist @ specified path in error log.

if not exist than try after creating one folder "lib" @ /tomcat/webapps/root/WEB-INF/

Thanks,
Pranay Patadiya
thumbnail
Madhavi Chandra Saladi, geändert vor 13 Jahren.

RE: Problem Creating New Portlet - "Build Failed"

New Member Beiträge: 4 Beitrittsdatum: 08.07.10 Neueste Beiträge
Thanks. I was able to do that. Now, my after my build, am getting this error message.
It has created most of the classes but Book class is missins in src. And the created classes have so many compilation issues w.r.t imports.
The error am getting is as follows:

[Console output redirected to fileemoticon:\Workspace\.metadata\.plugins\com.liferay.ide.eclipse.sdk\sdk.log]

Buildfile: D:\Workspace\liferay-plugins-sdk\portlets\LibraryTest-portlet\build.xml

build-service:
[mkdir] Created dir: D:\Workspace\liferay-plugins-sdk\portlets\LibraryTest-portlet\docroot\WEB-INF\classes
[copy] Copying 16 files to D:\Workspace\liferay-plugins-sdk\portlets\LibraryTest-portlet\docroot\WEB-INF\classes
[java] Loading jar:file:/D:/Workspace/bundles/liferay-portal-tomcat-6.0.2/liferay-portal-6.0.2/tomcat-6.0.26/webapps/ROOT/WEB-INF/lib/portal-impl.jar!/system.properties
[java] Loading jar:file:/D:/Workspace/bundles/liferay-portal-tomcat-6.0.2/liferay-portal-6.0.2/tomcat-6.0.26/webapps/ROOT/WEB-INF/lib/portal-impl.jar!/portal.properties
[java] Loading file:/D:/Workspace/bundles/liferay-portal-tomcat-6.0.2/liferay-portal-6.0.2/tomcat-6.0.26/webapps/ROOT/WEB-INF/classes/portal-ext.properties
[java] Loading jar:file:/D:/Workspace/bundles/liferay-portal-tomcat-6.0.2/liferay-portal-6.0.2/tomcat-6.0.26/webapps/ROOT/WEB-INF/lib/portal-impl.jar!/com/liferay/portal/tools/dependencies/portal-tools.properties
[java] 13:12:55,383 INFO [PortalImpl:276] Global lib directory /D:/Workspace/bundles/liferay-portal-tomcat-6.0.2/liferay-portal-6.0.2/tomcat-6.0.26/lib/ext/
[java] 13:12:55,399 INFO [PortalImpl:296] Portal lib directory /D:/Workspace/bundles/liferay-portal-tomcat-6.0.2/liferay-portal-6.0.2/tomcat-6.0.26/webapps/ROOT/WEB-INF/lib/
[java] Building Book

compile-java:
[javac] Compiling 14 source files to D:\Workspace\liferay-plugins-sdk\portlets\LibraryTest-portlet\docroot\WEB-INF\service-classes

BUILD FAILED
D:\Workspace\liferay-plugins-sdk\build-common-plugin.xml:355: The following error occurred while executing this line:
D:\Workspace\liferay-plugins-sdk\build-common.xml:90: Error running javac.exe compiler

Total time: 5 seconds

Please help me with this.
VCVijayan MCA, geändert vor 12 Jahren.

RE: Problem Creating New Portlet - "Build Failed"

thumbnail
Mani kandan, geändert vor 12 Jahren.

RE: Problem Creating New Portlet - "Build Failed"

Expert Beiträge: 492 Beitrittsdatum: 15.09.10 Neueste Beiträge
Hi,
Here you can find the attached war file.