You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@karaf.apache.org by kotoole <ke...@gmail.com> on 2017/06/19 17:41:35 UTC

LDAP module fails randomly

The LDAP module in Karaf 4.0.8 randomly fails at startup.
Logs:
14:26:13,438 | ERROR |  1.0.0 |  | FrameworkEvent ERROR -
custom-ldap-moduleorg.osgi.framework.BundleException: Unable to resolve
custom-ldap-module [286](R 286.0): missing requirement [custom-ldap-module
[286](R 286.0)] osgi.wiring.package;
(osgi.wiring.package=org.apache.karaf.jaas.modules.ldap) Unresolved
requirements: [[custom-ldap-module [286](R 286.0)] osgi.wiring.package;
(osgi.wiring.package=org.apache.karaf.jaas.modules.ldap)]	at
org.apache.felix.framework.Felix.resolveBundleRevision(Felix.java:4111)[org.apache.felix.framework-5.6.1.jar:]
at
org.apache.felix.framework.Felix.startBundle(Felix.java:2117)[org.apache.felix.framework-5.6.1.jar:]
at
org.apache.felix.framework.Felix.setBundleStartLevel(Felix.java:1563)[org.apache.felix.framework-5.6.1.jar:]
at
org.apache.felix.framework.FrameworkStartLevelImpl.run(FrameworkStartLevelImpl.java:338)[org.apache.felix.framework-5.6.1.jar:]
at java.lang.Thread.run(Thread.java:745)[:1.8.0_111]
Blueprint file being used:
&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
&lt;blueprint
  xmlns=&quot;http://www.osgi.org/xmlns/blueprint/v1.0.0&quot;
  xmlns:jaas=&quot;http://karaf.apache.org/xmlns/jaas/v1.0.0&quot;
 
xmlns:ext=&quot;http://aries.apache.org/blueprint/xmlns/blueprint-ext/v1.0.0&quot;&gt;

  &lt;manifest
xmlns=&quot;http://karaf.apache.org/xmlns/deployer/blueprint/v1.0.0&quot;&gt;
    Import-Package: org.apache.karaf.jaas.modules.ldap
  &lt;/manifest&gt;

  &lt;ext:property-placeholder
    placeholder-prefix=&quot;$[&quot;
    placeholder-suffix=&quot;]&quot;&gt;
  &lt;/ext:property-placeholder&gt;

  &lt;ext:property-placeholder
    placeholder-prefix=&quot;$(&quot;
    placeholder-suffix=&quot;)&quot;&gt;
    &lt;ext:location&gt;$[secure.file]&lt;/ext:location&gt;
  &lt;/ext:property-placeholder&gt;

  &lt;jaas:config
    name=&quot;karaf&quot;
    rank=&quot;1&quot;&gt;
    &lt;jaas:module
     
className=&quot;org.apache.karaf.jaas.modules.ldap.LDAPLoginModule&quot;
      flags=&quot;required&quot;&gt;
      connection.url=$[ldap.url]
     
connection.username=CN=$(serviceAccount.username),OU=ServiceAccounts,DC=company,DC=com
      connection.password=$(serviceAccount.password)
      user.base.dn=DC=company,DC=com
      user.filter=(sAMAccountName=%u)
      user.search.subtree=true
      role.base.dn=OU=CompanyGroups,DC=company,DC=com
      role.name.attribute=cn
      role.filter=(member=%fqdn)
      role.search.subtree=false
      ssl.protocol=SSL
      authentication=simple
    &lt;/jaas:module&gt;
  &lt;/jaas:config&gt;

&lt;/blueprint&gt;




--
View this message in context: http://karaf.922171.n3.nabble.com/LDAP-module-fails-randomly-tp4050828.html
Sent from the Karaf - User mailing list archive at Nabble.com.

Re: LDAP module fails randomly

Posted by kotoole <ke...@gmail.com>.
This appears to have worked. Thanks!



--
View this message in context: http://karaf.922171.n3.nabble.com/LDAP-module-fails-randomly-tp4050828p4050840.html
Sent from the Karaf - User mailing list archive at Nabble.com.

Re: LDAP module fails randomly

Posted by kotoole <ke...@gmail.com>.
I will give that a try and get back to you.

Thanks,
Kevin



--
View this message in context: http://karaf.922171.n3.nabble.com/LDAP-module-fails-randomly-tp4050828p4050832.html
Sent from the Karaf - User mailing list archive at Nabble.com.

Re: LDAP module fails randomly

Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
I think it could be related to fileinstall and race condition.

Can you try to change the etc/org.apache.felix.fileinstall-deploy.cfg as follow:

felix.fileinstall.start.level=100
felix.fileinstall.noInitialDelay=false
felix.fileinstall.poll=5000

Thanks,
Regards
JB

On 06/19/2017 09:22 PM, kotoole wrote:
> Correct!
> 
> Thanks,
> Kevin
> 
> 
> 
> --
> View this message in context: http://karaf.922171.n3.nabble.com/LDAP-module-fails-randomly-tp4050828p4050830.html
> Sent from the Karaf - User mailing list archive at Nabble.com.
> 

-- 
Jean-Baptiste Onofré
jbonofre@apache.org
http://blog.nanthrax.net
Talend - http://www.talend.com

Re: LDAP module fails randomly

Posted by kotoole <ke...@gmail.com>.
Correct!

Thanks,
Kevin



--
View this message in context: http://karaf.922171.n3.nabble.com/LDAP-module-fails-randomly-tp4050828p4050830.html
Sent from the Karaf - User mailing list archive at Nabble.com.

Re: LDAP module fails randomly

Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
Hi,

I guess you drop the blueprint file directly in deploy folder right ?

Regards
JB

On 06/19/2017 07:41 PM, kotoole wrote:
> The LDAP module in Karaf 4.0.8 randomly fails at startup.
> Logs:
> 14:26:13,438 | ERROR |  1.0.0 |  | FrameworkEvent ERROR -
> custom-ldap-moduleorg.osgi.framework.BundleException: Unable to resolve
> custom-ldap-module [286](R 286.0): missing requirement [custom-ldap-module
> [286](R 286.0)] osgi.wiring.package;
> (osgi.wiring.package=org.apache.karaf.jaas.modules.ldap) Unresolved
> requirements: [[custom-ldap-module [286](R 286.0)] osgi.wiring.package;
> (osgi.wiring.package=org.apache.karaf.jaas.modules.ldap)]	at
> org.apache.felix.framework.Felix.resolveBundleRevision(Felix.java:4111)[org.apache.felix.framework-5.6.1.jar:]
> at
> org.apache.felix.framework.Felix.startBundle(Felix.java:2117)[org.apache.felix.framework-5.6.1.jar:]
> at
> org.apache.felix.framework.Felix.setBundleStartLevel(Felix.java:1563)[org.apache.felix.framework-5.6.1.jar:]
> at
> org.apache.felix.framework.FrameworkStartLevelImpl.run(FrameworkStartLevelImpl.java:338)[org.apache.felix.framework-5.6.1.jar:]
> at java.lang.Thread.run(Thread.java:745)[:1.8.0_111]
> Blueprint file being used:
> &lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
> &lt;blueprint
>    xmlns=&quot;http://www.osgi.org/xmlns/blueprint/v1.0.0&quot;
>    xmlns:jaas=&quot;http://karaf.apache.org/xmlns/jaas/v1.0.0&quot;
>   
> xmlns:ext=&quot;http://aries.apache.org/blueprint/xmlns/blueprint-ext/v1.0.0&quot;&gt;
> 
>    &lt;manifest
> xmlns=&quot;http://karaf.apache.org/xmlns/deployer/blueprint/v1.0.0&quot;&gt;
>      Import-Package: org.apache.karaf.jaas.modules.ldap
>    &lt;/manifest&gt;
> 
>    &lt;ext:property-placeholder
>      placeholder-prefix=&quot;$[&quot;
>      placeholder-suffix=&quot;]&quot;&gt;
>    &lt;/ext:property-placeholder&gt;
> 
>    &lt;ext:property-placeholder
>      placeholder-prefix=&quot;$(&quot;
>      placeholder-suffix=&quot;)&quot;&gt;
>      &lt;ext:location&gt;$[secure.file]&lt;/ext:location&gt;
>    &lt;/ext:property-placeholder&gt;
> 
>    &lt;jaas:config
>      name=&quot;karaf&quot;
>      rank=&quot;1&quot;&gt;
>      &lt;jaas:module
>       
> className=&quot;org.apache.karaf.jaas.modules.ldap.LDAPLoginModule&quot;
>        flags=&quot;required&quot;&gt;
>        connection.url=$[ldap.url]
>       
> connection.username=CN=$(serviceAccount.username),OU=ServiceAccounts,DC=company,DC=com
>        connection.password=$(serviceAccount.password)
>        user.base.dn=DC=company,DC=com
>        user.filter=(sAMAccountName=%u)
>        user.search.subtree=true
>        role.base.dn=OU=CompanyGroups,DC=company,DC=com
>        role.name.attribute=cn
>        role.filter=(member=%fqdn)
>        role.search.subtree=false
>        ssl.protocol=SSL
>        authentication=simple
>      &lt;/jaas:module&gt;
>    &lt;/jaas:config&gt;
> 
> &lt;/blueprint&gt;
> 
> 
> 
> 
> --
> View this message in context: http://karaf.922171.n3.nabble.com/LDAP-module-fails-randomly-tp4050828.html
> Sent from the Karaf - User mailing list archive at Nabble.com.
> 

-- 
Jean-Baptiste Onofré
jbonofre@apache.org
http://blog.nanthrax.net
Talend - http://www.talend.com