[Biojava-dev] Error loading Ontology with Hibernate

Florian Mittag florian.mittag at uni-tuebingen.de
Thu Aug 6 13:16:50 UTC 2009


Found the cause.

After importing an ontology (Gene or Sequence Ontology) into the BioSQL using 
load_ontology.pl, the table "term_dbxref" has only NULL values in the rank 
column. I tried it with DB2 and MySQL, same results/error.

The way I see it, this is not a problem of Hibernate. Can I set the "rank" to 
an arbitrary value to circumvent this problem?


On Wednesday, 5. August 2009 17:41, Florian Mittag wrote:
> Hi, it's me again ;-)
>
> I'm really sorry to bother you with yet another problem, but I seem to
> attract those problems.
>
> When I parse Genbank files and store them in a BioSQL DB, all features
> like "gap", "mRNA", "gene", etc. are represented by newly created Terms in
> the ontology "biojavax" with the comment "autocreated by biojavax". I
> searched for an appropriate ontology and found the Sequence Ontology, which
> I loaded into the DB using BioPerl's load_ontology.pl
>
> I tried setting the default ontology using
> RichObjectBuilder.setDefaultOntology("sequence"), but when it comes to
> instantiation the SimpleRichSequenceBuilder, a multi-nested exception is
> thrown. I followed it in the code and found the cause in Hibernate:
>
> [SEVERE] <init>(): illegal access to loading collection >>
> org.hibernate.LazyInitializationException: illegal access to loading
> collection
> 	at
> org.hibernate.collection.AbstractPersistentCollection.initialize(AbstractPe
>rsistentCollection.java:341) at
> org.hibernate.collection.AbstractPersistentCollection.read(AbstractPersiste
>ntCollection.java:86) at
> org.hibernate.collection.PersistentSet.toString(PersistentSet.java:309) at
> java.lang.String.valueOf(String.java:2827)
> 	at java.lang.StringBuilder.append(StringBuilder.java:115)
> 	at java.util.AbstractCollection.toString(AbstractCollection.java:422)
> 	at
> org.hibernate.engine.StatefulPersistenceContext.initializeNonLazyCollection
>s(StatefulPersistenceContext.java:844)
>
> probably cause by this exception
>
> org.hibernate.PropertyAccessException: Null value was assigned to a
> property of primitive type setter of org.biojavax.SimpleRankedCrossRef.rank
>
>
> The code to reproduce this:
>
> sessionFactory = new Configuration().configure().buildSessionFactory();
> session = sessionFactory.openSession();
> RichObjectFactory.connectToBioSQL(session);
> RichObjectFactory.setDefaultOntologyName("sequence");
> Ontology onto = RichObjectFactory.getDefaultOntology();
>
> My DB has the following ontologies listed:
> - biological_process
> - gene_ontology
> - molecular_function
> - cellular_component
> - sequence
> - biojavax
>
> and only for "gene_ontology" and "biojavax" the above code snippet runs
> without failure. All ontologies were loaded with the load_ontology.pl
> script.
>
>
> What might be the cause?
>
> Thanks
>
> - Florian

-- 
Dipl. Inf. Florian Mittag
Universität Tuebingen
WSI-RA, Sand 1
72076 Tuebingen, Germany
Phone: +49 7071 / 29 78985  Fax: +49 7071 / 29 5091




More information about the biojava-dev mailing list