• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Liutauras Vilda
  • Junilu Lacar
  • Jeanne Boyarsky
  • Bear Bibeault
  • Knute Snortum
  • Tim Cooke
  • Devaka Cooray
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
  • Piet Souris
  • Frits Walraven
  • Ganesh Patekar

javax.persistence dependency error using spring-context

Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey guys,

I am developping an applciation using spring-data jpa. The application launches and runs without any problem, but when I want to write unit tests using spring-context, it seems that I have a dependency conflict due to a JPA1 dependency(I think brought by spring-context.

He is my Test:

My Stacktrace:

My maven dependency tree:

Thanks in advance,


Posts: 2759
Eclipse IDE Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, you are indeed, right. SOmewhere JPA1 classes have been added to the mix, and the classloader is loading the class from JPA1. If you have the whole project open in Eclipse, and you are using a m2eclipse plugin, you can ask Eclipse to open PersistenceUnit type. Eclipse convinently tells you which jars in the classpath have that class. You have your answer right there

If that doesn't get you what you need then add <argLine>-verbose</argLine> to the maven sure fire plugin configuration. When you run the test it will log where each class is loaded from. That will give you where the JPA1 class is coming from
Villains always have antidotes. They're funny that way. Here's an antidote disquised as a tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!