Announcement Announcement Module
Collapse
No announcement yet.
org.springframework.ldap imports com.sun.jndi.ldap... how do I provide that? Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • 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, http://java.sun.com/products/jndi/).

    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.

    -J.C.

    Code:
    Caused by: com.springsource.kernel.osgi.framework.UnableToSatisfyBundleDependenciesException: Unable to satisfy dependencies of bundle 'com.plateau.common.security' at version '1.13.0': Cannot resolve: com.plateau.common.security
        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(QuasiResolveStage.java:54)
    	at com.springsource.kernel.install.pipeline.internal.StandardPipeline.doProcessTree(StandardPipeline.java:71)
    	at com.springsource.kernel.install.pipeline.internal.CompensatingPipeline.doProcessTree(CompensatingPipeline.java:81)
    	at com.springsource.kernel.install.pipeline.stage.AbstractPipelineStage.process(AbstractPipelineStage.java:50)
    	at com.springsource.kernel.install.pipeline.internal.StandardPipeline.doProcessTree(StandardPipeline.java:71)
    	at com.springsource.kernel.install.pipeline.stage.AbstractPipelineStage.process(AbstractPipelineStage.java:50)
    	at com.springsource.kernel.deployer.core.internal.PipelinedApplicationDeployer.driveInstallPipeline(PipelinedApplicationDeployer.java:261)
    	... 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:

    Code:
    org.osgi.framework.system.packages = \
     com.sun.jndi.ldap,\
     javax.accessibility,\
     javax.activation,\
     ...

    Comment


    • #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'.

      So:
      * either add
      Code:
      -Dorg.osgi.framework.bootdelegation=com.sun.jndi.ldap
      to the command launching Equinox
      * or add a line:
      Code:
      org.osgi.framework.bootdelegation=com.sun.jndi.ldap
      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.

      Comment


      • #4
        The problem still exist after the last suggestion

        Hi,
        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:

        org.osgi.framework.bootdelegation=com.sap.jvm.impl .*,com.sun.tools.attach*,sun.tools.attach,javax.ma 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 -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false -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/com.sap.js.startup.jar -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(AbstractBundle.java:1313)
        at org.eclipse.osgi.framework.internal.core.AbstractB undle.getResolutionFailureException(AbstractBundle .java:1297)
        at org.eclipse.osgi.framework.internal.core.BundleHos t.startWorker(BundleHost.java:309)
        at org.eclipse.osgi.framework.internal.core.AbstractB undle.start(AbstractBundle.java:280)
        at org.eclipse.osgi.framework.internal.core.AbstractB undle.start(AbstractBundle.java:272)
        at org.eclipse.equinox.internal.simpleconfigurator.Co nfigApplier.startBundles(ConfigApplier.java:307)
        at org.eclipse.equinox.internal.simpleconfigurator.Co nfigApplier.install(ConfigApplier.java:108)
        at org.eclipse.equinox.internal.simpleconfigurator.Si mpleConfiguratorImpl.applyConfiguration(SimpleConf iguratorImpl.java:129)
        at org.eclipse.equinox.internal.simpleconfigurator.Si mpleConfiguratorImpl.applyConfiguration(SimpleConf iguratorImpl.java:143)
        at org.eclipse.equinox.internal.simpleconfigurator.Ac tivator.start(Activator.java:48)
        at org.eclipse.osgi.framework.internal.core.BundleCon textImpl$1.run(BundleContextImpl.java:783)
        at java.security.AccessController.doPrivileged(Native Method)
        at org.eclipse.osgi.framework.internal.core.BundleCon textImpl.startActivator(BundleContextImpl.java:774 )
        at org.eclipse.osgi.framework.internal.core.BundleCon textImpl.start(BundleContextImpl.java:755)
        at org.eclipse.osgi.framework.internal.core.BundleHos t.startWorker(BundleHost.java:352)
        at org.eclipse.osgi.framework.internal.core.AbstractB undle.resume(AbstractBundle.java:370)
        at org.eclipse.osgi.framework.internal.core.Framework .resumeBundle(Framework.java:1068)
        at org.eclipse.osgi.framework.internal.core.StartLeve lManager.resumeBundles(StartLevelManager.java:557)
        at org.eclipse.osgi.framework.internal.core.StartLeve lManager.incFWSL(StartLevelManager.java:464)
        at org.eclipse.osgi.framework.internal.core.StartLeve lManager.doSetStartLevel(StartLevelManager.java:24 8)
        at org.eclipse.osgi.framework.internal.core.StartLeve lManager.dispatchEvent(StartLevelManager.java:445)
        at org.eclipse.osgi.framework.eventmgr.EventManager.d ispatchEvent(EventManager.java:227)
        at org.eclipse.osgi.framework.eventmgr.EventManager$E ventThread.run(EventManager.java:337)
        Configuration management agent starting...
        Service listener starting...
        The service is available: (objectclass=org.osgi.service.cm.ConfigurationAdmi 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.

        Comment

        Working...
        X