Some of the information present in the PersistenceUnit configured in the persistence.xml file I'm using is presented below. All I find in online resources is that it may be a Glassfish bug and restart the server generally works. I'm not seeing any reasonable solution to approach this problem. I'm not closing the EntityManager directly anywhere in the code either. However, I thought this opening and closing of the EntityManager was managed automatically. I understand that the EntityManager is closed when I try to perform the operation and that is indeed the problem. Right after receiving a request, this class calls the respective singleton bean, based on the request, passing the injected EntityManager to the respective bean. The entity manager is being injected outside of the bean in the of a annotated class, using the line '(EntityManager)new InitialContext().lookup("java:comp/env/persistence/etc") ' This is the class that receives all the incoming requests and decides which bean should be called, based on request. And when this error happens, it is always originated by a call to a WebService deployed in the same server that performs a find in the database using the method 'find' from the entityManager instance. The next line of the log was the call to an WebService deployed in the same server. The log goes on, but I just showed the top of it. (EntityManagerImpl.java: 532) ~Īt .(EntityManagerWrapper.java: 320) ~ : Attempting to execute an operation on a closed EntityManager.Īt. Copy Code ERROR. Attempting to execute an operation on a closed EntityManager. Grave: Exception while invoking class .JPADeployer prepare method Grave: Exception while preparing the app Grave: Exception EclipseLink-28018 (Eclipse Persistence Services - 2.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |