Message Boards

Guestbook-web not compiling

Anu Narayanan, modified 3 Years ago.

Guestbook-web not compiling

Junior Member Posts: 50 Join Date: 4/24/15 Recent Posts

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;

thumbnail
Russell Bohl, modified 3 Years ago.

RE: Guestbook-web not compiling

Expert Posts: 291 Join Date: 2/13/13 Recent Posts

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

Anu Narayanan, modified 3 Years ago.

RE: RE: Guestbook-web not compiling

Junior Member Posts: 50 Join Date: 4/24/15 Recent Posts

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.

John Mueller, modified 1 Year ago.

RE: RE: Guestbook-web not compiling

New Member Posts: 2 Join Date: 10/13/22 Recent Posts

I have the same problem. Have you been able to resolve this?

Anu Narayanan, modified 1 Year ago.

RE: Guestbook-web not compiling

Junior Member Posts: 50 Join Date: 4/24/15 Recent Posts

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