| Summary: | redeployment does not work on weblogic for non-managed persistence units, "not a known entity type" | ||
|---|---|---|---|
| Product: | z_Archived | Reporter: | James Sutherland <jamesssss> |
| Component: | Eclipselink | Assignee: | Project Inbox <eclipselink.orm-inbox> |
| Status: | NEW --- | QA Contact: | |
| Severity: | major | ||
| Priority: | P2 | CC: | a.elmaksoud, iker.olabarria, john.cecere, michael.f.obrien, tom.ware, tszho.siu |
| Version: | unspecified | Flags: | michael.f.obrien:
documentation+
|
| Target Milestone: | --- | ||
| Hardware: | PC | ||
| OS: | Windows XP | ||
| URL: | http://wiki.eclipse.org/EclipseLink/Development/JPA_2.0/weblogic#Results_Matrix | ||
| Whiteboard: | |||
| Bug Depends on: | |||
| Bug Blocks: | 338676 | ||
|
Description
James Sutherland
There should also be a way to manually undeploy a persistence unit. Their is an undeploy on EntityManagerSetupImpl, but no way to access this from an EntityManagerFactoryImpl. It should have a getEntityManagerSetup method, as well as an undeploy method. Also the cached setup impls in the static EntityManagerSetupImpl never seem to ever get cleared, this does not seem correct. i have same issue any news to solve it >>>>>work around restart the server Just moved from JPA 1/Eclipse 2.1 to JPA 2/Eclipse 2.3 and started encountering this problem. Having to bounce WebLogic every time I do a redeploy is becoming time-consuming. Is this fixed in a later release? Are there any plans to fix it in 2.3? I tried implementing a listener in WebLogic with a preStop method that closes the EntityManagerFactory. This had no effect. Encounter the same issue, definitely there is a caching of old class definition issue. The classloader of eclipselink library is the WebLogic system class loader whereas the classloader of the entity classes is the EAR application class loader, everytime when redeployment of application occur, a new set of entity classes are loaded in a new EAR application class loader. Somehow the eclipselink's EntityManagerFactory in the WebLogic system class loader still reference to the old entity classes definition. So, everytime need to restart the server when re-deployment is needed. This issue happen when u create EntityManagerFactory manulally like Persistence.createEntityManagerFactory serveral times. Your application should create it once on startup and destory it when the application undeploy If its web app create ServletContextListener *in contextInitialized method create it once[as golobal varibale or using single tone class] EntityManagerFactory fact = Persistence.createEntityManagerFactory *and in contextDestroyed method fact.close() (In reply to Ahmed Abb Elmaksoud from comment #6) > This issue happen when u create EntityManagerFactory manulally like > Persistence.createEntityManagerFactory serveral times. > Your application should create it once on startup and destory it when the > application undeploy > If its web app create ServletContextListener > > *in contextInitialized method create it once[as golobal varibale or using > single tone class] EntityManagerFactory fact = > Persistence.createEntityManagerFactory > > > *and in contextDestroyed method fact.close() In my case, no, it is managed by the server, I called it through injection annotation @PersistenceContext. I am not sure how to close the container-managed EntityManagerFactory. Try to search in your app anyone else is using EntityManagerFactory or not may be any other Lib I think there is no bug. I had the same behaviour because of not closing the persistence service. Into my infraestrcuture i use weblogic + eclipselink + guice-persist. Guice has a PersisteService. In many example u can see how to start this service... but not to stop it. If you don't stop it the behaviour is that after a redploy Weblogic does not know about the entities, getting an ", "not a known entity type" error. ... but if you stop the PersistService, there is no issue.!!! I started also an Stackoverflow post about this: http://stackoverflow.com/questions/28604296/eclipselink-jpa-guice-persist-and-redeployments The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink |