From: Loren C. <lor...@gm...> - 2011-03-03 06:19:16
|
Dmitriy, You will find the logs below. 03 Mar 2011 00:04:56,782 [exist_QuartzScheduler_Worker-2] INFO (TestUserJavaJob.java [execute]:74) - EnteringTestUserJavaJob 03 Mar 2011 00:04:56,783 [exist_QuartzScheduler_Worker-2] INFO (TestUserJavaJob.java [execute]:76) - xmlrpcurl: xmldb:exist:// 03 Mar 2011 00:04:56,783 [exist_QuartzScheduler_Worker-2] INFO (TestUserJavaJob.java [execute]:85) - collectionURI: xmldb:exist:///db 03 Mar 2011 00:04:56,783 [exist_QuartzScheduler_Worker-2] INFO (TestUserJavaJob.java [execute]:93) - docURI: xmldb:exist:///db/foo2.xml 03 Mar 2011 00:04:56,784 [exist_QuartzScheduler_Worker-2] INFO (TestUserJavaJob.java [execute]:114) - collection: /db[test.xq] 03 Mar 2011 00:04:56,785 [exist_QuartzScheduler_Worker-2] DEBUG (Collection.java [validateXMLResourceInternal]:1196) - Scanning document /db/db/foo2.xml 03 Mar 2011 00:04:56,786 [exist_QuartzScheduler_Worker-2] INFO (TestUserJavaJob.java [execute]:121) - INFO: IndexInfo: Indexer: org.exist.Indexer@686fdca5 DOMStreamer: org.exist.util.serializer.DOMStreamer@7ff0a34 DocumentTrigger: null IsCreating: trueCollectionConfiguration: Full-text index includeByDefault : false includeAttributes : false includeAlphaNum : true exclude : /auth 03 Mar 2011 00:04:56,786 [exist_QuartzScheduler_Worker-2] DEBUG (Collection.java [storeXMLInternal]:1006) - storing document 8 ... 03 Mar 2011 00:04:56,787 [exist_QuartzScheduler_Worker-2] DEBUG (Collection.java [storeXMLInternal]:1019) - document stored. 03 Mar 2011 00:04:56,787 [exist_QuartzScheduler_Worker-2] INFO (TestUserJavaJob.java [execute]:129) - /db/foo.xml is stored 03 Mar 2011 00:04:57,109 [eXistThread-27] DEBUG (XQueryContext.java [importModule]:2631) - Module http://exist-db.org/xquery/request already present. 03 Mar 2011 00:04:57,109 [eXistThread-27] DEBUG (XQueryContext.java [importModule]:2631) - Module http://exist-db.org/xquery/xmldb already present. You will also see that those two lines are close together. try { broker = brokerPool.get(systemSubject); if (broker == null) { LOG.error("No system subject"); return; } DocumentImpl document = buildDocument(broker); try { collection = broker.openCollection(collectionURI, Lock.WRITE_LOCK); LOG.info("collection: " + collection); if (collection == null) { return; } transact = brokerPool.getTransactionManager(); txn = transact.beginTransaction(); info = collection.validateXMLResource(txn, broker, docURI, document); LOG.info("INFO: " + info.toString()); } finally { if (collection != null) collection.release(Lock.WRITE_LOCK); } collection.store(txn, broker, info, document, false); transact.commit(txn); LOG.info("/db/foo.xml is stored"); } catch (Exception e) { LOG.error("Failure to execute org.exist.scheduler.job.test.TestUserJavaJob [" + xmlrpcurl + "]", e); if (transact != null && txn != null) transact.abort(txn); } finally { if (brokerPool != null && broker != null) brokerPool.release(broker); } On Mar 2, 2011, at 11:46 PM, Dmitriy Shabanov wrote: > info = collection.validateXMLResource(txn, broker, docURI, document); > and > collection.store(txn, broker, info, document, false); > must be as close as possible to each other. > > what logs do you have around this execution? > > On Wed, Mar 2, 2011 at 10:13 PM, Loren Cahlander <lor...@gm...> wrote: > The following test UserJavaJob is not storing the created document in /db/foo.xml. It is called by the following: > > xquery version "1.0"; > > declare namespace scheduler="http://exist-db.org/xquery/scheduler"; > > let $login := xmldb:login("/db", "admin", "", true()) > > let $success := scheduler:schedule-java-periodic-job("org.exist.scheduler.job.test.TestUserJavaJob", 120000, "test", > <parameters> > <param name="xmlrpcurl" value="xmldb:exist://localhost:8080/exist/xmlrpc"/> > </parameters>, 100, 0) > > return $success > > This does create the document /db/foo.xml as <test/>, but the document is not visible or accessible. > > I am getting the System Subject so that I can get the DBBroker as something other than guest. I do not want this job being passed a username and password, because then that is in the code and if a password changes, then the code needs to be changed. > > Can someone take a look at this code and let me know what is wrong? > > Thanks, > Loren |