Hi everybody.
I hope I can find help here.
I am trying to make biojavax and hibernate work on a PowerMac running Mac OS X Server.
When I try to execute a very simple transaction to retrieve an object of type Namespace from a biosql schema installed on mySQL I get the error reported below.
The thing that is driving me crazy is that if I run the very same code from my laptop everything works great.
I am not an expert, but my guess is that it has something to do with the JVM that doesn't want my code to create the object using the reflection system...but I could be totally wrong!!!
Any suggestion will be greatly appreciated.
This is the code that is giving me teh problem:
try { // print out all the namespaces in the database Query q = session.createQuery("from Namespace"); List namespaces = q.list(); // retrieve all the namespaces from the db for (Iterator i = namespaces.iterator(); i.hasNext(); ) { Namespace ns = (Namespace)i.next(); System.out.println(ns.getName()); // print out the name of the namespace // print out all the sequences in the namespace Query sq = session.createQuery("from BioEntry where namespace= :nsp"); // set the named parameter "nsp" to ns sq.setParameter("nsp",ns); List sequences = sq.list(); for (Iterator j = sequences.iterator(); j.hasNext(); ) { BioEntry be = (BioEntry)j.next(); // RichSequences are BioEntrys too System.out.println(" "+be.getName()); // print out the name of the sequence // if the sequence is called bloggs, change its description to XYZ if (be.getName().equals("bloggs")) { be.setDescription("XYZ"); } } }
and this is the output i get:
16:44:28,499 INFO Environment:514 - Hibernate 3.2.4.sp1 16:44:28,508 INFO Environment:547 - hibernate.properties not found 16:44:28,512 INFO Environment:681 - Bytecode provider name : cglib 16:44:28,517 INFO Environment:598 - using JDK 1.4 java.sql.Timestamp handling 16:44:28,599 INFO Configuration:1426 - configuring from resource: /hibernate.cfg.xml 16:44:28,599 INFO Configuration:1403 - Configuration resource: /hibernate.cfg.xml 16:44:28,747 INFO Configuration:553 - Reading mappings from resource : Namespace.hbm.xml 16:44:28,895 INFO HbmBinder:300 - Mapping class: Namespace -> biodatabase 16:44:28,931 INFO Configuration:553 - Reading mappings from resource : Taxon.hbm.xml 16:44:28,988 INFO HbmBinder:300 - Mapping class: Taxon -> taxon 16:44:29,001 INFO HbmBinder:1422 - Mapping collection: Taxon.nameSet -> taxon_name 16:44:29,004 INFO Configuration:553 - Reading mappings from resource : Ontology.hbm.xml 16:44:29,031 INFO HbmBinder:300 - Mapping class: Ontology -> ontology 16:44:29,043 INFO Configuration:553 - Reading mappings from resource : Term.hbm.xml 16:44:29,072 INFO HbmBinder:300 - Mapping class: Term -> term 16:44:29,156 INFO HbmBinder:1422 - Mapping collection: Term.synonymSet -> term_synonym 16:44:29,156 INFO HbmBinder:1422 - Mapping collection: Term.rankedCrossRefs -> term_dbxref 16:44:29,157 INFO Configuration:553 - Reading mappings from resource : Triple.hbm.xml 16:44:29,231 INFO HbmBinder:300 - Mapping class: Triple -> term_relationship 16:44:29,233 INFO HbmBinder:1422 - Mapping collection: Triple.descriptors -> term_relationship_term 16:44:29,233 INFO Configuration:553 - Reading mappings from resource : BioEntry.hbm.xml 16:44:29,268 INFO HbmBinder:300 - Mapping class: BioEntry -> bioentry 16:44:29,276 INFO HbmBinder:1422 - Mapping collection: BioEntry.rankedDocRefs -> bioentry_reference 16:44:29,276 INFO HbmBinder:1422 - Mapping collection: BioEntry.rankedCrossRefs -> bioentry_dbxref 16:44:29,277 INFO HbmBinder:1422 - Mapping collection: BioEntry.noteSet -> bioentry_qualifier_value 16:44:29,319 INFO HbmBinder:876 - Mapping joined-subclass: ThinSequence -> biosequence 16:44:29,331 INFO HbmBinder:876 - Mapping joined-subclass: Sequence -> biosequence 16:44:29,335 INFO Configuration:553 - Reading mappings from resource : Comment.hbm.xml 16:44:29,347 INFO HbmBinder:300 - Mapping class: Comment -> comment 16:44:29,352 INFO Configuration:553 - Reading mappings from resource : BioEntryRelationship.hbm.xml 16:44:29,362 INFO HbmBinder:300 - Mapping class: BioEntryRelationship -> bioentry_relationship 16:44:29,365 INFO Configuration:553 - Reading mappings from resource : CrossRef.hbm.xml 16:44:29,385 INFO HbmBinder:300 - Mapping class: CrossRef -> dbxref 16:44:29,388 INFO HbmBinder:1422 - Mapping collection: CrossRef.noteSet -> dbxref_qualifier_value 16:44:29,388 INFO Configuration:553 - Reading mappings from resource : DocRef.hbm.xml 16:44:29,448 INFO HbmBinder:300 - Mapping class: DocRef -> reference 16:44:29,452 INFO Configuration:553 - Reading mappings from resource : Feature.hbm.xml 16:44:29,475 INFO HbmBinder:300 - Mapping class: Feature -> seqfeature 16:44:29,486 INFO HbmBinder:1422 - Mapping collection: Feature.noteSet -> seqfeature_qualifier_value 16:44:29,488 INFO HbmBinder:1422 - Mapping collection: Feature.rankedCrossRefs -> seqfeature_dbxref 16:44:29,491 INFO Configuration:553 - Reading mappings from resource : FeatureRelationship.hbm.xml 16:44:29,521 INFO HbmBinder:300 - Mapping class: FeatureRelationship -> seqfeature_relationship 16:44:29,523 INFO Configuration:553 - Reading mappings from resource : Location.hbm.xml 16:44:29,541 INFO HbmBinder:300 - Mapping class: Location -> location 16:44:29,551 INFO HbmBinder:1422 - Mapping collection: Location.noteSet -> location_qualifier_value 16:44:29,551 INFO Configuration:1541 - Configured SessionFactory: null 16:44:29,556 INFO HbmBinder:2385 - Mapping collection: Ontology.termSet -> term 16:44:29,556 INFO HbmBinder:2385 - Mapping collection: Ontology.tripleSet -> term_relationship 16:44:29,559 INFO HbmBinder:2385 - Mapping collection: BioEntry.comments -> comment 16:44:29,559 INFO HbmBinder:2385 - Mapping collection: BioEntry.relationships -> bioentry_relationship 16:44:29,567 INFO HbmBinder:2385 - Mapping collection: ThinSequence.featureSet -> seqfeature 16:44:29,567 INFO HbmBinder:2385 - Mapping collection: Sequence.featureSet -> seqfeature 16:44:29,568 INFO HbmBinder:2385 - Mapping collection: Feature.locationSet -> location 16:44:29,570 INFO HbmBinder:2385 - Mapping collection: Feature.featureRelationshipSet -> seqfeature_relationship 16:44:29,681 INFO DriverManagerConnectionProvider:41 - Using Hibernate built-in connection pool (not for production use!) 16:44:29,681 INFO DriverManagerConnectionProvider:42 - Hibernate connection pool size: 20 16:44:29,683 INFO DriverManagerConnectionProvider:45 - autocommit mode: false 16:44:29,690 INFO DriverManagerConnectionProvider:80 - using driver: com.mysql.jdbc.Driver at URL: jdbc:mysql://10.0.1.2/biosqldb 16:44:29,690 INFO DriverManagerConnectionProvider:86 - connection properties: {user=www, password=****} 16:44:29,970 INFO SettingsFactory:89 - RDBMS: MySQL, version: 5.0.41-log 16:44:29,970 INFO SettingsFactory:90 - JDBC driver: MySQL-AB JDBC Driver, version: mysql-connector-java-5.1.0 ( $Date: 2007-04-05 23:56:05 +0200 (Thu, 05 Apr 2007) $, $Revision: 6376 $ ) 16:44:29,989 INFO Dialect:152 - Using dialect: org.hibernate.dialect.MySQLInnoDBDialect 16:44:29,997 INFO TransactionFactoryFactory:31 - Using default transaction strategy (direct JDBC transactions) 16:44:30,000 INFO TransactionManagerLookupFactory:33 - No TransactionManagerLookup configured (in JTA environment, use of read-write or transactional second-level cache is not recommended) 16:44:30,000 INFO SettingsFactory:143 - Automatic flush during beforeCompletion(): disabled 16:44:30,000 INFO SettingsFactory:147 - Automatic session close at end of transaction: disabled 16:44:30,001 INFO SettingsFactory:154 - JDBC batch size: 15 16:44:30,001 INFO SettingsFactory:157 - JDBC batch updates for versioned data: disabled 16:44:30,002 INFO SettingsFactory:162 - Scrollable result sets: enabled 16:44:30,002 INFO SettingsFactory:170 - JDBC3 getGeneratedKeys(): enabled 16:44:30,002 INFO SettingsFactory:178 - Connection release mode: auto 16:44:30,003 INFO SettingsFactory:202 - Maximum outer join fetch depth: 2 16:44:30,003 INFO SettingsFactory:205 - Default batch fetch size: 1 16:44:30,004 INFO SettingsFactory:209 - Generate SQL with comments: disabled 16:44:30,004 INFO SettingsFactory:213 - Order SQL updates by primary key: disabled 16:44:30,005 INFO SettingsFactory:217 - Order SQL inserts for batching: disabled 16:44:30,006 INFO SettingsFactory:386 - Query translator: org.hibernate.hql.ast.ASTQueryTranslatorFactory 16:44:30,009 INFO ASTQueryTranslatorFactory:24 - Using ASTQueryTranslatorFactory 16:44:30,010 INFO SettingsFactory:225 - Query language substitutions: {} 16:44:30,010 INFO SettingsFactory:230 - JPA-QL strict compliance: disabled 16:44:30,010 INFO SettingsFactory:235 - Second-level cache: enabled 16:44:30,010 INFO SettingsFactory:239 - Query cache: disabled 16:44:30,010 INFO SettingsFactory:373 - Cache provider: org.hibernate.cache.NoCacheProvider 16:44:30,011 INFO SettingsFactory:254 - Optimize cache for minimal puts: disabled 16:44:30,011 INFO SettingsFactory:263 - Structured second-level cache entries: disabled 16:44:30,016 INFO SettingsFactory:283 - Echoing all SQL to stdout 16:44:30,016 INFO SettingsFactory:290 - Statistics: disabled 16:44:30,016 INFO SettingsFactory:294 - Deleted entity synthetic identifier rollback: disabled 16:44:30,017 INFO SettingsFactory:309 - Default entity-mode: pojo 16:44:30,017 INFO SettingsFactory:313 - Named query checking : enabled 16:44:30,050 INFO SessionFactoryImpl:161 - building session factory 16:44:30,891 INFO SessionFactoryObjectFactory:82 - Not binding factory to JNDI, no JNDI name configured Hibernate: select namespace0_.biodatabase_id as biodatab1_0_, namespace0_.name as name0_, namespace0_.authority as authority0_, namespace0_.description as descript4_0_ from biodatabase namespace0_ Changes rolled back. org.hibernate.PropertyAccessException: Exception occurred inside setter of org.biojavax.SimpleNamespace.authority at org.hibernate.property.BasicPropertyAccessor$BasicSetter.set(BasicPropertyAccessor.java:65) at org.hibernate.tuple.entity.AbstractEntityTuplizer.setPropertyValues(AbstractEntityTuplizer.java:337) at org.hibernate.tuple.entity.PojoEntityTuplizer.setPropertyValues(PojoEntityTuplizer.java:200) at org.hibernate.persister.entity.AbstractEntityPersister.setPropertyValues(AbstractEntityPersister.java:3566) at org.hibernate.engine.TwoPhaseLoad.initializeEntity(TwoPhaseLoad.java:129) at org.hibernate.loader.Loader.initializeEntitiesAndCollections(Loader.java:854) at org.hibernate.loader.Loader.doQuery(Loader.java:729) at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:236) at org.hibernate.loader.Loader.doList(Loader.java:2220) at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2104) at org.hibernate.loader.Loader.list(Loader.java:2099) at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:378) at org.hibernate.hql.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:338) at org.hibernate.engine.query.HQLQueryPlan.performList(HQLQueryPlan.java:172) at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1121) at org.hibernate.impl.QueryImpl.list(QueryImpl.java:79) at testhibernate.Main.<init>(Main.java:48) at testhibernate.Main.main(Main.java:92) Caused by: java.lang.reflect.InvocationTargetException at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.hibernate.property.BasicPropertyAccessor$BasicSetter.set(BasicPropertyAccessor.java:42) ... 17 more Caused by: org.biojava.utils.AssertionFailure: Couldn't find class or field org.biojavax.Namespace->NAME at org.biojava.utils.ChangeType.<init>(ChangeType.java:162) at org.biojava.utils.ChangeType.<init>(ChangeType.java:171) at org.biojavax.Namespace.<clinit>(Namespace.java:40) at org.biojavax.SimpleNamespace.setAuthority(SimpleNamespace.java:90) ... 22 more Caused by: java.lang.ClassNotFoundException: org.biojavax.Namespace at java.net.URLClassLoader$1.run(URLClassLoader.java:200) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:188) at java.lang.ClassLoader.loadClass(ClassLoader.java:306) at java.lang.ClassLoader.loadClass(ClassLoader.java:251) at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:164) at org.biojava.utils.ChangeType.<init>(ChangeType.java:159) ... 25 more
|