Unable to connect to a Stardog db

2 views
Skip to first unread message

Stéphane Campinas

unread,
Apr 15, 2014, 8:20:00 AM4/15/14
to sta...@clarkparsia.com
Hi,

I have created a database using the command at [1]. I am able to access the web interface of the created database at [2] and also send some simple queries.
However, I am unable to connect to the Stardog database using sesame. I provide the name of the database and credentials, but all I get is the exception:

Caused by: org.openrdf.repository.RepositoryException: Unable to obtain a connection to the Stardog database.  The configuration could be incorrect or the database not available.
        at com.complexible.stardog.sesame.StardogRepository.getConnection(StardogRepository.java:97)
        at com.complexible.stardog.sesame.StardogRepository.getConnection(StardogRepository.java:29)
        at org.sindice.core.sesame.backend.AbstractSesameBackend.initConnection(AbstractSesameBackend.java:175)
        ... 5 more

Can you advise me on what I did wrong ?

Thanks,

[1] http://docs.stardog.com/quick-start/
[2] http://localhost:5820/db

Evren Sirin

unread,
Apr 15, 2014, 10:01:01 AM4/15/14
to Stardog
How are you creating the connection configuration passed to the
StardogRepository? Are you providing the server address in addition to
the name of the database and credentials as in:

new StardogRepository(ConnectionConfiguration.to("testDB").server("snarl://localhost:5820").credentials("admin",
"admin"));

Best,
Evren
> --
> -- --
> You received this message because you are subscribed to the C&P "Stardog"
> group.
> To post to this group, send email to sta...@clarkparsia.com
> To unsubscribe from this group, send email to
> stardog+u...@clarkparsia.com
> For more options, visit this group at
> http://groups.google.com/a/clarkparsia.com/group/stardog?hl=en

Stéphane Campinas

unread,
Apr 16, 2014, 6:37:25 AM4/16/14
to sta...@clarkparsia.com
I am creating the StardogRepository in the way you mentioned. However, I have now the following errors coming from Guice (I am not sure if I had them before, I may have overlooked them since I only checked the bottom of my logs).
I read in https://groups.google.com/a/clarkparsia.com/d/msg/stardog/Vpo7wTIvlj8/U7Ip2BCEOG8J that it could be due to a corrupted database. I have therefore dropped and created a new one. However, I got that exception below. Also, the problem in that thread was because the server had crashed for that person, but this is not the case for me.

Thanks for your help,

com.google.inject.ProvisionException: Guice provision errors:

1) Error injecting constructor, java.lang.NoSuchMethodError: com.google.common.collect.Range.closed(Ljava/lang/Comparable;Ljav
a/lang/Comparable;)Lcom/google/common/collect/Range;
  at com.complexible.stardog.protocols.snarl.SNARLThrowableCodec.<init>(SNARLThrowableCodec.java:48)
  while locating com.complexible.stardog.protocols.snarl.SNARLThrowableCodec
  while locating com.complexible.barc.ThrowableCodec annotated with @com.google.inject.multibindings.Element(setName=,uniqueId
=9)
  at com.complexible.stardog.protocols.snarl.SNARLProtocolModule.configure(SNARLProtocolModule.java:32)
  while locating java.util.Set<com.complexible.barc.ThrowableCodec>
    for parameter 2 at com.complexible.barc.BigPacketCodec.<init>(BigPacketCodec.java:46)
  while locating com.complexible.barc.BigPacketCodec
  while locating com.complexible.barc.PacketCodec annotated with @com.google.inject.multibindings.Element(setName=,uniqueId=2)
  at com.complexible.stardog.protocols.snarl.admin.SNARLAdminModule.configure(SNARLAdminModule.java:31)
  while locating java.util.Set<com.complexible.barc.PacketCodec>
    for field at com.complexible.common.inject.OptionalConstructorParam.value(OptionalConstructorParam.java:42)
  while locating com.complexible.common.inject.OptionalConstructorParam<java.util.Set<com.complexible.barc.PacketCodec>>
    for parameter 1 at com.complexible.barc.BigPacketDecoder.<init>(BigPacketDecoder.java:49)
  while locating com.complexible.barc.BigPacketDecoder
Caused by: java.lang.NoSuchMethodError: com.google.common.collect.Range.closed(Ljava/lang/Comparable;Ljava/lang/Comparable;)Lc
om/google/common/collect/Range;
        at com.complexible.stardog.protocols.snarl.SNARLThrowableCodec.<init>(SNARLThrowableCodec.java:93)
        at com.complexible.stardog.protocols.snarl.SNARLThrowableCodec$$FastClassByGuice$$482b7618.newInstance(<generated>)
        at com.google.inject.internal.cglib.reflect.$FastConstructor.newInstance(FastConstructor.java:40)
        at com.google.inject.internal.DefaultConstructionProxyFactory$1.newInstance(DefaultConstructionProxyFactory.java:60)
        at com.google.inject.internal.ConstructorInjector.construct(ConstructorInjector.java:85)
        at com.google.inject.internal.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:254)
        at com.google.inject.internal.FactoryProxy.get(FactoryProxy.java:54)
        at com.google.inject.internal.InjectorImpl$4$1.call(InjectorImpl.java:978)
        at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1031)
        at com.google.inject.internal.InjectorImpl$4.get(InjectorImpl.java:974)
        at com.google.inject.multibindings.Multibinder$RealMultibinder.get(Multibinder.java:326)
        at com.google.inject.multibindings.Multibinder$RealMultibinder.get(Multibinder.java:220)
        at com.google.inject.internal.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:40)
        at com.google.inject.internal.SingleParameterInjector.inject(SingleParameterInjector.java:38)
        at com.google.inject.internal.SingleParameterInjector.getAll(SingleParameterInjector.java:62)
        at com.google.inject.internal.ConstructorInjector.construct(ConstructorInjector.java:84)
        at com.google.inject.internal.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:254)
        at com.google.inject.internal.FactoryProxy.get(FactoryProxy.java:54)
        at com.google.inject.internal.InjectorImpl$4$1.call(InjectorImpl.java:978)
        at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1031)
        at com.google.inject.internal.InjectorImpl$4.get(InjectorImpl.java:974)
        at com.google.inject.multibindings.Multibinder$RealMultibinder.get(Multibinder.java:326)
        at com.google.inject.multibindings.Multibinder$RealMultibinder.get(Multibinder.java:220)
        at com.google.inject.internal.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:40)
        at com.google.inject.internal.SingleFieldInjector.inject(SingleFieldInjector.java:53)
        at com.google.inject.internal.MembersInjectorImpl.injectMembers(MembersInjectorImpl.java:110)
        at com.google.inject.internal.ConstructorInjector.construct(ConstructorInjector.java:94)
        at com.google.inject.internal.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:254)
        at com.google.inject.internal.SingleParameterInjector.inject(SingleParameterInjector.java:38)
        at com.google.inject.internal.SingleParameterInjector.getAll(SingleParameterInjector.java:62)
        at com.google.inject.internal.ConstructorInjector.construct(ConstructorInjector.java:84)
        at com.google.inject.internal.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:254)
        at com.google.inject.internal.InjectorImpl$4$1.call(InjectorImpl.java:978)
        at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1024)
        at com.google.inject.internal.InjectorImpl$4.get(InjectorImpl.java:974)
        at com.complexible.stardog.protocols.snarl.client.SNARLClientProtocol.apply(SNARLClientProtocol.java:59)
        at com.complexible.common.protocols.client.rpc.DefaultRPCClient$2.initChannel(DefaultRPCClient.java:164)
        at io.netty.channel.ChannelInitializer.channelRegistered(ChannelInitializer.java:69)
        at io.netty.channel.DefaultChannelHandlerContext.invokeChannelRegistered(DefaultChannelHandlerContext.java:165)
        at io.netty.channel.DefaultChannelHandlerContext.fireChannelRegistered(DefaultChannelHandlerContext.java:151)
        at io.netty.channel.DefaultChannelPipeline.fireChannelRegistered(DefaultChannelPipeline.java:730)
        at io.netty.channel.AbstractChannel$AbstractUnsafe.register0(AbstractChannel.java:442)
        at io.netty.channel.AbstractChannel$AbstractUnsafe.access$100(AbstractChannel.java:374)
        at io.netty.channel.AbstractChannel$AbstractUnsafe$1.run(AbstractChannel.java:418)
        at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:354)
        at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:353)
        at io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:101)
        at java.lang.Thread.run(Thread.java:662)

Evren Sirin

unread,
Apr 16, 2014, 8:38:57 AM4/16/14
to Stardog
The cause of the exception in your stack trace is
java.lang.NoSuchMethodError: com.google.common.collect.Range.closed
which indicates a mismatch in Guava jar. The mentioned function was
added to Guava in version 14.0 and Stardog is shipped with version
15.0 but it looks like you have an older version in your classpath
form another source.

Best,
Evren

On Wed, Apr 16, 2014 at 6:37 AM, Stéphane Campinas

Stéphane Campinas

unread,
Apr 16, 2014, 12:32:48 PM4/16/14
to sta...@clarkparsia.com
You got it right. Thanks for pointing this out.

ant...@gmail.com

unread,
Apr 16, 2015, 12:28:53 PM4/16/15
to sta...@clarkparsia.com
Do you found any solution?

ant...@gmail.com

unread,
Apr 16, 2015, 2:03:50 PM4/16/15
to sta...@clarkparsia.com, ant...@gmail.com
Solution on Glassfish:

Put yours stardog libraries(stardog,guava,guise, etc) inside the glassfish_installation/domains/your_domain/lib/ext directory, coz this libs are loaded before the glassfish libs.


Regards. 
Reply all
Reply to author
Forward
0 new messages