I'm trying to run a simple dataImport class which is using JPA and Hibernate.
If I run my class, i always have the following error:
Exception in thread "main" java.lang.IllegalArgumentException: Unknown entity: ch.itartis.relman.entities.code.ReferenceCode
at org.hibernate.ejb.AbstractEntityManagerImpl.persist(AbstractEntityManagerImpl.java:675)
at ch.itartis.relman.service.test.dataimport.DataImport.doSave(DataImport.java:111)
at ch.itartis.relman.service.test.dataimport.DataImport.main(DataImport.java:43)
My Class is located in the src/test/java/ folder, I have a service-config.xml in src/test/resources/ and I also have a persistence.xml in src/test/resources/META-INF/.
If I run the class in in the src/main/java/... folder, it works. But if I want to have the class in src/test/java/, it doesn't.
What am I doing wrong?
Thanks a lot!