facebook

Problem with JPA Deployment

  1. MyEclipse Archived
  2.  > 
  3. Application Servers and Deployment
Viewing 12 posts - 1 through 12 (of 12 total)
  • Author
    Posts
  • #298699 Reply

    unisys_polis
    Member

    I have 4 Maven Projects,
    – Project A :
    Is a Maven Java Project. I use this Project for Object serialization over JPA so it contains a persistance.xml in the META-INF folder. The packaging type for this project is JAR
    – Project B :
    Is a Maven Java Project. Project B depends on Project A. The packaging type for this project is JAR.
    – Project C:
    Is a WebProject with maven support. It depends on Project B.
    – Project D:
    Is a maven EAR project and depends on Project A,B and C

    The Application Server i use is Weblogic 10.3

    If i build my projects and deploy the EAR everything works fine. But if i try to debug or just run the Project C over MyEclipse i get the following error message from Weblogic:
    weblogic.deployment.EnvironmentException: duplicate persistence units with name…
    I analysed the weblogic autodeployment folder and i think the problem is that it contains 2 persistance.xml Files. The first one is located in the ProjectC\WEB-INF\classes\META-INF folder and the second one in the ProjectC\WEB-INF\lib\projectB.jar Jar file.

    Do you have any suggestion to solve that problem?

    #298701

    Please try to change you web project properties as shown on the screenshot.

    Attachments:
    You must be logged in to view attached files.
    #298708

    unisys_polis
    Member

    Thanks for the quick answer
    It still not works. The persistance.xml is not in the ProjectC\WEB-INF\classes\META-INF Folder anymore but now i have the persistance.xml in 2 Jar files. One Jar is the maven generated on (ProjectName-Version-SNAPSHOT.jar) and the other is named as ProjectName_classes.jar). Both are located in the WEB-INF\lib Folder.

    #298709

    Did you do mvn install for all projects?

    #298710

    unisys_polis
    Member

    I just make a installation over console not in MyEclipse. Now i try to install all project in MyEclipse (run as-> maven install). Everything works fine except the WebProject. Here i get following exception:

    Exception in thread “main” com.thoughtworks.xstream.converters.ConversionException: dependenciesInfo : dependenciesInfo
    —- Debugging information —-
    message : dependenciesInfo : dependenciesInfo
    cause-exception : com.thoughtworks.xstream.mapper.CannotResolveClassException
    cause-message : dependenciesInfo : dependenciesInfo
    class : org.apache.maven.plugin.war.util.WebappStructure
    required-type : org.apache.maven.plugin.war.util.WebappStructure
    path : /webapp-structure/dependenciesInfo
    line number : 33
    ——————————-
    at com.thoughtworks.xstream.core.TreeUnmarshaller.convert(TreeUnmarshaller.java:63)
    at com.thoughtworks.xstream.core.AbstractReferenceUnmarshaller.convert(AbstractReferenceUnmarshaller.java:45)
    at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:46)
    at com.thoughtworks.xstream.core.TreeUnmarshaller.start(TreeUnmarshaller.java:117)
    at com.thoughtworks.xstream.core.ReferenceByXPathMarshallingStrategy.unmarshal(ReferenceByXPathMarshallingStrategy.java:29)
    at com.thoughtworks.xstream.XStream.unmarshal(XStream.java:846)
    at com.thoughtworks.xstream.XStream.unmarshal(XStream.java:833)
    at com.thoughtworks.xstream.XStream.fromXML(XStream.java:781)
    at org.apache.maven.plugin.war.util.WebappStructureSerializer.fromXml(WebappStructureSerializer.java:48)
    at org.apache.maven.plugin.war.AbstractWarMojo.buildWebapp(AbstractWarMojo.java:346)
    at org.apache.maven.plugin.war.AbstractWarMojo.buildExplodedWebapp(AbstractWarMojo.java:317)
    at org.apache.maven.plugin.war.WarMojo.performPackaging(WarMojo.java:166)
    at org.apache.maven.plugin.war.WarMojo.execute(WarMojo.java:130)
    at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:579)
    at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:498)
    at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegmentForProject(DefaultLifecycleExecutor.java:265)
    at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:191)
    at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:149)
    at org.apache.maven.DefaultMaven.execute_aroundBody0(DefaultMaven.java:223)
    at org.apache.maven.DefaultMaven.execute_aroundBody1$advice(DefaultMaven.java:304)
    at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:1)
    at org.apache.maven.embedder.MavenEmbedder.execute_aroundBody2(MavenEmbedder.java:904)
    at org.apache.maven.embedder.MavenEmbedder.execute_aroundBody3$advice(MavenEmbedder.java:304)
    at org.apache.maven.embedder.MavenEmbedder.execute(MavenEmbedder.java:1)
    at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:176)
    at org.apache.maven.cli.MavenCli.main(MavenCli.java:63)
    at org.apache.maven.cli.MavenCli.main(MavenCli.java:52)

    #298711

    I beg your pardon, I didn’t mean you should run “mvn install” – I’m only trying to reproduce your issue locally. As for your previous comment – it’s some Maven problem, I don’t think it has something to do with your deployment one.

    #298713

    unisys_polis
    Member

    No Problem.
    The Installation over console (mvn install) did i already before your post. This works fine without problems. After your post i try to install over MyEclipse, this also works for the Jar projects but not for the WebProject.
    Maybe that helps you:
    The jar file generated by maven (*SNAPSHOT.jar) for the JPA project is already in my local store.

    #298714

    I can’t reproduce your issue – i.e. library project packaged twice in web application. Can you try undeploy and redeploy the project using MyEclipse? I believe that there’s a chance Maven deployment conflicts with ME one.

    #298717

    unisys_polis
    Member

    I remove the deplyment in the server tag and deploy it again. But has no effect. Still the same error.
    By the way i never deploy manually, except for testing the ear. I always click “Run as -> MyEclipse Server Application” to start the project.

    #298731

    @unisys_polis wrote:

    I remove the deplyment in the server tag and deploy it again. But has no effect. Still the same error.
    By the way i never deploy manually, except for testing the ear. I always click “Run as -> MyEclipse Server Application” to start the project.

    I can’t reproduce the issue…
    Can you provide dependencies as written in your pom.xmls? You can replace your company’s IDs with something random.

    #298791

    unisys_polis
    Member

    Now it is working 🙂
    I make a competly new workspace and setup all projects again.
    The initial project was made by another person on MyEclipse 7.0. But i working with MyEclipse 7.1.
    Maybe the different MyEclipse Version leads to this strange problems.

    Thank you very much for your help…

    #298819

    support-joy
    Member

    Good to hear that you are all set.

Viewing 12 posts - 1 through 12 (of 12 total)
Reply To: Problem with JPA Deployment

You must be logged in to post in the forum log in