• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

javax.persistence dependency error using spring-context

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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,

Mario

 
Rancher
Posts: 2759
32
Eclipse IDE Spring Tomcat Server
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic