Add a note about Jackson annotation library clash in Wildfly
Nobody has claimed this yet.
- Dominant language
- AsciiDoc
- Stars
- 38
- Forks
- 225
- Avg merge
- 1d 4h
- Merged PRs (30d)
- 170
Description
When using Vaadin 25 in Wildfly, it could happen that the application fails at deployment or runtime because of an incompatibility with the Jackson annotation artifact version.
Wildfly adds jackson 2.x to each deployment as part of the default jaxrs subsystem. This causes issues with Vaadin 25 if the Jackson annotation dependency is older than the one expected by Jackson 3 (used by Vaadin).
07:41:44,960 ERROR [io.undertow.request] (default task-1) UT005023: Exception handling request to /push/: java.lang.NoSuchFieldError: Class com.fasterxml.jackson.annotation.JsonFormat$Shape does not have member field 'com.fasterxml.jackson.annotation.JsonFormat$Shape POJO'
at deployment.push.war//tools.jackson.databind.ser.BasicSerializerFactory.buildEnumSerializer(BasicSerializerFactory.java:1071)
at deployment.push.war//tools.jackson.databind.ser.BeanSerializerFactory._createSerializer2(BeanSerializerFactory.java:241)
at deployment.push.war//tools.jackson.databind.ser.BeanSerializerFactory.createSerializer(BeanSerializerFactory.java:182)
at deployment.push.war//tools.jackson.databind.SerializationContext._createAndCachePropertySerializer(SerializationContext.java:1027)
at deployment.push.war//tools.jackson.databind.SerializationContext.findPrimaryPropertySerializer(SerializationContext.java:697)
at deployment.push.war//tools.jackson.databind.ser.bean.BeanSerializerBase.resolve(BeanSerializerBase.java:311)
at deployment.push.war//tools.jackson.databind.ser.UnrolledBeanSerializer.resolve(UnrolledBeanSerializer.java:155)
at deployment.push.war//tools.jackson.databind.ser.SerializerCache.addAndResolveNonTypedSerializer(SerializerCache.java:216)
at deployment.push.war//tools.jackson.databind.SerializationContext._createAndCacheUntypedSerializer(SerializationContext.java:975)
at deployment.push.war//tools.jackson.databind.SerializationContext.findValueSerializer(SerializationContext.java:774)
at deployment.push.war//tools.jackson.databind.SerializationContext.findTypedValueSerializer(SerializationContext.java:586)
at deployment.push.war//tools.jackson.databind.ser.SerializationContextExt.valueToTree(SerializationContextExt.java:185)
at deployment.push.war//tools.jackson.databind.ObjectMapper.valueToTree(ObjectMapper.java:1365)
at deployment.push.war//com.vaadin.flow.server.communication.UidlWriter.dependencyToJson(UidlWriter.java:252)
The current solution to the problem is to add a jboss-deployment-structure.xml descriptor to the application, which contains an explicit exclusion for the Jackson annotation modules or the whole jaxrs subsytem.
To be noted that the module exclusion works only starting with Widlfly 37; for previous releases the jaxrs subsytem must be excluded.
This is mentioned in the release notes for Vaadin 25, but it would be good to add a note also on the Vaadin CDI add-on documentation, since Wildfly is most likely to be used with that add-on.
<jboss-deployment-structure>
<deployment>
<!-- Wildfly 37+ -->
<exclusions>
<module name="com.fasterxml.jackson.core.jackson-annotations"/>
</exclusions>
<!-- Wildfly less than 37 -->
<exclude-subsystems>
<subsystem name="jaxrs" />
</exclude-subsystems>
</deployment>
</jboss-deployment-structure>
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reviewing the Vaadin CDI add-on documentation and the existing Vaadin 25 release-note guidance referenced in the issue. Add the WildFly Jackson annotation clash note, including the jboss-deployment-structure.xml alternatives for WildFly 37+ and earlier releases. Done means CDI users can find the workaround and distinguish the two version cases.
Written by the indexing model from the issue text.
Assessment
- Domain
- documentation
- Issue type
- Documentation
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 55/100