2014-09-23 69 views
0

我有一个OSGi包,我想在这个包中使用slf4j包,所以我已经添加到manifest.mf(位于META-INF)这个:我收到一个错误,当我想将slf4j包含在OSGi包中时

Import-Package: org.slf4j;version="[1.7.7,2)" 

但我发现了这个错误:

This inspections reports usage of classes from packages not accessible inside the OSGi context - i.e. not imported neither implicitly nor via manifest file. Asking for such a classes may cause "class not found" exceptions at runtime. The inspection is only effective for modules with OSGi facet set to use existing manifest file.

我使用intellijidea 13.1

+0

听起来不像是一个错误,但只是警告IntelliJ无法做某些检查。你的程序是不是编译或运行?如果没有,那么你得到的实际编译错误或运行时错误是什么? – Jesper 2014-09-23 08:49:48

回答

1

在OSGi的模式理念内省的罐(包)使用。可能你使用的slf4j api不是OSGi包。所以想法没有找到提供你导入的软件包的软件包。和运行时一样,你可能使用不同的包,比如pax-logging,这个警告可以忽略。

相关问题