This is a bug in Spring - I was able to find it a few days ago by
googling the error message you're seeing.

http://issues.appfuse.org/browse/APF-887

Matt

On 9/13/07, syg6 <[EMAIL PROTECTED]> wrote:
>
> I tried reverting back to the way things were previous to upgrading Hibernate
> (commenting out all of the Hibernate dependency blocks in pom.xml, so it
> uses ${hibernate.version}, 3.2.1) and it seemed to take the change. When I
> ran jetty:run-war this was printed:
>
> attempting to create parent directories for destination:
> hibernate-3.2.1.ga.jar.tmp
> Downloading [appfuse] ->
> http://static.appfuse.org/repository/org/hibernate/hibernate/3.2.1.ga/hibernate-3.2.1.ga.jar
>
> ... but it still doesn't work, same error.
>
> Spring seems to be unhappy about transactionManager. This is the pertinent
> code from my applicationContext-dao.xml:
>
> <!-- Transaction manager for a single Hibernate SessionFactory (alternative
> to JTA) -->
> <bean id="transactionManager"
> class="org.springframework.orm.hibernate3.HibernateTransactionManager">
>   <property name="sessionFactory" ref="sessionFactory"/>
> </bean>
>
> As you can see it hasn't changed a lick from the original. In fact the only
> reason I have my own applicationContext-dao.xml instead of using the one
> bundled with appfuse-hibernate-2.0-m5.jar is because I have event listeners
> defined within the sessionFactory bean. I haven't made a change in this file
> in a while and it's worked up until now.
>
> But obviously reverting back to the previous Hibernate version has left
> something that's mucking up the works.
>
> Appfuse / Spring / Hibernate experts? Anyone?
>
> Thanks,
> Bob
>
>
>
> syg6 wrote:
> >
> > I tried nuking the entire hibernate directory in my Maven repository and I
> > changed my pom.xml so it has the correct hibernate-annotations block:
> >
> > <dependency>
> >   <groupId>org.hibernate</groupId>
> >   <artifactId>hibernate-annotations</artifactId>
> >   <version>3.3.0.ga</version>
> > </dependency>
> >
> > After running mvn -U. I now (seemingly) have all the correct Hibernate
> > files installed in my repository.
> >
> > And I am still getting the same 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
> >
> > This must be something used by one of the new Hibernate jars because I
> > can't find any reference to the 'transactionInterceptor' bean anywhere in
> > appfuse. I searched my whole project and the Maven repository, no trace.
> > (Mind you, I used Windows to search the repository ... nuff said.)
> >
> > Anyone seen this error before?
> >
> > Bob
> >
> >
> > mraible wrote:
> >>
> >> If you "rm -r" the hibernate JAR you installed and try again-what
> >> happens?
> >>
> >> Matt
> >>
> >>
> >> On 9/12/07, syg6 <[EMAIL PROTECTED]> wrote:
> >>>
> >>> Hi Matt, and thanks for taking the time to answer from Oslo!
> >>>
> >>> It's official: I am now in Maven hell. I am a total Maven noob and have
> >>> to
> >>> say, it's quite confusing. Previously the error I was getting when
> >>> running
> >>> 'mvn anything' was that it couldn't find javax.persistence.*. Do you
> >>> know
> >>> what the solution was? Change the hibernate version back to the way it
> >>> originally was in the <properties> section. Talk about uninformative
> >>> errors!
> >>>
> >>> Anyway, I am now getting even stranger errors. A bunch of tests are
> >>> failing,
> >>> all Appfuse core stuff (addUser, contextInitialized, send, etc.) and the
> >>> reason is this:
> >>>
> >>> 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
> >>>
> >>> As I said, I 'installed' hibernate, hibernate annotations and hibernate
> >>> entity manager by first downloading each one from the hibernate.org site
> >>> and
> >>> then executing mvn:install for each one, which seems to have worked
> >>> because
> >>> in my Maven repository I have all the new versions.
> >>>
> >>> My pom.xml is currently like this:
> >>>
> >>> <dependency>
> >>>   <groupId>org.hibernate</groupId>
> >>>   <artifactId>hibernate-annotations</artifactId>
> >>>   <version>${hibernate.version}</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>jboss</groupId>
> >>>   <artifactId>jboss-archive-browsing</artifactId>
> >>>   <version>5.0.0alpha-200607201-119</version>
> >>> </dependency>
> >>>
> >>> and in the <properties> section it now is as it was originally:
> >>>
> >>>   <hibernate.version>3.2.1.ga</hibernate.version>
> >>>
> >>> I also tried copying the three aforementioned jars into the WEB-INF/lib
> >>> directory of my project, just for the hell of it. Makes no difference.
> >>>
> >>> I am not sure if I shot myself in the foot by executing mvn -U. Since I
> >>> am
> >>> using the 'exploded' version of AppFuse I was worried that running mvn
> >>> -U
> >>> might have over-written changes I had made in certain Appfuse core
> >>> config
> >>> files (like the interceptors I defined in applicationContext-dao.xml)
> >>> but
> >>> CVS tells me there are no changes.
> >>>
> >>> So it must just be that I am doing fundamentally wrong in terms of
> >>> Maven.
> >>> What do you mean when you say I shouldn't have to install 3.2.5.ga? If
> >>> that's the case why do I need to go to mvnrepository.com? Apart from the
> >>> dependency block that's listed there for hibernate which I have pasted
> >>> into
> >>> my pom.xml do I need to do anything else there, like click on Download
> >>> or
> >>> POM? I have tried that and it craps out with a 'No such file or
> >>> directory'
> >>> error.
> >>>
> >>> I have been reading through the Maven books trying to get my head around
> >>> Maven but so far I don't see what I am doing wrong ...
> >>>
> >>> Any help you can throw my way much appreciated,
> >>> Bob
> >>>
> >>>
> >>>
> >>>
> >>> mraible wrote:
> >>> >
> >>> > You should be able to upgrade to 3.2.5.ga without installing it. It's
> >>> > available in maven's central repo, which is searchable with
> >>> > mvnrepository.com. You need to add the full dependency block to your
> >>> > pom.xml since Maven doesn't allow you to override properties in
> >>> > dependencies.
> >>> >
> >>> > If you continue reading the thread you linked to - you should find the
> >>> > solution to your other problem. There's a new dependency you need to
> >>> > add.
> >>> >
> >>> > Matt
> >>> >
> >>> >
> >>> > On 9/12/07, syg6 <[EMAIL PROTECTED]> wrote:
> >>> >>
> >>> >> Nothing quite like answering your own posts. No chance for arguing
> >>> ...
> >>> >>
> >>> >> So I was reading
> >>> >>
> >>> http://www.nabble.com/Upgrading-to-hibernate-annotation-to-version-3.3.0.ga-tf4310306s2369.html#a12270648
> >>> >> this  thread about the Hibernate / Hibernate Annotations upgrade and
> >>> >> decided
> >>> >> it was time to upgrade, to hopefully fix my original problem.
> >>> >>
> >>> >> This is what I did:
> >>> >>
> >>> >> 1. mvn install:install-file -DgroupId=org.hibernate
> >>> >> -DartifactId=hibernate
> >>> >> -Dversion=3.2.5.ga -Dpackaging=jar
> >>> >> -Dfile=C:/downloads/hibernate/hibernate3.jar
> >>> >>
> >>> >> 2. mvn install:install-file -DgroupId=org.hibernate
> >>> >> -DartifactId=hibernate-annotations -Dversion=3.2.5.ga -Dpackaging=jar
> >>> >> -Dfile=C:/downloads/hibernate/hibernate-annotations.jar
> >>> >>
> >>> >> 3. mvn install:install-file -DgroupId=org.hibernate
> >>> >> -DartifactId=hibernate-entitymanager -Dversion=3.3.1.ga
> >>> -Dpackaging=jar
> >>> >> -Dfile=C:/downloads/hibernate/hibernate-entitymanager.jar
> >>> >>
> >>> >> 4. Change the hibernate version in my pom.xml:
> >>> >> <hibernate.version>3.2.5.ga</hibernate.version>
> >>> >>
> >>> >> All went well. But now when I run mvn jetty:run-war, both from within
> >>> >> Eclipse and on the command line, it's telling me it can't find
> >>> >> javax.persistence.*. It seems it is not finding persistence.jar,
> >>> although
> >>> >> I've never had this problem before, and the jar exists. I've also
> >>> tried
> >>> >> running mvn clean and then mvn -U and the same thing happens, it
> >>> can't
> >>> >> compile my POJOs because it can't find javax.persistence. The
> >>> persistence
> >>> >> jar is not one of the files upgraded when I run mvn -U so I don't
> >>> know
> >>> >> why
> >>> >> it would 'disappear'.
> >>> >>
> >>> >> Anyone? I am stuck in Maven ... if not hell, limbo.
> >>> >>
> >>> >> Bob
> >>> >>
> >>> >>
> >>> >> syg6 wrote:
> >>> >> >
> >>> >> > Hmmm ... According to
> >>> >> >
> >>> >>
> >>> http://forum.hibernate.org/viewtopic.php?t=971930&highlight=inversejoincolumns+update
> >>> >> > this post  it's a Hibernate
> >>> >> > http://opensource.atlassian.com/projects/hibernate/browse/HHH-2292
> >>> bug
> >>> >> .
> >>> >> > How involved is it to change the version of Hibernate being used by
> >>> >> > Appfuse? Is it as simple as changing the pom.xml line:
> >>> >> >
> >>> >> > <hibernate.version>3.2.1.ga</hibernate.version>
> >>> >> >
> >>> >> > to
> >>> >> >
> >>> >> > <hibernate.version>3.2.2.ga</hibernate.version>
> >>> >> >
> >>> >> > and then copying the jar to the Maven repository? I'll give it a
> >>> try.
> >>> >> >
> >>> >> > Bob
> >>> >> >
> >>> >> >
> >>> >> > syg6 wrote:
> >>> >> >>
> >>> >> >> I am using Appfuse 2.0, Spring MVC, Hibernate.
> >>> >> >>
> >>> >> >> I have two POJOs, Application (as in a job application or form)
> >>> and
> >>> >> >> Place. I got this example straight out of the JPA Annotations
> >>> >> Reference:
> >>> >> >>
> >>> >> >> Application.java
> >>> >> >>
> >>> >> >> @Entity
> >>> >> >> @Table(name = "applications")
> >>> >> >>
> >>> >> >> private Set<Place> places;
> >>> >> >>
> >>> >> >> @ManyToMany(
> >>> >> >> targetEntity=com.myco.myapp.model.Place.class,
> >>> >> >> cascade={CascadeType.ALL},
> >>> >> >> fetch = FetchType.EAGER
> >>> >> >> )
> >>> >> >> @JoinTable(
> >>> >> >> name="applicationsplaces",
> >>> >> >> [EMAIL PROTECTED](name="idApplication")},
> >>> >> >> [EMAIL PROTECTED](name="idPlace")}
> >>> >> >> )
> >>> >> >> public Set<Place> getPlaces(){
> >>> >> >> return places;
> >>> >> >> }
> >>> >> >>
> >>> >> >> Place.java
> >>> >> >> @Entity
> >>> >> >> @Table(name = "places")
> >>> >> >>
> >>> >> >> @ManyToMany(
> >>> >> >> cascade={CascadeType.ALL},
> >>> >> >> mappedBy="places",
> >>> >> >> targetEntity=Application.class
> >>> >> >> )
> >>> >> >> public Set<Application> getApplications() {
> >>> >> >> return applications;
> >>> >> >> }
> >>> >> >>
> >>> >> >> When I create a new Application and associate Places my table,
> >>> >> >> applicationsplaces, is updated. But when I update an Application
> >>> it is
> >>> >> >> not updated. Looking at the generated SQL, when I create a new
> >>> >> >> Application the following insert is done:
> >>> >> >>
> >>> >> >> insert into applicationsplaces (idApplication, idPlace) values (?,
> >>> ?)
> >>> >> >>
> >>> >> >> No such insert is done when I update an Application. I've looked
> >>> here,
> >>> >> >> Hibernate forums, FAQs, you name it. This seems like Hibernate 101
> >>> to
> >>> >> me,
> >>> >> >> something that should be a no-brainer, even for a noob like me.
> >>> But I
> >>> >> >> can't find the problem.
> >>> >> >>
> >>> >> >> Anyone?
> >>> >> >>
> >>> >> >> Thanks,
> >>> >> >> Bob
> >>> >> >>
> >>> >> >
> >>> >> >
> >>> >>
> >>> >> --
> >>> >> View this message in context:
> >>> >>
> >>> http://www.nabble.com/Hibernate-ManyToMany-not-updating-collection-tf4428202s2369.html#a12633605
> >>> >> 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/Hibernate-ManyToMany-not-updating-collection-tf4428202s2369.html#a12638397
> >>> 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/Hibernate-ManyToMany-not-updating-collection-tf4428202s2369.html#a12655887
> 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]

Reply via email to