You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomee.apache.org by larxxor <la...@rimfaxe.com> on 2015/09/29 12:33:54 UTC

DuplicateDeploymentIdException, same EJB found twice in claspath scan

I have an EAR (originally developed for weblogic, but now being
Tomee'ified).

It contains various libs, an EJB Module, and a WAR module.

When it deploys, it correctly scans the EJB module, and finds my beans.
Great. 

But then it tries to deploy the WAR, and scans the classpath again, finds
all the same EJBs all over again. And complains about Duplicate id's.

The annotated ejbs are present in one jar only, the EJB module. 
I feel like I'm missing som important aspect of deploying to Tomee here. Am
I supposed to turn of the scan in the war, and if so, how?



--
View this message in context: http://tomee-openejb.979440.n4.nabble.com/DuplicateDeploymentIdException-same-EJB-found-twice-in-claspath-scan-tp4676366.html
Sent from the TomEE Users mailing list archive at Nabble.com.

Re: DuplicateDeploymentIdException, same EJB found twice in claspath scan

Posted by larxxor <la...@rimfaxe.com>.
Solved the issue by repackaging.

This setup is apparently NOT supported by Tomee in its current form
(although a common pattern) :

EAR  | APP-INF
       | META-INF
       | EJB-module jar containing annotated beans
       | WAR containing annotated webservices inside WEB-INF/classes


This setup is recognized by Tomee however :

EAR  | APP-INF
       | META-INF
       | WAR containing annotated webservices and beans  inside
WEB-INF/classes


Packaging is easy, but the above behaviour should probably be remedied or
documented. 




--
View this message in context: http://tomee-openejb.979440.n4.nabble.com/DuplicateDeploymentIdException-same-EJB-found-twice-in-claspath-scan-tp4676366p4676376.html
Sent from the TomEE Users mailing list archive at Nabble.com.

Re: DuplicateDeploymentIdException, same EJB found twice in claspath scan

Posted by larxxor <la...@rimfaxe.com>.
I was wrong, the duplicate ID issue is still there, it was just delayed by
the previous errors.

The id's have changed per the suggested pattern, but they are still
duplicates.

Note that the EJB module and WAR resides in the same EAR. That is common
practice in other containers, but appears not to be best practice in Tomee?



--
View this message in context: http://tomee-openejb.979440.n4.nabble.com/DuplicateDeploymentIdException-same-EJB-found-twice-in-claspath-scan-tp4676366p4676375.html
Sent from the TomEE Users mailing list archive at Nabble.com.

Re: DuplicateDeploymentIdException, same EJB found twice in claspath scan

Posted by larxxor <la...@rimfaxe.com>.
I was running 1.7.1, tried 1.7.2 instead. Works better, no complains about
duplicate id's.

Although I'm now sorting out other issues. Sealed jdbc package, WS classpath
issues. But those seem easier to solve.



--
View this message in context: http://tomee-openejb.979440.n4.nabble.com/DuplicateDeploymentIdException-same-EJB-found-twice-in-claspath-scan-tp4676366p4676374.html
Sent from the TomEE Users mailing list archive at Nabble.com.

Re: DuplicateDeploymentIdException, same EJB found twice in claspath scan

Posted by Felipe Jaekel <fk...@gmail.com>.
Try to set the property *openejb.deploymentId.format* to
*{appId}/{ejbJarId}/{ejbName}* on *system.properties*

2015-09-29 7:33 GMT-03:00 larxxor <la...@rimfaxe.com>:

>
> I have an EAR (originally developed for weblogic, but now being
> Tomee'ified).
>
> It contains various libs, an EJB Module, and a WAR module.
>
> When it deploys, it correctly scans the EJB module, and finds my beans.
> Great.
>
> But then it tries to deploy the WAR, and scans the classpath again, finds
> all the same EJBs all over again. And complains about Duplicate id's.
>
> The annotated ejbs are present in one jar only, the EJB module.
> I feel like I'm missing som important aspect of deploying to Tomee here. Am
> I supposed to turn of the scan in the war, and if so, how?
>
>
>
> --
> View this message in context:
> http://tomee-openejb.979440.n4.nabble.com/DuplicateDeploymentIdException-same-EJB-found-twice-in-claspath-scan-tp4676366.html
> Sent from the TomEE Users mailing list archive at Nabble.com.
>