Groups keyboard shortcuts have been updated
Dismiss
See shortcuts

use of @XmlRootElement and @xmlType at the same time.

48 views
Skip to first unread message

Thomas Franconville

unread,
Jan 14, 2025, 5:22:51 PMJan 14
to WildFly
Hello,

I have the behind error on the code runing under wildfly 26 (I am trying to migrate from TomEE 8).
SystemInfo systemInfo = response.readEntity(SystemInfo.class);
java.lang.ClassCastException: class javax.xml.bind.JAXBElement cannot be cast to class ch.abraxas.cari.dispo.theorie.connect.cut.jaxb.version_1_4.systeminfo.SystemInfo (javax.xml.bind.JAXBElement is in unnamed module of loader 'javax.xml...@2.3.3' @28b46423; ch.abraxas.cari.dispo.theorie.connect.cut.jaxb.version_1_4.systeminfo.SystemInfo is in unnamed module of loader 'deployment.ROOT.war' @28321c9e)

The class SystemInfo has those annotation:
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "systemInfo", propOrder = {
"environment",
"version",
"questionsUpdated"
})
@XmlRootElement(name = "systemInfo")

There is an ObjectFactory define as XmlRegistry for this Object

If I remove the @XmlType, it works, but My application needs it for some other case.
Jow can I do ?

Thank's for your help,

Thomas

Jim Ma

unread,
Jan 16, 2025, 3:53:29 AMJan 16
to Thomas Franconville, WildFly
Did you package some jaxb impl or api jars in your ROOT.war file ? Try to remove it to see if it works .


--
You received this message because you are subscribed to the Google Groups "WildFly" group.
To unsubscribe from this group and stop receiving emails from it, send an email to wildfly+u...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/wildfly/07e4b5e7-5b62-48ad-b479-d5603dce784dn%40googlegroups.com.

Thomas Franconville

unread,
Jan 17, 2025, 11:05:08 AMJan 17
to Jim Ma, WildFly
Hi Jim,

Thank's for your reply.
I don't know where I can easily view all the library embedded by WildFly. But I don't think there is still any jaxb impl or api in my lib directory. Here is the list:
CommonsConnector-1.05.00-b02.jar
FaberJConnector-1.05.00-b02.jar
HikariCP-4.0.3.jar
MofisJConnector-1.05.00-b02.jar
PDFRenderer-0.9.1.jar
POLA-1.0-LOCAL.jar
SparseBitSet-1.2.jar
activiti-engine-5.11.jar
attoparser-2.0.5.RELEASE.jar
backport-util-concurrent-3.1.jar
batch-bit-431.09-SNAPSHOT.jar
cache-api-1.1.0.jar
cage-1.0.jar
cari-core-431.09-SNAPSHOT.jar
cari-pentaho-431.09-SNAPSHOT.jar
cari-runtime-431.09-SNAPSHOT.jar
cari-service-431.09-SNAPSHOT.jar
cari-servlet-431.09-SNAPSHOT.jar
cariapi-base-431.09-SNAPSHOT.jar
cariapi-domain-431.09-SNAPSHOT.jar
cariapi-rs-431.09-SNAPSHOT.jar
cariapi-service-431.09-SNAPSHOT.jar
classindex-3.13.jar
commons-beanutils-1.9.4.jar
commons-collections-3.2.2.jar
commons-collections4-4.3.jar
commons-compress-1.18.jar
commons-digester-1.8.jar
commons-email-1.2.jar
commons-fileupload-1.2.jar
commons-httpclient-3.1.jar
commons-imaging-1.0-alpha2.jar
commons-io-2.8.0.jar
commons-lang-2.5.jar
commons-lang3-3.12.0.jar
commons-math3-3.6.1.jar
commons-net-3.6.jar
commons-text-1.8.jar
commons-validator-1.1.4.jar
commonservices-1.9.1.0.jar
conn-admas-fedro-release-25.01-431.09-SNAPSHOT.jar
conn-archivage-ais-431.09-SNAPSHOT.jar
conn-archivage-d3-431.09-SNAPSHOT.jar
conn-archivage-dok-431.09-SNAPSHOT.jar
conn-archivage-osecm-431.09-SNAPSHOT.jar
conn-circulation-cls-431.09-SNAPSHOT.jar
conn-circulation-fedro-release-25.01-431.09-SNAPSHOT.jar
conn-circulation-sis-431.09-SNAPSHOT.jar
conn-common-ebill-431.09-SNAPSHOT.jar
conn-conduite-card-431.09-SNAPSHOT.jar
conn-conduite-fak-central-431.09-SNAPSHOT.jar
conn-conduite-fedro-release-25.01-431.09-SNAPSHOT.jar
conn-conduite-sari-431.09-SNAPSHOT.jar
conn-conduite-sari-vkupgs-431.09-SNAPSHOT.jar
conn-datatrans-431.09-SNAPSHOT.jar
conn-detenteur-fedro-release-25.01-431.09-SNAPSHOT.jar
conn-detenteur-geres-431.09-SNAPSHOT.jar
conn-detenteur-geres-v3-431.09-SNAPSHOT.jar
conn-detenteur-per-431.09-SNAPSHOT.jar
conn-detenteur-photocollect-431.09-SNAPSHOT.jar
conn-detenteur-sari-fmp-431.09-SNAPSHOT.jar
conn-detenteur-vrsg-431.09-SNAPSHOT.jar
conn-dispo-conduite-cufu-431.09-SNAPSHOT.jar
conn-dispo-conduite-inspect-431.09-SNAPSHOT.jar
conn-dispo-expertise-bateau-inspect-431.09-SNAPSHOT.jar
conn-dispo-expertise-cufa-431.09-SNAPSHOT.jar
conn-dispo-ims-431.09-SNAPSHOT.jar
conn-dispotheorie-cut-431.09-SNAPSHOT.jar
conn-monitoring-release-25.01-431.09-SNAPSHOT.jar
conn-navigation-neptun-431.09-SNAPSHOT.jar
conn-paynet-v2-431.09-SNAPSHOT.jar
conn-poursuite-egeli-431.09-SNAPSHOT.jar
conn-poursuite-elp-v2_1_01-431.09-SNAPSHOT.jar
conn-poursuite-elp-v2_2-431.09-SNAPSHOT.jar
conn-sobe-bedag-431.09-SNAPSHOT.jar
conn-user-keycloak-431.09-SNAPSHOT.jar
conn-yb-download-v1-431.09-SNAPSHOT.jar
conn-yb-upload-v1-431.09-SNAPSHOT.jar
conn-yb-upload-v3-431.09-SNAPSHOT.jar
core-3.1.0.jar
cos-1.0-LOCAL.jar
curvesapi-1.06.jar
dozer-5.3.2.jar
eCodeAdapter-3.00.03.jar
eftoa-1.12.010.jar
ehcache-107-3.10.8.jar
ehcache-api-3.10.8.jar
ehcache-core-3.10.8.jar
ehcache-impl-3.10.8.jar
ehcache-xml-3.10.8.jar
ehcache-xml-spi-3.10.8.jar
enunciate-core-annotations-2.15.0.jar
ext-avedris-431.09-SNAPSHOT.jar
ext-card-431.09-SNAPSHOT.jar
ext-cut-431.09-SNAPSHOT.jar
ext-dispo-expertise-bateau-431.09-SNAPSHOT.jar
ext-inspect-431.09-SNAPSHOT.jar
ext-inspect-bateau-431.09-SNAPSHOT.jar
ext-inspect-conduite-431.09-SNAPSHOT.jar
ext-ivz-431.09-SNAPSHOT.jar
ext-orfee-431.09-SNAPSHOT.jar
ext-tvdx-431.09-SNAPSHOT.jar
ext-zek-431.09-SNAPSHOT.jar
fedro-framework-release-25.01-431.09-SNAPSHOT.jar
fedro-release-25.01-431.09-SNAPSHOT.jar
flexicapture-ws-1.0-LOCAL.jar
fontbox-3.0.2.jar
fw-core-431.09-SNAPSHOT.jar
fw-jee-wildfly-stack-431.09-SNAPSHOT.jar
graphics2d-0.30.jar
hibernate-hikaricp-5.4.31.Final.jar
ical4j-1.0.2.jar
impl-accounting-cari-431.09-SNAPSHOT.jar
impl-avedris-431.09-SNAPSHOT.jar
impl-circulation-cari-431.09-SNAPSHOT.jar
impl-circulation-frontend-431.09-SNAPSHOT.jar
impl-conduite-cari-431.09-SNAPSHOT.jar
impl-conduite-frontend-431.09-SNAPSHOT.jar
impl-conduite-ivz-ws-fedro-conduite-431.09-SNAPSHOT.jar
impl-conduite-ivz-ws-fl-conduite-431.09-SNAPSHOT.jar
impl-detenteur-cari-431.09-SNAPSHOT.jar
impl-ivz-431.09-SNAPSHOT.jar
impl-monitoring-cari-431.09-SNAPSHOT.jar
impl-notifications-431.09-SNAPSHOT.jar
int-accounting-431.09-SNAPSHOT.jar
int-accounting-cari-431.09-SNAPSHOT.jar
int-accounting-usecases-431.09-SNAPSHOT.jar
int-admas-431.09-SNAPSHOT.jar
int-archivage-431.09-SNAPSHOT.jar
int-circulation-431.09-SNAPSHOT.jar
int-circulation-cari-431.09-SNAPSHOT.jar
int-circulation-frontend-431.09-SNAPSHOT.jar
int-circulation-usecases-431.09-SNAPSHOT.jar
int-conduite-431.09-SNAPSHOT.jar
int-conduite-cari-431.09-SNAPSHOT.jar
int-conduite-frontend-431.09-SNAPSHOT.jar
int-conduite-ivz-431.09-SNAPSHOT.jar
int-detenteur-431.09-SNAPSHOT.jar
int-detenteur-cari-431.09-SNAPSHOT.jar
int-dispo-conduite-431.09-SNAPSHOT.jar
int-dispo-expertise-431.09-SNAPSHOT.jar
int-dispo-expertise-bateau-431.09-SNAPSHOT.jar
int-monitoring-431.09-SNAPSHOT.jar
int-monitoring-cari-431.09-SNAPSHOT.jar
int-navigation-431.09-SNAPSHOT.jar
int-notifications-431.09-SNAPSHOT.jar
int-poursuites-431.09-SNAPSHOT.jar
int-sobe-431.09-SNAPSHOT.jar
int-user-431.09-SNAPSHOT.jar
interfaceCFI-2.0.jar
iso20022-0.1-LOCAL.jar
j2ssh-core-0.2.9.jar
jackcess-3.5.1.jar
javase-3.1.0.jar
javassist-3.27.0-GA.jar
jboss-logging-3.4.3.Final.jar
jcl-over-slf4j-1.7.36.jar
jdbc-stdext-2.0.jar
jdom-1.0.jar
jose4j-0.6.0.jar
jsch-0.1.72.jar
json-20140107.jar
jsoup-1.12.1.jar
libphonenumber-7.2.8.jar
log4j-api-2.19.0.jar
log4j-core-2.19.0.jar
mapstruct-1.4.1.Final.jar
messages-431.09-SNAPSHOT.jar
mod-access-impl-431.09-SNAPSHOT.jar
mod-access-int-431.09-SNAPSHOT.jar
mod-dispo-431.09-SNAPSHOT.jar
mod-environnement-431.09-SNAPSHOT.jar
mod-environnement-api-431.09-SNAPSHOT.jar
mybatis-3.1.1.jar
offheap-store-2.5.3.jar
ognl-3.1.26.jar
ojdbc8-19.3.0.0.0.jar
openpdf-1.3.23.jar
orfee-impl-431.09-SNAPSHOT.jar
org.apache.oltu.oauth2.client-1.0.2.jar
org.apache.oltu.oauth2.common-1.0.2.jar
oro-2.0.8.jar
pdfbox-3.0.2.jar
pdfbox-io-3.0.2.jar
poi-5.0.0.jar
poi-ooxml-5.0.0.jar
poi-ooxml-lite-5.0.0.jar
poi-scratchpad-5.0.0.jar
qrbill-generator-3.3.0.jar
qrcodegen-1.8.0.jar
r1dvision-1.0-LOCAL.jar
rbarcode-1.0-LOCAL.jar
reflections-0.9.12.jar
resteasy-servlet-initializer-4.7.7.Final.jar
rvision-1.0-LOCAL.jar
sardine-5.8.jar
sizeof-0.4.3.jar
slf4j-api-1.7.36.jar
soap-2.3.1.jar
spring-aop-5.3.18.jar
spring-beans-5.3.18.jar
spring-context-5.3.18.jar
spring-core-5.3.18.jar
spring-expression-5.3.18.jar
spring-jcl-5.3.18.jar
spring-oxm-5.3.18.jar
spring-security-config-5.6.2.jar
spring-security-core-5.6.2.jar
spring-security-crypto-5.6.2.jar
spring-security-jwt-1.1.1.RELEASE.jar
spring-security-oauth2-2.5.1.RELEASE.jar
spring-security-web-5.6.2.jar
spring-web-5.3.18.jar
spring-webmvc-5.3.18.jar
statistics-2.1.2.jar
struts-1.1.jar
struts-legacy-1.1.jar
terracotta-utilities-tools-0.0.15.jar
thymeleaf-3.0.15.RELEASE.jar
thymeleaf-spring5-3.0.15.RELEASE.jar
tika-core-1.24.1.jar
tp-gifencoder-431.09-SNAPSHOT.jar
transport-431.09-SNAPSHOT.jar
unbescape-1.1.6.RELEASE.jar
ws-cxf-provider-1.05.01.jar
xmlbeans-5.0.3.jar
xmlpull-1.1.3.1.jar
xpp3_min-1.1.4c.jar
xstream-1.4.15.jar

Do you see any problem ?
Thank you.

Thomas

Thomas Franconville

unread,
Jan 17, 2025, 11:10:43 AMJan 17
to Jim Ma, WildFly
I have done a test with and without the @XmlType and taken the stack of the creation of the SystemInfo object
Here is the one with the @XmlType that return a JAXBElement:
<init>:61, SystemInfo (ch.abraxas.cari.dispo.theorie.connect.cut.jaxb.version_1_4.systeminfo)
newInstance0:-1, NativeConstructorAccessorImpl (jdk.internal.reflect)
newInstance:77, NativeConstructorAccessorImpl (jdk.internal.reflect)
newInstance:45, DelegatingConstructorAccessorImpl (jdk.internal.reflect)
newInstanceWithCaller:499, Constructor (java.lang.reflect)
newInstance:480, Constructor (java.lang.reflect)
create0:102, ClassFactory (com.sun.xml.bind.v2)
createInstance:254, ClassBeanInfoImpl (com.sun.xml.bind.v2.runtime)
createInstance:671, UnmarshallingContext (com.sun.xml.bind.v2.runtime.unmarshaller)
startElement:158, StructureLoader (com.sun.xml.bind.v2.runtime.unmarshaller)
startElement:30, ProxyLoader (com.sun.xml.bind.v2.runtime.unmarshaller)
startElement:223, ElementBeanInfoImpl$IntercepterLoader (com.sun.xml.bind.v2.runtime)
_startElement:546, UnmarshallingContext (com.sun.xml.bind.v2.runtime.unmarshaller)
startElement:525, UnmarshallingContext (com.sun.xml.bind.v2.runtime.unmarshaller)
startElement:137, SAXConnector (com.sun.xml.bind.v2.runtime.unmarshaller)
startElement:498, AbstractSAXParser (org.apache.xerces.parsers)
scanStartElement:283, XMLNSDocumentScannerImpl (org.apache.xerces.impl)
scanRootElementHook:733, XMLNSDocumentScannerImpl$NSContentDispatcher (org.apache.xerces.impl)
dispatch:1754, XMLDocumentFragmentScannerImpl$FragmentContentDispatcher (org.apache.xerces.impl)
scanDocument:324, XMLDocumentFragmentScannerImpl (org.apache.xerces.impl)
parse:875, XML11Configuration (org.apache.xerces.parsers)
parse:798, XML11Configuration (org.apache.xerces.parsers)
parse:108, XMLParser (org.apache.xerces.parsers)
parse:1198, AbstractSAXParser (org.apache.xerces.parsers)
parse:564, SAXParserImpl$JAXPSAXParser (org.apache.xerces.jaxp)
unmarshal0:228, UnmarshallerImpl (com.sun.xml.bind.v2.runtime.unmarshaller)
unmarshal:199, UnmarshallerImpl (com.sun.xml.bind.v2.runtime.unmarshaller)
unmarshal:123, AbstractUnmarshallerImpl (javax.xml.bind.helpers)
unmarshal:106, AbstractUnmarshallerImpl (javax.xml.bind.helpers)
unmarshal:233, SecureUnmarshaller (org.jboss.resteasy.plugins.providers.jaxb)
unmarshal:211, SecureUnmarshaller (org.jboss.resteasy.plugins.providers.jaxb)
processWithSecureProcessing:286, AbstractJAXBProvider (org.jboss.resteasy.plugins.providers.jaxb)
readFrom:117, AbstractJAXBProvider (org.jboss.resteasy.plugins.providers.jaxb)
readFrom:101, AbstractReaderInterceptorContext (org.jboss.resteasy.core.interception.jaxrs)
proceed:80, AbstractReaderInterceptorContext (org.jboss.resteasy.core.interception.jaxrs)
aroundReadFrom:36, DigitalVerificationInterceptor (org.jboss.resteasy.security.doseta)
proceed:88, AbstractReaderInterceptorContext (org.jboss.resteasy.core.interception.jaxrs)
readFrom:217, ClientResponse (org.jboss.resteasy.client.jaxrs.internal)
readEntity:90, BuiltResponse (org.jboss.resteasy.specimpl)
readEntity:262, AbstractBuiltResponse (org.jboss.resteasy.specimpl)
getSystemInfo:686, CutConnector (ch.abraxas.cari.dispo.theorie.connect.cut)

The only difference with the test without the @XmlType and that retrun as I would like the SystmInfo object, is that the 2 behind lines are not here:
startElement:30, ProxyLoader (com.sun.xml.bind.v2.runtime.unmarshaller)
startElement:223, ElementBeanInfoImpl$IntercepterLoader (com.sun.xml.bind.v2.runtime)

Can it give somebody a clue for my problem ?

Thank's

Thomas 

Le jeu. 16 janv. 2025 à 09:53, Jim Ma <e...@redhat.com> a écrit :

Jim Ma

unread,
Jan 19, 2025, 11:20:05 PMJan 19
to Thomas Franconville, WildFly
Do you know which version of jaxb is used to generate these jaxb annotations in SystemInfo ? 
Can you please check if it is compatible with javax.xml...@2.3.3 ? 

Thomas Franconville

unread,
Jan 20, 2025, 4:09:05 AMJan 20
to WildFly
Hello Jim,

Good point!
It was genereted in version  2.2.11 with sun implementation,
And if I regenerate now, it is on v.2.3.8 of eclipe implementation,
And the @XmlRootElement(name = "systemInfo") has been removed.
With that, it works well.
Thank's a lot :)

Thomas
Reply all
Reply to author
Forward
0 new messages