Announcement Announcement Module
No announcement yet.
org.springframework.ldap imports com.sun.jndi.ldap... how do I provide that? Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • org.springframework.ldap imports com.sun.jndi.ldap... how do I provide that?

    I'm trying to use the org.springframework.ldap-1.3.0.RELEASE.jar provided by the EBR (I also tried the 1.2.1 JAR). In its MANIFEST, it includes an import reference (the first one in the Import-Package):

    Import-Package: com.sun.jndi.ldap;version="0",

    When I do try to use it, I get the error below.

    com.sun.jndi.ldap seems to be a system provided package... it's available on the classpath in my Java 6 environment (and according to the Sun website is provided as part of the JRE at least as far back Java 5,

    So, is this a bnd/bundlor error in generating the manifest? If so, the 1.2.1 has the same issue. Or, am I supposed to do something to make the com.sun.jndi.ldap package available to this bundle?

    Thanks in advance.


    Caused by: com.springsource.kernel.osgi.framework.UnableToSatisfyBundleDependenciesException: Unable to satisfy dependencies of bundle '' at version '1.13.0': Cannot resolve:
        Resolver report:
            An Import-Package could not be resolved. Caused missing constraint <Import-Package: org.springframework.ldap; version="0.0.0"> in bundle <com.plateau.common.security_1.13.0>
            An Import-Package could not be resolved. Caused missing constraint <Import-Package: com.sun.jndi.ldap; version="0.0.0"> in bundle <org.springframework.ldap_1.3.0.RELEASE>
    	at com.springsource.kernel.install.pipeline.stage.resolve.internal.QuasiResolveStage.process(
    	at com.springsource.kernel.install.pipeline.internal.StandardPipeline.doProcessTree(
    	at com.springsource.kernel.install.pipeline.internal.CompensatingPipeline.doProcessTree(
    	at com.springsource.kernel.install.pipeline.stage.AbstractPipelineStage.process(
    	at com.springsource.kernel.install.pipeline.internal.StandardPipeline.doProcessTree(
    	at com.springsource.kernel.install.pipeline.stage.AbstractPipelineStage.process(
    	at com.springsource.kernel.deployer.core.internal.PipelinedApplicationDeployer.driveInstallPipeline(
    	... 35 common frames omitted

  • #2
    This is tricky area of OSGi: there's no standard for what parts of the JRE should be made available. For something in a com.sun.* package it's probably JVM dependent as to whether or not the classes with actually be in the JRE.

    You can make the package available from the JRE such that it can be imported by other bundles by exporting it from the system bundle. In dm Server this is controlled by the org.osgi.framework.system.packages property in the lib/java6-server.profile file. Adding an entry for com.sun.jndi.ldap will make the package available:

    org.osgi.framework.system.packages = \


    • #3
      If you use Equinox as your OSGi runtime you can add the required package to the boot delegation, using the system property 'org.osgi.framework.bootdelegation'.

      * either add
      to the command launching Equinox
      * or add a line:
      in your config.ini

      It solved for me a similar problem as yours, with Equinox not finding the LDAP initial context factory.

      Hope it helps.


      • #4
        The problem still exist after the last suggestion

        I have the same problem and I added the com.sun.jndi.ldap to the org.osgi.framework.bootdelegation line, the line in the config.ini looks like this: .*,*,, nagement.*,com.sun.jndi.ldap.*

        But, still when I start the server I get the following exception:

        C:\Ljs>"C:\Program Files\Java\jdk1.6.0_21\bin\java" -server -XX:+HeapDumpOnOutOfMemoryError -Xms512m -Xmx1024m -XX:PermSize=256M -XX:MaxPermSize=256M -Dcom.sun.
        management.jmxremote.port=1717 -Dosgi.requiredJavaVersion=1.6 -Dljs.c
        ommand.port=2222 -Dosgi.install.area=. -Dorg.eclipse.equinox.simpleconfigurator.exclusiveI nstallation=false -Declipse.ignoreApp=true -Dosgi.noShutdown=true -ja
        r plugins/ -console

        osgi> org.osgi.framework.BundleException: The bundle could not be resolved. Reason: Missing Constraint: Import-Package: com.sun.jndi.ldap; version="0.0.0"
        at org.eclipse.osgi.framework.internal.core.AbstractB undle.getResolverError(
        at org.eclipse.osgi.framework.internal.core.AbstractB undle.getResolutionFailureException(AbstractBundle .java:1297)
        at org.eclipse.osgi.framework.internal.core.BundleHos t.startWorker(
        at org.eclipse.osgi.framework.internal.core.AbstractB undle.start(
        at org.eclipse.osgi.framework.internal.core.AbstractB undle.start(
        at org.eclipse.equinox.internal.simpleconfigurator.Co nfigApplier.startBundles(
        at org.eclipse.equinox.internal.simpleconfigurator.Co nfigApplier.install(
        at org.eclipse.equinox.internal.simpleconfigurator.Si mpleConfiguratorImpl.applyConfiguration(SimpleConf
        at org.eclipse.equinox.internal.simpleconfigurator.Si mpleConfiguratorImpl.applyConfiguration(SimpleConf
        at org.eclipse.equinox.internal.simpleconfigurator.Ac tivator.start(
        at org.eclipse.osgi.framework.internal.core.BundleCon textImpl$
        at Method)
        at org.eclipse.osgi.framework.internal.core.BundleCon textImpl.startActivator( )
        at org.eclipse.osgi.framework.internal.core.BundleCon textImpl.start(
        at org.eclipse.osgi.framework.internal.core.BundleHos t.startWorker(
        at org.eclipse.osgi.framework.internal.core.AbstractB undle.resume(
        at org.eclipse.osgi.framework.internal.core.Framework .resumeBundle(
        at org.eclipse.osgi.framework.internal.core.StartLeve lManager.resumeBundles(
        at org.eclipse.osgi.framework.internal.core.StartLeve lManager.incFWSL(
        at org.eclipse.osgi.framework.internal.core.StartLeve lManager.doSetStartLevel( 8)
        at org.eclipse.osgi.framework.internal.core.StartLeve lManager.dispatchEvent(
        at org.eclipse.osgi.framework.eventmgr.EventManager.d ispatchEvent(
        at org.eclipse.osgi.framework.eventmgr.EventManager$E
        Configuration management agent starting...
        Service listener starting...
        The service is available: ( n)
        Configuration management agent started...
        Command interpreter console listen for commands on port: 2222
        Listening on port 2222 ...
        LJS Logging started.
        ACHManager service is registered.