java.lang.IllegalStateException at org.daisy.pipeline.persistence.Database.addObject(Database.java:20)

126 views
Skip to first unread message

Jostein Austvik Jacobsen

unread,
Jun 26, 2012, 10:20:20 AM6/26/12
to daisy-pip...@googlegroups.com
I'm not sure how to reproduce it just yet, but I'm sporadically getting this exception in the fwk / WS. I have to restart the framework to get it working again. The exception only appears in the terminal, not in the logs (should it be both places?). I'll try to pin down how to reproduce it the next time it occurs:

Jun 26, 2012 4:06:49 PM org.restlet.engine.log.LogFilter afterHandle
INFO: 2012-06-26 16:06:49 127.0.0.1 - - 8182 GET /ws/scripts authid=clientid&time=2012-06-26T14:06:49Z&nonce=799332412988747233266817268560&sign=pZmRMti8O/7cTcALUwu5SznfbHE= 500 448 0 7 http://localhost:8182 Restlet-Framework/2.0.14 -
Jun 26, 2012 4:06:50 PM org.restlet.resource.ServerResource doCatch
WARNING: Exception or error caught in server resource
java.lang.IllegalStateException: 
Exception Description: Transaction is currently active
at org.eclipse.persistence.internal.jpa.transaction.EntityTransactionImpl.begin(EntityTransactionImpl.java:45)
at org.daisy.pipeline.persistence.Database.addObject(Database.java:20)
at org.daisy.pipeline.persistence.webservice.PersistentRequestLog.add(PersistentRequestLog.java:34)
at org.daisy.pipeline.webserviceutils.Authenticator.checkValidNonce(Authenticator.java:127)
at org.daisy.pipeline.webserviceutils.Authenticator.authenticate(Authenticator.java:67)
at org.daisy.pipeline.webservice.AuthenticatedResource.authenticate(AuthenticatedResource.java:37)
at org.daisy.pipeline.webservice.AuthenticatedResource.doInit(AuthenticatedResource.java:22)
at org.daisy.pipeline.webservice.ScriptsResource.doInit(ScriptsResource.java:29)
at org.restlet.resource.Resource.init(Resource.java:631)
at org.restlet.resource.Finder.handle(Finder.java:243)
at org.restlet.routing.Filter.doHandle(Filter.java:159)
at org.restlet.routing.Filter.handle(Filter.java:206)
at org.restlet.routing.Router.doHandle(Router.java:431)
at org.restlet.routing.Router.handle(Router.java:648)
at org.restlet.routing.Filter.doHandle(Filter.java:159)
at org.restlet.routing.Filter.handle(Filter.java:206)
at org.restlet.routing.Filter.doHandle(Filter.java:159)
at org.restlet.routing.Filter.handle(Filter.java:206)
at org.restlet.routing.Filter.doHandle(Filter.java:159)
at org.restlet.engine.application.StatusFilter.doHandle(StatusFilter.java:154)
at org.restlet.routing.Filter.handle(Filter.java:206)
at org.restlet.routing.Filter.doHandle(Filter.java:159)
at org.restlet.routing.Filter.handle(Filter.java:206)
at org.restlet.engine.CompositeHelper.handle(CompositeHelper.java:211)
at org.restlet.engine.application.ApplicationHelper.handle(ApplicationHelper.java:84)
at org.restlet.Application.handle(Application.java:381)
at org.restlet.routing.Filter.doHandle(Filter.java:159)
at org.restlet.routing.Filter.handle(Filter.java:206)
at org.restlet.routing.Router.doHandle(Router.java:431)
at org.restlet.routing.Router.handle(Router.java:648)
at org.restlet.routing.Filter.doHandle(Filter.java:159)
at org.restlet.routing.Filter.handle(Filter.java:206)
at org.restlet.routing.Router.doHandle(Router.java:431)
at org.restlet.routing.Router.handle(Router.java:648)
at org.restlet.routing.Filter.doHandle(Filter.java:159)
at org.restlet.engine.application.StatusFilter.doHandle(StatusFilter.java:154)
at org.restlet.routing.Filter.handle(Filter.java:206)
at org.restlet.routing.Filter.doHandle(Filter.java:159)
at org.restlet.routing.Filter.handle(Filter.java:206)
at org.restlet.engine.CompositeHelper.handle(CompositeHelper.java:211)
at org.restlet.Component.handle(Component.java:392)
at org.restlet.Server.handle(Server.java:516)
at org.restlet.engine.connector.ServerConnectionHelper.handle(ServerConnectionHelper.java:253)
at org.restlet.engine.connector.ServerConnectionHelper.doHandleInbound(ServerConnectionHelper.java:186)
at org.restlet.engine.connector.BaseHelper$2.run(BaseHelper.java:588)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
at java.lang.Thread.run(Thread.java:679)


Jostein

Jostein Austvik Jacobsen

unread,
Jun 26, 2012, 11:24:58 AM6/26/12
to daisy-pip...@googlegroups.com
It only happens when running scripts, and there are other types of exceptions occuring as well, such as:

javax.persistence.PersistenceException: Exception [EclipseLink-4002] (Eclipse Persistence Services - 2.3.2.v20111125-r10461): org.eclipse.persistence.exceptions.DatabaseException
Internal Exception: java.sql.SQLIntegrityConstraintViolationException: The statement was aborted because it would have caused a duplicate key value in a unique or primary key constraint or unique index identified by 'SQL120626170349570' defined on 'PERSISTENTREQUESTLOGENTRY'.
Error Code: 20000
Call: INSERT INTO PERSISTENTREQUESTLOGENTRY (INTERNALID, CLIENTID, NONCE, TIMESTAMP) VALUES (?, ?, ?, ?)
bind => [4 parameters bound]
Query: InsertObjectQuery(org.daisy.pipeline.persistence.webservice.PersistentRequestLogEntry@6bfb5fce)
at org.eclipse.persistence.internal.jpa.EntityManagerImpl.flush(EntityManagerImpl.java:786)
at org.eclipse.persistence.internal.jpa.EJBQueryImpl.performPreQueryFlush(EJBQueryImpl.java:1298)
at org.eclipse.persistence.internal.jpa.EJBQueryImpl.executeReadQuery(EJBQueryImpl.java:434)
at org.eclipse.persistence.internal.jpa.EJBQueryImpl.getResultList(EJBQueryImpl.java:742)
at org.daisy.pipeline.persistence.Database.runQuery(Database.java:43)
at org.daisy.pipeline.persistence.webservice.PersistentRequestLog.contains(PersistentRequestLog.java:26)
at org.daisy.pipeline.webserviceutils.Authenticator.checkValidNonce(Authenticator.java:122)
at org.daisy.pipeline.webserviceutils.Authenticator.authenticate(Authenticator.java:67)
at org.daisy.pipeline.webservice.AuthenticatedResource.authenticate(AuthenticatedResource.java:37)
at org.daisy.pipeline.webservice.AuthenticatedResource.doInit(AuthenticatedResource.java:22)
at org.daisy.pipeline.webservice.JobResource.doInit(JobResource.java:36)
(...)


I've pushed my latest changes of the Web UI to the repo; can anyone reproduce this?

Jostein


2012/6/26 Jostein Austvik Jacobsen <jost...@gmail.com>
Reply all
Reply to author
Forward
0 new messages