Exclude hibernate-validator module in Wildfly 8.2.1 - spring-boot

I'm attempting to deploy the packager-01 EAR from https://github.com/dewthefifth/java-examples/tree/master/multi-ear-jms on Wildfly 8.2.1, and am receiving the following error because Wildfly is insisting on loading the hibernate-validator module out of $JBOSS_HOME/modules/org/hibernate/validator/main instead of the one located inside of my EAR.
Caused by: java.lang.RuntimeException: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.boot.context.properties.ConfigurationPropertiesBindingPostProcessor': Invocation of init method failed; nested exception is java.lang.AbstractMethodError: org.hibernate.validator.engine.ConfigurationImpl.getDefaultParameterNameProvider()Ljavax/validation/ParameterNameProvider;
at io.undertow.servlet.core.DeploymentManagerImpl.deploy(DeploymentManagerImpl.java:223)
at org.wildfly.extension.undertow.deployment.UndertowDeploymentService.startContext(UndertowDeploymentService.java:87)
at org.wildfly.extension.undertow.deployment.UndertowDeploymentService.start(UndertowDeploymentService.java:72)
at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1948) [jboss-msc-1.2.2.Final.jar:1.2.2.Final]
at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1881) [jboss-msc-1.2.2.Final.jar:1.2.2.Final]
... 3 more
Note: this is a custom deployed module required by a different application deployed on the same app server. Prior to deploying the other application, which includes multiple custom hibernate modules, I was able to get the EAR to deploy.
I've attempted to exclude the validator module using the following jboss-deployment-structure (assembled out of basically adding every exclusion any google result even hinted at), but have had no luck. No matter what I do the validator being loaded is Hibernate Validator 4.2.0.Final while the validator I'm providing in my EAR is hibernate-validator-6.0.7.Final.jar.
<jboss-deployment-structure>
<!-- Make sub deployments isolated by default, so they cannot see each others classes without a Class-Path entry -->
<ear-subdeployments-isolated>false</ear-subdeployments-isolated>
<!-- This corresponds to the top level deployment. For a war this is the war's module, for an ear -->
<!-- This is the top level ear module, which contains all the classes in the EAR's lib folder -->
<deployment>
<exclude-subsystems>
<subsystem name="jaxrs" />
<subsystem name="resteasy" />
</exclude-subsystems>
<exclusions>
<!-- Exclude Jackson - I included my own -->
<module name="com.fasterxml.jackson.core.jackson-annotations" />
<module name="com.fasterxml.jackson.core.jackson-core" />
<module name="com.fasterxml.jackson.core.jackson-databind" />
<module name="com.fasterxml.jackson.jaxrs.jackson-jaxrs-json-provider" />
<module name="org.jboss.resteasy.resteasy-jackson-provider" />
<module name="org.jboss.resteasy.resteasy-jackson2-provider" />
<module name="org.apache.xalan" />
<module name="org.apache.xerces" />
<module name="org.jboss.logging" />
<!-- Exclude Hibernate -->
<module name="org.hibernate" />
<!-- Exclude hibernate validation -->
<module name="org.jboss.resteasy.resteasy-validator-provider-11" />
<module name="org.hibernate.validator" />
<module name="javax.validation.api" />
<module name="javaee.api" />
<module name="javax.faces.api" />
</exclusions>
<!-- This allows you to define additional dependencies, it is the same as using the Dependencies: manifest attribute -->
<dependencies>
</dependencies>
</deployment>
If anybody knows which subsystem I need to exclude I'd greatly appreciate the help.
Note: I'm sharing my Wildfly 8.2.1, and even using my Wildfly 8.2.1 because those are constraints placed on me by my customer deployment site.
Update 1:
Thanks for the help so far.
I've reached the point that my new excludes list includes the following
false
<module name="org.jboss.resteasy.resteasy-jackson-provider" />
<module name="org.jboss.resteasy.resteasy-jackson2-provider" />
<module name="org.apache.xalan" />
<module name="org.apache.xerces" />
<module name="org.jboss.logging" />
<!-- Exclude Hibernate -->
<module name="org.hibernate" />
<module name="javax.persistence.api" />
<!-- Exclude hibernate validation -->
<module name="org.hibernate.validator" />
<module name="org.jboss.invocation" />
<module name="org.jboss.as.connector" />
<module name="org.jboss.as.ee" />
<module name="org.jboss.as.jpa" />
<module name="org.jboss.as.jpa.hibernate" />
<module name="javax.resource.api" />
<module name="org.jboss.as.ejb-client" />
<module name="org.jboss.as.weld" />
<module name="org.jboss.ironjacamar.impl" />
<module name="org.jboss.ironjacamar.jdbcadapters" />
<module name="org.jboss.resteasy.resteasy-jaxrs" />
<module name="org.jboss.resteasy.resteasy-validator-provider-11" />
<module name="javaee.api" />
<module name="javax.el.api" />
<module name="javax.enterprise.api" />
<module name="javax.faces.api" />
<module name="javax.persistence.api" />
<module name="javax.servlet.jsp.api" />
<module name="javax.validation.api" />
</exclusions>
<!-- This allows you to define additional dependencies, it is the same as using the Dependencies: manifest attribute -->
<dependencies>
</dependencies>
</deployment>
which I determined by turning TRACE level logging on for all JBOSS and basically adding exclusions the the first listed entry until I stopped seeing Hibernate 4.0.2 was being loaded. I haven't yet been able to run down exactly which of these were the real culperite, but we're getting somewhere.
I will add that the WAR no longer deploys, now because it's missing core jee libraries... (as you might expect). I'll update as I find time, hopefuly eventually producing the genuine (minimal) set of exclusions required for it to work.

I think you need to exclude it from all dependencies also. I'm working on 6.4EAP so it could change slightly for your version of jboss, but try it. So go to your modules jboss subdirectory and grep for org.hibernate.validator (grep -ir "org.hibernate.validator" .) if you are on linux.
That will show you result like:
./system/layers/base/org/hibernate/validator/main/module.xml:<module xmlns="urn:jboss:module:1.1" name="org.hibernate.validator">
./system/layers/base/org/jboss/as/jpa/hibernate/3/module.xml: <module name="org.hibernate.validator"/>
./system/layers/base/org/jboss/as/jpa/hibernate/4/module.xml: <module name="org.hibernate.validator"/>
./system/layers/base/org/jboss/as/jpa/main/module.xml: <module name="org.hibernate.validator"/>
./system/layers/base/org/jboss/as/ee/main/module.xml: <module name="org.hibernate.validator" optional="true"/>
./system/layers/base/org/jboss/as/connector/main/module.xml: <module name="org.hibernate.validator"/>
./system/layers/base/org/jboss/resteasy/resteasy-hibernatevalidator-provider/main/module.xml: <module name="org.hibernate.validator"/>
./system/layers/base/org/jboss/ironjacamar/impl/main/module.xml: <module name="org.hibernate.validator"/>
./system/layers/base/org/jboss/ironjacamar/jdbcadapters/main/module.xml: <module name="org.hibernate.validator"/>
Then you could know which modules you need and from which you need to exclude it. Here I'm posting my configuration...maybe it will help you
<deployment>
<exclusions>
<module name="org.apache.log4j"/>
<module name="org.apache.commons.logging"/>
<module name="org.slf4j"/>
<module name="org.jboss.logging"/>
<module name="org.hibernate"/>
<module name="org.hibernate.validator"/>
<module name="javaee.api"/>
<module name="javax.el.api"/>
<module name="javax.enterprise.api"/>
<module name="javax.faces.api"/>
<module name="javax.persistence.api"/>
<module name="javax.servlet.jsp.api"/>
<module name="javax.validation.api"/>
</exclusions>
<dependencies>
<module name="javax.annotation.api" export="true"/>
<module name="javax.ejb.api" export="true"/>
<module name="javax.interceptor.api" export="true"/>
<module name="org.jboss.modules" export="true"/>
<module name="javax.servlet.jsp.api" export="true">
<imports>
<include path="/**"/>
<exclude-set>
<path name="javax/el"/>
</exclude-set>
</imports>
</module>
<module name="javax.enterprise.api" export="true">
<imports>
<include path="/**"/>
<exclude-set>
<path name="javax/el"/>
</exclude-set>
</imports>
</module>
</dependencies>
</deployment>
<sub-deployment name="admin.war">
<exclusions>
<module name="javaee.api"/>
<module name="javax.el.api"/>
<module name="javax.enterprise.api"/>
<module name="javax.faces.api"/>
<module name="javax.persistence.api"/>
<module name="javax.servlet.jsp.api"/>
<module name="javax.validation.api"/>
<module name="org.apache.commons.logging"/>
<module name="org.apache.log4j"/>
<module name="org.jboss.logging"/>
<module name="org.hibernate"/>
<module name="org.hibernate.validator"/>
<module name="org.slf4j"/>
</exclusions>
<local-last value="true"/>
</sub-deployment>
for me worked when I removed javax/el

I ended up having some success with this on a different project/module which is available at https://github.com/dewthefifth/spring-boot-ear-skinny-war/tree/spring-boot-2.0-with-spring-legacy-with-wfcore-209-workaround.
Specifically the web0 project had luck removing the validator, but any attempt to remove it from the EAR fails.
The github link is focused on making the removal so that Spring 5+ can be used on JBOSS and Wildfly. It includes a README with detailed information on exactly which versions of Wildfly and JBOSS were tested, and a workaround for the versions of JBOSS that didn't work (it's not pretty).

Related

Wildfly 14 - explicit dependencies

I have two EAR (ear01-0.0.1-SNAPSHOT.ear, ear02-0.0.1-SNAPSHOT.ear) applications and both of them are useing a common library (common-0.0.1-SNAPSHOT.jar). I decided to move out that common part and add it as module to a Wildfly 14 but even with a deployment descritor I get exception during the EAR deployment:
java.lang.NoClassDefFoundError: Failed to link ki/wildfly_deps/ejbs01/EchoBean01
I used this CLI to add the new module:
module add --name=ki.wildfly_deps.common --resources=common-0.0.1-SNAPSHOT.jar
and the JAR now is in
$JBOSS_HOME/modules/ki/wildfly_deps/common/main
1. QUESTION
This JAR shouldn't be in folder
$JBOSS_HOME/modules/system/layers/base/ki/wildfly_deps/common/main
beside the other modules?
After adding the module, the module.xml look like this:
<?xml version='1.0' encoding='UTF-8'?>
<module xmlns="urn:jboss:module:1.1" name="ki.wildfly_deps.common">
<resources>
<resource-root path="common-0.0.1-SNAPSHOT.jar"/>
</resources>
</module>
The jboss-deployment-structure.xml from each EAR declares a dependency on the above common library:
<jboss-deployment-structure xmlns="urn:jboss:deployment-structure:1.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<deployment>
<dependencies>
<module name="ki.wildfly_deps.common" />
</dependencies>
</deployment>
2. QUESTION
Should I specify the package what must be imported from the common module?
<jboss-deployment-structure
xmlns="urn:jboss:deployment-structure:1.2"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<deployment>
<dependencies>
<module name="ki.wildfly_deps.common" //>
<imports>
<include path="META-INF**" />
<include path="ki.wildfly_deps.common**" />
</imports>
</module>
</dependencies>
</deployment>

neo4j jdbc driver as a module on wildfly

I'm trying to install neo4j-jdbc-driver-3.3.1 as a module on Wildfly 11. I created the folders org/neo4j/driver/main and added the module.xml file as following:
<?xml version="1.0" encoding="UTF-8"?>
<module xmlns="urn:jboss:module:1.5" name="org.neo4j.driver">
<resources>
<resource-root path="neo4j-jdbc-driver-3.3.1.jar"/>
</resources>
<dependencies>
<module name="javax.api"/>
<module name="javax.transaction.api"/>
<module name="sun.jdk"/>
</dependencies>
</module>
I added the jar neo4j-jdbc-driver-3.3.1.jar in the same directory, but the module does not get deployed.
If I add the jar on the deployments folder it works, but I need the driver as a module.

Exception while deploying to JBoss 7.1.1, caused by: org.springframework:main is not found in local module

I'm trying to implement module for my grails application, which is using Spring Security. Since the Spring Security and Grails are having large number of dependencies, the war size becomes more than 80MB. In order to avoid this, I'm trying to access these dependency from the module.
But, I'm getting the following error when trying to deploy the grails WAR in jboss 7.1.1.Final.
ERROR [org.jboss.msc.service.fail] (MSC service thread 1-4) MSC00001: Failed to start service jboss.module.service."deployment.IFP.war".main: org.jboss.msc.service.StartException in service jboss.module.service."deployment.IFP.war".main: Failed to load module: deployment.IFP.war:main
at org.jboss.as.server.moduleservice.ModuleLoadService.start(ModuleLoadService.java:91) [jboss-as-server-7.1.1.Final.jar:7.1.1.Final]
at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]
at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110) [rt.jar:1.7.0]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603) [rt.jar:1.7.0]
at java.lang.Thread.run(Thread.java:722) [rt.jar:1.7.0]
Caused by: org.jboss.modules.ModuleNotFoundException: Module org.springframework:main is not found in local module loader #1f88953 (roots: C:\Jboss\jboss-as-7.1.1.Final\modules)
at org.jboss.modules.LocalModuleLoader.findModule(LocalModuleLoader.java:126)
at org.jboss.modules.ModuleLoader.loadModuleLocal(ModuleLoader.java:275)
at org.jboss.modules.ModuleLoader.preloadModule(ModuleLoader.java:222)
at org.jboss.modules.LocalModuleLoader.preloadModule(LocalModuleLoader.java:94)
at org.jboss.modules.Module.addPaths(Module.java:841)
at org.jboss.modules.Module.link(Module.java:1181)
at org.jboss.modules.Module.relinkIfNecessary(Module.java:1207)
at org.jboss.modules.ModuleLoader.loadModule(ModuleLoader.java:208)
at org.jboss.as.server.moduleservice.ModuleLoadService.start(ModuleLoadService.java:70) [jboss-as-server-7.1.1.Final.jar:7.1.1.Final]
jboss-deployment-structure.xml
<?xml version="1.0" encoding="UTF-8"?>
<jboss-deployment-structure xmlns="urn:jboss:deployment-structure:1.0">
<deployment>
<dependencies>
<module name="com.sits.grails">
<imports>
<include path="META-INF**"/>
<include path="org**"/>
</imports>
</module>
</dependencies>
</deployment>
</jboss-deployment-structure>
module.xml
<?xml version="1.0" encoding="UTF-8"?>
<module xmlns="urn:jboss:module:1.1" name="com.sits.grails">
<properties>
<property name="jboss.api" value="private"/>
</properties>
<resources>
<resource-root path="activation-1.1.jar"/>
<resource-root path="antlr-2.7.7.jar"/>
.........
.........
<resource-root path="jboss-logging-3.1.0.GA.jar"/>
<resource-root path="jboss-logging-annotations-1.2.0.Beta1.jar"/>
<resource-root path="jboss-transaction-api_1.2_spec-1.0.0.Final.jar"/>
<resource-root path="jcl-over-slf4j-1.7.5.jar"/>
<resource-root path="jsr166y-1.7.0.jar"/>
<resource-root path="jul-to-slf4j-1.7.5.jar"/>
<resource-root path="liquibase-core-2.0.5.jar"/>
<resource-root path="log4j-1.2.17.jar"/>
<resource-root path="mysql-connector-java-5.1.13.jar"/>
<resource-root path="netty-all-4.0.15.Final.jar"/>
<resource-root path="rhino-1.7R4.jar"/>
<resource-root path="serializer-2.7.1.jar"/>
<resource-root path="sitemesh-2.4.jar"/>
<resource-root path="slf4j-api-1.7.5.jar"/>
<resource-root path="spring-aop-4.0.7.RELEASE.jar"/>
<resource-root path="spring-aspects-4.0.7.RELEASE.jar"/>
<resource-root path="spring-beans-4.0.7.RELEASE.jar"/>
<resource-root path="spring-context-4.0.7.RELEASE.jar"/>
<resource-root path="spring-context-support-4.0.7.RELEASE.jar"/>
<resource-root path="spring-core-4.0.7.RELEASE.jar"/>
<resource-root path="spring-expression-4.0.7.RELEASE.jar"/>
<resource-root path="spring-jdbc-4.0.7.RELEASE.jar"/>
<resource-root path="spring-orm-4.0.7.RELEASE.jar"/>
<resource-root path="spring-security-core-3.2.7.RELEASE.jar"/>
<resource-root path="spring-security-web-3.2.7.RELEASE.jar"/>
<resource-root path="spring-tx-4.0.7.RELEASE.jar"/>
<resource-root path="spring-web-4.0.7.RELEASE.jar"/>
<resource-root path="spring-webmvc-4.0.7.RELEASE.jar"/>
<resource-root path="tomcat-embed-logging-log4j-7.0.50.jar"/>
<resource-root path="tomcat-jdbc-7.0.50.jar"/>
<resource-root path="tomcat-juli-7.0.50.jar"/>
<resource-root path="validation-api-1.1.0.Final.jar"/>
</resources>
<dependencies>
<module name="javax.api"/>
<module name="sun.jdk"/>
<module name="org.javassist" optional="true"/>
<module name="javax.servlet.api"/>
<module name="org.apache.commons.logging"/>
</dependencies>
</module>
In my MANIFEST.MF file have the dependencies declared
Dependencies: org.apache.log4j,com.sits.grails,org.springframework
I'm not understanding what causes this issue. If anyone can help me to identify will be a great help. Thanks.
ApplicationContext.xml
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">
<bean id="grailsApplication" class="org.codehaus.groovy.grails.commons.GrailsApplicationFactoryBean">
<description>Grails application factory bean</description>
<property name="grailsDescriptor" value="/WEB-INF/grails.xml" />
</bean>
<bean id="pluginManager" class="org.codehaus.groovy.grails.plugins.GrailsPluginManagerFactoryBean">
<description>A bean that manages Grails plugins</description>
<property name="grailsDescriptor" value="/WEB-INF/grails.xml" />
<property name="application" ref="grailsApplication" />
</bean>
<bean id="grailsConfigurator" class="org.codehaus.groovy.grails.commons.spring.GrailsRuntimeConfigurator">
<constructor-arg>
<ref bean="grailsApplication" />
</constructor-arg>
<property name="pluginManager" ref="pluginManager" />
</bean>
<bean id="characterEncodingFilter" class="org.springframework.web.filter.CharacterEncodingFilter">
<property name="encoding">
<value>utf-8</value>
</property>
</bean>
<bean id="conversionService" class="org.springframework.context.support.ConversionServiceFactoryBean" />
</beans>
The module names specified in MANIFEST.MF are not package names but module names as define in the module.xml in JBoss
Your module.xml which contains spring jar is named as com.sits.grails.Hence your MANIFEST.MF should not include org.springframework as its not defined as a separate module.

AWS Java SDK on JBoss AS7 - module.xml entries

I am having problems using the new AmazonAWS SDK in a JBoss AS 7.1 (EE6) project
I am just using the S3 library, so in accordance with the new release (1.9.7) I am only using the s3, core, kms jars
-aws-java-sdk-core-1.9.17.jar
-aws-java-sdk-s3-1.9.17.jar
-aws-java-sdk-kms-1.9.17.jar
So I have created 3 separate module.xml entries for each jar within the /com/amazonaws directory:
/com/amazonaws/aws-java-sdk-s3/main/module.xml
<module xmlns="urn:jboss:module:1.1" name="com.amazonaws.aws-java-sdk-s3">
<properties>
<property name="jboss.api" value="private"/>
</properties>
<resources>
<resource-root path="aws-java-sdk-s3-1.9.17.jar"/>
<!-- Insert resources here -->
</resources>
<dependencies>
<module name="com.amazonaws.aws-java-sdk-core" />
<module name="com.amazonaws.aws-java-sdk-kms" />
</dependencies>
</module>
/com/amazonaws/aws-java-sdk-kms/main/module.xml
<resources>
<resource-root path="aws-java-sdk-kms-1.9.17.jar"/>
<!-- Insert resources here -->
</resources>
<dependencies>
<module name="com.amazonaws.aws-java-sdk-core" />
</dependencies>
/com/amazonaws/aws-java-sdk-core/main/module.xml
<module xmlns="urn:jboss:module:1.1" name="com.amazonaws.aws-java-sdk-core">
<properties>
<property name="jboss.api" value="private"/>
</properties>
<resources>
<resource-root path="aws-java-sdk-core-1.9.17.jar"/>
<resource-root path="commons-logging-1.1.3.jar"/>
<resource-root path="httpclient-4.3.4.jar"/>
<resource-root path="jackson-databind-2.3.2.jar"/>
<resource-root path="joda-time-2.2.jar"/>
<!-- Insert resources here -->
</resources>
</module>
(I have put the extra dependencies eg. apache-commons, jodatime etc. directly in the module directory)
The following jboss-deployment-structure.xml entry:
<sub-deployment name="Processor-ejb.jar">
<dependencies>
<module name="com.amazonaws.aws-java-sdk-core" />
<module name="com.amazonaws.aws-java-sdk-s3" />
<module name="com.amazonaws.aws-java-sdk-kms" />
</dependencies>
</sub-deployment>
(I have also tried declaring these as EAR-level dependancies with export=true)
The the following pom.xml entry:
<dependency>
<groupId>com.amazonaws</groupId>
<artifactId>aws-java-sdk-s3</artifactId>
<version>1.9.17</version>
<scope>provided</scope>
</dependency>
But whenever I try to initialise a new S3 client:
AWSCredentials credentials = new ProfileCredentialsProvider("ProcessingApp").getCredentials();
AmazonS3 s3 = new AmazonS3Client(credentials);
I get the following exception:
Caused by: java.lang.NoClassDefFoundError: javax/management/MalformedObjectNameException
at com.amazonaws.jmx.SdkMBeanRegistrySupport.registerMetricAdminMBean(SdkMBeanRegistrySupport.java:27)
at com.amazonaws.metrics.AwsSdkMetrics.registerMetricAdminMBean(AwsSdkMetrics.java:330)
at com.amazonaws.metrics.AwsSdkMetrics.<clinit>(AwsSdkMetrics.java:308)
at com.amazonaws.services.s3.AmazonS3Client.<clinit>(AmazonS3Client.java:261)
at net.processor.actions.scheduled.ScheduledActionsBean.minuteActions(ScheduledActionsBean.java:79)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [classes.jar:1.6.0_65]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) [classes.jar:1.6.0_65]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) [classes.jar:1.6.0_65]
at java.lang.reflect.Method.invoke(Method.java:597) [classes.jar:1.6.0_65]
at org.jboss.as.ee.component.ManagedReferenceMethodInterceptorFactory$ManagedReferenceMethodInterceptor.processInvocation(ManagedReferenceMethodInterceptorFactory.java:72) [jboss-as-ee-7.1.1.Final.jar:7.1.1.Final]
at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]
at org.jboss.invocation.InterceptorContext$Invocation.proceed(InterceptorContext.java:374) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]
at org.jboss.seam.intercept.EJBInvocationContext.proceed(EJBInvocationContext.java:44)
at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:56)
at org.jboss.seam.intercept.Interceptor.aroundTimeout(Interceptor.java:201)
at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:74)
at org.jboss.seam.core.BijectionInterceptor.aroundInvoke(BijectionInterceptor.java:79)
... 56 more
My hunch would be a conflict with apache-commons-logging as there is an import in the SdkMBeanRegistrySupport class and I know JBoss uses this library elsewhere using an alias to org.slf4j.jcl-over-slf4j, but I thought that putting the apache lib in with the jar would sort this out?
I am fairly new to AS7 so maybe I'm missing a trick?
Ok I got eventually thanks to #Federico Sierra, here is the sdk-core module.xml (nb. I had to drop the commons-logging, httpclient and httpcore jars into the module folder as the ones shipped with JBoss arent compatible, I added the jackson and joda libs as their own modules)...
<module xmlns="urn:jboss:module:1.1" name="com.amazonaws.aws-java-sdk-core">
<properties>
<property name="jboss.api" value="private"/>
</properties>
<resources>
<resource-root path="aws-java-sdk-core-1.9.17.jar"/>
<resource-root path="commons-logging-1.1.3.jar"/>
<resource-root path="httpclient-4.3.4.jar"/>
<resource-root path="httpcore-4.3.2.jar"/>
<!-- Insert resources here -->
</resources>
<dependencies>
<module name="javax.api"/>
<module name="javax.xml.stream.api"/>
<module name="javax.xml.bind.api"/>
<module name="com.fasterxml.jackson"/>
<module name="org.joda.time"/>
</dependencies>
</module>
and the sdk-s3 module.xml needed javax.xml.stream.api too
<resources>
<resource-root path="aws-java-sdk-s3-1.9.17.jar"/>
<!-- Insert resources here -->
</resources>
<dependencies>
<module name="com.amazonaws.aws-java-sdk-core" />
<module name="com.amazonaws.aws-java-sdk-kms" />
<module name="javax.xml.stream.api"/>
</dependencies>
Hope this helps someone else
I want to share my code, it is working to me, I hope that it be useful to you
<module xmlns="urn:jboss:module:1.5" name="com.amazonaws.aws-java-sdk-s3">
<properties>
<property name="jboss.api" value="private"/>
</properties>
<resources>
<resource-root path="aws-java-sdk-s3-1.11.106.jar"/>
<resource-root path="aws-java-sdk-core-1.11.106.jar"/>
<resource-root path="aws-java-sdk-kms-1.11.106.jar"/>
<resource-root path="jmespath-java-1.11.106.jar"/>
<resource-root path="commons-logging-1.1.1.jar"/>
<resource-root path="httpclient-4.5.2.redhat-1.jar"/>
<resource-root path="httpcore-4.4.4.redhat-1.jar"/>
<resource-root path="jackson-annotations-2.8.9.redhat-1.jar"/>
<resource-root path="jackson-databind-2.8.9.redhat-1.jar"/>
<resource-root path="jackson-core-2.8.9.redhat-1.jar"/>
<resource-root path="jackson-dataformat-cbor-2.6.6.jar"/>
</resources>
<dependencies>
<module name="javax.api"/>
<module name="javax.xml.bind.api"/>
<module name="javax.xml.stream.api"/>
<module name="org.joda.time"/>
</dependencies>
</module>
I use only a folder "com/amazonaws/aws-java-sdk-s3" in the jboss y there I put all the jars.

Logback not working with JBoss EAP 6.1

I have a maven web application in which I am using logback and JBoss EAP 6.1 as server. The problem is that when I deploy it on server, my logback.xml is ignored and logback's default configuration is used which prints on console instead of my log file. Logging works fine if I deploy my application on tomcat.
I have put logback.xml in src/main/resources.
Found similar question at - Logging Configuration in Logback + SL4J + JBoss EAP 6.0
and
Logback and Jboss 7 - don't work together?
but no use...
Forgot to share the solution earlier..here it is -
We need to add following lines in jboss-deployment-structure.xml
<exclusions>
<module name="org.apache.commons.logging" />
<module name="org.slf4j" />
<module name="org.slf4j.ext" />
<module name="org.slf4j.impl" />
<module name="org.apache.log4j" />
</exclusions>
So the entire file looks like -
<?xml version="1.0" encoding="UTF-8"?>
<jboss-deployment-structure>
<deployment>
<!-- Exclusions allow you to prevent the server from automatically adding
some dependencies -->
<exclusions>
<module name="org.apache.commons.logging" />
<module name="org.slf4j" />
<module name="org.slf4j.ext" />
<module name="org.slf4j.impl" />
<module name="org.apache.log4j" />
</exclusions>
</deployment>
</jboss-deployment-structure>
If you have a maven project, you can put this file at -
<project>/webapp/META-INF/jboss-deployment-structure.xml
Now logging will work fine.
First, thanks to #popeye
Climbing on to what #popeye has well defined, here are my 2 cents
Location of 'jboss-deployment-structure.xml' : src/main/webapp/WEB-INF/jboss-deployment-structure.xml
<?xml version="1.0" encoding="UTF-8"?>
<jboss-deployment-structure>
<deployment>
<!-- Hey Server please don't add these dependencies. I don't need them.
I have mine in my application dependencies -->
<exclusions>
<module name="org.apache.commons.logging" />
<module name="org.slf4j" />
<module name="org.slf4j.ext" />
<module name="org.slf4j.impl" />
<module name="org.apache.log4j" />
</exclusions>
<dependencies>
<module name="com.oracle" />
<module name="org.jboss.ironjacamar.jdbcadapters" slot="main" />
</dependencies>
</deployment>
</jboss-deployment-structure>
Now, logback.xml is in action. yo!
why is this needed - <module name="com.oracle" /> ?
This is the name of module of driver you mentioned in JBOSS standalone.xml
<subsystem xmlns="urn:jboss:domain:datasources:1.1">
<datasources>
<datasource><!-- your configurations --></datasource>
<drivers>
<driver name="ojdbc6-11.2.0.4" module="com.oracle">
<xa-datasource-class>oracle.jdbc.OracleDriver</xa-datasource-class>
</driver>
</drivers>
</datasources>
</subsystem>
Note that this is for JBOSS server to Database communication.
[Even if you have ojdbc6-11.2.0.4.jar in your project/lib you need this configuration ]
How did you come up with this name 'com.oracle'? Is that a standard ?
No . This is the struture of folder I created on server
Look at this SO post here - Xmlparserv2 error while application deployed in jboss, Installing Oracle ojdbc module in JBoss for Java web application 'How to create a Oracle module in JBOSS'
Also note not to confuse this one with the dependency that you might add in your project pom.xml.
ie: this one
<dependency>
<groupId>com.oracle</groupId>
<artifactId>ojdbc6</artifactId>
<version>11.2.0.4</version>
<scope>provided</scope> <!-- to exclude from WEB-INF/lib -->
</dependency>
The above project dependency is needed for you to write the Java code, get it compiled,
and also during runtime, for your code to communicate to the driver.
why is this needed - <module name="org.jboss.ironjacamar.jdbcadapters" slot="main" /> ?
Otherwise you might get an error to get a jndi datasource set on JBoss in your Spring application.
So that's a dependency. Don't forget to add the jar as well in your pom.xml
<dependency>
<groupId>org.jboss.ironjacamar</groupId>
<artifactId>ironjacamar-jdbc</artifactId>
</dependency>

Resources