karaf-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rafael Marins <rafael.mar...@neociclo.com>
Subject Re: Problem reusing JAAS login modules
Date Tue, 28 Dec 2010 11:25:24 GMT
Hi JB,

Thanks everybody for all replies.

I suspected about it and included org.apache.karaf.modules.* to the bundle imports, but didn't
worked. The maven-bundle-plugin simply don't put that import statement it in the Manifest
as there is no Java package imports. See the pom statements:

From the org.neociclo.accord.server.server-core bundle's pom:

  <artifactId>server-core</artifactId>
  <packaging>bundle</packaging>
  <name>Accord Server :: Core</name>

  <properties>
    <!-- OSGi bundle custom properties -->
    <accord.osgi.export.pkg>
      org.neociclo.accord.server.*
    </accord.osgi.export.pkg>
    <accord.osgi.private.pkg>
      org.neociclo.accord.server.impl.*
    </accord.osgi.private.pkg>
    <accord.osgi.import.additional>
      org.apache.karaf.jaas.config.*;version="[2.1.2,3)",
      org.apache.karaf.jaas.modules.*;version="[2.1.2,3)"
    </accord.osgi.import.additional>
  </properties>

From the parent pom:

  <properties>
...
    <accord.osgi.name>${project.name}</accord.osgi.name>
    <accord.osgi.import.accord.version>version="[$(version;==;${accord.osgi.version.clean}),$(version;=+;${accord.osgi.version.clean}))"</accord.osgi.import.accord.version>
    <accord.osgi.import.strict.version>version="[$(version;===;${accord.osgi.version.clean}),$(version;==+;${accord.osgi.version.clean}))"</accord.osgi.import.strict.version>
    <accord.osgi.import.default.version>[$(version;==;$(@)),$(version;+;$(@)))</accord.osgi.import.default.version>
    <accord.osgi.import.defaults>
      org.springframework.*;version="[3.0,4)",
      org.apache.camel.*;version="[2.5,3)",
      org.slf4j.*;version="[1.5,1.6)",
    </accord.osgi.import.defaults>
    <accord.osgi.import.before.defaults />
    <accord.osgi.import.additional />
    <accord.osgi.import.pkg>
      !${accord.osgi.export.pkg},
      org.neociclo.accord.server.*;${accord.osgi.import.accord.version},
      ${accord.osgi.import.before.defaults},
      ${accord.osgi.import.defaults},
      ${accord.osgi.import.additional},
      *
    </accord.osgi.import.pkg>
    <accord.osgi.activator />
    <accord.osgi.failok>false</accord.osgi.failok>
    <accord.osgi.private.pkg>!*</accord.osgi.private.pkg>
    <accord.osgi.export>${accord.osgi.export.pkg};${accord.osgi.version}</accord.osgi.export>
    <accord.osgi.version>version=${project.version}</accord.osgi.version>
    <accord.osgi.split.pkg>-split-package:=first</accord.osgi.split.pkg>
    <accord.osgi.import>${accord.osgi.import.pkg}</accord.osgi.import>
    <accord.osgi.dynamic />
    <accord.osgi.symbolic.name>${project.groupId}.${project.artifactId}</accord.osgi.symbolic.name>
    <accord.osgi.exclude.dependencies>false</accord.osgi.exclude.dependencies>
...

      <plugin>
        <groupId>org.apache.felix</groupId>
        <artifactId>maven-bundle-plugin</artifactId>
        <version>${felix-version}</version>
        <extensions>true</extensions>
        <configuration>
          <excludeDependencies>${accord.osgi.exclude.dependencies}</excludeDependencies>
          <instructions>
            <Bundle-Name>${accord.osgi.name}</Bundle-Name>
            <Bundle-SymbolicName>${accord.osgi.symbolic.name}</Bundle-SymbolicName>
            <Bundle-Activator>${accord.osgi.activator}</Bundle-Activator>
            <Export-Package>${accord.osgi.export}</Export-Package>
            <Import-Package>${accord.osgi.import}</Import-Package>
            <DynamicImport-Package>${accord.osgi.dynamic}</DynamicImport-Package>
            <Private-Package>${accord.osgi.private.pkg}</Private-Package>
            <Implementation-Title>Neociclo Accord</Implementation-Title>
            <Implementation-Version>${project.version}</Implementation-Version>
            <_versionpolicy>${accord.osgi.import.default.version}</_versionpolicy>
            <_failok>${accord.osgi.failok}</_failok>
          </instructions>
        </configuration>
      </plugin>
...


And it produced the MANIFEST.MF with:

Bundle-SymbolicName: org.neociclo.accord.server.server-core
Import-Package: javax.security.auth,javax.security.auth.callback,javax
 .security.auth.login,javax.security.auth.spi,org.osgi.service.bluepri
 nt;version="[1.0.0,2.0.0)"



Best regards,
--
Rafael Marins




On Dec 28, 2010, at 4:34 AM, Jean-Baptiste Onofré wrote:

> Hi Rafael,
> 
> it's certainly due to classloader issue. Could you paste your bundle pom to see the Import-Package
statement ?
> 
> Regards
> JB


Mime
View raw message