- This topic has 11 replies, 3 voices, and was last updated 16 years ago by
support-joy.
-
AuthorPosts
-
unisys_polisMemberI 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 CThe 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?
May 26, 2009 at 6:07 am #298701
support-eugeneMemberPlease try to change you web project properties as shown on the screenshot.
Attachments:
You must be logged in to view attached files.May 26, 2009 at 7:16 am #298708
unisys_polisMemberThanks 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.May 26, 2009 at 7:25 am #298709
support-eugeneMemberDid you do mvn install for all projects?
May 26, 2009 at 7:48 am #298710
unisys_polisMemberI 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)May 26, 2009 at 7:55 am #298711
support-eugeneMemberI 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.
May 26, 2009 at 8:15 am #298713
unisys_polisMemberNo 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.May 26, 2009 at 8:20 am #298714
support-eugeneMemberI 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.
May 26, 2009 at 9:02 am #298717
unisys_polisMemberI 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.May 26, 2009 at 12:51 pm #298731
support-eugeneMember@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.May 27, 2009 at 9:22 am #298791
unisys_polisMemberNow 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…
May 28, 2009 at 4:35 am #298819
support-joyMemberGood to hear that you are all set.
-
AuthorPosts