Deployments Share JAR Files in WildFly 10 - java

I have a fully functioning web application packaged in a WAR format which I am trying to remove the *.jar files from /WEB-INF/lib and place into WildFly 10.
What I have done so far (unsuccessfully) and the resources I have referenced are below.
Copy *.jar from /WEB-INF/lib to C:...\wildfly-10.0.0.Final\standalone\deployments
Deployed the copied JAR files successfully.
Created a /WEB-INF/jboss-deployment-structure.xml (found below) to reference the jars in the deployments directory
The above attempt was in response to Share util jar file with war deployments in Wildfly
I am also open to attempting to try other methods. I would think it would be possible to jar all the jars in my WEB-INF/lib into one jar and have WildFly 10 create an id for the jar. Then my war file would specify this id somewhere. The issue is I'm not quite sure how to google what I have just said with specific Wildfly/J2EE terminology. Referencing https://docs.jboss.org/author/display/WFLY8/Class+Loading+in+WildFly doesn't really give me specific examples to help me.
jboss-deployment-structure.xml
<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-subsystem prevents a subsystems deployment unit processors running on a deployment -->
<!-- which gives basically the same effect as removing the subsystem, but it only affects single deployment -->
<!-- This allows you to define additional dependencies, it is the same as using the Dependencies: manifest attribute -->
<dependencies>
<module name="deployment.aesh-0.33.11.jar" />
<module name="deployment.aether-api-1.13.1.jar" />
<module name="deployment.aether-impl-1.13.1.jar" />
<module name="deployment.aether-spi-1.13.1.jar" />
<module name="deployment.aether-util-1.13.1.jar" />
<module name="deployment.angular2-2.0.0-beta.7.jar" />
<module name="deployment.antlr-2.7.7.jar" />
<module name="deployment.antlr4-runtime-4.5.2-1.jar" />
<module name="deployment.aopalliance-1.0.jar" />
<module name="deployment.bcpkix-jdk15on-1.48.jar" />
<module name="deployment.bcprov-jdk15on-1.48.jar" />
<module name="deployment.bootstrap-3.3.6.jar" />
<module name="deployment.cglib-nodep-2.1_3.jar" />
<module name="deployment.checkstyle-6.16.1.jar" />
<module name="deployment.commons-beanutils-1.9.2.jar" />
<module name="deployment.commons-cli-1.3.1.jar" />
<module name="deployment.commons-codec-1.10.jar" />
<module name="deployment.commons-collections-3.2.1.jar" />
<module name="deployment.commons-compress-1.5.jar" />
<module name="deployment.commons-exec-1.3.jar" />
<module name="deployment.commons-io-2.4.jar" />
<module name="deployment.commons-lang3-3.4.jar" />
<module name="deployment.commons-logging-1.2.jar" />
<module name="deployment.dom4j-1.6.1.jar" />
<module name="deployment.gson-2.3.1.jar" />
<module name="deployment.guava-19.0.jar" />
<module name="deployment.hibernate-commons-annotations-4.0.5.Final.jar" />
<module name="deployment.hibernate-core-4.3.11.Final.jar" />
<module name="deployment.hibernate-jpa-2.1-api-1.0.0.Final.jar" />
<module name="deployment.httpclient-4.3.5.jar" />
<module name="deployment.httpcore-4.3.2.jar" />
<module name="deployment.jackson-core-asl-1.9.13.jar" />
<module name="deployment.jackson-mapper-asl-1.9.13.jar" />
<module name="deployment.jandex-1.1.0.Final.jar" />
<module name="deployment.jansi-1.9.jar" />
<module name="deployment.javassist-3.12.1.GA.jar" />
<module name="deployment.javassist-3.18.1-GA.jar" />
<module name="deployment.javax.servlet.jsp-api-2.3.1.jar" />
<module name="deployment.javax.servlet-api-3.1.0.jar" />
<module name="deployment.jboss-dmr-1.2.0.Final.jar" />
<module name="deployment.jboss-logging-3.1.3.GA.jar" />
<module name="deployment.jboss-logging-annotations-1.2.0.Beta1.jar" />
<module name="deployment.jboss-marshalling-1.4.2.Final.jar" />
<module name="deployment.jboss-marshalling-river-1.4.2.Final.jar" />
<module name="deployment.jboss-remoting-4.0.3.Final.jar" />
<module name="deployment.jboss-sasl-1.0.4.Final.jar" />
<module name="deployment.jboss-threads-2.1.1.Final.jar" />
<module name="deployment.jboss-transaction-api_1.2_spec-1.0.0.Final.jar" />
<module name="deployment.jboss-vfs-3.2.5.Final.jar" />
<module name="deployment.jcip-annotations-1.0.jar" />
<module name="deployment.jcommander-1.48.jar" />
<module name="deployment.jetty-rc-repacked-5.jar" />
<module name="deployment.jetty-repacked-9.2.13.v20150730.jar" />
<module name="deployment.jna-4.1.0.jar" />
<module name="deployment.jna-platform-4.1.0.jar" />
<module name="deployment.jquery-1.11.1.jar" />
<module name="deployment.jstl-1.2.jar" />
<module name="deployment.log4j-api-2.0.jar" />
<module name="deployment.log4j-core-2.0.jar" />
<module name="deployment.log4j-slf4j-impl-2.5.jar" />
<module name="deployment.maven-aether-provider-3.0.5.jar" />
<module name="deployment.maven-artifact-3.0.5.jar" />
<module name="deployment.maven-core-3.0.5.jar" />
<module name="deployment.maven-model-3.0.5.jar" />
<module name="deployment.maven-model-builder-3.0.5.jar" />
<module name="deployment.maven-plugin-annotations-3.2.jar" />
<module name="deployment.maven-plugin-api-3.0.5.jar" />
<module name="deployment.maven-repository-metadata-3.0.5.jar" />
<module name="deployment.maven-settings-3.0.5.jar" />
<module name="deployment.maven-settings-builder-3.0.5.jar" />
<module name="deployment.mx4j-tools-3.0.1.jar" />
<module name="deployment.mysql-connector-java-5.1.38.jar" />
<module name="deployment.netty-3.5.7.Final.jar" />
<module name="deployment.plexus-cipher-1.4.jar" />
<module name="deployment.plexus-classworlds-2.4.jar" />
<module name="deployment.plexus-component-annotations-1.5.5.jar" />
<module name="deployment.plexus-interpolation-1.14.jar" />
<module name="deployment.plexus-sec-dispatcher-1.3.jar" />
<module name="deployment.plexus-utils-3.0.10.jar" />
<module name="deployment.remoting-jmx-2.0.0.Final.jar" />
<module name="deployment.selenium-api-2.53.0.jar" />
<module name="deployment.selenium-chrome-driver-2.53.0.jar" />
<module name="deployment.selenium-edge-driver-2.53.0.jar" />
<module name="deployment.selenium-firefox-driver-2.53.0.jar" />
<module name="deployment.selenium-ie-driver-2.53.0.jar" />
<module name="deployment.selenium-java-2.53.0.jar" />
<module name="deployment.selenium-leg-rc-2.53.0.jar" />
<module name="deployment.selenium-remote-driver-2.53.0.jar" />
<module name="deployment.selenium-safari-driver-2.53.0.jar" />
<module name="deployment.selenium-server-2.53.0.jar" />
<module name="deployment.selenium-support-2.53.0.jar" />
<module name="deployment.sisu-guava-0.9.9.jar" />
<module name="deployment.sisu-guice-3.1.0-no_aop.jar" />
<module name="deployment.sisu-inject-bean-2.3.0.jar" />
<module name="deployment.sisu-inject-plexus-2.3.0.jar" />
<module name="deployment.slf4j-api-1.7.18.jar" />
<module name="deployment.snakeyaml-1.8.jar" />
<module name="deployment.spring-aop-4.1.6.RELEASE.jar" />
<module name="deployment.spring-beans-4.1.6.RELEASE.jar" />
<module name="deployment.spring-context-4.1.6.RELEASE.jar" />
<module name="deployment.spring-core-4.1.6.RELEASE.jar" />
<module name="deployment.spring-expression-4.1.6.RELEASE.jar" />
<module name="deployment.spring-jdbc-4.2.4.RELEASE.jar" />
<module name="deployment.spring-security-acl-4.0.3.RELEASE.jar" />
<module name="deployment.spring-security-config-4.0.1.RELEASE.jar" />
<module name="deployment.spring-security-core-4.0.1.RELEASE.jar" />
<module name="deployment.spring-security-taglibs-4.0.3.RELEASE.jar" />
<module name="deployment.spring-security-web-4.0.1.RELEASE.jar" />
<module name="deployment.spring-tx-4.2.4.RELEASE.jar" />
<module name="deployment.spring-web-4.1.6.RELEASE.jar" />
<module name="deployment.spring-webmvc-4.1.6.RELEASE.jar" />
<module name="deployment.stacks-client-1.0.2.Final.jar" />
<module name="deployment.staxmapper-1.1.0.Final.jar" />
<module name="deployment.wildfly-build-config-8.1.0.Final.jar" />
<module name="deployment.wildfly-cli-8.1.0.Final.jar" />
<module name="deployment.wildfly-controller-client-8.1.0.Final.jar" />
<module name="deployment.wildfly-maven-plugin-1.0.2.Final.jar" />
<module name="deployment.wildfly-protocol-8.1.0.Final.jar" />
<module name="deployment.wildfly-security-manager-1.0.0.Final.jar" />
<module name="deployment.xml-apis-1.0.b2.jar" />
<module name="deployment.xnio-api-3.2.2.Final.jar" />
<module name="deployment.xnio-nio-3.2.2.Final.jar" />
<module name="deployment.xz-1.2.jar" />
</dependencies>
<!-- These add additional classes to the module. In this case it is the same as including the jar in the EAR's lib directory -->
<resources>
<resource-root path="md.jar" />
</resources>
</deployment>
</jboss-deployment-structure>
The error log from WildFly indicating it cannot deploy my ROOT.war
13:27:30,977 INFO [org.jboss.as.server] (ServerService Thread Pool -- 34) WFLYSRV0010: Deployed "antlr4-runtime-4.5.2-1.jar" (runtime-name : "antlr4-runtime-4.5.2-1.jar")
13:27:30,978 INFO [org.jboss.as.server] (ServerService Thread Pool -- 34) WFLYSRV0010: Deployed "antlr-2.7.7.jar" (runtime-name : "antlr-2.7.7.jar")
13:27:30,978 INFO [org.jboss.as.server] (ServerService Thread Pool -- 34) WFLYSRV0010: Deployed "angular2-2.0.0-beta.7.jar" (runtime-name : "angular2-2.0.0-beta.7.jar")
13:27:30,979 INFO [org.jboss.as.server] (ServerService Thread Pool -- 34) WFLYSRV0010: Deployed "aether-util-1.13.1.jar" (runtime-name : "aether-util-1.13.1.jar")
13:27:30,979 INFO [org.jboss.as.server] (ServerService Thread Pool -- 34) WFLYSRV0010: Deployed "aether-spi-1.13.1.jar" (runtime-name : "aether-spi-1.13.1.jar")
13:27:30,979 INFO [org.jboss.as.server] (ServerService Thread Pool -- 34) WFLYSRV0010: Deployed "aether-impl-1.13.1.jar" (runtime-name : "aether-impl-1.13.1.jar")
13:27:30,979 INFO [org.jboss.as.server] (ServerService Thread Pool -- 34) WFLYSRV0010: Deployed "aether-api-1.13.1.jar" (runtime-name : "aether-api-1.13.1.jar")
13:27:30,981 INFO [org.jboss.as.server] (ServerService Thread Pool -- 34) WFLYSRV0010: Deployed "aesh-0.33.11.jar" (runtime-name : "aesh-0.33.11.jar")
13:27:30,983 INFO [org.jboss.as.controller] (Controller Boot Thread) WFLYCTL0183: Service status report
WFLYCTL0184: New missing/unsatisfied dependencies:
service jboss.deployment.unit."ROOT.war".beanmanager (missing) dependents: [service jboss.deployment.unit."ROOT.war".weld.weldClassIntrospector, service jboss.deployment.unit."ROOT.war".batch.environment]
WFLYCTL0186: Services which failed to start: service jboss.deployment.unit."ROOT.war".INSTALL: org.jboss.msc.service.StartException in service jboss.deployment.unit."ROOT.war".INSTALL: WFLYSRV0153: Failed to process phase INSTALL of deployment "ROOT.war"
13:27:31,234 INFO [org.jboss.as] (Controller Boot Thread) WFLYSRV0060: Http management interface listening on http://127.0.0.1:9990/management
13:27:31,234 INFO [org.jboss.as] (Controller Boot Thread) WFLYSRV0051: Admin console listening on http://127.0.0.1:9990
13:27:31,234 ERROR [org.jboss.as] (Controller Boot Thread) WFLYSRV0026: WildFly Full 10.0.0.Final (WildFly Core 2.0.10.Final) started (with errors) in 47550ms - Started 4867 of 5891 services (3 services failed or missing dependencies, 1357 services are lazy, passive or on-demand)
13:27:44,221 INFO [org.jboss.as.server.deployment] (MSC service thread 1-5) WFLYSRV0028: Stopped deployment ROOT.war (runtime-name: ROOT.war) in 11969ms
13:27:44,285 INFO [org.jboss.as.repository] (DeploymentScanner-threads - 2) WFLYDR0002: Content removed from location C:\home\toazi\apps\wildfly-10.0.0.Final\standalone\data\content\71\0188d928a988dddca670dade8e87ac9ec64b57\content
13:27:44,285 INFO [org.jboss.as.server] (DeploymentScanner-threads - 2) WFLYSRV0009: Undeployed "ROOT.war" (runtime-name: "ROOT.war")
13:27:44,286 INFO [org.jboss.as.controller] (DeploymentScanner-threads - 2) WFLYCTL0183: Service status report
WFLYCTL0186: Services which failed to start: service jboss.deployment.unit."ROOT.war".INSTALL

Wildfly provides many of the dependencies in your list (e.g. Hibernate, logging). Therefore you don't need to include them, or if you do (e.g. if you need another version than Wildfly includes), you should exclude them.
If every jar is an own deployment, i am not sure if they can see each other.
Apart from that, it would probably be a better idea to put your Jars into a module. Then you only have to include a reference to that module in the jboss-deployment-structure and not 30. An example for that is also given in the question you linked to.

Related

Error com.fasterxml.jackson Deploy .WAR Spring Boot in JBoss/Wildfly

ERROR [org.springframework.boot.web.servlet.support.ErrorPageFilter] (default task-22) Forwarding to error page from request [/api/method] due to exception [com.fasterxml.jackson.annotation.JsonFormat$Value.hasLenient()Z]: java.lang.NoSuchMethodError: com.fasterxml.jackson.annotation.JsonFormat$Value.hasLenient()Z
at com.fasterxml.jackson.datatype.jsr310.deser.JSR310DateTimeDeserializerBase.createContextual(JSR310DateTimeDeserializerBase.java:104)
at com.fasterxml.jackson.databind.DeserializationContext.handleSecondaryContextualization(DeserializationContext.java:685)
at com.fasterxml.jackson.databind.DeserializationContext.findContextualValueDeserializer(DeserializationContext.java:446)
- Create file named jboss-deployment-structure.xml
- Add the below block
- Copy file in location WEB-INF/jboss-deployment-structure.xml
<?xml version='1.0' encoding='UTF-8'?>
<jboss-deployment-structure xmlns="urn:jboss:deployment-structure:1.1">
<deployment>
<exclusions>
<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-jackson2-provider" />
<module name="org.slf4j" />
</exclusions>
</deployment>
</jboss-deployment-structure>
IMG - Preview project Maven

Can't find spring-context Schema from WildFly 10 Module

I've been searching and fighting this all day and nothing I have found has been able to resolve this issue. I am in the progress of attempting to migrate a spring-based application to WildFly 10 (from a legacy JBoss application server) and am having issues when deploying.
For this application, I have my application (MyApplication.war) and 2 modules, Spring 3.1.2 and MyCustomJar.jar. The custom JAR contains spring XML configuration files (and is what appears to be blowing up on WildFly).
The WAR file deploys, and the spring container gets initialized. However once it starts to try and process bean definitions from mycustomjar.jar!myspring-app.xml it errors out because it cannot find the spring context schema. The stack trace from wildfly and my module + jboss-deployment-structure are included. Any ideas to try would be appreciated. I have done about every variation of import/export from the spring module that I could find online today with absolutely no effect.
2017-03-02 14:58:08,282 INFO [org.springframework.web.context.support.XmlWebApplicationContext] (ServerService Thread Pool -- 62) Refreshing Root WebApplicationContext: startup date [Thu Mar 02 14:58:08 EST 2017]; root of context hierarchy
2017-03-02 14:58:08,317 INFO [org.springframework.beans.factory.xml.XmlBeanDefinitionReader] (ServerService Thread Pool -- 62) Loading XML bean definitions from URL [jar:file:/c:/data/apps/wildfly-10.1.0.Final/modules/mycustomjar/mycustomjar.jar!/myspring-context.xml]
2017-03-02 14:58:08,518 INFO [org.springframework.beans.factory.xml.XmlBeanDefinitionReader] (ServerService Thread Pool -- 62) Loading XML bean definitions from class path resource [myspring-app.xml]
2017-03-02 14:58:08,575 INFO [org.springframework.beans.factory.xml.XmlBeanDefinitionReader] (ServerService Thread Pool -- 62) Loading XML bean definitions from class path resource [myspring-services.xml]
2017-03-02 14:58:08,676 ERROR [org.springframework.web.context.ContextLoader] (ServerService Thread Pool -- 62) Context initialization failed: org.springframework.beans.factory.parsing.BeanDefinitionParsingException: Configuration problem: Failed to import bean definitions from URL location [classpath:myspring-services.xml]
Offending resource: URL [jar:file:/c:/data/apps/wildfly-10.1.0.Final/modules/mycustomjar/mycustomjar.jar!/myspring-context.xml]; nested exception is org.springframework.beans.factory.parsing.BeanDefinitionParsingException: Configuration problem: Unable to locate Spring NamespaceHandler for XML schema namespace [http://www.springframework.org/schema/context]
Offending resource: class path resource [myspring-services.xml]
org.springframework.spring
<?xml version="1.0" encoding="UTF-8"?>
<module xmlns="urn:jboss:module:1.3" name="org.springframework.spring" slot="3.1.2">
<resources>
<resource-root path="org.springframework.aop-3.1.2.RELEASE.jar" />
<resource-root path="org.springframework.asm-3.1.2.RELEASE.jar" />
<resource-root path="org.springframework.aspects-3.1.2.RELEASE.jar" />
<resource-root path="org.springframework.beans-3.1.2.RELEASE.jar" />
<resource-root path="org.springframework.context-3.1.2.RELEASE.jar" />
<resource-root path="org.springframework.context.support-3.1.2.RELEASE.jar" />
<resource-root path="org.springframework.core-3.1.2.RELEASE.jar" />
<resource-root path="org.springframework.expression-3.1.2.RELEASE.jar" />
<resource-root path="org.springframework.instrument-3.1.2.RELEASE.jar" />
<resource-root path="org.springframework.instrument.tomcat-3.1.2.RELEASE.jar" />
<resource-root path="org.springframework.jdbc-3.1.2.RELEASE.jar" />
<resource-root path="org.springframework.jms-3.1.2.RELEASE.jar" />
<resource-root path="org.springframework.orm-3.1.2.RELEASE.jar" />
<resource-root path="org.springframework.oxm-3.1.2.RELEASE.jar" />
<resource-root path="org.springframework.test-3.1.2.RELEASE.jar" />
<resource-root path="org.springframework.transaction-3.1.2.RELEASE.jar" />
<resource-root path="org.springframework.web-3.1.2.RELEASE.jar" />
<resource-root path="org.springframework.web.portlet-3.1.2.RELEASE.jar" />
<resource-root path="org.springframework.web.servlet-3.1.2.RELEASE.jar" />
<resource-root path="org.springframework.web.struts-3.1.2.RELEASE.jar" />
</resources>
<dependencies>
<module name="javax.api" export="true" />
<module name="javax.servlet.api" />
<module name="org.apache.commons.logging" />
<module name="org.jboss.vfs" />
<module name="org.jboss.msc" />
</dependencies>
</module>
MyCustomJar.jar
<?xml version="1.0" encoding="UTF-8"?>
<module xmlns="urn:jboss:module:1.1" name="mycustomjar">
<resources>
<resource-root path="mycustomjar.jar" />
</resources>
<dependencies>
</dependencies>
</module>
MyApplication.war jboss-deployment-structure.xml
<?xml version="1.0" encoding="UTF-8"?>
<jboss-deployment-structure xmlns="urn:jboss:deployment-structure:1.2">
<deployment>
<dependencies>
<module name="javax.servlet.api" />
<module name="org.springframework.spring" meta-inf="export" export="true" />
<module name="mycustomjar" />
</dependencies>
</deployment>
</jboss-deployment-structure>
EDIT
I started testing around with different spring versions, and upgrading to 3.2.14 I was able to get it running without any issues using the above configuration. Are the schema files located in a different spot in 3.1.2? It has to be something with those specific versions because a simple upgrade fixed everything

javax.faces.context.FacesContextFactory. Attempting to find backup

I'm deploying an app in jboss 6.2.4.
But it return this error when I'm opening the index page:
10:36:21,808 SEVERE [javax.faces] (ServerService Thread Pool -- 1563) La aplicación no se ha inicializado correctamente durante el inicio, no se encuentra la fábrica: javax.faces.context.FacesContextFactory. Attempting to find backup.
10:36:21,809 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/auditoria-migracion]] (ServerService Thread Pool -- 1563) JBWEB000289: Servlet Faces Servlet threw load() exception: java.lang.IllegalStateException: Could not find backup for factory javax.faces.context.FacesContextFactory.
at javax.faces.FactoryFinder$FactoryManager.getFactory(FactoryFinder.java:996) [jsf-api-2.0.10.jar:2.0.10-SNAPSHOT]
at javax.faces.FactoryFinder.getFactory(FactoryFinder.java:331) [jsf-api-2.0.10.jar:2.0.10-SNAPSHOT]
at javax.faces.webapp.FacesServlet.init(FacesServlet.java:219) [jsf-api-2.0.10.jar:2.0.10-SNAPSHOT]
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1194) [jbossweb-7.3.2.Final-redhat-1.jar:7.3.2.Final-redhat-1]
at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1100) [jbossweb-7.3.2.Final-redhat-1.jar:7.3.2.Final-redhat-1]
at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:3591) [jbossweb-7.3.2.Final-redhat-1.jar:7.3.2.Final-redhat-1]
at org.apache.catalina.core.StandardContext.start(StandardContext.java:3798) [jbossweb-7.3.2.Final-redhat-1.jar:7.3.2.Final-redhat-1]
at org.jboss.as.web.deployment.WebDeploymentService.doStart(WebDeploymentService.java:156) [jboss-as-web-7.3.4.Final-redhat-1.jar:7.3.4.Final-redhat-1]
at org.jboss.as.web.deployment.WebDeploymentService.access$000(WebDeploymentService.java:60) [jboss-as-web-7.3.4.Final-redhat-1.jar:7.3.4.Final-redhat-1]
at org.jboss.as.web.deployment.WebDeploymentService$1.run(WebDeploymentService.java:93) [jboss-as-web-7.3.4.Final-redhat-1.jar:7.3.4.Final-redhat-1]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441) [rt.jar:1.6.0_25]
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303) [rt.jar:1.6.0_25]
at java.util.concurrent.FutureTask.run(FutureTask.java:138) [rt.jar:1.6.0_25]
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) [rt.jar:1.6.0_25]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [rt.jar:1.6.0_25]
at java.lang.Thread.run(Thread.java:662) [rt.jar:1.6.0_25]
at org.jboss.threads.JBossThread.run(JBossThread.java:122)
10:36:21,897 INFO [org.jboss.as.server] (management-handler-thread - 140) JBAS018559: Implementado "auditoria-migracion-3.0.war" (runtime-name : "auditoria-migracion.war")
I have added these jars into the project:
jsf-api-2.0.10.jar
jsf-impl-2.0.10.jar
jstl-1.2.jar
in the jboss-deployment-structure.xml I have excluded the jboss jsf libraries in order to get the jars in the app lib:
<exclusions>
<module name="javax.api" />
<module name="javax.faces.api" />
<module name="org.hibernate" slot="main"/>
<module name="org.slf4j" />
<module name="org.slf4j.impl" />
<module name="javaee.api" />
<module name="javax.jsf-impl" slot="main" />
<module name="javax.jsf-impl" slot="1.2" />
<module name="javax.jsf-api" slot="main" />
</exclusions>
<dependencies>
<module name="org.apache.commons.digester" export="true" />
<module name="org.hibernate" slot="3" export="true" />
<module name="javaee.api" export="true" />
<module name="deployment.auditoria.ear" export="true" />
<module name="deployment.cliente-notificaciones.jar" export="true" />
</dependencies>
Why I'm getting this error?
The problem was that jboss 6 have more jsf apis in system modules, so I have to exclude all of them in jboss-deployment-structure.xml
<exclusions>
<module name="javax.api" />
<module name="javax.faces.api" />
<module name="org.hibernate" slot="main"/>
<module name="org.slf4j" />
<module name="org.slf4j.impl" />
<module name="javaee.api" />
<module name="javax.jsf-impl" slot="main" />
<module name="javax.jsf-impl" slot="1.2" />
<module name="javax.jsf-api" slot="main" />
<module name="javax.faces.api" slot="main" />
<module name="javax.faces.api" slot="1.2" />
<module name="org.jboss.as.jsf" />
<module name="com.sun.jsf-impl" slot="1.2" />
<module name="com.sun.jsf-impl" slot="main" />
</exclusions>

JBoss: Error while deploying the war

I am fairly new to the JBoss. Getting following error while deploying the war. Not sure where to look at to fix it.
service jboss.module.service."deployment.myProject.war".main: JBAS018759: Failed to load module: deployment.myProject.war:main
at org.jboss.as.server.moduleservice.ModuleLoadService.start(ModuleLoadService.java:92) [jboss-as-server-7.2.0.Final-redhat-8.jar:7.2.0.Final-redhat-8]
at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811) [jboss-msc-1.0.4.GA-redhat-1.jar:1.0.4.GA-redhat-1]
at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746) [jboss-msc-1.0.4.GA-redhat-1.jar:1.0.4.GA-redhat-1]
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895) [classes.jar:1.6.0_65]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918) [classes.jar:1.6.0_65]
at java.lang.Thread.run(Thread.java:695) [classes.jar:1.6.0_65]
Caused by: org.jboss.modules.ModuleNotFoundException: config:main
at org.jboss.modules.Module.addPaths(Module.java:949) [jboss-modules.jar:1.2.0.Final-redhat-1]
at org.jboss.modules.Module.link(Module.java:1304) [jboss-modules.jar:1.2.0.Final-redhat-1]
at org.jboss.modules.Module.relinkIfNecessary(Module.java:1332) [jboss-modules.jar:1.2.0.Final-redhat-1]
at org.jboss.modules.ModuleLoader.loadModule(ModuleLoader.java:226) [jboss-modules.jar:1.2.0.Final-redhat-1]
at org.jboss.as.server.moduleservice.ModuleLoadService.start(ModuleLoadService.java:71) [jboss-as-server-7.2.0.Final-redhat-8.jar:7.2.0.Final-redhat-8]`
... 5 more
Using JBoss EAD 6.1 with JDK 1.6
jboss-deployment-structure.xml
<?xml version="1.0" encoding="UTF-8"?>
<jboss-deployment-structure xmlns="urn:jboss:deployment-structure:1.2">
<deployment>
<module-alias name="myProject"/>
<exclude-subsystems>
<subsystem name="jaxrs" />
<subsystem name="webservices" />
<subsystem name="ejb3" />
<subsystem name="jca" />
<subsystem name="jpa" />
<subsystem name="cdi" />
</exclude-subsystems>
<exclusions>
<module name="org.antlr" />
<module name="asm.asm" />
<module name="org.apache.commons.beanutils" />
<module name="org.apache.commons.logging" />
<module name="org.dom4j" />
<module name="org.jboss.as.jpa.hibernate" />
<module name="org.hibernate" />
<module name="org.hibernate.commons-annotations" />
<module name="org.hibernate.envers" />
<module name="org.hibernate.validator" />
<module name="org.codehaus.jackson.jackson-core-asl" />
<module name="org.codehaus.jackson.jackson-jaxrs" />
<module name="org.codehaus.jackson.jackson-mapper-asl" />
<module name="org.codehaus.jackson.jackson-xc" />
<module name="org.javassist" />
<module name="javax.inject.api" />
<module name="org.jboss.as.logging" />
<module name="javax.transaction.api" />
<module name="org.slf4j.jcl-over-slf4j" />
<module name="org.codehaus.jettison" />
<module name="javax.servlet.jstl.api" />
<module name="org.apache.log4j" />
<module name="org.slf4j" />
<module name="org.springframework.spring" />
</exclusions>
</deployment>
</jboss-deployment-structure>

JBoss AS 7.2 Failed to determine implementation class name

When I am trying to call a WSDL-based web service from inside a Resource Adapter, I get the following exception:
SEVERE [org.apache.cxf.BusFactory] (JmsMessageDispatcher#2) Failed to determine BusFactory implementation class name.: java.lang.ClassCastException: class org.apache.cxf.bus.spring.SpringBusFactory
at java.lang.Class.asSubclass(Class.java:3126) [rt.jar:1.7.0_45]
at org.apache.cxf.BusFactory.getBusFactoryClass(BusFactory.java:333) [cxf-api-2.5.9.jar:2.5.9]
at org.apache.cxf.BusFactory.newInstance(BusFactory.java:260) [cxf-api-2.5.9.jar:2.5.9]
at org.apache.cxf.BusFactory.newInstance(BusFactory.java:247) [cxf-api-2.5.9.jar:2.5.9]
at org.apache.cxf.BusFactory.getDefaultBus(BusFactory.java:99) [cxf-api-2.5.9.jar:2.5.9]
at org.apache.cxf.BusFactory.createThreadBus(BusFactory.java:193) [cxf-api-2.5.9.jar:2.5.9]
at org.apache.cxf.BusFactory.getThreadDefaultBus(BusFactory.java:182) [cxf-api-2.5.9.jar:2.5.9]
at org.apache.cxf.BusFactory.getThreadDefaultBus(BusFactory.java:166) [cxf-api-2.5.9.jar:2.5.9]
at org.apache.cxf.frontend.ClientProxyFactoryBean.configureObject(ClientProxyFactoryBean.java:99) [cxf-rt-frontend-simple-2.5.9.jar:2.5.9]
at org.apache.cxf.frontend.ClientProxyFactoryBean.create(ClientProxyFactoryBean.java:131) [cxf-rt-frontend-simple-2.5.9.jar:2.5.9]
at org.apache.cxf.jaxws.JaxWsProxyFactoryBean.create(JaxWsProxyFactoryBean.java:155) [cxf-rt-frontend-jaxws-2.5.9.jar:2.5.9]
During deployment of said Resource Adapter, I get this warning:
WARN [org.jboss.as.server.deployment] (MSC service thread 1-1) JBAS015893: Encountered invalid class name 'org.springframework.context.ApplicationContext,org.springframework.beans.BeansException' for service type 'org.apache.cxf.bus.factory'
I guess it is like they say: A warning DOES become an error sooner or later ;)
The answer to this question didn't help, since I added the following dependency to my pom.xml already like so:
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-api</artifactId>
<version>2.5.9</version>
</dependency>
The Resource Adapter is deployed as a JCA Connector (.rar).
Thanks for any help!
Don't deliver Spring and CXF with your resource adapters. Include them as module dependency.
In your RA project:
pom.xml: use provided scope for CXF libraries
add META-INF/jboss-deployment-structure.xml to RAR archive
META-INF/jboss-deployment-structure.xml
<jboss-deployment-structure xmlns="urn:jboss:deployment-structure:1.2">
<deployment>
<dependencies>
<module name="org.jboss.ws.cxf.jbossws-cxf-client" services="import" />
<module name="org.apache.cxf"> <!-- .impl removed -->
<imports>
<include path="META-INF" />
<include path="META-INF/cxf" />
</imports>
</module>
<module name="org.springframework.spring">
<imports>
<include path="META-INF" />
</imports>
</module>
</dependencies>
</deployment>
</jboss-deployment-structure>
As spring is not part of JBoss you have to deploy it as new module.
Create module directory $JBOSS_HOME/modules/org/springframework/spring/main/
add module.xml
add the JAR files listed in module.xml to the directory
module.xml
<?xml version="1.0" ?>
<module xmlns="urn:jboss:module:1.1" name="org.springframework.spring">
<resources>
<resource-root path="spring-aop-3.2.4.RELEASE.jar" />
<resource-root path="spring-beans-3.2.4.RELEASE.jar" />
<resource-root path="spring-context-3.2.4.RELEASE.jar" />
<resource-root path="spring-core-3.2.4.RELEASE.jar" />
<resource-root path="spring-expression-3.2.4.RELEASE.jar" />
<resource-root path="spring-web-3.2.4.RELEASE.jar" />
</resources>
<dependencies>
<module name="javax.api" />
<module name="javax.servlet.api" />
<module name="javax.transaction.api" />
<module name="org.apache.commons.logging" />
</dependencies>
</module>
I'm not sure if this is a class-loading bug deep down in JBoss or not.

Categories