Forums

Home » Liferay Portal » English » 3. Development

Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
a g
Date cannot be resolved to a type
December 20, 2012 1:30 AM
Answer

a g

Rank: Expert

Posts: 415

Join Date: March 2, 2012

Recent Posts

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.

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)
public com.test.model.HOLIDAY_LIST createHOLIDAY_LIST(Date m03date);
^^^^
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.
a g
RE: Date cannot be resolved to a type
December 20, 2012 4:15 AM
Answer

a g

Rank: Expert

Posts: 415

Join Date: March 2, 2012

Recent Posts

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.
David H Nebinger
RE: Date cannot be resolved to a type
December 20, 2012 5:39 AM
Answer

David H Nebinger

Community Moderator

Rank: Liferay Legend

Posts: 11464

Join Date: September 1, 2006

Recent Posts

Try using the full java classname, java.util.Date
a g
RE: Date cannot be resolved to a type
December 20, 2012 10:02 PM
Answer

a g

Rank: Expert

Posts: 415

Join Date: March 2, 2012

Recent Posts

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.
Attachment

Attachments: Holiday_List.jpg (186.5k)
a g
RE: Date cannot be resolved to a type
December 20, 2012 11:28 PM
Answer

a g

Rank: Expert

Posts: 415

Join Date: March 2, 2012

Recent Posts

Anybody know why I am getting this error.

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

Please help me...........
Danial Mustofa Habibi
RE: Date cannot be resolved to a type
December 21, 2012 12:07 AM
Answer

Danial Mustofa Habibi

Rank: Regular Member

Posts: 141

Join Date: November 1, 2011

Recent Posts

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
a g
RE: Date cannot be resolved to a type
December 21, 2012 2:36 AM
Answer

a g

Rank: Expert

Posts: 415

Join Date: March 2, 2012

Recent Posts

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....................
Bart Simpson
RE: Date cannot be resolved to a type
December 21, 2012 7:12 AM
Answer

Bart Simpson

Rank: Liferay Master

Posts: 524

Join Date: August 29, 2011

Recent Posts

You have problem in your build path. Make sure that the package where the class HOLIDAY_LIST is places is accessible
a g
RE: Date cannot be resolved to a type
December 23, 2012 10:13 PM
Answer

a g

Rank: Expert

Posts: 415

Join Date: March 2, 2012

Recent Posts

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.
Bart Simpson
RE: Date cannot be resolved to a type
December 24, 2012 3:41 AM
Answer

Bart Simpson

Rank: Liferay Master

Posts: 524

Join Date: August 29, 2011

Recent Posts

Try and remove type 'Date' as the type for primary key, and see if it works.
a g
RE: Date cannot be resolved to a type
December 24, 2012 3:45 AM
Answer

a g

Rank: Expert

Posts: 415

Join Date: March 2, 2012

Recent Posts

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.
Attachments: Console_output.txt (15.8k)
a g
RE: Date cannot be resolved to a type
December 24, 2012 3:58 AM
Answer

a g

Rank: Expert

Posts: 415

Join Date: March 2, 2012

Recent Posts

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.
Attachments: Console_output1.txt (20.2k)
Bart Simpson
RE: Date cannot be resolved to a type
December 24, 2012 4:16 AM
Answer

Bart Simpson

Rank: Liferay Master

Posts: 524

Join Date: August 29, 2011

Recent Posts

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" />
a g
RE: Date cannot be resolved to a type
December 24, 2012 4:32 AM
Answer

a g

Rank: Expert

Posts: 415

Join Date: March 2, 2012

Recent Posts

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.