1 Reply Latest reply: Jul 5, 2012 2:37 PM by Joe Weinstein-Oracle RSS

    Duplicate persistence error -- deploying GlassFish application in Weblogic


      I am using NetBeans to deploy a web application which has RESTful web services. I am using Weblogic 12c and MySQL database. The NBproject MyAppServer includes another NB project MyAppLibrary. Both MyAppServer and MyAppLibrary have their own perisitence.xml files. Both projects are referencing the same database. The application was previously deployed in GlassFish and worked perfectly. However, migrating to Weblogic gives me the following error:

      "Deployment failed. The message was: weblogic.application.naming.EnvironmentException: duplicate persistence units with name MyAppLibraryPU in scope web. First PU location: file:/C:/cygwin/home/test/myfolder/apps/MyApp/MyAppServer/build/web/WEB-INF/classes/. Second PU location: file:/C:/Oracle/Middleware/user_projects/domains/base_domain/servers/AdminServer/tmp/_WL_user/MyAppServer/ub3nr6/war/WEB-INF/lib/MyAppLibrary.jar"

      I changed the name of the persistence unit in persistence.xml of MyAppServer, which resulted in no error being logged, but the server-side of the application doesn't run correctly now i.e. apparently no data was retrieved from the database.

      Any help will be appreciated.