More frequent StardogException "There is no session with id ..."

2 views
Skip to first unread message

Håvard Ottestad

unread,
Dec 12, 2016, 5:11:56 AM12/12/16
to Stardog
Hi,

I'm getting this exception more frequently in our tests that run against an embedded stardog (in-memory). Anything to worry about?

org.openrdf.repository.RepositoryException: com.complexible.stardog.StardogException: There is no session with id [74b877d8-1c07-48b6-8056-170697b24a4c]


        at com.complexible.stardog.sesame.StardogRepositoryConnection.begin(StardogRepositoryConnection.java:148)


        at no.difi.einnsyn.stardog.StardogService.uploadAndReplace(StardogService.java:507)


        at no.difi.einnsyn.stardog.StardogService.uploadOntology(StardogService.java:502)


        at no.difi.einnsyn.stardog.StardogService.populateWithInitialData(StardogService.java:159)


        at no.difi.einnsyn.stardog.AbstractStardogServiceTest.createDatabase(AbstractStardogServiceTest.java:139)


        at no.difi.einnsyn.stardog.AbstractStardogServiceTest.setUp(AbstractStardogServiceTest.java:92)


        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.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)


        at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)


        at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)


        at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:24)


        at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)


        at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)


        at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)


        at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)


        at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)


        at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)


        at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)


        at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)


        at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)


        at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)


        at org.junit.runners.ParentRunner.run(ParentRunner.java:363)


        at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:252)


        at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:141)


        at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:112)


        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.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:189)


        at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:165)


        at org.apache.maven.surefire.booter.ProviderFactory.invokeProvider(ProviderFactory.java:85)


        at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:115)


        at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:75)


Caused by: com.complexible.stardog.StardogException: There is no session with id [74b877d8-1c07-48b6-8056-170697b24a4c]


        at com.complexible.stardog.protocols.client.SPECClientUtil.toStardogException(SPECClientUtil.java:86)


        at com.complexible.stardog.protocols.client.SPECClientUtil.toStardogException(SPECClientUtil.java:34)


        at com.complexible.stardog.api.impl.SPECConnection._begin(SPECConnection.java:236)


        at com.complexible.stardog.api.impl.AbstractConnection.begin(AbstractConnection.java:165)


        at com.complexible.stardog.api.impl.DelegatingConnection.begin(DelegatingConnection.java:95)


        at com.complexible.stardog.api.impl.DelegatingConnection.begin(DelegatingConnection.java:95)


        at com.complexible.stardog.sesame.StardogRepositoryConnection.begin(StardogRepositoryConnection.java:140)


        ... 36 more


Caused by: com.complexible.common.protocols.client.ClientException: There is no session with id [74b877d8-1c07-48b6-8056-170697b24a4c]


        at com.complexible.common.protocols.client.rpc.DefaultRPCClient.get(DefaultRPCClient.java:278)


        at com.complexible.common.protocols.client.rpc.DefaultRPCClient.execute(DefaultRPCClient.java:254)


        at com.complexible.stardog.protocols.snarl.client.AbstractSNARLClient.begin(AbstractSNARLClient.java:384)


        at com.complexible.stardog.protocols.snarl.client.AbstractSNARLClient.begin(AbstractSNARLClient.java:61)


        at com.complexible.stardog.api.impl.SPECConnection._begin(SPECConnection.java:233)


        ... 40 more


Caused by: org.apache.shiro.session.UnknownSessionException: There is no session with id [74b877d8-1c07-48b6-8056-170697b24a4c]


        at org.apache.shiro.session.mgt.eis.AbstractSessionDAO.readSession(AbstractSessionDAO.java:170)


        at org.apache.shiro.session.mgt.DefaultSessionManager.retrieveSessionFromDataSource(DefaultSessionManager.java:236)


        at org.apache.shiro.session.mgt.DefaultSessionManager.retrieveSession(DefaultSessionManager.java:222)


        at org.apache.shiro.session.mgt.AbstractValidatingSessionManager.doGetSession(AbstractValidatingSessionManager.java:118)


        at org.apache.shiro.session.mgt.AbstractNativeSessionManager.lookupSession(AbstractNativeSessionManager.java:108)


        at org.apache.shiro.session.mgt.AbstractNativeSessionManager.lookupRequiredSession(AbstractNativeSessionManager.java:112)


        at org.apache.shiro.session.mgt.AbstractNativeSessionManager.getAttribute(AbstractNativeSessionManager.java:209)


        at org.apache.shiro.session.mgt.DelegatingSession.getAttribute(DelegatingSession.java:141)


        at org.apache.shiro.session.ProxiedSession.getAttribute(ProxiedSession.java:121)


        at org.apache.shiro.session.ProxiedSession.getAttribute(ProxiedSession.java:121)


        at org.apache.shiro.subject.support.DelegatingSubject.getRunAsPrincipalsStack(DelegatingSubject.java:469)


        at org.apache.shiro.subject.support.DelegatingSubject.getPrincipals(DelegatingSubject.java:153)


        at org.apache.shiro.mgt.DefaultSecurityManager.logout(DefaultSecurityManager.java:547)


        at org.apache.shiro.subject.support.DelegatingSubject.logout(DelegatingSubject.java:363)


        at com.complexible.stardog.StardogKernel.logout(StardogKernel.java:1742)


        at com.complexible.stardog.StardogKernel.lambda$getConnection$0(StardogKernel.java:822)


        at com.complexible.stardog.db.DatabaseImpl$DBConnectionWrapper.close(DatabaseImpl.java:1553)


        at com.complexible.stardog.StardogKernel.finishConnection(StardogKernel.java:756)


        at com.complexible.stardog.StardogKernel.access$400(StardogKernel.java:211)


        at com.complexible.stardog.StardogKernel$KernelDbConnection.close(StardogKernel.java:2740)


        at com.complexible.stardog.db.DelegatingDatabaseConnection.close(DelegatingDatabaseConnection.java:154)


        at com.complexible.stardog.StardogKernel$NotifyingDatabaseConnection.close(StardogKernel.java:3018)


        at com.complexible.stardog.protocols.server.KernelServerFunction.closeAndLogout(KernelServerFunction.java:110)


        at com.complexible.stardog.protocols.server.SPECServerFunction.close(SPECServerFunction.java:222)


        at com.complexible.stardog.protocols.server.SPECServerFunction.rollbackTx(SPECServerFunction.java:419)


        at com.complexible.stardog.protocols.server.SPECServerFunction.handleMessage(SPECServerFunction.java:164)


        at com.complexible.common.protocols.server.rpc.ServerHandler.lambda$handleMessage$1(ServerHandler.java:336)


        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)


        at java.util.concurrent.FutureTask.run(FutureTask.java:266)


        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)


        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)


        at java.lang.Thread.run(Thread.java:745)




Michael Grove

unread,
Dec 12, 2016, 9:31:19 AM12/12/16
to stardog
What's your test case doing that you're seeing these exceptions?

Cheers,

Mike

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

Håvard Ottestad

unread,
Dec 12, 2016, 9:56:41 AM12/12/16
to Stardog
public void uploadAndReplace(InputStream data, IRI namedGraph, RDFFormat format) throws IOException {
   
try (RepositoryConnection connection = repository.getConnection()) {
        connection
.begin();
        connection
.clear(namedGraph);
        connection
.add(data, "", format, namedGraph);
        connection
.commit();
   
}
}



Just clearing a graph, then uploading a stream of data into that same graph. That's essentially it. Most of the time it works, sometimes I get the exception above. The exception is on connection.begin().

Before every test we have an @Before method which drops the database, recreates it. I'm thinking maybe this is the problem, since I don't reconnect the repository after I do that.

Michael Grove

unread,
Dec 12, 2016, 11:14:13 AM12/12/16
to stardog
At a glance, it seems like maybe it's a connection management problem somewhere. We have similar code in our test suite for the Sesame integration, but we're not seeing these type of messages. We're creating a new `StardogRepository` for each test around a common `ConnectionConfiguration`.

Cheers,

Mike
Reply all
Reply to author
Forward
0 new messages