stardog connection to server using java

28 views
Skip to first unread message

Cong Wang

unread,
Feb 4, 2015, 1:09:15 PM2/4/15
to sta...@clarkparsia.com
Hi, 

It seems the newest version of stardog isn't compatible with the manual. I was trying to connect server in java, but failed.

" String aServerUrl = "http://localhost:5820";
  Connection aConn = ConnectionConfiguration.to("myDB").server(aServerUrl).credentials("admin", "admin").connect();"

By doing above, it returns error with 

"Exception in thread "main" com.complexible.stardog.StardogException: No driver was found which supports the connection string: 'http://localhost:5820/myDB', please double-check the URL and verify the protocol is correct and try again."

I am very sure I have started the server from command line and the store name is correct. 

Then, i tried to start server in java directly (of course i stopped the server already)

By doing, "Server aServer = Stardog.buildServer().bind(SNARLProtocol.EMBEDDED_ADDRESS).start();",  however the newest version doesn't contain stardog class at all, it was in com.complexible.stardog. 

So, any suggestion? how should I do with the newest stardog? 

Any helps are appreciated.


Mike Grove

unread,
Feb 4, 2015, 2:13:59 PM2/4/15
to stardog
On Wed, Feb 4, 2015 at 1:09 PM, Cong Wang <joshu...@gmail.com> wrote:
Hi, 

It seems the newest version of stardog isn't compatible with the manual. I was trying to connect server in java, but failed.

" String aServerUrl = "http://localhost:5820";
  Connection aConn = ConnectionConfiguration.to("myDB").server(aServerUrl).credentials("admin", "admin").connect();"

By doing above, it returns error with 

"Exception in thread "main" com.complexible.stardog.StardogException: No driver was found which supports the connection string: 'http://localhost:5820/myDB', please double-check the URL and verify the protocol is correct and try again."

That indicates you're missing the jar files which contain the implementation of the HTTP protocol.  You should double check your classpath to verify that you've included them.
 

I am very sure I have started the server from command line and the store name is correct. 

Then, i tried to start server in java directly (of course i stopped the server already)

By doing, "Server aServer = Stardog.buildServer().bind(SNARLProtocol.EMBEDDED_ADDRESS).start();",  however the newest version doesn't contain stardog class at all, it was in com.complexible.stardog. 

Again, this sounds like you're missing jar files in your classpath; the Stardog class is present in all recent versions of Stardog.

Cheers,

Mike
 

So, any suggestion? how should I do with the newest stardog? 

Any helps are appreciated.


--
-- --
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

Cong Wang

unread,
Feb 5, 2015, 1:13:57 PM2/5/15
to sta...@clarkparsia.com
Hi Mike,

I had figured it out. Thanks. 

One more question, after i load about 2 million triples and run some test sparql queries, my RAM is used about 2.3g. Is there anyway to flush these cache when i don't need to query, but still need open the server. 

Thanks. 

To unsubscribe from this group and stop receiving emails from it, send an email to stardog+u...@clarkparsia.com.



--
Cong Wang
Ph.D Candidate,
Kno.e.sis Center,
Wright State University.

Mike Grove

unread,
Feb 5, 2015, 1:15:17 PM2/5/15
to stardog
On Thu, Feb 5, 2015 at 1:13 PM, Cong Wang <joshu...@gmail.com> wrote:
Hi Mike,

I had figured it out. Thanks. 

One more question, after i load about 2 million triples and run some test sparql queries, my RAM is used about 2.3g. Is there anyway to flush these cache when i don't need to query, but still need open the server. 

Thanks. 

We start the JVM with 2G by default, you can reduce that number if you need to.

Cheers,

Mike
Reply all
Reply to author
Forward
0 new messages