I don't know if it's the right place to ask, if not... feel free to move the thread ;)
well, I`m using seam 2 with hibernate, ejb3, richfaces, ibm websphere and Rational Software Architect as my IDE (based on eclipse) and I tried to test my persistence entity packages, which are all located in an extra project.
I've created a new project with testng, which just should contain test-classes, who are referencing the entity classes in the persistence project, initiate them and run the tests... but it seems, it's not that easy. I added the imports in the test-classes to the entities in the persistence-project and all seems normal, no errors. I wrote a test, which just initiates the persistence entity, persist it to the oracle db, reads them out trough the entitiy-manager by using "find()" and remove the entity again from the db.
And here comes the error: at the point, where the entitiy-manager tries to persist the entity, I get the following error:
It seems like the application finds the class, otherwise the import wouldn't have worked, but when it tries to persist, it doesn't have the mapping, doesn't have the class in the runtime classpath or whatever. Maybe it's because there is a persistence.xml in the entity-package and an extra persistence.xml in the testng-project?
here's the persistence.xml from the testng-proect. I also tried to publish the class by adding the "<class>"-tag to the xml-file, but it cannot resolve the name? weird...
and the persistence.xml from the entity-project:
any suggestions? ;)
posted 9 years ago
i changed some project-dependencies and added the required class by using the "class"-tag in the persistence.xml. it works that way, my tests run without any errors, but isn't there a more sophisticated way available for adding entities? I don't want to add hundreds of classes to the xml-file just because I want to reach them through my tests
posted 9 years ago
anyone? there has to be a way to scan a path for entities....
Your buns are mine! But you can have this tiny ad: