Foren

I am not able to import certain packages in liferay 7

kamesh suddala, geändert vor 6 Jahren.

I am not able to import certain packages in liferay 7

New Member Beiträge: 2 Beitrittsdatum: 02.08.17 Neueste Beiträge
Hello,

I am not able to access the below interfaces and classes in my custom class in Liferay DXP. Can any one help to get idea how to access them in my class.

1)com.liferay.portal.workflow.kaleo.service.KaleoDefinitionLocalService
2)com.liferay.petra.log4j.Log4JUtil;

I am getting compile time errors as the path is not available to my custom class.

For this "Log4JUtil class I added entry in gradle and also in bnd.bnd

build.gradle : compile group: 'com.liferay', name: 'com.liferay.petra.log4j', version: '1.0.6'

bnd.bnd: Include-Resource:@com.liferay.petra.log4j-1.0.6.jar,\

With this I am able to get rid of the compilation errors .but when ever I call this method "Log4JUtil.setLevel("com.test", "Error", true)" ,it does nothing for me.Neither showing errors nor showing the package in the log categories in the control panel ->server administration.



Thanks in advance !

Regards,
Kamesh
thumbnail
Andrew Jardine, geändert vor 6 Jahren.

RE: I am not able to import certain packages in liferay 7

Liferay Legend Beiträge: 2416 Beitrittsdatum: 22.12.10 Neueste Beiträge
Hi Kamesh,

build.gradle : compile group: 'com.liferay', name: 'com.liferay.petra.log4j', version: '1.0.6'


This will resolve your build time (compile time) errors because it will provide gradle with the references it needs to resolve those libs/classes.

bnd.bnd: Include-Resource:@com.liferay.petra.log4j-1.0.6.jar,\


may or may not be enough depending on how the libraries have made it to your run time. David wrote a great post explaining this. If you haven't seen it yet, I would suggest you check it out: https://web.liferay.com/web/user.26526/blog/-/blogs/osgi-module-dependencies