Erf, good catch, I didn't check the package visibility.
Regards JB On 01/10/2018 01:07 PM, Guillaume Nodet wrote:
That's a bug, the package should be made available. You add it manually in etc/config.properties by modifying the org.osgi.framework.system.packages property and adding: org.apache.karaf.info;version="4.2.0.SNAPSHOT" Could you raise a JIRA about that ? 2018-01-10 4:39 GMT+01:00 Chris Caspanello <[email protected]>:Hey guys, I'm trying to access the ServerInfo service from my bundle. In my bundle I included the following in my pom.xml <dependency> <groupId>org.apache.karaf</groupId> <artifactId>org.apache.karaf.main</artifactId> <version>${karaf.version}</version> <scope>provided</scope> </dependency> I marked it provided since it is already included by Karaf. I know this because I can list the services in Bundle 0 and see the ServerInfo service. I can also debug my bundle with the following and see the service returned. ServiceReference<?> ref = bundleContext.getServiceReference( "org.apache.karaf.info.ServerInfo" ); bundleContext.getService( ref ); However if I try try to import the ServerInfo in my class like this: ServiceReference<ServerInfo> ref = bundleContext.getServiceReference(ServerInfo.class); ServerInfo serverInfo = (ServerInfo) bundleContext.getService(ref); Then I get the following bundle wiring error: osgi.wiring.package; filter:="(&(osgi.wiring.package=org.apache.karaf.info)( version>=4.0.0)(!(version>=5.0.0)))"]] Any ideas how I can fix this? Thanks, Chris -- Sent from: http://karaf.922171.n3.nabble.com/Karaf-Dev-f930721.html
-- Jean-Baptiste Onofré [email protected] http://blog.nanthrax.net Talend - http://www.talend.com
