ciao Marco, Please find the stacktrace below
grazie! :) <testcase time="0" name="testFindById"> <error message="Could not initialize class perfectjpattern.j2ee.database.dao.hibernate.HibernateGenericDao" type="java.lang.NoClassDefFoundError">java.lang.NoClassDefFoundError: Could not initialize class perfectjpattern.j2ee.database.dao.hibernate.HibernateGenericDao at perfectjpattern.j2ee.database.dao.hibernate.TestHibernateGenericReadOnlyDao. setUp(TestHibernateGenericReadOnlyDao.java:147) at junit.framework.TestCase.runBare(TestCase.java:128) at junit.framework.TestResult$1.protect(TestResult.java:106) at junit.framework.TestResult.runProtected(TestResult.java:124) at junit.framework.TestResult.run(TestResult.java:109) at junit.framework.TestCase.run(TestCase.java:120) at junit.framework.TestSuite.runTest(TestSuite.java:230) at junit.framework.TestSuite.run(TestSuite.java:225) 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.junit.JUnitTestSet.execute(JUnitTestSet.java:213) 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 ) at org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:818 ) </error> </testcase> > -----Original Message----- > From: Marco Mistroni [mailto:[EMAIL PROTECTED] > Sent: Friday, November 30, 2007 11:40 PM > To: Maven Users List > Subject: Re: errors for hibernate test cases > > Giovanni, > could you please post stacktrace of exception? i had also > problems with hibernate and got everything sorted out.. > your hbm.xml files should end up in src/main/resources in > order to be present in the classpath during testing(they'll > end up in target\classes) > > regards > marco > > On Nov 30, 2007 10:17 PM, Giovanni Azua > <[EMAIL PROTECTED]> wrote: > > > hi, > > > > I have a set of test cases that pass fine under Eclipse .. but from > > Maven I get java.lang.NoClassDefFoundError when running > > TestHibernateGenericReadOnlyDao and TestHibernateGenericDao > (see below). > > > > My gut-feeling is that the auxiliary Fixture class Person (not a > > TestCase and not Test* pattern) is being filtered out by > Maven during testing? > > > > Also can not tell from the logs that Person.hbm.xml is > being picked up > > properly ... does it belong under /src/test/java/<my > packages>.../ ? > > or under /src/test/resources/<my packages>.../ ? > > > > If interested the sources are available for checkout from: > > > http://perfectjpattern.svn.sourceforge.net/svnroot/perfectjpattern/tru > > nk/ > > > > TIA, > > regards, > > Giovanni > > > > I have implemented a Generic Dao based on Hibernate and > then included > > under my test package: > > > > trunk/ > > - perfectjpattern-j2ee > > -- pom.xml > > -- src/ > > --- test/ > > ---- java/ > > ----- perfectjpattern/ > > ------ j2ee/ > > ------- database/ > > -------- dao/ > > --------- hibernate/ > > ---------- Person.java > > ---------- Person.hbm.xml > > ---------- TestHibernateGenericReadOnlyDao.java > > ---------- TestHibernateGenericDao.java > > ---- resources/ > > ----- hibernate.cfg.xml > > ----- hsql.properties > > ----- hsql.script > > ----- log4j.xml > > > > > > > > > --------------------------------------------------------------------- > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
