Maven dependency for ejb and war

I have an ear with an ejb and a war.

| ear
| ---> ejb
| ---> war
| ---  ---> WEB-INF/lib
| ---  ---  ---> primefaces.jar
| ---> other dependency libs
| ---> primefaces.jar

I want to use primefaces push to send messages from the ejb service layer to the web clients. Therefore i need i have a dependency from the ejb and from the war to the primefaces.jar.

But i don't now how to solve this. My current problem is, that i have doubled the jar. But this leeds to a linker exception:

loader constraint violation: when resolving method "de.digitaljukebox.service.PushService.setEventBus(Lorg/primefaces/push/EventBus;)V" the class loader (instance of org/jboss/modules/ModuleClassLoader) of the current class, TestBean, and the class loader (instance of org/jboss/modules/ModuleClassLoader) for the method's defining class, PushService, have different Class objects for the type org/primefaces/push/EventBus used in the signature

I need to keep primefaces in my WEB-INF/lib, otherwise the components won't work.

I tried to set the dependency of the EJB with

<scope>provided</scope>

but the ejb does not find the jar in the WEB-INF/lib folder...

Does anyone have an idea how to solve that maven dependency mess?


Setting:
Primefaces 6.0
Wildfly 10

链接地址: http://www.djcxy.com/p/82670.html

上一篇: Windows Mobile 6.5上的CAB自动更新

下一篇: Maje依赖于ejb和war