Problem with StardocsConnection (view implementation)

0 views
Skip to first unread message

Becky Tauber

unread,
Nov 3, 2016, 12:29:55 PM11/3/16
to Stardog

When trying to create a StardocsConnection, I hit the following message:


General Exception : Could not find an appropriate view implementation of this connection for 'com.complexible.stardog.docs.StardocsConnection’.


I’m 99.99% sure that I have all the jars imported. I checked out the topic on the similar issue with ReasoningConnection, and it looked like it was solved by importing all the jars. I tried adding the jars in my gradle build file, and I also tried downloading the jars and manually adding them to my build path.


Here's what's in my code:


StardocsConnection sConn = ConnectionConfiguration

    .to(dbTitle)

    .server(stardogServer)

    .credentials(stardogUser, stardogPw)

    .connect()

    .as(StardocsConnection.class);


I use an admin connection beforehand to create the database, which is done successfully - so I am connecting to the server. It fails when it gets to the StardocsConnection.


I also tried doing the StardocsConnection this way (below) and got the same issue. I've successfully used this method to create a ReasoningConnection. Again, the database is created, but it fails when it gets to .as(StardocsConnection.class).


StardocsConnection sConn = (admin.memory(dbTitle).connect())

    .as(StardocsConnection.class);

Jess Balint

unread,
Nov 3, 2016, 12:56:52 PM11/3/16
to sta...@clarkparsia.com
Are you using an HTTP connection? You need the following jars from the client/http directory:

stardog-stardocs-api-4.2.jar
stardog-stardocs-protocols-http-client-4.2.jar
stardog-stardocs-protocols-http-shared-4.2.jar
stardog-stardocs-shared-4.2.jar

Jess

--
-- --
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+unsubscribe@clarkparsia.com
For more options, visit this group at
http://groups.google.com/a/clarkparsia.com/group/stardog?hl=en

Becky Tauber

unread,
Nov 3, 2016, 1:09:49 PM11/3/16
to Stardog
Yes, and I just double checked that those 4 are included.

Jess Balint

unread,
Nov 3, 2016, 1:47:23 PM11/3/16
to sta...@clarkparsia.com
Hi Becky,

Please try to run this trivial example. You will need to change the references to $STARDOG to point to your Stardog installation directory. You will need to change the database (what you call dbTitle) and server name (what you call stardogServer) in the connection configuration to point to your installation.


Best,
Jess

Becky Tauber

unread,
Nov 3, 2016, 3:02:20 PM11/3/16
to Stardog
Hi again -

I tried to run just that example and got the same error. The normal Connection was fine again.

Thanks
- Becky

Jess Balint

unread,
Nov 3, 2016, 3:50:50 PM11/3/16
to sta...@clarkparsia.com
Can you show the output of: echo $CLASSPATH?

Jess

Becky Tauber

unread,
Nov 3, 2016, 9:14:01 PM11/3/16
to Stardog
I don't have the CLASSPATH set in my .bash_profile but I'm using Eclipse. I'm using gradle build and have the following compiled in my dependencies:

    compile "com.complexible.stardog:client-http:$stardogVersion"

    compile "com.complexible.stardog:server:$stardogVersion"


I also tried adding the jars that you specified manually to my build path in Eclipse from the Stardog files I have downloaded. I'm using Spring so I also have stardog-spring-4.1.jar added as so:

    compile fileTree(dir: "lib-stardog", include: "*.jar")

Jess Balint

unread,
Nov 3, 2016, 9:15:06 PM11/3/16
to sta...@clarkparsia.com
Becky,

BITES is available starting in Stardog version 4.2. Is this the version you are using?

Jess

Becky Tauber

unread,
Nov 3, 2016, 9:30:41 PM11/3/16
to Stardog
So it looks like I had 4.1~. I changed the version to 4.2, then cleaned and did a build. Upon running it again, I got the same 'view implementation' exception.

Thanks
- Becky

Jess Balint

unread,
Nov 4, 2016, 11:17:49 AM11/4/16
to sta...@clarkparsia.com
Hi Becky,

It looks like the BITES dependency was missing from the "com.complexible.stardog:client-http:4.2" module. I fixed this in our Maven repository. If you clear your Gradle Maven cache and rerun your Gradle build, you should be good to go.

Jess

Becky Tauber

unread,
Nov 4, 2016, 11:51:42 AM11/4/16
to Stardog
Thank you!

Is it still version 4.2? I cleared everything and re-ran build but still got the same error when I tried to run the app.

- Becky

Jess Balint

unread,
Nov 4, 2016, 11:54:33 AM11/4/16
to sta...@clarkparsia.com
It is still version 4.2. Here is the command I ran on my system to clear the caches:

rm -rf ~/.gradle/caches/modules-2/files-2.1/com.complexible.stardog/client-http/4.2 ~/.gradle/caches/modules-2/metadata-2.21/descriptors/com.complexible.stardog/client-http/4.2

I'm not sure if the paths will be exactly the same for you, but you can search for the "client-http/4.2" directories and remove the contents.

Jess


Becky Tauber

unread,
Nov 4, 2016, 1:46:40 PM11/4/16
to Stardog
It worked, thanks! I thought it was enough to run gradle clean & gradle build but I wasn't thinking that it was the same version. As soon as I deleted the files and built it, it was fine.

- Becky

Jess Balint

unread,
Nov 4, 2016, 5:13:26 PM11/4/16
to sta...@clarkparsia.com
Glad it's working Becky. Please let us know if you have any further questions or feedback regarding BITES.
Best,
Jess

Becky Tauber

unread,
Nov 8, 2016, 1:33:57 PM11/8/16
to Stardog
Hey again Jess,

So the StardocsConnection was working great on Friday, but for some reason it's back to those same errors again. I performed the same steps to clear the caches and then downloaded the jars through a gradle build again (4.2), just in case something got mixed up.

I didn't change anything in my code so I'm not sure what would have caused this.

Thanks for your help!
Becky

Jess Balint

unread,
Nov 8, 2016, 1:38:43 PM11/8/16
to sta...@clarkparsia.com
Are you running your application through Gradle?

Jess

Becky Tauber

unread,
Nov 8, 2016, 1:52:14 PM11/8/16
to Stardog
Eclipse with Buildship Gradle Integration plug in (Gradle project). I'm using Spring as well, not sure if that matters as far as this goes.
Reply all
Reply to author
Forward
0 new messages