Foros de discusión

Date cannot be resolved to a type

anand gopalan, modificado hace 11 años.

Date cannot be resolved to a type

Expert Mensajes: 442 Fecha de incorporación: 2/03/12 Mensajes recientes
Hi,
Table structure:
Name Null Type
----------------- -------- -------------
M03DATE NOT NULL DATE
MONTH VARCHAR2(36)
DAY VARCHAR2(36)
M03BANGALORE VARCHAR2(255)
M03GURGAON VARCHAR2(255)
M03CHENNAICOIMB VARCHAR2(255)
M03MUMBAIPUNE VARCHAR2(255)
M03AHMEDABAD VARCHAR2(255)
M03VADODARA VARCHAR2(255)
M03KOLKATAJAM VARCHAR2(255)
M03HYDERABADVIZAG VARCHAR2(255)

My service.xml
<entity name="HOLIDAY_LIST" table="pficontacts.INDIA_HOLIDAY_LIST" data-source="holidayDS" local-service="true">

<column name="m03date" type="Date" primary="true"></column>
<column name="month" type="String"></column>
<column name="day" type="String"></column>
<column name="m03bangalore" type="String"></column>
<column name="m03gurgaon" type="String"></column>
<column name="m03chennaicoimb" type="String"></column>
<column name="m03mumbaipune" type="String"></column>
<column name="m03ahmedabad " type="String"></column>
<column name="m03vadodara" type="String"></column>
<column name="m03kolkatajam" type="String"></column>
<column name="m03hyderabadvizag" type="String"></column>

</entity>

After build the service.xml

I getting below error.

[javac] 1. ERROR in C:\Users\agopalan\Downloads\liferay-plugins-sdk-6.1.0-ce-ga1\portlets\HolidayList-portlet\docroot\WEB-INF\service\com\test\service\HOLIDAY_LISTLocalService.java (at line 63)
[javac] public com.test.model.HOLIDAY_LIST createHOLIDAY_LIST(Date m03date);
[javac] ^^^^
[javac] Date cannot be resolved to a type

Any body know why I am getting this error. And I want to get all the records from the table so I didn't put finder tag..
please help me.
anand gopalan, modificado hace 11 años.

RE: Date cannot be resolved to a type

Expert Mensajes: 442 Fecha de incorporación: 2/03/12 Mensajes recientes
Any body know, why i am getting the compile error and is it problem in liferay-plugins-sdk-6.1.0-ce-ga1 configuration.. if it is configuration problem, how to fix this issue.
please help me.
thumbnail
David H Nebinger, modificado hace 11 años.

RE: Date cannot be resolved to a type

Liferay Legend Mensajes: 14916 Fecha de incorporación: 2/09/06 Mensajes recientes
Try using the full java classname, java.util.Date
anand gopalan, modificado hace 11 años.

RE: Date cannot be resolved to a type

Expert Mensajes: 442 Fecha de incorporación: 2/03/12 Mensajes recientes
Hi,

I am getting "Import com.test.model.HOLIDAY_LIST" can't be resolved..

I am getting same error in many places. All the classes are available in that location. But it still I am getting the error.

Please let me know any Jar file missing or plugin setup issue.

Archivos adjuntos:

anand gopalan, modificado hace 11 años.

RE: Date cannot be resolved to a type

Expert Mensajes: 442 Fecha de incorporación: 2/03/12 Mensajes recientes
Anybody know why I am getting this error.

I am getting "Import com.test.model.HOLIDAY_LIST" can't be resolved..

Please help me...........
thumbnail
Danial Mustofa Habibi, modificado hace 11 años.

RE: Date cannot be resolved to a type

Regular Member Mensajes: 141 Fecha de incorporación: 1/11/11 Mensajes recientes
hi there try to re creating your project..or try to close your project and then open again..and then try to refresh your project sometime if u were using Eclipse IDE or Liferay IDE ..It happens..


Regards

Danial
anand gopalan, modificado hace 11 años.

RE: Date cannot be resolved to a type

Expert Mensajes: 442 Fecha de incorporación: 2/03/12 Mensajes recientes
Hi,

I tried recreating project and open & close the eclipse & I tried all the possibility . But all are failed. I am getting same problem.

Any body can help me solve this issue. Please help me....................
thumbnail
Bart Simpson, modificado hace 11 años.

RE: Date cannot be resolved to a type

Liferay Master Mensajes: 522 Fecha de incorporación: 29/08/11 Mensajes recientes
You have problem in your build path. Make sure that the package where the class HOLIDAY_LIST is places is accessible
anand gopalan, modificado hace 11 años.

RE: Date cannot be resolved to a type

Expert Mensajes: 442 Fecha de incorporación: 2/03/12 Mensajes recientes
Hello Bart,

after declare the entity name and table column name in service.xml and build the service.
All are auto generate code. Please let me know how to fix the build path. Because same environment I created many port-lets that time i didn't get any error.
I didn't change any thing in my setting. Please help me Bart.

My enviornment: LiferayIDE & Liferay6.1.0

thank you.
thumbnail
Bart Simpson, modificado hace 11 años.

RE: Date cannot be resolved to a type

Liferay Master Mensajes: 522 Fecha de incorporación: 29/08/11 Mensajes recientes
Try and remove type 'Date' as the type for primary key, and see if it works.
anand gopalan, modificado hace 11 años.

RE: Date cannot be resolved to a type

Expert Mensajes: 442 Fecha de incorporación: 2/03/12 Mensajes recientes
Hello Bart,

try with

<column name="m03date" primary="true" />

it showing "Attribute type is required and must be specified for element type column "

and try with this also

<column name="m03date" type="" primary="true" />

its giving the error.

see the attachment.
FYI: Bart, it just display all the records i am not giving any condition, so I didn't use any finder method. .

Please help me Bart.
thumbnail
Bart Simpson, modificado hace 11 años.

RE: Date cannot be resolved to a type

Liferay Master Mensajes: 522 Fecha de incorporación: 29/08/11 Mensajes recientes
emoticon you have to give the type atleast
You completely skipped the type so there should be at-least something like
<column name="holidayId" type="long" primary="true" />
<column name="m03date" type="Date" />
anand gopalan, modificado hace 11 años.

RE: Date cannot be resolved to a type

Expert Mensajes: 442 Fecha de incorporación: 2/03/12 Mensajes recientes
No Bart i tried all the option.

<column name="m03date" type="Date" />
<column name="m03date" type="Date" primary="true" />
<column name="m03date" type="" primary="true" />

all i am getting the error.

Now I fixed the problem. Now I changed the primary key to some other column. Now I didn't get any error.

thanks for your response. Bart....emoticon

Merry Christmas & Happy New Year.
anand gopalan, modificado hace 11 años.

RE: Date cannot be resolved to a type

Expert Mensajes: 442 Fecha de incorporación: 2/03/12 Mensajes recientes
Hi,

I just want to display the all the records from the table.

Table desc:
M03DATE NOT NULL DATE
MONTH VARCHAR2(36)
DAY VARCHAR2(36)
M03BANGALORE VARCHAR2(255)
M03GURGAON VARCHAR2(255)
M03CHENNAICOIMB VARCHAR2(255)
M03MUMBAIPUNE VARCHAR2(255)
M03AHMEDABAD VARCHAR2(255)
M03VADODARA VARCHAR2(255)
M03KOLKATAJAM VARCHAR2(255)
M03HYDERABADVIZAG VARCHAR2(255)

Service.xml:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE service-builder PUBLIC "-//Liferay//DTD Service Builder 6.1.0//EN" "http://www.liferay.com/dtd/liferay-service-builder_6_1_0.dtd">
<service-builder package-path="com.test">
<author>agopalan</author>
<namespace>Holiday</namespace>

<entity name="HOLIDAY_LIST" table="pficontacts.INDIA_HOLIDAY_LIST" data-source="holidayDS" local-service="true">

<column name="m03date" type="Date" primary="true" />

<column name="month" type="String" />
<column name="day" type="String" />
<column name="m03bangalore" type="String" />
<column name="m03gurgaon" type="String" />
<column name="m03chennaicoimb" type="String" />

<column name="m03mumbaipune" type="String" />
<column name="m03ahmedabad" type="String" />
<column name="m03vadodara" type="String" />
<column name="m03kolkatajam" type="String" />
<column name="m03hyderabadvizag" type="String" />


</entity>
</service-builder>

after declare the entity name and table column name in service.xml and build the service.
All are auto generate code. Please let me know how to fix the build path. Because same environment I created many port-lets that time i didn't get any error.
I didn't change any thing in my setting. Please help me

My enviornment: LiferayIDE & Liferay6.1.0.


see the console output in the attachment.

Archivos adjuntos: