Nested exception is Java. Lang. nosuchmethoderror: javax. Persistence. onetoworkflow. orphanremoval () Z

Source: Internet
Author: User

An exception occurs after one-to-multiple bidirectional Association of @ onetovers using spring + hibernate Annotations:
Java. Lang. nosuchmethoderror: javax. Persistence. oneto133. orphanremoval () Z
This exception usually occurs because the Java ee. Jar version of myeclipse is relatively low, and conflicts with the built-in JPA such as hibernate.

Some processing methods on the Internet are to delete the Java ee. jar that comes with the web project when the project is created, but the consequence is that components such as httpservletrequest cannot be used.

Directly create a project with jdk1.6

<Prop key = "javax. Persistence. validation. mode"> none </prop>

<Bean id = "sessionfactory" class = "org. springframework. orm. hibernate4.localsessionfactorybean "> <property name =" datasource "ref =" datasource "/> <property name =" hibernateproperties "> <props> <prop key =" javax. persistence. validation. mode "> none </prop> <prop key =" hibernate. dialect ">$ {hibernate. dialect} </prop> <prop key = "hibernate. show_ SQL ">$ {hibernate. show_ SQL} </prop> <prop key = "hibernate. format ">$ {hibernate. for Mat} </prop> <! -- As long as an empty database DDL is created, the database table can be automatically generated based on the object class --> <prop key = "hibernate. hbm2ddl. auto ">$ {hibernate. hbm2ddl. auto} </prop> </props> </property> <property name = "packagestoscan"> <list> <value> COM. gaozhi. school. **. model </value> <! -- Scan annotation object class, that is, model --> </List> </property> </bean>


Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.