掲示板

Date cannot be resolved to a type

11年前 に anand gopalan によって更新されました。

Date cannot be resolved to a type

Expert 投稿: 442 参加年月日: 12/03/02 最新の投稿
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.
11年前 に anand gopalan によって更新されました。

RE: Date cannot be resolved to a type

Expert 投稿: 442 参加年月日: 12/03/02 最新の投稿
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
11年前 に David H Nebinger によって更新されました。

RE: Date cannot be resolved to a type

Liferay Legend 投稿: 14916 参加年月日: 06/09/02 最新の投稿
Try using the full java classname, java.util.Date
11年前 に anand gopalan によって更新されました。

RE: Date cannot be resolved to a type

Expert 投稿: 442 参加年月日: 12/03/02 最新の投稿
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.

添付ファイル:

11年前 に anand gopalan によって更新されました。

RE: Date cannot be resolved to a type

Expert 投稿: 442 参加年月日: 12/03/02 最新の投稿
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
11年前 に Danial Mustofa Habibi によって更新されました。

RE: Date cannot be resolved to a type

Regular Member 投稿: 141 参加年月日: 11/11/01 最新の投稿
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
11年前 に anand gopalan によって更新されました。

RE: Date cannot be resolved to a type

Expert 投稿: 442 参加年月日: 12/03/02 最新の投稿
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
11年前 に Bart Simpson によって更新されました。

RE: Date cannot be resolved to a type

Liferay Master 投稿: 522 参加年月日: 11/08/29 最新の投稿
You have problem in your build path. Make sure that the package where the class HOLIDAY_LIST is places is accessible
11年前 に anand gopalan によって更新されました。

RE: Date cannot be resolved to a type

Expert 投稿: 442 参加年月日: 12/03/02 最新の投稿
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
11年前 に Bart Simpson によって更新されました。

RE: Date cannot be resolved to a type

Liferay Master 投稿: 522 参加年月日: 11/08/29 最新の投稿
Try and remove type 'Date' as the type for primary key, and see if it works.
11年前 に anand gopalan によって更新されました。

RE: Date cannot be resolved to a type

Expert 投稿: 442 参加年月日: 12/03/02 最新の投稿
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
11年前 に Bart Simpson によって更新されました。

RE: Date cannot be resolved to a type

Liferay Master 投稿: 522 参加年月日: 11/08/29 最新の投稿
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" />
11年前 に anand gopalan によって更新されました。

RE: Date cannot be resolved to a type

Expert 投稿: 442 参加年月日: 12/03/02 最新の投稿
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.
11年前 に anand gopalan によって更新されました。

RE: Date cannot be resolved to a type

Expert 投稿: 442 参加年月日: 12/03/02 最新の投稿
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.

添付ファイル: