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
Related
How to exclude war having version specified in the name of war?
There are multiple war in single ear and needs to exclude from only one war.
E.g.
<sub-deployment name="AppName-1.4.0-SNAPSHOT.war">
<exclusions>
<module name="com.fasterxml.jackson.core.jackson-core" />
<module name="com.fasterxml.jackson.core.jackson-annotations" />
<module name="com.fasterxml.jackson.core.jackson-databind" />
<module name="com.fasterxml.jackson.datatype.jackson-datatype-jdk8" />
<module name="com.fasterxml.jackson.datatype.jackson-datatype-jsr310" />
<module name="com.fasterxml.jackson.jaxrs.jackson-jaxrs-json-provider" />
<module name="org.jboss.resteasy.resteasy-jackson2-provider" />
<module name="org.jboss.resteasy.resteasy-jackson-provider" />
</exclusions>
</sub-deployment>
Above is my jboss-deployment-structure.xml.
When version of AppName change, it requires to change this file. I tried to use wildcard as AppName-*.war, but it didn't work. How to write generic jboss-deployment-structure.xml or any alternative ?
You cannot achieve this with jboss-deployment-structure.xml. Wildcards are not allowed (even in modules/subystems exclusions). Simplest thing is to remove the version from your wars and naming them in a meaningful way.
I was trying to add jsf2.2 into JBoss 7.0 server following this article's 2nd option. I created folder with name 2.2 within /modules/javax/faces/api/ and modules\com\sun\jsf-impl and added jsf-api-2.2.14.jar and jsf-impl-2.2.14.jar respectively.
The module.xml file within /modules/javax/faces/api/2.2 looks like
<?xml version="1.0" encoding="UTF-8"?>
<module xmlns="urn:jboss:module:1.1" name="javax.faces.api" slot="2.2">
<dependencies>
<module name="javax.el.api" export="true"/>
<module name="javax.servlet.api" export="true"/>
<module name="javax.servlet.jsp.api" export="true"/>
<module name="javax.servlet.jstl.api" export="true"/>
<module name="javax.validation.api" export="true"/>
<module name="com.sun.jsf-impl" slot="2.2"/>
</dependencies>
<resources>
<resource-root path="jsf-api-2.2.14.jar"/>
</resources>
</module>
and module.xml file within /modules/com/sunjsf-impl/2.2 looks like
<?xml version="1.0" encoding="UTF-8"?>
<module xmlns="urn:jboss:module:1.1" name="com.sun.jsf-impl" slot="2.2">
<properties>
<property name="jboss.api" value="private"/>
</properties>
<dependencies>
<module name="javax.faces.api" slot="2.2"/>
<module name="javaee.api"/>
<module name="javax.servlet.jstl.api"/>
<module name="org.apache.xerces" services="import"/>
<module name="org.apache.xalan" services="import"/>
</dependencies>
<resources>
<resource-root path="jsf-impl-2.2.14.jar"/>
</resources>
</module>
and jboss-deployment-structure.xml looks like below in both Project and and JBoss Server
<?xml version="1.0" encoding="UTF-8"?>
<jboss-deployment-structure>
<deployment>
<exclusions>
<module name="org.apache.log4j" />
<module name="javax.faces.api" />
<module name="com.sun.jsf-impl" />
</exclusions>
<dependencies>
<module name="javax.faces.api" slot="2.2"/>
<module name="com.sun.jsf-impl" slot="2.2"/>
</dependencies>
</deployment>
</jboss-deployment-structure>
After all these set up done, when I run the project, I get below error in modules\javax\faces\api\2.2\module.xml
Unexpected content of type 'element start' named
'{urn:jboss:module:1.1}module'
But I don't know what's wrong with that line in file mentioned above. Everything seems valid there. Here is the complete StackTrace
at org.jboss.as.server.moduleservice.ModuleLoadService.start(ModuleLoadService.java:67) [jboss-as-server-7.0.2.Final.jar:7.0.2.Final]
at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1824) [jboss-msc-1.0.1.GA.jar:1.0.1.GA]
at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1759) [jboss-msc-1.0.1.GA.jar:1.0.1.GA]
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) [:1.7.0_79]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [:1.7.0_79]
at java.lang.Thread.run(Unknown Source) [:1.7.0_79]
Caused by: org.jboss.modules.ModuleLoadException: Error loading module from D:\Eclipse\jboss-as-web-7.0.2.Final\jboss-as-web-7.0.2.Final\modules\javax\faces\api\2.2\module.xml
at org.jboss.modules.ModuleXmlParser.parseModuleXml(ModuleXmlParser.java:249)
at org.jboss.modules.ModuleXmlParser.parseModuleXml(ModuleXmlParser.java:200)
at org.jboss.modules.LocalModuleLoader.parseModuleInfoFile(LocalModuleLoader.java:147)
at org.jboss.modules.LocalModuleLoader.findModule(LocalModuleLoader.java:124)
at org.jboss.modules.ModuleLoader.loadModuleLocal(ModuleLoader.java:245)
at org.jboss.modules.ModuleLoader.preloadModule(ModuleLoader.java:194)
at org.jboss.modules.LocalModuleLoader.preloadModule(LocalModuleLoader.java:97)
at org.jboss.modules.ModuleLoader.preloadExportedModule(ModuleLoader.java:205)
at org.jboss.modules.ModuleLoader.preloadModule(ModuleLoader.java:218)
at org.jboss.as.server.moduleservice.ServiceModuleLoader.preloadModule(ServiceModuleLoader.java:161) [jboss-as-server-7.0.2.Final.jar:7.0.2.Final]
at org.jboss.modules.ModuleLoader.loadModule(ModuleLoader.java:176)
at org.jboss.modules.Module.linkImports(Module.java:1041)
at org.jboss.modules.Module.relink(Module.java:1153)
at org.jboss.modules.ModuleLoader.relink(ModuleLoader.java:400)
at org.jboss.as.server.moduleservice.ServiceModuleLoader.relinkModule(ServiceModuleLoader.java:204) [jboss-as-server-7.0.2.Final.jar:7.0.2.Final]
at org.jboss.as.server.moduleservice.ModuleLoadService.start(ModuleLoadService.java:64) [jboss-as-server-7.0.2.Final.jar:7.0.2.Final]
... 5 more
Caused by: javax.xml.stream.XMLStreamException: ParseError at [row,col]:[25,72]
Message: Unexpected content of type 'element start' named '{urn:jboss:module:1.1}module'
at org.jboss.modules.ModuleXmlParser.unexpectedContent(ModuleXmlParser.java:312)
at org.jboss.modules.ModuleXmlParser.parseDocument(ModuleXmlParser.java:503)
at org.jboss.modules.ModuleXmlParser.parseModuleXml(ModuleXmlParser.java:244)
... 20 more
Could someone help me out through this?
According to this link
https://developer.jboss.org/thread/171833
a similar problem (but that time caused by the file jboss-deployment-structure.xml ) was solved by removing the namespace attribute from the element.
Now that your error message is actually the same, why don't you experiment by changing the namespace of (one of) your elements from
<module xmlns="urn:jboss:module:1.1"
maybe to
<module xmlns="urn:jboss:module:1.0"
Or just try to completely remove the namespace attribute from the element?
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>
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>
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.