Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7603079
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T23:34:39+00:00 2026-05-30T23:34:39+00:00

I have a project setup where i have a module which is present in

  • 0

I have a project setup where i have a module which is present in the WEB-INF/lib folder of the parent war file. This module contains a persistence.xml and an entity which i need to be loaded when the JPA container loads during startup. Somehow i need to merge the persistence units of the war and the lib jar. the persistence.xml of my war is present in WEB-INF/classes/META-INF hence it would take WEB-INF/classes as the persistence root and wouldnt understand the entity from my lib jar. That i found out the hard way.

I stumbled across multiple people suggesting solutions to this problem

http://ancientprogramming.blogspot.com/2007/05/multiple-persistencexml-files-and.html
And i also found out that there is Spring’s Data-jpa project which has a MergingPersistenceUnitManager which will merge the class definitions of the entities.

Here is my configuration

<bean id="pum" class="org.springframework.data.jpa.support.MergingPersistenceUnitManager">
  <property name="persistenceXmlLocations">
    <list>
     <value>classpath*:META-INF/persistence.xml</value>
    </list> 
  </property>
  <property name="defaultDataSource" ref="dataSource"></property>
</bean>


<bean id="entityManagerFactory" class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
    <property name="dataSource" ref="dataSource" />
    <property name="persistenceUnitName" value="LineManagement" />
    <property name="persistenceUnitManager" ref="pum"></property>
    <property name="jpaVendorAdapter">
        <bean class="org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter">
            <property name="generateDdl" value="false" />
            <property name="showSql" value="false" />
            <property name="databasePlatform" ref="cpsHibernateDialectClassName" />
        </bean>
    </property>

which doesnt work. It gives me an error
java.lang.NoSuchMethodError:org.springframework.data.jpa.support.MergingPersistenceUnitManager.getPersistenceUnitInfo(Ljava/lang/String;)Lorg/springframework/orm/jpa/persistenceunit/MutablePersistenceUnitInfo;

I have no clue how it gives me this error. From my understanding the MergingPersistenceUnitManager extends the DefaultPersistenceManager. Only thing i suspect is that there might be a conflict.

Here are my dependencies. spring-orm-3.0.2-RELEASE.jar and spring-data-jpa-1.0.3-RELEASE.jar.

I can go back to the ancient programming solution, but shouldnt it just work out of the box?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T23:34:40+00:00Added an answer on May 30, 2026 at 11:34 pm

    You have mismatching versions of spring-orm and spring-data-jpa. In general arbitrary versions are not guaranteed to play well together.

    MutablePersistenceUnitInfo getPersistenceUnitInfo – method is absent from the MergingPersistenceUnitManager (or actually from it’s superclass DefaultPersistenceUnitManager) in version orm version 3.0.2.

    From same class in version 3.0.5 you can find this method: DefaultPersistenceUnitManager.java Also maven pom for spring-data-jpa-1.0.3 lists dependency to spring-orm 3.0.5. So your problem is solved by using sprin-orm version 3.0.5.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a setup project for my C# program, and this setup project has
In the Setup Project I have 2 web.config files: web.config - used during the
This is my project setup: In visual studio I have a solution with a
We have a multi-module project documented with the (excellent) Sphinx. Our setup is not
I have setup url routing in my ASP.NET 4 project, which works perfectly offline.
I have a multimodule maven setup for my project, made of 5 modules, which
We have a multi-module project on which I wanted to use the release plugin.
I have a project to setup an anonymous feedback form to our website. I
I have a Project Collection setup in my TFS2010RC deployment. I have two Projects
I have a PHP project setup in Netbeans (v6.8) where all the PHP files

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.