ReasoningConnection General Exception

13 views
Skip to first unread message

rcta...@gmail.com

unread,
Jul 22, 2016, 10:38:13 AM7/22/16
to Stardog
Hello!

I am trying to take a Connection (in Java) and turn it into a ReasoningConnection to check isConsistent. The Connection works fine on its own, and then I use:
ReasoningConnection reasoning = conn.as(ReasoningConnection.class);

And it returns the following:
General Exception : Could not find an appropriate view implementation of this connection for 'com.complexible.stardog.api.reasoning.ReasoningConnection'

I saw there was a topic on this some time ago, but I couldn't really solve my problem based on their solution. I have the jar in my library and I am able to import com.complexible.stardog.api.reasoning.ReasoningConnection with no warnings... so I'm not quite sure where this is coming from. Maybe I'm doing something silly.

Thanks!

Michael Grove

unread,
Jul 22, 2016, 10:42:02 AM7/22/16
to stardog
On Fri, Jul 22, 2016 at 10:38 AM, <rcta...@gmail.com> wrote:
> Hello!
>
> I am trying to take a Connection (in Java) and turn it into a
> ReasoningConnection to check isConsistent. The Connection works fine on its
> own, and then I use:
> ReasoningConnection reasoning = conn.as(ReasoningConnection.class);
>
> And it returns the following:
> General Exception : Could not find an appropriate view implementation of
> this connection for
> 'com.complexible.stardog.api.reasoning.ReasoningConnection'

This indicates you're missing jar files from your classpath. You have
to include a protocol implementation, either http or snarl. If you're
not using something like maven or gradle to resolve your dependencies,
I strongly suggest you begin doing so, you'll avoid issues like this
in the future.

Cheers,

Mike

>
> I saw there was a topic on this some time ago, but I couldn't really solve
> my problem based on their solution. I have the jar in my library and I am
> able to import com.complexible.stardog.api.reasoning.ReasoningConnection
> with no warnings... so I'm not quite sure where this is coming from. Maybe
> I'm doing something silly.
>
> Thanks!
>
> --
> -- --
> 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

rcta...@gmail.com

unread,
Jul 22, 2016, 10:45:15 AM7/22/16
to Stardog
Thank you for the fast response!

I'm using gradle and I've got the following related dependencies:

    compile "com.complexible.stardog:client-http:$stardogVersion"
    compile
"com.complexible.stardog:client-snarl:$stardogVersion"
    compile
"com.complexible.stardog:server:$stardogVersion"
    compile fileTree
(dir: "lib-stardog", include: "*.jar")

where lib-stardog includes the stardog-spring jar. Is there another dependency that should be included?

Michael Grove

unread,
Jul 22, 2016, 10:53:05 AM7/22/16
to stardog
On Fri, Jul 22, 2016 at 10:45 AM, <rcta...@gmail.com> wrote:
> Thank you for the fast response!
>
> I'm using gradle and I've got the following related dependencies:
>
> compile "com.complexible.stardog:client-http:$stardogVersion"
> compile "com.complexible.stardog:client-snarl:$stardogVersion"
> compile "com.complexible.stardog:server:$stardogVersion"
> compile fileTree(dir: "lib-stardog", include: "*.jar")
>
> where lib-stardog includes the stardog-spring jar. Is there another
> dependency that should be included?

That looks about right, but the docs for this are at [1].

If you're using the http protocol, for example, you should see
stardog-reasoning-protocols-http-client-VERSION.jar in your classpath,
that contains the class that you need.

Cheers,

Mike

[1] http://docs.stardog.com/#_using_maven

rcta...@gmail.com

unread,
Jul 22, 2016, 10:59:36 AM7/22/16
to Stardog
Hmm, I've got stardog-reasoning-protocols-http-client-3.1.4.jar and stardog-reasoning-protocols-snarl-client-3.1.4.jar, though I'm only using snarl so I suppose I don't really need the http-client one... But, they're in my build path (Eclipse).
Reply all
Reply to author
Forward
0 new messages