I'm developing a web application using Spring MVC runing on glassfish.
Globaly every is going well but the test purpose.
Since for the webapp i have to decalre in web.xml
to make it able to identify persistence unit name in the DAO classCode:<persistence-context-ref> <persistence-context-ref-name>MyApp_JTA</persistence-context-ref-name> <persistence-unit-name>MyApp_JTA</persistence-unit-name> </persistence-context-ref>
but this make the test using JUnit fails since it uses another persistence unit that doesn't need to be hard coded the as shown above.Code:@PersistenceContext(unitName = "MyApp_JTA") private EntityManager em;
So any suggestion ? thanks


Reply With Quote
