Question

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?

Was it helpful?

Solution

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"?

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top