OSGI LogService.log method does not work!
I have the weirdest bug, when writting my LogHelper class.
I am using org.osgi.service.log.LogService (with Apache Felix implementation).
Now I can call the:
LogService.log(int level, String message)
with no problems, but when I try to use the one with the exception:
LogService.log(int level, String message, Throwable exception)
Eclipse highlights the call as wrong, and gives me this wierd error message:
The type org.osgi.framework.ServiceReference cannot be resolved. It is indirectly referenced from required .cla开发者_运维知识库ss files
Your bundle should import package org.osgi.framework that is used by LogService.
According to nice folks at apache felix this is because Eclipse does not see ServiceReference in my classpath.
Putting the "org.osgi.core" into my (maven+osgi) dependencies, fixed it.
精彩评论