jboss-deployment-structure.
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
15.
16.
17.
18.
19.
20.
21.
22.
23.
<jboss-deployment-structure>
<deployment>
<dependencies>
<module name="by.lib" meta-inf="export" export="true"/>
</dependencies>
<exclusions>
<module name="org.apache.log4j"/>
<module name="org.slf4j"/>
<module name="org.apache.commons.logging"/>
<module name="org.log4j"/>
<module name="org.jboss.logging"/>
</exclusions>
</deployment>
<sub-deployment name="api.ejb-1.1.jar">
<exclusions>
<module name="org.apache.log4j"/>
<module name="org.slf4j"/>
<module name="org.apache.commons.logging"/>
<module name="org.log4j"/>
<module name="org.jboss.logging"/>
</exclusions>
</sub-deployment>
...
Server_10.1.0\modules\by\lib\main\modules.xml
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
15.
16.
17.
18.
19.
20.
21.
22.
23.
24.
25.
26.
27.
- <module xmlns="urn:jboss:module:1.3" name="by.softclub.mobile.lib">
- <resources>
<resource-root path="apache-any23-api-1.1.jar" />
<resource-root path="commons-codec-1.10.0.redhat-5.jar" />
<resource-root path="commons-collections-3.2.2.redhat-2.jar" />
<resource-root path="commons-digester-1.8.1.redhat-4.jar" />
<resource-root path="commons-lang-2.6.jar" />
<resource-root path="commons-lang3-3.5.jar" />
<resource-root path="commons-logging-1.2.jar" />
<resource-root path="joda-time-2.9.6.jar" />
<resource-root path="gson-2.8.0.jar" />
<resource-root path="itext-2.1.7.js5.jar" />
<resource-root path="jasperreports-6.4.0.jar" />
<resource-root path="jasperreports-fonts-6.0.0.jar" />
<resource-root path="json-simple-1.1.1.jar" />
<resource-root path="log4j-1.2.17.jar" />
<resource-root path="ojdbc6-11.2.0.4.jar" />
<resource-root path="opencsv-3.8.jar" />
<resource-root path="primefaces-6.0.jar" />
<resource-root path="tika-parsers-1.14.jar" />
<resource-root path="xercesImpl-2.11.0.SP5-redhat-1.jar" />
</resources>
- <dependencies>
<module name="javax.faces.api" />
<module name="javax.api" />
</dependencies>
</module>
pom.xml
1.
2.
3.
4.
5.
6.
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>${log4j.version}</version>
<scope>provided</scope>
</dependency>
В standalone.xml прописаны настройки для внешнего log4.xml
Ловлю ошибку
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
15.
16.
17.
18.
19.
20.
21.
22.
23.
24.
25.
26.
27.
28.
29.
30.
31.
32.
33.
Caused by: java.lang.LinkageError: loader constraint violation: when resolving field "DEBUG_LOGGER" the class loader (instance of org/jboss/modules/ModuleClassLoader) of the referring class, by/util/LoggerUtil, and the class loader (instance of org/jboss/modules/ModuleClassLoader) for the field's resolved type, org/apache/log4j/Logger, have different Class objects for that type
at by.api.session.SessionServiceBean$AbstractLoginResponseBuilder.build(SessionServiceBean.java:254)
at by.api.session.SessionServiceBean.login(SessionServiceBean.java:95)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at org.jboss.as.ee.component.ManagedReferenceMethodInterceptor.processInvocation(ManagedReferenceMethodInterceptor.java:52)
at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
at org.jboss.invocation.InterceptorContext$Invocation.proceed(InterceptorContext.java:437)
at org.jboss.as.weld.ejb.Jsr299BindingsInterceptor.doMethodInterception(Jsr299BindingsInterceptor.java:82)
at org.jboss.as.weld.ejb.Jsr299BindingsInterceptor.processInvocation(Jsr299BindingsInterceptor.java:93)
at org.jboss.as.ee.component.interceptors.UserInterceptorFactory$1.processInvocation(UserInterceptorFactory.java:63)
at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
at org.jboss.as.ejb3.component.invocationmetrics.ExecutionTimeInterceptor.processInvocation(ExecutionTimeInterceptor.java:43)
at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
at org.jboss.as.jpa.interceptor.SBInvocationInterceptor.processInvocation(SBInvocationInterceptor.java:47)
at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
at org.jboss.invocation.InterceptorContext$Invocation.proceed(InterceptorContext.java:437)
at org.jboss.weld.ejb.AbstractEJBRequestScopeActivationInterceptor.aroundInvoke(AbstractEJBRequestScopeActivationInterceptor.java:64)
at org.jboss.as.weld.ejb.EjbRequestScopeActivationInterceptor.processInvocation(EjbRequestScopeActivationInterceptor.java:83)
at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
at org.jboss.as.ee.concurrent.ConcurrentContextInterceptor.processInvocation(ConcurrentContextInterceptor.java:45)
at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
at org.jboss.invocation.InitialInterceptor.processInvocation(InitialInterceptor.java:21)
at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
at org.jboss.invocation.ChainedInterceptor.processInvocation(ChainedInterceptor.java:61)
at org.jboss.as.ee.component.interceptors.ComponentDispatcherInterceptor.processInvocation(ComponentDispatcherInterceptor.java:52)
at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
at org.jboss.as.ejb3.component.pool.PooledInstanceInterceptor.processInvocation(PooledInstanceInterceptor.java:51)
at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
at org.jboss.as.ejb3.tx.CMTTxInterceptor.invokeInOurTx(CMTTxInterceptor.java:275)
... 124 more
Я понимаю, что две библиотеки с двумя версиями, куда можно еще глянуть, что забыл настроить?