Ask Questions and Find Answers
Important:
Ask is now read-only. You can review any existing questions and answers, but not add anything new.
But - don't panic! While ask is no more, we've replaced it with discuss - the new Liferay Discussion Forum! Read more here here or just visit the site here:
discuss.liferay.com
RE: Guestbook-web not compiling
I am working through the tutorials 'Building a web application' in Liferay 7.2.
When I add the references to the services in the 'GuestbookPortlet', I see an error message in the 'guestbook-web' deployed in the server. I am not able to find out what is wrong because all my gradle tasks are greyed out.
@Reference
private GuestbookEntryLocalService _guestbookEntryLocalService;
@Reference
private GuestbookLocalService _guestbookLocalService;
Hi Anu, you probably already have this, but make sure you have the compileOnly project declarations for guestbook-api and guestbook-service in the web module's build.gradle file. And make sure you have the import for org.osgi.service.component.annotations.Reference
You can run the gradle tasks right from the command line as well. Do you have blade installed? You can run
blade gw clean
Hi Russell,
Thanks for your immediate response. Yes, I do have the compileOnly project declarations for guestbook-api and guestbook-service. Also, I have the correct import of the Reference class in the GuestbookPortlet. BTW, I found an alternate method to run the gradle tasks to build the jar files. I right click the gradlew.batch and run configurations and pick the gradle task to create the jar file. It is not throwing any errors but still I see the red mark on the guestbook-web project under the server.
I have the same problem. Have you been able to resolve this?
Hi John, yes I resolved this. Dont know if there was any resolution for this but I started re-doing the entire project again in Liferay 7.3. It worked.
thanks,
Anu
Powered by Liferay™