Any ideas regarding the below guys?

 

Thanks

Aled

 

From: Aled Rhys Jones [mailto:[EMAIL PROTECTED] 
Sent: 20 October 2007 16:31
To: 'users@appfuse.dev.java.net'
Subject: Hibernate issues after upgrading to appfuse 2.0

 

Hi all

 

I've just updated from a m4 of appfuse 2.0 to the release version.

 

I'm having a few teething issues with this new version.  Now all my DAOTests
fail on my add and remove tests.  I've debugged the code, and when the model
is saved after creation, the id is not updated, so the get function fails as
follows:

----------------------------------------------------------------------------
---

Test set: .....dao.AssociationDAOTest

----------------------------------------------------------------------------
---

Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.377 sec
<<< FAILURE!

testAddAndRemoveAssociation(......dao.AssociationDAOTest)  Time elapsed:
0.372 sec  <<< ERROR!

java.lang.IllegalArgumentException: id to load is required for loading

      at org.hibernate.event.LoadEvent.<init>(LoadEvent.java:51)

      at org.hibernate.event.LoadEvent.<init>(LoadEvent.java:33)

      at org.hibernate.impl.SessionImpl.get(SessionImpl.java:812)

      at org.hibernate.impl.SessionImpl.get(SessionImpl.java:808)

      at
org.springframework.orm.hibernate3.HibernateTemplate$1.doInHibernate(Hiberna
teTemplate.java:470)

      at
org.springframework.orm.hibernate3.HibernateTemplate.execute(HibernateTempla
te.java:372)

      at
org.springframework.orm.hibernate3.HibernateTemplate.get(HibernateTemplate.j
ava:464)

      at
org.springframework.orm.hibernate3.HibernateTemplate.get(HibernateTemplate.j
ava:458)

      at
org.appfuse.dao.hibernate.GenericDaoHibernate.get(GenericDaoHibernate.java:5
7)

      at
........dao.AssociationDAOTest.testAddAndRemoveAssociation(AssociationDAOTes
t.java:41)

      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:597)

      at junit.framework.TestCase.runTest(TestCase.java:168)

      at junit.framework.TestCase.runBare(TestCase.java:134)

      at
org.springframework.test.ConditionalTestCase.runBare(ConditionalTestCase.jav
a:69)

      at junit.framework.TestResult$1.protect(TestResult.java:110)

      at junit.framework.TestResult.runProtected(TestResult.java:128)

      at junit.framework.TestResult.run(TestResult.java:113)

      at junit.framework.TestCase.run(TestCase.java:124)

      at junit.framework.TestSuite.runTest(TestSuite.java:232)

      at junit.framework.TestSuite.run(TestSuite.java:227)

      at
org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:81
)

      at
org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:62
)

      at
org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(Ab
stractDirectoryTestSuite.java:138)

      at
org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractD
irectoryTestSuite.java:125)

      at org.apache.maven.surefire.Surefire.run(Surefire.java:132)

      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:597)

      at
org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireB
ooter.java:290)

      at
org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:818
)

 

If I disable those tests, my application loads ok and more or less works,
but I know have an issue where it can't load a collection of models
associated with a model in one of my forms:

 

[travelbeen] ERROR [btpool0-5] LazyInitializationException.<init>(19) |
failed t

o lazily initialize a collection of role: ..........model.Website.w

ebsiteAssociations, no session or session was closed

org.hibernate.LazyInitializationException: failed to lazily initialize a
collect

ion of role: .........model.Website.websiteAssociations, no sessio

n or session was closed

        at
org.hibernate.collection.AbstractPersistentCollection.throwLazyInitia

lizationException(AbstractPersistentCollection.java:358)

        at
org.hibernate.collection.AbstractPersistentCollection.throwLazyInitia

lizationExceptionIfNotConnected(AbstractPersistentCollection.java:350)

        at
org.hibernate.collection.AbstractPersistentCollection.readSize(Abstra

ctPersistentCollection.java:97)

        at
org.hibernate.collection.PersistentBag.size(PersistentBag.java:225)

        at org.displaytag.tags.TableTag.initParameters(TableTag.java:1003)

        at org.displaytag.tags.TableTag.doStartTag(TableTag.java:722)

        at
org.apache.jsp.WEB_002dINF.pages.websiteform_jsp._jspx_meth_display_t

able_0(org.apache.jsp.WEB_002dINF.pages.websiteform_jsp:2206)

 

Any ideas?

 

Thanks in advance

 

Aled

Reply via email to