0

first intro: I try to get a hook running on a new Liferay 6.1.2 GA3. Previously I was using the portlet plugin mechanism only.

I try to get a simple calendar hook running and get compiler errors, such as "CalEvent cannot be resolved as a type". My feeling is that I am missing the entire Liferay libraries in the hook, but the included libraries look complete to me (in order of build path priority): - ear libraries - Java JDK 6 - Liferay Hook Plugin API - Liferay V6.1 CE (Tomcat 7) - Web App Libraries

The libraries got automatically selected when creating the project as a hook. Any ideas?

Peter Branforn
  • 1,679
  • 3
  • 17
  • 29
  • are you getting any runtime errors? did you deployed it & tested? – Laxman Rana Sep 16 '13 at 06:10
  • It deploys and runs. But in the IDE (eclipse+liferayIDE) it shows errors all over the place, basically it does look like it cannot resolve any symbols related to liferay. – Peter Branforn Sep 16 '13 at 20:05

1 Answers1

1

com.liferay.portlet.calendar.model.CalEvent is in portal-service.jar. This should be on the classpath of your hook and Liferay IDE/DevStudio typically adds this library when you create a new hook. If it's not there, add it. You'll find it on the global classpath of your tomcat installation, e.g. ${liferay.home}/tomcat/lib/ext - assuming that you develop on tomcat.

If you need to add this file to the project, make sure it doesn't get packaged in the plugin's WEB-INF/lib folder - it needs to be picked up from the global classpath when deployed.

You do get the errors during development time (e.g. in IDE), not when you're deploying, right?

Or is it as simple as a forgotten "organize imports"?

Olaf Kock
  • 46,930
  • 8
  • 59
  • 90
  • The setup appears to be more complex than I originally thought. the "liferay-plugin-package.properties" needed to be changed. Nevertheless I also had to manually provide the path to the original liferay jsps (I hope that this is correct). – Peter Branforn Sep 16 '13 at 20:00