| Re: [eclipselink-users] Eclipselink 2 / JPA 2 integration with Spring on WebLogic 12.1.1 |
Michael, Hi, I would put your entities in one of the standard locations – for EE 1) Beside the persistence.xml 2) In their own java SE jar (matches p.445 section 13-11 of the Pro JPA 2 book) 3) Persistence archive collatzEAR +--- APP-INF +--- classes (empty) +--- lib (empty) +--- lib +--- collatzModel.jar +--- collatzEJB.jar (/META-INF/persistence.xml – is here) +--- collatzWeb.jar Normally, I would recommend 2) and decouple the entities from any EE or Web tier so you can use them anywhere as well as SE junit test them. If you follow the structure of the examples directory – you will see an example of 2) However, I since your persistence.xml and entities are both off of the classes classloader – I would expect this to be ok. I normally work with jars in the EAR where the model jar is separate from the ejb.jar and the war jar. There is a use case for application managed deployments putting everything off the app-inf folder. I will look more into the spring use case when I have more time later today or tomorrow and get back to you – as I find all possible deployment scenarios of high interest. Thank you / Michael O’Brien From: Michael Gitelman [mailto:mgitelman@xxxxxxxxxxxxxxx] Michael, Thank you for your response. I completely switched to the Spring DI and got rid of EJB: configuring Spring and EJB proved to be too complicated and besides the rest of the application is using Spring configuration. What you are telling me about the CNFE exception makes a lot of sense. I thought I should be fine: I deploy the application as an exploded EAR directory; my entity classes are in APP-INF/classes of the exploded EAR; my persistence.xml is in APP-INF\classes\META-INF. What do you think is wrong? Best regards, Michael Gitelman Delphi Technology, Inc. One Washington Mall, Suite 3 Boston, MA 02108 O: 617 259 1256 F: 617 778 2296 Experience, Innovation... Results. From: Michael O'Brien [mailto:Michael.F.Obrien@xxxxxxxxx] Michael, Hi, I will look into your spring configuration when I get back into the office later today. If you switch from EE container managed spec development to VMWare spring development – your configuration could change in several ways depending on whether you are running the spring DI container in your WAR or EJB container. From a quick look on my IPhone, the CNFE exception is due to the persistence unit and entity classes being in different classloaders. The weaving exception I will need to look at. Normally the EJB container proxy handles this without Spring. /Michael From: Michael Gitelman [mailto:mgitelman@xxxxxxxxxxxxxxx] Hi Michael, Thank you for your help on trying to make JPA 2 / EclipseLink 2 to work on Weblogic 10.3.4. I have been able to persuade my superiors to move to WebLogic 12.1.1. However, I am having a bit of a problem trying to deploy my persistence.xml. I have changed my design a bit. Now, instead of an EJB I am using a Spring configured DAO class (I am integrating my piece into a larger Spring-configured application). I use the same entities. I believe my problem is due to the Spring configuration. That’s how my project looks like: DAO Class
A sample entity class
persistence.xml
Spring configuration:
If I use “loadTimeWeaver” it wouldn’t deploy and throw the following exception:
If I comment out the reference to “loadTimeWeaver” I would get the following strange error:
Do you know what is wrong with my configuration? Best regards, Michael Gitelman Delphi Technology, Inc. One Washington Mall, Suite 3 Boston, MA 02108 O: 617 259 1256 F: 617 778 2296 Experience, Innovation... Results. |