We're Hiring!

Querying the external XML file (written by OMERO.editor)

General and open developer discussion about using OMERO APIs from C++, Java, Python, Matlab and more! Please new questions at https://forum.image.sc/tags/omero
Please note:
Historical discussions about OMERO. Please look for and ask new questions at https://forum.image.sc/tags/omero

If you are having trouble with custom code, please provide a link to a public repository, ideally GitHub.

Querying the external XML file (written by OMERO.editor)

Postby bhcho » Fri Jan 07, 2011 9:58 pm

Hi,

I generated an external XML file (Experiment file) by OMERO.editor and attached it to images.
After that, I'd like to retrieve all image IDs by querying them.
for example, that Experiment file has a hierarchy such as
A>B>(C1, C2, C3, ...)
A>D>(C1, C2, C3, ...)
If I want to get all those image IDs that have A>D>C1 of "Bob".

Can anyone answer if the current OMERO support APIs that do this? I'm not sure if the OMERO parse the experiment file.

Best,
BK
bhcho
 
Posts: 236
Joined: Mon Apr 05, 2010 2:15 pm

Re: Querying the external XML file (written by OMERO.editor)

Postby jmoore » Mon Jan 10, 2011 8:34 am

Hi BK,

There's currently no special parsing of experiment files, so if it's not possible to find the file you're looking for with a basic Lucene query of the text parsing, then it is probably time to add a bridge specifically for your needs.

It's largely a question, then, of how to parse the XML into something Lucene understands. You could use dot-notation of the elements as the field names and the the value (here:"bob") as the text itself. A search like:
Code: Select all
A.D.C1:Bob

should then do what you want. If you'll ever need to perform a search of the form:
Code: Select all
D.C1:Bob

(i.e. matching on some sub-branch of the hierarchy), then another strategy may be needed.

Cheers,
~Josh
User avatar
jmoore
Site Admin
 
Posts: 1591
Joined: Fri May 22, 2009 1:29 pm
Location: Germany

Re: Querying the external XML file (written by OMERO.editor)

Postby bhcho » Tue Jan 11, 2011 6:05 pm

Hi Josh,

From what I understand at http://trac.openmicroscopy.org.uk/omero ... rchBridges
The bridge means the mapping between my metadata and how it is stored in the Lucene index.


I have lots of questions,

0. is the bridge a java code that defines how to map the meta data into the Lucene index? such as
http://trac.openmicroscopy.org.uk/omero ... ridge.java
in which I don't understand a lot.

1. Assuming I want to parse all the values in the Protocol XML file into the Lucene index.
and have a java class named "ExperimentFileBridge", in which I have a function such as

public void set (final Object XMLfile, final Document document, final LuceneOptions _opts){
// 1. parse the XML file and get all the values from individual elements

// 2. add all the values to the lucene document such as
// add(document, "A.B.C1", value1, _opts);
// add(document, "A.B.C2", value2, _opts);
// add(document, "A.D.C1", value3, _opts);
}

Am I right about this?

1.1. when I tried to compile this source file, it gave me errors like
package ome.model.containers does not exist
which library file should I include for a classpath when I compile this. I tried with loci_tools.jar, but it did not work.




2. I don't understand how to configure this class to my server.

2.1. from http://trac.openmicroscopy.org.uk/omero ... Deployment,
what is the NewServicel.class file and how it look like? (Do I need this file?)
2.2. and what is "ome/service/blits-*.xml file"? (Do I need this file?)
2.3. should I compile my java source file with all related files and generate a jar file named "extensions.jar" and copy it to
OMERO_DIST/lib./server/ ?
And that's all for the configuration?


3. how can I call the bridge?
is it called everytime I import an image or everytime I attach the external xml file?

3.1. as you can see in the pseudo-source code above, I need to pass the XMLfile and Lucene document as input argument to the bridge,
I think I need to know when the bridge is called and how to pass them to the bridge. (maybe I'm misunderstanding alot with this question).


4. for the search query in my Script python code, could you show me an example code to query like "A.B.C1:Bob"?



I guess I will have a lot further questions after this.
Thanks in advance,

BK
bhcho
 
Posts: 236
Joined: Mon Apr 05, 2010 2:15 pm

Re: Querying the external XML file (written by OMERO.editor)

Postby jmoore » Tue Jan 25, 2011 6:48 pm

BK,

hi, sorry apparently this post failed to save somehow. My apologies. I'll try to recall everything I wrote previously?

Have you made any progress in the mean time?

From what I understand at http://trac.openmicroscopy.org.uk/omero ... rchBridges
The bridge means the mapping between my metadata and how it is stored in the Lucene index.


Correct. A bridge is responsible for adding key/value pairs to the Lucene "Document" which is modified on every SQL INSERT/UPDATE/DELETE.

0. is the bridge a java code that defines how to map the meta data into the Lucene index? such as
http://trac.openmicroscopy.org.uk/omero ... ridge.java
in which I don't understand a lot.


That's an example bridge, yes. The default bridge -- "FullTextBridge" -- maps annotations and similar.

1. Assuming I want to parse all the values in the Protocol XML file into the Lucene index.
and have a java class named "ExperimentFileBridge", in which I have a function such as

public void set (final Object XMLfile, final Document document, final LuceneOptions _opts){
// 1. parse the XML file and get all the values from individual elements

// 2. add all the values to the lucene document such as
// add(document, "A.B.C1", value1, _opts);
// add(document, "A.B.C2", value2, _opts);
// add(document, "A.D.C1", value3, _opts);
}

Am I right about this?


That is roughly correct as pseudo-code, but you won't be given the XMLfile directly. Rather, you will be given the OME model objects, in your case the image, and you will have to navigate to the original file via annotations.


1.1. when I tried to compile this source file, it gave me errors like
package ome.model.containers does not exist
which library file should I include for a classpath when I compile this. I tried with loci_tools.jar, but it did not work.


The simplest thing to do is to include all of the jars under OMERO_DIST/lib/server.




2. I don't understand how to configure this class to my server.

2.1. from http://trac.openmicroscopy.org.uk/omero ... Deployment,
what is the NewServicel.class file and how it look like? (Do I need this file?)
2.2. and what is "ome/service/blits-*.xml file"? (Do I need this file?)
2.3. should I compile my java source file with all related files and generate a jar file named "extensions.jar" and copy it to
OMERO_DIST/lib./server/ ?
And that's all for the configuration?


In most cases you won't need to put anything other than your bridge .class file in extensions.jar and then copy that to lib/server, correct. (i.e. no blitz-*.xml or NewServiceI.class)

3. how can I call the bridge?
is it called everytime I import an image or everytime I attach the external xml file?


You don't need to call it. It will be called periodically with any new changes that are detected.

3.1. as you can see in the pseudo-source code above, I need to pass the XMLfile and Lucene document as input argument to the bridge,
I think I need to know when the bridge is called and how to pass them to the bridge. (maybe I'm misunderstanding alot with this question).


You may want to take a look at how the FileParsers interact with the bridges. Again, you won't be given the file, but you will have to look it up based on the metadata.

4. for the search query in my Script python code, could you show me an example code to query like "A.B.C1:Bob"?


Very roughly:
Code: Select all
searchService = session.createSearchService()
searchService.onlyType("Image")
searchService.byFullText("A.B.C1:Bob")
if searchService.hasNext(): print searchService.results()


Cheers,
~Josh
User avatar
jmoore
Site Admin
 
Posts: 1591
Joined: Fri May 22, 2009 1:29 pm
Location: Germany

Re: Querying the external XML file (written by OMERO.editor)

Postby bhcho » Thu Jan 27, 2011 9:33 pm

Thanks Josh,

I have further questions though.
but you won't be given the XMLfile directly. Rather, you will be given the OME model objects, in your case the image, and you will have to navigate to the original file via annotations.

I understand. then could you show me sample codes to retrieve the XML file? And I want to retrieve only the Experiment file (rather than other XML files) I guess you already know how to do this (because the OMERO.Insight automatically recognize the Experiment file and there is a dedicated panel that shows Experiment files).


ok, I generated an "extensions.jar" file using the current sample java code (that maps all the image names into the Lucene "image_name" index).
I copied that jar file to the OMERO_DIST/lib/server/ and restarted the server.
And I created a new project and dataset. then I copied one image ("img_bk.ome.tif") into the new dataset, hoping this Bridge is automatically called.
But when I tried this
Code: Select all
searchService = session.createSearchService()
searchService.onlyType("Image")
searchService.byFullText("image_name:img_bk.ome.tif")
if searchService.hasNext(): print searchService.results()

I didnt get any returned results.
Am I wrong with something here?

Best,
BK
bhcho
 
Posts: 236
Joined: Mon Apr 05, 2010 2:15 pm

Re: Querying the external XML file (written by OMERO.editor)

Postby jmoore » Fri Jan 28, 2011 2:24 pm

bhcho wrote:I have further questions though.
but you won't be given the XMLfile directly. Rather, you will be given the OME model objects, in your case the image, and you will have to navigate to the original file via annotations.

I understand. then could you show me sample codes to retrieve the XML file? And I want to retrieve only the Experiment file (rather than other XML files) I guess you already know how to do this (because the OMERO.Insight automatically recognize the Experiment file and there is a dedicated panel that shows Experiment files).


Did you get a chance to look into the FileParsers API?

ok, I generated an "extensions.jar" file using the current sample java code (that maps all the image names into the Lucene "image_name" index).
I copied that jar file to the OMERO_DIST/lib/server/ and restarted the server.
And I created a new project and dataset. then I copied one image ("img_bk.ome.tif") into the new dataset, hoping this Bridge is automatically called.
But when I tried this
Code: Select all
searchService = session.createSearchService()
searchService.onlyType("Image")
searchService.byFullText("image_name:img_bk.ome.tif")
if searchService.hasNext(): print searchService.results()

I didnt get any returned results.
Am I wrong with something here?


Did you set the "omero.search.bridges" configuration property described under "Configuration"?

~J.
User avatar
jmoore
Site Admin
 
Posts: 1591
Joined: Fri May 22, 2009 1:29 pm
Location: Germany

Re: Querying the external XML file (written by OMERO.editor)

Postby bhcho » Fri Jan 28, 2011 2:55 pm

Did you get a chance to look into the FileParsers API?

I cannot see any description of the FileParsers API in http://trac.openmicroscopy.org.uk/omero/wiki/FileParsers
those links inside the webpage are broken.

I set the configuration by
Code: Select all
bin/omero config set omero.search.bridges edu.cmu.search.bridges.ExperimentFileBridge

, where edu.cmu.search.bridges.ExperimentFileBridge is the full path of the java class in the extensions.jar.
Do I need to do something else?

BK
bhcho
 
Posts: 236
Joined: Mon Apr 05, 2010 2:15 pm

Re: Querying the external XML file (written by OMERO.editor)

Postby jmoore » Fri Jan 28, 2011 3:06 pm

bhcho wrote:
Did you get a chance to look into the FileParsers API?

I cannot see any description of the FileParsers API in http://trac.openmicroscopy.org.uk/omero/wiki/FileParsers


A map of FileParsers is used by FullTextBridge (the primary bridge) to do something similar to what you are attempting.

I set the configuration by
Code: Select all
bin/omero config set omero.search.bridges edu.cmu.search.bridges.ExperimentFileBridge

, where edu.cmu.search.bridges.ExperimentFileBridge is the full path of the java class in the extensions.jar.
Do I need to do something else?


No, that looks good. Do you have any logging in your bridge? Can you see if it shows up in the var/log/Indexer-0.log? (Either log at the WARN level so that it shows up, or modify the etc/log4j-indexing.xml file) If you print to standard out or standard in it will go to var/log/master.out or var/log/master.err, respectively.

Do keep in mind that the bridge is only called when an object has been modified. If you would like to force indexing, see "bin/omero admin reindex -h".

~Josh.
User avatar
jmoore
Site Admin
 
Posts: 1591
Joined: Fri May 22, 2009 1:29 pm
Location: Germany

Re: Querying the external XML file (written by OMERO.editor)

Postby bhcho » Fri Jan 28, 2011 3:40 pm

A map of FileParsers is used by FullTextBridge (the primary bridge) to do something similar to what you are attempting.

Thanks, I will take a look at the code.

Do you have any logging in your bridge? Can you see if it shows up in the var/log/Indexer-0.log?

here's the part of Indexer-0.log.


2011-01-28 09:44:50,663 INFO [ ome.security.basic.CurrentDetails] (3-thread-2) Adding log:INSERT,class ome.model.meta.Session,5140
2011-01-28 09:46:36,081 INFO [.cmu.search.bridges.ExperimentFileBridge] (3-thread-4) Indexing all image names for ome.model.containers.Project:Id_501
2011-01-28 09:46:36,277 INFO [ ome.services.fulltext.FullTextIndexer] (3-thread-4) INDEXED 1 objects in 1 batch(es) [256 ms.]
2011-01-28 09:46:44,149 INFO [ ome.services.fulltext.FullTextIndexer] (3-thread-4) INDEXED 1 objects in 1 batch(es) [133 ms.]
2011-01-28 09:46:48,062 INFO [.cmu.search.bridges.ExperimentFileBridge] (3-thread-1) Scheduling all project containers of ome.model.core.Image:Id_4901 for re-indexing
2011-01-28 09:46:48,380 INFO [ ome.services.fulltext.EventBacklog] (3-thread-1) Added to backlog:ome.model.core.Image:Id_4901
2011-01-28 09:46:49,174 INFO [ ome.services.fulltext.FullTextIndexer] (3-thread-1) INDEXED 10 objects in 1 batch(es) [1159 ms.]
2011-01-28 09:46:52,031 INFO [.cmu.search.bridges.ExperimentFileBridge] (3-thread-2) Scheduling all project containers of ome.model.core.Image:Id_4901 for re-indexing
2011-01-28 09:46:52,069 INFO [ ome.services.fulltext.FullTextIndexer] (3-thread-2) INDEXED 1 objects in 1 batch(es) [54 ms.]
2011-01-28 10:14:44,009 INFO [ome.services.sessions.state.SessionCache] (3-thread-3) Synchronizing session cache. Count = 2
2011-01-28 10:14:44,039 INFO [ome.services.sessions.state.SessionCache] (3-thread-3) Synchronization took 30 ms.


and when I tried to reindex fully again, i got the following errors
-bash-3.2$ omero admin reindex --full
2011-01-28 10:42:20,217 0 [ main] INFO ng.ShutdownSafeEhcacheManagerFactoryBean - Initializing EHCache CacheManager
2011-01-28 10:42:20,229 12 [ main] WARN t.sf.ehcache.config.ConfigurationFactory - No configuration found. Configuring ehcache from ehcache-failsafe.xml found in the classpath: jar:file:/usr0/local/omero.server/OMERO.server-Beta-4.2.1/lib/server/ehcache.jar!/ehcache-failsafe.xml
2011-01-28 10:42:22,944 2727 [ main] INFO ome.services.db.SelfCorrectingDataSource - Found location in errorTimes: -1
2011-01-28 10:42:22,944 2727 [ main] INFO ome.services.db.SelfCorrectingDataSource - Removing 0 from errorTimes
2011-01-28 10:42:22,944 2727 [ main] WARN ome.services.db.SelfCorrectingDataSource - Registering error with list: Current size: 0
2011-01-28 10:42:22,944 2727 [ main] INFO ome.services.db.SelfCorrectingDataSource - Sleeping for 0 then retry: 1
2011-01-28 10:42:22,946 2729 [ main] INFO ome.services.db.SelfCorrectingDataSource - Found location in errorTimes: -1
2011-01-28 10:42:22,946 2729 [ main] INFO ome.services.db.SelfCorrectingDataSource - Removing 0 from errorTimes
2011-01-28 10:42:22,946 2729 [ main] WARN ome.services.db.SelfCorrectingDataSource - Registering error with list: Current size: 1
2011-01-28 10:42:22,946 2729 [ main] INFO ome.services.db.SelfCorrectingDataSource - Sleeping for 1000 then retry: 2
2011-01-28 10:42:23,949 3732 [ main] INFO ome.services.db.SelfCorrectingDataSource - Found location in errorTimes: -1
2011-01-28 10:42:23,949 3732 [ main] INFO ome.services.db.SelfCorrectingDataSource - Removing 0 from errorTimes
2011-01-28 10:42:23,949 3732 [ main] WARN ome.services.db.SelfCorrectingDataSource - Registering error with list: Current size: 2
2011-01-28 10:42:23,950 3733 [ main] ERROR ome.services.db.SelfCorrectingDataSource - Failed to acquire connection after retries=3
java.sql.SQLException: unable to get a connection from pool of a PoolingDataSource containing an XAPool of resource ecb6995d-5082-48c8-956e-3b89a6e8201d with 0 connection(s) (0 still available)
at bitronix.tm.resource.jdbc.PoolingDataSource.getConnection(PoolingDataSource.java:109)
at org.springframework.jdbc.datasource.DelegatingDataSource.getConnection(DelegatingDataSource.java:83)
at ome.services.db.SelfCorrectingDataSource.call(SelfCorrectingDataSource.java:102)
at ome.services.db.SelfCorrectingDataSource.callWithRetries(SelfCorrectingDataSource.java:75)
at ome.services.db.SelfCorrectingDataSource.getConnection(SelfCorrectingDataSource.java:59)
at org.springframework.jdbc.datasource.DataSourceUtils.doGetConnection(DataSourceUtils.java:113)
at org.springframework.jdbc.datasource.TransactionAwareDataSourceProxy$TransactionAwareInvocationHandler.invoke(TransactionAwareDataSourceProxy.java:214)
at $Proxy46.getMetaData(Unknown Source)
at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:116)
at org.hibernate.cfg.Configuration.buildSettingsInternal(Configuration.java:2163)
at org.hibernate.cfg.Configuration.buildSettings(Configuration.java:2159)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1383)
at org.hibernate.cfg.AnnotationConfiguration.buildSessionFactory(AnnotationConfiguration.java:954)
at org.springframework.orm.hibernate3.LocalSessionFactoryBean.newSessionFactory(LocalSessionFactoryBean.java:855)
at org.springframework.orm.hibernate3.LocalSessionFactoryBean.buildSessionFactory(LocalSessionFactoryBean.java:774)
at org.springframework.orm.hibernate3.AbstractSessionFactoryBean.afterPropertiesSet(AbstractSessionFactoryBean.java:211)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1460)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1400)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:513)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:450)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:290)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:287)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:189)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:322)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:106)
at org.springframework.beans.factory.support.ConstructorResolver.resolveConstructorArguments(ConstructorResolver.java:600)
at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:140)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:984)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:888)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:479)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:450)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:290)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:287)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:189)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:322)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:106)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1308)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1067)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:511)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:450)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:290)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:287)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:189)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:562)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:871)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:423)
at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:139)
at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:105)
at ome.system.OmeroContext.<init>(OmeroContext.java:98)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:126)
at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:107)
at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:273)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:984)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:888)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:479)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:450)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:290)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:287)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193)
at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1048)
at org.springframework.beans.factory.access.SingletonBeanFactoryLocator.useBeanFactory(SingletonBeanFactoryLocator.java:397)
at ome.system.OmeroContext.getInstance(OmeroContext.java:203)
at ome.system.OmeroContext.getManagedServerContext(OmeroContext.java:185)
at ome.services.fulltext.Main.init(Main.java:49)
at ome.services.fulltext.Main.indexFullDb(Main.java:124)
at ome.services.fulltext.Main.main(Main.java:103)
Caused by: java.sql.SQLException: unable to connect to non-XA resource org.postgresql.Driver
at bitronix.tm.resource.jdbc.lrc.LrcXADataSource.getXAConnection(LrcXADataSource.java:82)
at bitronix.tm.resource.jdbc.PoolingDataSource.createPooledConnection(PoolingDataSource.java:167)
at bitronix.tm.resource.common.XAPool.createPooledObject(XAPool.java:200)
at bitronix.tm.resource.common.XAPool.grow(XAPool.java:310)
at bitronix.tm.resource.common.XAPool.getInPool(XAPool.java:289)
at bitronix.tm.resource.common.XAPool.getConnectionHandle(XAPool.java:72)
at bitronix.tm.resource.common.XAPool.getConnectionHandle(XAPool.java:58)
at bitronix.tm.resource.jdbc.PoolingDataSource.getConnection(PoolingDataSource.java:105)
... 73 more
Caused by: org.postgresql.util.PSQLException: FATAL: password authentication failed for user "omero2"
at org.postgresql.core.v3.ConnectionFactoryImpl.doAuthentication(ConnectionFactoryImpl.java:276)
at org.postgresql.core.v3.ConnectionFactoryImpl.openConnectionImpl(ConnectionFactoryImpl.java:95)
at org.postgresql.core.ConnectionFactory.openConnection(ConnectionFactory.java:66)
at org.postgresql.jdbc2.AbstractJdbc2Connection.<init>(AbstractJdbc2Connection.java:124)
at org.postgresql.jdbc3.AbstractJdbc3Connection.<init>(AbstractJdbc3Connection.java:30)
at org.postgresql.jdbc3.Jdbc3Connection.<init>(Jdbc3Connection.java:24)
at org.postgresql.Driver.makeConnection(Driver.java:386)
at org.postgresql.Driver.connect(Driver.java:260)
at bitronix.tm.resource.jdbc.lrc.LrcXADataSource.getXAConnection(LrcXADataSource.java:79)
... 80 more
2011-01-28 10:42:23,956 3739 [ main] INFO ng.ShutdownSafeEhcacheManagerFactoryBean - Shutting down EHCache CacheManager
Exception in thread "main" org.springframework.beans.factory.access.BootstrapException: Unable to return specified BeanFactory instance: factory key [ome.server], from group with resource name [classpath*:beanRefContext.xml]; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'ome.server' defined in URL [jar:file:/usr0/local/omero.server/OMERO.server-Beta-4.2.1/lib/server/server.jar!/beanRefContext.xml]: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [ome.system.OmeroContext]: Constructor threw exception; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionManager' defined in class path resource [ome/services/sec-primitives.xml]: Cannot resolve reference to bean 'executor' while setting bean property 'executor'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'executor' defined in class path resource [ome/services/services.xml]: Cannot resolve reference to bean 'sessionFactory' while setting constructor argument; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in class path resource [ome/services/hibernate.xml]: Invocation of init method failed; nested exception is ome.conditions.DatabaseBusyException: Cannot acquire connection
at org.springframework.beans.factory.access.SingletonBeanFactoryLocator.useBeanFactory(SingletonBeanFactoryLocator.java:409)
at ome.system.OmeroContext.getInstance(OmeroContext.java:203)
at ome.system.OmeroContext.getManagedServerContext(OmeroContext.java:185)
at ome.services.fulltext.Main.init(Main.java:49)
at ome.services.fulltext.Main.indexFullDb(Main.java:124)
at ome.services.fulltext.Main.main(Main.java:103)
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'ome.server' defined in URL [jar:file:/usr0/local/omero.server/OMERO.server-Beta-4.2.1/lib/server/server.jar!/beanRefContext.xml]: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [ome.system.OmeroContext]: Constructor threw exception; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionManager' defined in class path resource [ome/services/sec-primitives.xml]: Cannot resolve reference to bean 'executor' while setting bean property 'executor'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'executor' defined in class path resource [ome/services/services.xml]: Cannot resolve reference to bean 'sessionFactory' while setting constructor argument; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in class path resource [ome/services/hibernate.xml]: Invocation of init method failed; nested exception is ome.conditions.DatabaseBusyException: Cannot acquire connection
at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:281)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:984)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:888)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:479)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:450)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:290)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:287)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193)
at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1048)
at org.springframework.beans.factory.access.SingletonBeanFactoryLocator.useBeanFactory(SingletonBeanFactoryLocator.java:397)
... 5 more
Caused by: org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [ome.system.OmeroContext]: Constructor threw exception; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionManager' defined in class path resource [ome/services/sec-primitives.xml]: Cannot resolve reference to bean 'executor' while setting bean property 'executor'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'executor' defined in class path resource [ome/services/services.xml]: Cannot resolve reference to bean 'sessionFactory' while setting constructor argument; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in class path resource [ome/services/hibernate.xml]: Invocation of init method failed; nested exception is ome.conditions.DatabaseBusyException: Cannot acquire connection
at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:141)
at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:107)
at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:273)
... 15 more
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionManager' defined in class path resource [ome/services/sec-primitives.xml]: Cannot resolve reference to bean 'executor' while setting bean property 'executor'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'executor' defined in class path resource [ome/services/services.xml]: Cannot resolve reference to bean 'sessionFactory' while setting constructor argument; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in class path resource [ome/services/hibernate.xml]: Invocation of init method failed; nested exception is ome.conditions.DatabaseBusyException: Cannot acquire connection
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:328)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:106)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1308)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1067)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:511)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:450)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:290)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:287)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:189)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:562)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:871)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:423)
at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:139)
at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:105)
at ome.system.OmeroContext.<init>(OmeroContext.java:98)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:126)
... 17 more
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'executor' defined in class path resource [ome/services/services.xml]: Cannot resolve reference to bean 'sessionFactory' while setting constructor argument; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in class path resource [ome/services/hibernate.xml]: Invocation of init method failed; nested exception is ome.conditions.DatabaseBusyException: Cannot acquire connection
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:328)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:106)
at org.springframework.beans.factory.support.ConstructorResolver.resolveConstructorArguments(ConstructorResolver.java:600)
at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:140)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:984)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:888)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:479)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:450)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:290)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:287)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:189)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:322)
... 37 more
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in class path resource [ome/services/hibernate.xml]: Invocation of init method failed; nested exception is ome.conditions.DatabaseBusyException: Cannot acquire connection
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1403)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:513)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:450)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:290)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:287)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:189)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:322)
... 49 more
Caused by: ome.conditions.DatabaseBusyException: Cannot acquire connection
at ome.services.db.SelfCorrectingDataSource.callWithRetries(SelfCorrectingDataSource.java:91)
at ome.services.db.SelfCorrectingDataSource.getConnection(SelfCorrectingDataSource.java:59)
at org.springframework.jdbc.datasource.DataSourceUtils.doGetConnection(DataSourceUtils.java:113)
at org.springframework.jdbc.datasource.TransactionAwareDataSourceProxy$TransactionAwareInvocationHandler.invoke(TransactionAwareDataSourceProxy.java:214)
at $Proxy46.getMetaData(Unknown Source)
at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:116)
at org.hibernate.cfg.Configuration.buildSettingsInternal(Configuration.java:2163)
at org.hibernate.cfg.Configuration.buildSettings(Configuration.java:2159)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1383)
at org.hibernate.cfg.AnnotationConfiguration.buildSessionFactory(AnnotationConfiguration.java:954)
at org.springframework.orm.hibernate3.LocalSessionFactoryBean.newSessionFactory(LocalSessionFactoryBean.java:855)
at org.springframework.orm.hibernate3.LocalSessionFactoryBean.buildSessionFactory(LocalSessionFactoryBean.java:774)
at org.springframework.orm.hibernate3.AbstractSessionFactoryBean.afterPropertiesSet(AbstractSessionFactoryBean.java:211)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1460)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1400)
... 56 more
bhcho
 
Posts: 236
Joined: Mon Apr 05, 2010 2:15 pm

Re: Querying the external XML file (written by OMERO.editor)

Postby jmoore » Fri Jan 28, 2011 3:50 pm

BK,

it looks like your bridge is being run fine, so the re-index is not necessary. (The long exception is just a configuration issue, which we can handle if necessary later).

At this point, I would assume that you are in fact adding things to the Lucene index, but the question is whether or not what you are adding is what you are searching for. You might try http://www.getopt.org/luke/ to examine the /OMERO/FullText directory. Find an image that has passed through your bridge and look at its contents. It should have a field of the for A.B.C (or similar).

Cheers,
~Josh
User avatar
jmoore
Site Admin
 
Posts: 1591
Joined: Fri May 22, 2009 1:29 pm
Location: Germany

Next

Return to Developer Discussion

Who is online

Users browsing this forum: No registered users and 1 guest