Message Boards

Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
Problems with First run
Answer
11/10/11 11:40 AM
Hello,

I'm working with liferay-plugins-sdk-6.0.5 and XMLPortletFactory-6.x-v1.5-beta in Linux Fedora 12.

My first portlet is:
* ./create.sh architectPositions but I was to give execution permissions to "create.sh". Working.

* ant BUILD FAILED: Basedir /home/projects/myProject/tmp/liferay-plugins-sdk-6.0.5/portlets/architectPositions-portlet does not exist
so I made that directory

* ant (again) BUILD FAILED
java.io.FileNotFoundException: /home/projects/myProject/tmp/liferay-plugins-sdk-6.0.5/portlets/architectPositions-portlet/build.xml (No such file or directory)


I think I'm doing something wront, isn't it?. Any idea?.


Thanks in advance.

David.


Next the architectPositions.xml:

 1<?xml version="1.0" encoding="utf-8"?>
 2<definition xmlns="https://www.xmlportletfactory.org/xml/xmlportletfactory" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="https://www.xmlportletfactory.org/xml/xmlportletfactory xmlportletfactory.xsd">
 3    <commonData>
 4        <client>coavnbiz</client>
 5        <projectName>coavnvt</projectName>
 6        <version>1</version>
 7    </commonData>
 8    <applications>
 9    <!-- architectPositions Portlet Class and File definition  -->
10        <application>
11            <classDef>
12                <name>architectPositions</name>
13                <title>architect positions</title>
14                <restrictBy>
15                        <userId>false</userId>
16                </restrictBy>
17            </classDef>
18            <fileDef>
19                <name>architectPosition</name>
20                <fields>
21                    <field>
22                        <name>architectPositionId</name>
23                        <title>architectPositions Id</title>
24                        <type>
25                            <long>
26                                <length>10</length>
27                                <signed>false</signed>
28                                <nullable>false</nullable>
29                            </long>
30                        </type>
31                        <showFieldInView>false</showFieldInView>
32                    </field>
33                    <field>
34                        <name>description</name>
35                        <title>architectPositions Description</title>
36                        <type>
37                            <varchar>
38                                <length>50</length>
39                            </varchar>
40                        </type>
41                        <showFieldInView>true</showFieldInView>
42                        <required>true</required>
43                    </field>
44                </fields>
45            </fileDef>
46        </application>
47    </applications>
48</definition>

RE: Problems with First run
Answer
11/10/11 8:40 PM as a reply to David Navarro.
Hola David,


I dont just get the problem you found, and I dont have a Linux Box to test right now, but I will have a look this weekend. Meanwhile, if might help me if you post your folder structure.

I have generated a portlet with your xml, and I also added filter and sort to it. Find the new xml file and the portlet attached, that way you can start using it. I deployed it on a 6.05 and seems to be perfect.


Saludos, Jack.
Attachment

Attachments: architectPositions.xml (2.4k), coavnvt-portlet-6.0.5.1.war (379.1k), coavnvt_605 (Medium).jpg (32.9k)

RE: Problems with First run
Answer
11/13/11 10:10 AM as a reply to David Navarro.
Hello David,

I think I finally figure it out. There are two things in your post. First is the execute permissions for the create.sh file, where you have to give them your self. If you have some time, maybe you can update instalation wiki page, to reflect this need in Linux instalations.

On the other hand, the BUILD FAILED error message you get, is due to your <projectName> where you probably.

1.- Created the project something like : ./create.sh architectPositions "architect positions"
2.- Modified architectPositions.xml <projectName> from "architectPositions" to "coavnvt"

This way when you "ant", it wont find "architectPositons-portlet" because it generated "coavnvt-portlet".

To correct:

1.- you can change "architectPositions" to "coavnvt" in create.sh and copy your xml. It will create coavnvt-portlet. No error messages.
2.- or you can modify ".../architectPositions-xmlportletfactory/build.xml" to reflect your needs. (I dont like)
3.- dont do nothing and go to ..../portlets/coavnvt-portlet" and use it as normal generated portlet.
4.- Probably the easiest, change your xml's <projectName> to architectPositions. And proceed again (I like)

¿this helped?

Saludos, Jack.

RE: Problems with First run
Answer
11/14/11 11:27 AM as a reply to Jack A. Rider.
Thanks Jack.

I've created a wiki page about "create.sh permissions" but I'm not sure if you want a new page or a comment. Please feel free to edit or move its content.



I'm still having problems.

First of all, I've moved to Windows to have your enviroment.

My first run now is:
1- create.bat architectSituations "Architect Situations" BUILD SUCCESSFUL

2- edit architectSituations.xml's
<client>coavnbiz</client>
<fileDef><name>ArchitectSituation</name> //read it from service.xml <entity name="ArchitectSituation" table="COD_ARCHITECT_SITUATIONS"

<fields>
<field><name>architectSituationId</name> //from service.xml
<field><name>description</name> //from service.xml

3- ant
Value 'ArchitectSituation' is not facet-valid with respect to pattern '[a-z]{1}[a-zA-Z0-9]*' for
type '#AnonType_namefileDefapplicationapplicationsdefinition'.
BUILD FAILED

Solution : edit architectSituations.xml's <application><fileDef><name>architectSituation</name>
and, if it works, I will change my service.xml

3.bis - ant
BUILD FAILED
E:\proyectos\coavn-biz\visado_telem\tmp\liferay-plugins-sdk-6.0.5\XMLPortletFactory\architectSituations-xmlportletfactory\build.xml:25: The following error
occurred while executing this line:
E:\proyectos\coavn-biz\visado_telem\tmp\liferay-plugins-sdk-6.0.5\build-common-plugin.xml:176: E:\proyectos\coavn-biz\visado_telem\tmp\liferay-plugins-sdk-
6.0.5\portlets\architectSituations-portlet\liferay-portal-6.0.5\tomcat-6.0.26\lib\ext does not exist.


OK, the path is wrong, so my Liferay SDK configuration may be wrong, isn't it?

My build.dnavarro.properties I have
app.server.dir=${project.dir}/../liferay-portal-6.0.5/tomcat-6.0.26
service.input.file=${project.dir}/../../etc/services/service.xml

And my folder structure is:
E:\proyectos\coavn-biz\visado_telem\tmp\liferay-portal-6.0.5
E:\proyectos\coavn-biz\visado_telem\tmp\liferay-plugins-sdk-6.0.5
E:\proyectos\coavn-biz\visado_telem\tmp\liferay-plugins-sdk-6.0.5\XMLPortletFactory\architectSituations-xmlportletfactory
E:\proyectos\coavn-biz\visado_telem\tmp\liferay-plugins-sdk-6.0.5\portlets\architectSituations-portlet


Do you see something wrong?.

Note: Executing "Service Builder" works with this configuration.

RE: Problems with First run
Answer
11/15/11 8:06 PM as a reply to David Navarro.
Hola David,


Yes, it seems something in your configuration is not ok. Let me show you an example of mine, for Liferay-6.0.5.

My build.administrator.properties:

1app.server.type = tomcat
2app.server.dir = C:\\Liferay-6.0.5\\liferay-portal-6.0.5\\tomcat-6.0.26
3app.server.deploy.dir = ${app.server.dir}/webapps
4app.server.lib.global.dir = ${app.server.dir}/lib/ext
5app.server.portal.dir = ${app.server.dir}/webapps/ROOT


Observe, that I put full path for tomcat in app.server.dir. Make sure the rest of "*.dir" variables are pointing to an existing folder.

Find also attached a image of my instalation file structure.

Maybe you can find more help in liferay wiki of Plugins SDK or Liferay IDE getting Started Tutorial..


If you cannot get it working, please send me your contact data through the contact form and I will get to you.


Saludos, Jack.
Attachment

Attachments: file_structure.jpg (23.6k)

RE: Problems with First run
Answer
11/18/11 11:59 AM as a reply to Jack A. Rider.
Hello Jack,

Working with absolute paths in build.xxxxx.properties was a good idea. The process advances one step more, but it's not working yet.

Now, the "model" package it's not deployed so in the compile step fails.

generate-portlet:

build-service:

compile-java:
Compiling 871 source files to E:\proyectos\coavn-biz\visado_telem\tmp\liferay-plugins-sdk-6.0.5\portlets\architectSituations-portlet\docroot\WE
B-INF\service-classes

compile:

merge:

compile-java:
Compiling 400 source files to E:\proyectos\coavn-biz\visado_telem\tmp\liferay-plugins-sdk-6.0.5\portlets\architectSituations-portlet\docroot\WE
B-INF\classes
E:\proyectos\coavn-biz\visado_telem\tmp\liferay-plugins-sdk-6.0.5\portlets\architectSituations-portlet\docroot\WEB-INF\src\org\xmlportletfactor
y\portal\coavnbiz\architectSituationsComparator.java:20: package org.xmlportletfactory.portal.coavnbiz.model does not exist
import org.xmlportletfactory.portal.coavnbiz.model.architectSituation;

....

60 errors

BUILD FAILED
E:\proyectos\coavn-biz\visado_telem\tmp\liferay-plugins-sdk-6.0.5\XMLPortletFactory\architectSituations-xmlportletfactory\build.xml:26: The following error
occurred while executing this line:
E:\proyectos\coavn-biz\visado_telem\tmp\liferay-plugins-sdk-6.0.5\build-common-plugin.xml:361: The following error occurred while executing this line:
E:\proyectos\coavn-biz\visado_telem\tmp\liferay-plugins-sdk-6.0.5\build-common.xml:90: Compile failed; see the compiler error output for details.

(RESOLVED) RE: Problems with First run
Answer
11/22/11 9:52 AM as a reply to David Navarro.
Works !!


Nice job Jack.


The problem, as Jack discovered, was a line in my build.xxxx.properties.

My old build.xxxx.properties was:

theme.parent=classic
app.server.type = tomcat
app.server.dir = E:\\proyectos\\coavn-biz\\visado_telem\\tmp\\liferay-portal-6.0.5\\tomcat-6.0.26
app.server.deploy.dir = ${app.server.dir}/webapps
app.server.lib.global.dir = ${app.server.dir}/lib/ext
app.server.portal.dir = ${app.server.dir}/webapps/ROOT
service.input.file=E:\\proyectos\\coavn-biz\\visado_telem\\etc\\services\\service.xml

the last line "service.input.flie" points to a "Service Builder" file that I'm using "to automate the creation of interfaces and classes that are used by a given portal or portlet. This includes code for EJBs, Spring, Persistence, and Model. " See: http://www.liferay.com/community/wiki/-/wiki/Main/Service+Builder


If I comment that line XMLPortletFactory works well.

The problem was that XMLPF couldn't create a package in the SRC structure (org.xmlportletfactory.portal.coavnbiz.model).

RE: (RESOLVED) RE: Problems with First run
Answer
11/13/13 11:41 PM as a reply to David Navarro.
Hi people!!

Jack and Juan, thanks a lot for the tool !!

I started to use it but I am getting the same problem as David. It didnt create the model package. I have tried with two different XmlPortletFactory and no succes. I ave tried as well with the exampleA and exampleB. My build.xxxx.properties is :

app.server.portal.dir = C:\\Users\\root\\Desktop\\eclipse\\liferay-portal-6.1.1-ce-ga2\\tomcat-7.0.27\\webapps\\ROOT
app.server.lib.global.dir = C:\\Users\\root\\Desktop\\eclipse\\liferay-portal-6.1.1-ce-ga2\\tomcat-7.0.27\\lib\\ext
app.server.deploy.dir = C:\\Users\\root\\Desktop\\eclipse\\liferay-portal-6.1.1-ce-ga2\\tomcat-7.0.27\\webapps
app.server.type = tomcat
app.server.dir = C:\\Users\\root\\Desktop\\eclipse\\liferay-portal-6.1.1-ce-ga2\\tomcat-7.0.27

These are the classses: org.xmlportletfactory.goodclient.xmlpfexamplea.model.Users;
                                        org.xmlportletfactory.goodclient.xmlpfexamplea.service.UsersLocalServiceUtil;

Please give me a clue.

PD: I am using the UI.

Thanks a lot for your work!

RE: (RESOLVED) RE: Problems with First run
Answer
11/14/13 8:08 AM as a reply to Juan Quintana.
Hi Juan,

can you post here the  log when trying to execute ant task?

RE: (RESOLVED) RE: Problems with First run
Answer
11/14/13 10:46 AM as a reply to Juan G..
Thanks Juan for the quick reply.

I will install this afternoon the ant and I try it. I will let you know.

We are in contact.

RE: (RESOLVED) RE: Problems with First run
Answer
11/14/13 4:33 PM as a reply to Juan G..
Hi tocayo,

Hereby I send you the errors. I've installed the ant and this is the result. Please see atached file.

Thanks a lot!
Attachments: build.xml (1.4k), error.txt (39.6k)

RE: (RESOLVED) RE: Problems with First run
Answer
11/14/13 4:36 PM as a reply to Juan Quintana.
Try to change your entity from
1juan

to
1Juan

first letter in uppercase.

RE: (RESOLVED) RE: Problems with First run
Answer
11/14/13 4:56 PM as a reply to Juan G..
HI Juan,

I tried again and these are the errors (atached in file).
BUILD FAILED
C:\Users\root\Desktop\eclipse\liferay-plugins-sdk-6.1.1\XMLPortletFactory\Pepe-xmlportletfactory\build.xml:26: The following error occurred while executing this line:
C:\Users\root\Desktop\eclipse\liferay-plugins-sdk-6.1.1\build-common-plugin.xml:651: The following error occurred while executing this line: C:\Users\root\Desktop\eclipse\liferay-plugins-sdk-6.1.1\build-common.xml:95: Compile failed; see the compiler error output for details.

Total time: 12 seconds

My attach also my build-common-plugin.

Thanks Juan!
Attachments: build-common-plugin.xml (36.1k), error2.txt (40.6k)

RE: (RESOLVED) RE: Problems with First run
Answer
11/14/13 5:00 PM as a reply to Juan Quintana.
Please send your XMLPortletFactory xml definition file.

RE: (RESOLVED) RE: Problems with First run
Answer
11/14/13 5:04 PM as a reply to Juan G..
I am just creating my first example. I didnt create yet any xml file .

My steps are:
1- create Pepe Pepe (or Juan)
2- cd Pepe-xmlportletfactory
3- ant

Then it gives me those errors. ¿ Should I modify the Pepe.xml contained in the Pepe-xmlPortletFactory first ?

I dont know if the error is because my java compiler or my ant compiler ( I do it always tru eclipse).

Thanks dude!

RE: (RESOLVED) RE: Problems with First run
Answer
11/14/13 5:16 PM as a reply to Juan Quintana.
Try to execute:
1create Pepe "My Pepe Portlet"

Thanks

RE: (RESOLVED) RE: Problems with First run
Answer
11/14/13 7:59 PM as a reply to Juan G..
Hi Juan,

No success.

I update the variable system PATH and add the jre and the jdk bin libraries, just in case. The ant bin library is also there.

Look likes the problem is in the javac command.

Could be the java version ? I am using 1.7

Please Juan give me a clue.

RE: (RESOLVED) RE: Problems with First run
Answer
11/14/13 9:39 PM as a reply to Juan Quintana.
Hi Mr Juan,

It is solved!!

I was using an old version of xmlporletfactory. I unistall as well java 1.7 just in case.

Thank you dude!!

Hagamos portlets como churros!

VIVA XMLPORTLETFACTORY!!

Jack you are the lord!

RE: (RESOLVED) RE: Problems with First run
Answer
11/15/13 6:55 AM as a reply to Juan Quintana.
Juan Quintana:
I was using an old version of xmlporletfactory. I unistall as well java 1.7 just in case.
Great! That is the next thing I was going to ask you to do.

Thanks.