From: Chris H. (JIRA) <no...@at...> - 2006-01-30 18:17:09
|
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-1293?page=comments#action_21914 ] Chris Hane commented on HHH-1293: --------------------------------- I am also seeing this error in my envrionment. If it will help, here are the specfiics of what I am seeing and how I duplicate the error. Linux 2.6.11 MySQL 4.1.x Java 1.5.0_03 (Sun JVM) Hibernate 3.1.1 Tomcat 5.0.28 Dual PIII When I run with the '-server' flag, I do not get the error (at least not yet or with a test case). To trigger the error, I have 1 class (Person) with a bunch of Set relationships. For each iteration I load the primary object and then each of the relationships. In my setup, this loop triggers the error between 50 and 60 iterations. There error is thrown on the log.fatal line. Here is the error: Exception in thread "main" java.lang.NoSuchMethodError: com.itsolut.entity.survey.usr.UserTest.getHibernateLazyInitializer()Lorg/hibernate/proxy/LazyInitializer; at com.itsolut.entity.survey.usr.UserTest$$EnhancerByCGLIB$$559189a0.getHibernateLazyInitializer(<generated>) at org.hibernate.type.EntityType.resolveIdentifier(EntityType.java:274) at org.hibernate.type.EntityType.resolve(EntityType.java:303) at org.hibernate.engine.TwoPhaseLoad.initializeEntity(TwoPhaseLoad.java:113) at org.hibernate.loader.Loader.initializeEntitiesAndCollections(Loader.java:842) at org.hibernate.loader.Loader.doQuery(Loader.java:717) at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:224) at org.hibernate.loader.Loader.loadCollection(Loader.java:1919) at org.hibernate.loader.collection.CollectionLoader.initialize(CollectionLoader.java:71) at org.hibernate.persister.collection.AbstractCollectionPersister.initialize(AbstractCollectionPersister.java:520) at org.hibernate.event.def.DefaultInitializeCollectionEventListener.onInitializeCollection(DefaultInitializeCollectionEventListener.java:60) at org.hibernate.impl.SessionImpl.initializeCollection(SessionImpl.java:1693) at org.hibernate.collection.AbstractPersistentCollection.initialize(AbstractPersistentCollection.java:344) at org.hibernate.collection.AbstractPersistentCollection.read(AbstractPersistentCollection.java:86) at org.hibernate.collection.AbstractPersistentCollection.readSize(AbstractPersistentCollection.java:109) at org.hibernate.collection.PersistentSet.size(PersistentSet.java:114) at com.itsolut.backoffice.config.MaintDB.triggerError(MaintDB.java:80) at com.itsolut.backoffice.config.MaintDB.main(MaintDB.java:38) I first get a list of primary IDs and then load each object (and relationships) in a new Session. private static void triggerError() throws Exception{ Configuration configuration = new Configuration(); configuration.configure("/com/itsolut/entity/hibernate.cfg.xml"); SessionFactory factory = configuration.buildSessionFactory(); Session session = factory.openSession(); Statement st = session.connection().createStatement(); ResultSet rs = st.executeQuery("select partyID from bo_party where companyID=11 and type='P'");// limit 0,100"); List<Long> ids = new ArrayList<Long>(); while(rs.next()){ long id = rs.getLong(1); ids.add(new Long(id)); } st.close(); session.close(); int index=0; for(Long id: ids){ session = factory.openSession(); Person person = (Person)session.load(Person.class, id); log.fatal("count["+(index++)+"] " + " person id["+person.getPartyID()+"] fname["+person.getFname()+"]" + " org id["+person.getOrganization().getPartyID()+"] name["+person.getOrganization().getName()+"] " + " titles["+person.getUserTitles().size()+"] " + " notes["+person.getNotes().size()+"] " + " activities["+person.getActivities().size()+"] " + " addresses["+person.getAddresses().size()+"] " + " paymethods["+person.getMethods().size()+"] " + " opportunities["+person.getOpportunities().size()+"]" ); session.close(); } } > java.lang.NoSuchMethodError: <persistent class>.getHibernateLazyInitializer() > ----------------------------------------------------------------------------- > > Key: HHH-1293 > URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1293 > Project: Hibernate3 > Type: Bug > Versions: 3.1.1 > Reporter: Andreas Schildbach > Priority: Blocker > > > As documented in > http://forum.hibernate.org/viewtopic.php?t=940119 > some people (including me) are getting this exception with the final release of Hibernate 3.1: > java.lang.NoSuchMethodError: de.schildbach.game.integration.HibernateGamePlayer.getHibernateLazyInitializer()Lorg/hibernate/proxy/LazyInitializer; > at de.schildbach.game.integration.HibernateGamePlayer$$EnhancerByCGLIB$$afecb986.getHibernateLazyInitializer(<generated>) > at org.hibernate.type.EntityType.resolveIdentifier(EntityType.java:274) > at org.hibernate.type.ManyToOneType.assemble(ManyToOneType.java:177) > at org.hibernate.type.TypeFactory.assemble(TypeFactory.java:398) > at org.hibernate.cache.entry.CacheEntry.assemble(CacheEntry.java:96) > at org.hibernate.cache.entry.CacheEntry.assemble(CacheEntry.java:82) > at org.hibernate.event.def.DefaultLoadEventListener.assembleCacheEntry(DefaultLoadEventListener.java:520) > at org.hibernate.event.def.DefaultLoadEventListener.loadFromSecondLevelCache(DefaultLoadEventListener.java:474) > at org.hibernate.event.def.DefaultLoadEventListener.doLoad(DefaultLoadEventListener.java:328) > at org.hibernate.event.def.DefaultLoadEventListener.load(DefaultLoadEventListener.java:123) > at org.hibernate.event.def.DefaultLoadEventListener.returnNarrowedProxy(DefaultLoadEventListener.java:202) > at org.hibernate.event.def.DefaultLoadEventListener.proxyOrLoad(DefaultLoadEventListener.java:169) > at org.hibernate.event.def.DefaultLoadEventListener.onLoad(DefaultLoadEventListener.java:87) > at org.hibernate.impl.SessionImpl.fireLoad(SessionImpl.java:869) > at org.hibernate.impl.SessionImpl.internalLoad(SessionImpl.java:838) > at org.hibernate.type.EntityType.resolveIdentifier(EntityType.java:266) > at org.hibernate.type.ManyToOneType.assemble(ManyToOneType.java:177) > at org.hibernate.collection.PersistentList.initializeFromCache(PersistentList.java:378) > at org.hibernate.cache.entry.CollectionCacheEntry.assemble(CollectionCacheEntry.java:35) > at org.hibernate.event.def.DefaultInitializeCollectionEventListener.initializeCollectionFromCache(DefaultInitializeCollectionEventListener.java:130) > at org.hibernate.event.def.DefaultInitializeCollectionEventListener.onInitializeCollection(DefaultInitializeCollectionEventListener.java:48) > at org.hibernate.impl.SessionImpl.initializeCollection(SessionImpl.java:1627) > at org.hibernate.collection.AbstractPersistentCollection.initialize(AbstractPersistentCollection.java:344) > at org.hibernate.collection.AbstractPersistentCollection.read(AbstractPersistentCollection.java:86) > at org.hibernate.collection.AbstractPersistentCollection.readSize(AbstractPersistentCollection.java:109) > at org.hibernate.collection.PersistentList.size(PersistentList.java:91) > The exception varies with the actual persistent class in use. Most people seem to be using JDK 1.5 and Linux. Some reports say that the exception does not happen from the very start of the application, but it takes "several invocations"/"some time" until it appear, but then it appears very often. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira |