On 9/17/07, syg6 <[EMAIL PROTECTED]> wrote:
>
>
> Good morning,
>
> I see (or at least I think I see ...) that the version of Hibernate that
> Appfuse uses has been upgraded. If I nuke my Maven repository and create a
> new project I now have Hibernate 3.2.5.GA, Hibernate Annotations 3.3.0.GA
> and Hibernate Commons Annotations 3.3.0.GA. These are precisely the
> versions
> I have been trying to upgrade to by manually editing my pom.xml, now I
> guess
> I don't have to.
>
> But when I download and run a new project the same message is appearing -
> 'No Transaction manager found - if your webapp requires one, please
> configure one.' Curious, since as far as I can see there is an
> applicationContext-dao.xml in the appfuse-hibernate-2.0-rc1.jar which
> configures a transaction manager.


Not quite - it configures a Spring transaction manager, which is really just
a lightweight Spring abstraction which allows you to swap out your
transaction management layer without requiring code changes. Hibernate is
simply saying that it cannot find an in-container transaction manager, which
means that all transactions are delegated to the database. This should not
be an issue unless your application requires that you access multiple
transactional resources within the same transaction, or that you use
distributed transactions with remote web services/EJB beans.

Anyway, the plain-vanilla default app runs but I guess it doesn't use
> transactions, which is why it doesn't crap out, as my original app did. So
> I
> am stuck wondering - should I try to get my original app to work with the
> new Appfuse by following the upgrade guide? I guess I am going to have to
> at
> some point anyway. I was just wondering if anyone has successfully
> downloaded the latest version of Appfuse with the latest Hibernate
> versions
> and had any problems with transactions, as I have when I tried using the
> latest Hibernate versions ...


Transactions are used, but are delegated down to the database. The tests
effectively prove this - all the DAO tests are set to rollback the
transaction once the tests succeed. Run the tests and you should notice that
your database does not change....

Incidentally, how can I know what versions of a dependency/jar Appfuse is
> using if it's not specified in the pom.xml?


Running mvn site should produce a series of reports, one of which is the
dependency report. This will list all the transitive dependencies + versions
that your project uses.

Mike

Thanks,
> Bob
>
>
> mraible wrote:
> >
> > What version are you trying to upgrade from to? I can try to upgrade
> > one of the demo apps locally and provide instructions.
> >
> > Matt
> >
> > On 9/14/07, syg6 <[EMAIL PROTECTED]> wrote:
> >>
> >> Update: I stuck this in my pom.xml:
> >>
> >> <dependency>
> >>   <groupId>commons-collections</groupId>
> >>   <artifactId>commons-collections</artifactId>
> >>   <version>3.2</version>
> >> </dependency>
> >>
> >> And I no longer get the NoClassDefFoundError. But I still get the 'No
> >> Transaction manager found' error.
> >>
> >> Bob
> >>
> >> syg6 wrote:
> >> >
> >> > Hi again folks.
> >> >
> >> > This topic was started
> >> >
> >>
> http://www.nabble.com/Hibernate-ManyToMany-not-updating-collection-tf4428202s2369.html
> >> > here  under the name 'Hibernate ManyToMany not updating collection'.
> My
> >> > original problem was that upon saving an object that has an
> associated
> >> > Collection, the Collection was not being updated. But it turns out
> it's
> >> a
> >> > bug with older versions of Hibernate. So I've spent the last 3 days
> >> trying
> >> > unsuccessfully to upgrade Hibernate within Appfuse. And I decided to
> >> start
> >> > a new thread whose name reflects my real problem.
> >> >
> >> > Here's what I did:
> >> >
> >> > 1. Download my working project from CVS.
> >> > 2. Change the original POM like this:
> >> >
> >> > <dependency>
> >> >   <groupId>org.hibernate</groupId>
> >> >   <artifactId>hibernate-annotations</artifactId>
> >> >   <version>3.3.0.ga</version>
> >> > </dependency>
> >> > <dependency>
> >> >   <groupId>org.hibernate</groupId>
> >> >   <artifactId>hibernate</artifactId>
> >> >   <version>3.2.5.ga</version>
> >> > </dependency>
> >> > <dependency>
> >> >   <groupId>org.hibernate</groupId>
> >> >   <artifactId>hibernate-commons-annotations</artifactId>
> >> >   <version>3.3.0.ga</version>
> >> > </dependency>
> >> > <dependency>
> >> >   <groupId>org.hibernate</groupId>
> >> >   <artifactId>hibernate-entitymanager</artifactId>
> >> >   <version>3.3.1.ga</version>
> >> > </dependency>
> >> >
> >> > <dependency>
> >> >   <groupId>jboss</groupId>
> >> >   <artifactId>jboss-archive-browsing</artifactId>
> >> >   <version>5.0.0alpha-200607201-119</version>
> >> > </dependency>
> >> > <dependency>
> >> >   <groupId>jboss</groupId>
> >> >     <artifactId>jboss-common</artifactId>
> >> >     <version>4.0.2</version>
> >> >     <exclusions>
> >> >       <exclusion>
> >> >         <artifactId>jboss-common-core</artifactId>
> >> >         <groupId>jboss</groupId>
> >> >          </exclusion>
> >> >     </exclusions>
> >> > </dependency>
> >> >
> >> > 3. I run mvn clean and mvn -U to update my local Maven repository.
> >> > (Incidentally, Maven seems to be ignoring my <excludes> block, it
> >> > downloads jboss-common-core. But I had to hand-install
> >> jboss-common-core
> >> > myself using mvn install as it seems it doesn't exist in the central
> >> Maven
> >> > repository ...)
> >> >
> >> > And my project no longer works. This is the error:
> >> >
> >> > ERROR - ContextLoader.initWebApplicationContext(203) | Context
> >> > initialization failed
> >> > org.springframework.beans.factory.BeanCreationException: Error
> creating
> >> > bean with name
> >> >
> >> '
> org.springframework.transaction.interceptor.TransactionAttributeSourceAdvisor
> ':
> >> > Cannot create inner bean '(inner bean)' of type
> >> > [org.springframework.transaction.interceptor.TransactionInterceptor]
> >> while
> >> > setting bean property 'transactionInterceptor'; nested exception is
> >> > org.springframework.beans.factory.BeanCreationException: Error
> creating
> >> > bean with name '(inner bean)': Cannot resolve reference to bean
> >> > 'transactionManager' while setting bean property
> 'transactionManager';
> >> > nested exception is
> >> > org.springframework.beans.factory.NoSuchBeanDefinitionException: No
> >> bean
> >> > named 'transactionManager' is defined
> >> > Caused by:
> >> > org.springframework.beans.factory.BeanCreationException: Error
> creating
> >> > bean with name '(inner bean)': Cannot resolve reference to bean
> >> > 'transactionManager' while setting bean property
> 'transactionManager';
> >> > nested exception is
> >> > org.springframework.beans.factory.NoSuchBeanDefinitionException: No
> >> bean
> >> > named 'transactionManager' is defined
> >> > Caused by:
> >> > org.springframework.beans.factory.NoSuchBeanDefinitionException: No
> >> bean
> >> > named 'transactionManager' is defined
> >> >
> >> >
> >> > Apart from my obvious question - what the heck am I doing wrong - my
> >> > question is what are the steps for updating a dependency in Appfuse?
> >> Once
> >> > you locate the chunk of text to stick in your pom.xml, what goal do
> you
> >> > execute? mvn -U? mvn jetty:run-war? I ask because it seems like Maven
> >> is
> >> > downloading these new dependencies each time I run mvn jetty:run-war,
> >> > which I don't get ... Shouldn't it do this once, the first time you
> run
> >> > mvn jetty:run-war, and never have to do it again until you change
> your
> >> > pom.xml again?
> >> >
> >> > Interestingly after running mvn eclipse:eclipse to my .classpath and
> >> > .project files in Eclipse, when I run mvn jetty:run-war from within
> >> > Eclipse I don't see it trying to download the new dependencies. The
> app
> >> > doesn't work mind you, but at least it's not trying to download the
> >> > dependencies every time ...
> >> >
> >> > Out of desperation I tried downloading a brand-spanking-new app. I
> ran
> >> mvn
> >> > archetype, changed into the new app's directory, ran mvn to download
> >> all
> >> > of the stuff, then mvn jetty:run-war. A-ok. I then changed the
> pom.xml
> >> > adding the Hibernate and JBoss stuff from above. Now when I run mvn
> >> > jetty:run-war I get this:
> >> >
> >> > 2007-09-14 13:10:25.867::INFO:  No Transaction manager found - if
> your
> >> > webapp requires one, please configure one.
> >> >
> >> >  ... followed by this:
> >> >
> >> > 2007-09-14 13:10:31.131::WARN:  failed
> >> >
> >> [EMAIL PROTECTED]
> /,jar:file:/C:/eclipseeuropa/workspace/myapp/targe
> >> > t/myapp-1.0-SNAPSHOT.war!/}
> >> > java.lang.NoClassDefFoundError:
> >> > org/apache/commons/collections/map/LinkedMap
> >> >
> >> > This rings a bell ... a transaction manager error. Different error
> but
> >> > centered around the transaction manager. It seems one of these new
> >> > dependencies needs a newer version of commons-collections. Appfuse
> uses
> >> > 2.1.1, which does not have this class. The newest release, 3.2, does
> >> have
> >> > this class.
> >> >
> >> > I am in way over my head on this. Any help much appreciated.
> >> >
> >> > Bob
> >> >
> >>
> >> --
> >> View this message in context:
> >>
> http://www.nabble.com/Steps-to-to-upgrade-Hibernate-%28or-any-other-dependency%29-tf4441897s2369.html#a12673416
> >> Sent from the AppFuse - User mailing list archive at Nabble.com.
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: [EMAIL PROTECTED]
> >> For additional commands, e-mail: [EMAIL PROTECTED]
> >>
> >>
> >
> >
> > --
> > http://raibledesigns.com
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
> >
>
> --
> View this message in context:
> http://www.nabble.com/Steps-to-to-upgrade-Hibernate-%28or-any-other-dependency%29-tf4441897s2369.html#a12731703
> Sent from the AppFuse - User mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>

Reply via email to