2014-01-21 59 views
1

我已經下載了Upcoming Events portlet,我已經做了一些更改,並且將portlet部署到Liferay 6.2。CalEventServiceUtil無法解析

我得到這個錯誤:

Unable to compile class for JSP: 

An error occurred at line: [36] in the generated java file: [D:\Liferay\Test\tomcat-7.0.42\work\Catalina\localhost\upcoming-events-portlet\org\apache\jsp\view_jsp.java] 
Only a type can be imported. com.liferay.portlet.calendar.service.CalEventServiceUtil resolves to a package 

An error occurred at line: 79 in the jsp file: /view.jsp 
CalEventServiceUtil cannot be resolved 

生成的文件的第36行:

import com.liferay.portlet.calendar.service.CalEventServiceUtil; 

/view.jsp的線79:

lstEvents = CalEventServiceUtil.getEvents(scopeGroupId, gregCal, new String()); 

我要補充有些圖書館要投影,但哪一個?
任何幫助表示讚賞!謝謝!

+2

我的看法是未來活動的Portlet僅適用於6.1版。出現錯誤是因爲Calendar Portlet現在與Liferay分離。 – Mark

+1

@Mark我也這麼認爲 - 爲什麼不加這個作爲答案,以便它可以被表決/接受。市場信息指出該應用與* 6.1(任何版本)GA2 + *兼容,例如,可能與GA3,但它沒有說任何關於6.2(這將是* 6.1 + *) –

+0

非常感謝你@Mark –

回答

2

的答案複製評論:

我的看法是未來活動的Portlet僅適用於6.1版。出現錯誤是因爲Calendar Portlet現在與Liferay分離。

+1

非常感謝!我通過將'/ webapps/calendar-portlet/WEB-INF/lib'中的calendar-'portlet-service.jar'文件複製到我的項目的WEB-INF/lib文件夾中解決了這個問題。 –

+0

有一點需要注意的是,'CalEventServiceUtil'提供了處理calEvents的方法,沒有任何userId,但是'CalEventLocalServiceUtil'沒有。第一個只出現在LR61中(可能在之前),但後者出現在LR61和LR62中。因此,在LR62中以匿名方式操作該主題似乎很困難。 - 但我看不出這背後的理由。 –

1

我不確定,但你有com.liferay.portal/portal-service lib嗎?例如

This

+0

非常感謝你@Pisek,但在門戶服務庫'com.liferay.portlet。 calendar.service'沒有'CalEventServiceUtil',但有'CalEventLocalServiceUtil',所以我嘗試使用'CalEventLocalServiceUtil'但不起作用。 –

1

請使用而不是CalEventLocalServiceUtil CalendarBookingLocalServiceUtil