Win a copy of 97 Things Every Java Programmer Should Know this week in the Java in General forum!
  • 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 ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Frits Walraven
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • salvin francis
  • fred rosenberger

javax.persistence dependency error using spring-context

 
Greenhorn
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,

Mario

 
Rancher
Posts: 2759
32
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
 
She said she got a brazillian. I think owning people is wrong. That is how I learned ... tiny ad:
Devious Experiments for a Truly Passive Greenhouse!
https://www.kickstarter.com/projects/paulwheaton/greenhouse-1
    Bookmark Topic Watch Topic
  • New Topic