You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sling.apache.org by Eugen Stan <ie...@netdava.com> on 2018/08/10 06:24:36 UTC

help with Sling with mongo with authentification

Hello,

I'm trying to deploy Sling with Mongo back-end with authentication and
non default connection settings.

[1] https://docs.mongodb.com/manual/tutorial/enable-authentication/

I've updated the configuration for Sling/Mongo:

org.apache.sling.nosql.mongodb.resourceprovider.MongoDBNoSqlResourceProviderFactory.factory.config-default.cfg

provider.roots = [ \
  "/", \
  ]
connectionString="10.20.0.1:27017"
database="my-sling"
collection="resources"
org.apache.karaf.features.configKey =
"org.apache.sling.nosql.mongodb.resourceprovider.MongoDBNoSqlResourceProviderFactory.factory.config-default"

However, the logs show:

06:10:30.906 ERROR [FelixStartLevel]
[org.apache.jackrabbit.oak.plugins.document.DocumentNodeStoreService(55)]
The activate method has thrown an exception
com.mongodb.MongoTimeoutException: Timed out after 30000 ms while
waiting to connect. Client view of cluster state is {type=UNKNOWN,
servers=[{address=localhost:27017, type=UNKNOWN, state=CONNECTING,
exception={com.mongodb.MongoSocketOpenException: Exception opening
socket}, caused by {java.net.ConnectException: Connection refused
(Connection refused)}}]
    at
com.mongodb.connection.BaseCluster.getDescription(BaseCluster.java:167)
~[?:?]
    at com.mongodb.Mongo.getClusterDescription(Mongo.java:405) ~[?:?]
    at com.mongodb.Mongo.getReplicaSetStatus(Mongo.java:444) ~[?:?]
    at
org.apache.jackrabbit.oak.plugins.document.util.MongoConnection.getDefaultWriteConcern(MongoConnection.java:177)
~[?:?]
    at
org.apache.jackrabbit.oak.plugins.document.mongo.MongoDocumentNodeStoreBuilderBase.setMongoDB(MongoDocumentNodeStoreBuilderBase.java:83)
~[?:?]
    at
org.apache.jackrabbit.oak.plugins.document.DocumentNodeStoreService.registerNodeStore(DocumentNodeStoreService.java:297)
~[?:?]
    at
org.apache.jackrabbit.oak.plugins.document.DocumentNodeStoreService.registerNodeStoreIfPossible(DocumentNodeStoreService.java:252)
~[?:?]
    at
org.apache.jackrabbit.oak.plugins.document.DocumentNodeStoreService.activate(DocumentNodeStoreService.java:236)
~[?:?]
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?]
    at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
~[?:?]
    at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
~[?:?]
    at java.lang.reflect.Method.invoke(Method.java:498) ~[?:?]
    at
org.apache.felix.scr.impl.inject.BaseMethod.invokeMethod(BaseMethod.java:229)
~[48:org.apache.felix.scr:2.0.14]
    at
org.apache.felix.scr.impl.inject.BaseMethod.access$500(BaseMethod.java:39)
~[48:org.apache.felix.scr:2.0.14]
    at
org.apache.felix.scr.impl.inject.BaseMethod$Resolved.invoke(BaseMethod.java:650)
~[48:org.apache.felix.scr:2.0.14]
    at
org.apache.felix.scr.impl.inject.BaseMethod.invoke(BaseMethod.java:506)
[48:org.apache.felix.scr:2.0.14]
    at
org.apache.felix.scr.impl.inject.ActivateMethod.invoke(ActivateMethod.java:307)
[48:org.apache.felix.scr:2.0.14]
    at
org.apache.felix.scr.impl.inject.ActivateMethod.invoke(ActivateMethod.java:299)
[48:org.apache.felix.scr:2.0.14]
    at
org.apache.felix.scr.impl.manager.SingleComponentManager.createImplementationObject(SingleComponentManager.java:298)
[48:org.apache.felix.scr:2.0.14]
    at
org.apache.felix.scr.impl.manager.SingleComponentManager.createComponent(SingleComponentManager.java:109)
[48:org.apache.felix.scr:2.0.14]
    at
org.apache.felix.scr.impl.manager.SingleComponentManager.getService(SingleComponentManager.java:907)
[48:org.apache.felix.scr:2.0.14]
    at
org.apache.felix.scr.impl.manager.SingleComponentManager.getServiceInternal(SingleComponentManager.java:880)
[48:org.apache.felix.scr:2.0.14]
    at
org.apache.felix.scr.impl.manager.AbstractComponentManager.activateInternal(AbstractComponentManager.java:764)
[48:org.apache.felix.scr:2.0.14]
    at
org.apache.felix.scr.impl.manager.AbstractComponentManager.enableInternal(AbstractComponentManager.java:675)
[48:org.apache.felix.scr:2.0.14]
    at
org.apache.felix.scr.impl.manager.AbstractComponentManager.enable(AbstractComponentManager.java:430)
[48:org.apache.felix.scr:2.0.14]
    at
org.apache.felix.scr.impl.manager.ConfigurableComponentHolder.enableComponents(ConfigurableComponentHolder.java:657)
[48:org.apache.felix.scr:2.0.14]
    at
org.apache.felix.scr.impl.BundleComponentActivator.initialEnable(BundleComponentActivator.java:341)
[48:org.apache.felix.scr:2.0.14]
    at
org.apache.felix.scr.impl.Activator.loadComponents(Activator.java:387)
[48:org.apache.felix.scr:2.0.14]
    at org.apache.felix.scr.impl.Activator.access$200(Activator.java:52)
[48:org.apache.felix.scr:2.0.14]
    at
org.apache.felix.scr.impl.Activator$ScrExtension.start(Activator.java:262)
[48:org.apache.felix.scr:2.0.14]
    at
org.apache.felix.scr.impl.AbstractExtender.createExtension(AbstractExtender.java:196)
[48:org.apache.felix.scr:2.0.14]
    at
org.apache.felix.scr.impl.AbstractExtender.modifiedBundle(AbstractExtender.java:169)
[48:org.apache.felix.scr:2.0.14]
    at
org.apache.felix.scr.impl.AbstractExtender.modifiedBundle(AbstractExtender.java:49)
[48:org.apache.felix.scr:2.0.14]
    at
org.osgi.util.tracker.BundleTracker$Tracked.customizerModified(BundleTracker.java:482)
[?:?]
    at
org.osgi.util.tracker.BundleTracker$Tracked.customizerModified(BundleTracker.java:415)
[?:?]
    at
org.osgi.util.tracker.AbstractTracked.track(AbstractTracked.java:232) [?:?]
    at
org.osgi.util.tracker.BundleTracker$Tracked.bundleChanged(BundleTracker.java:444)
[?:?]
    at
org.apache.felix.framework.EventDispatcher.invokeBundleListenerCallback(EventDispatcher.java:915)
[?:?]
    at
org.apache.felix.framework.EventDispatcher.fireEventImmediately(EventDispatcher.java:834)
[?:?]
    at
org.apache.felix.framework.EventDispatcher.fireBundleEvent(EventDispatcher.java:516)
[?:?]
    at org.apache.felix.framework.Felix.fireBundleEvent(Felix.java:4579)
[?:?]
    at org.apache.felix.framework.Felix.startBundle(Felix.java:2174) [?:?]
    at
org.apache.felix.framework.Felix.setActiveStartLevel(Felix.java:1373) [?:?]
    at
org.apache.felix.framework.FrameworkStartLevelImpl.run(FrameworkStartLevelImpl.java:308)
[?:?]
    at java.lang.Thread.run(Thread.java:748) [?:?]




Re: help with Sling with mongo with authentification

Posted by Eugen Stan <ie...@netdava.com>.
Thank you Robert. That worked. I was mislead by the name and did not pay
attention to the "ResourceProvider" suffix.

I have another issue now but will write in another email.

On 10.08.2018 14:49, Robert Munteanu wrote:
> Hi Eugen,
>
> On Fri, 2018-08-10 at 09:24 +0300, Eugen Stan wrote:
>> Hello,
>>
>> I'm trying to deploy Sling with Mongo back-end with authentication
>> and
>> non default connection settings.
>>
>> [1] https://docs.mongodb.com/manual/tutorial/enable-authentication/
>>
>> I've updated the configuration for Sling/Mongo:
>>
>> org.apache.sling.nosql.mongodb.resourceprovider.MongoDBNoSqlResourceP
>> roviderFactory.factory.config-default.cfg
>>
>> provider.roots = [ \
>>   "/", \
>>   ]
>> connectionString="10.20.0.1:27017"
>> database="my-sling"
>> collection="resources"
>> org.apache.karaf.features.configKey =
>> "org.apache.sling.nosql.mongodb.resourceprovider.MongoDBNoSqlResource
>> ProviderFactory.factory.config-default"
> You're configuring the NoSQL MongoDB Resource Provider, which is not
> the same as the Oak NodeStore implementation :-)
>
> The connection details for MongoDB are described at 
>
> https://helpx.adobe.com/experience-manager/6-3/sites/deploying/using/data-store-config.html#DocumentNodeStore
>
> Hope this helps,
>
> Robert
>



Re: help with Sling with mongo with authentification

Posted by Robert Munteanu <ro...@apache.org>.
Hi Eugen,

On Fri, 2018-08-10 at 09:24 +0300, Eugen Stan wrote:
> Hello,
> 
> I'm trying to deploy Sling with Mongo back-end with authentication
> and
> non default connection settings.
> 
> [1] https://docs.mongodb.com/manual/tutorial/enable-authentication/
> 
> I've updated the configuration for Sling/Mongo:
> 
> org.apache.sling.nosql.mongodb.resourceprovider.MongoDBNoSqlResourceP
> roviderFactory.factory.config-default.cfg
> 
> provider.roots = [ \
>   "/", \
>   ]
> connectionString="10.20.0.1:27017"
> database="my-sling"
> collection="resources"
> org.apache.karaf.features.configKey =
> "org.apache.sling.nosql.mongodb.resourceprovider.MongoDBNoSqlResource
> ProviderFactory.factory.config-default"

You're configuring the NoSQL MongoDB Resource Provider, which is not
the same as the Oak NodeStore implementation :-)

The connection details for MongoDB are described at 

https://helpx.adobe.com/experience-manager/6-3/sites/deploying/using/data-store-config.html#DocumentNodeStore

Hope this helps,

Robert