javaee / jaxb-v2

Other
211 stars 100 forks source link

Messages.properties: Incorrect value for CONFLICTING_XML_ELEMENT_MAPPING #1017

Open glassfishrobot opened 10 years ago

glassfishrobot commented 10 years ago

When JAXB wants to read the string for following error:

CONFLICTING_XML_ELEMENT_MAPPING = \
    The element name '{'{0}'}'{1} has more than one mapping.

the original error will be lost because the formatting of the string fails and a new exception will be thrown:

java.lang.IllegalArgumentException: can't parse argument number ''{0}''
    at java.text.MessageFormat.makeFormat(MessageFormat.java:1339)[:1.6.0_25]
    at java.text.MessageFormat.applyPattern(MessageFormat.java:458)[:1.6.0_25]
    at java.text.MessageFormat.<init>(MessageFormat.java:350)[:1.6.0_25]
    at java.text.MessageFormat.format(MessageFormat.java:811)[:1.6.0_25]
    at com.sun.xml.bind.v2.model.impl.Messages.format(Messages.java:133)[jaxb-impl-2.2.5-2.jar:2.2.5-2]
    at com.sun.xml.bind.v2.model.impl.TypeInfoSetImpl.add(TypeInfoSetImpl.java:306)[jaxb-impl-2.2.5-2.jar:2.2.5-2]
    at com.sun.xml.bind.v2.model.impl.RegistryInfoImpl.<init>(RegistryInfoImpl.java:121)[jaxb-impl-2.2.5-2.jar:2.2.5-2]
    at com.sun.xml.bind.v2.model.impl.ModelBuilder.addRegistry(ModelBuilder.java:362)[jaxb-impl-2.2.5-2.jar:2.2.5-2]
    at com.sun.xml.bind.v2.model.impl.ModelBuilder.getTypeInfo(ModelBuilder.java:332)[jaxb-impl-2.2.5-2.jar:2.2.5-2]
    at com.sun.xml.bind.v2.runtime.JAXBContextImpl.getTypeInfoSet(JAXBContextImpl.java:460)[jaxb-impl-2.2.5-2.jar:2.2.5-2]
    at com.sun.xml.bind.v2.runtime.JAXBContextImpl.<init>(JAXBContextImpl.java:298)[jaxb-impl-2.2.5-2.jar:2.2.5-2]
    at com.sun.xml.bind.v2.runtime.JAXBContextImpl.<init>(JAXBContextImpl.java:141)[jaxb-impl-2.2.5-2.jar:2.2.5-2]
    at com.sun.xml.bind.v2.runtime.JAXBContextImpl$JAXBContextBuilder.build(JAXBContextImpl.java:1163)[jaxb-impl-2.2.5-2.jar:2.2.5-2]
    at com.sun.xml.bind.v2.ContextFactory.createContext(ContextFactory.java:145)[jaxb-impl-2.2.5-2.jar:2.2.5-2]
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)[:1.6.0_25]
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)[:1.6.0_25]
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)[:1.6.0_25]
    at java.lang.reflect.Method.invoke(Method.java:597)[:1.6.0_25]
    at javax.xml.bind.ContextFinder.newInstance(ContextFinder.java:202)[:1.6.0_25]
    at javax.xml.bind.ContextFinder.find(ContextFinder.java:363)[:1.6.0_25]
    at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:574)[:1.6.0_25]
    at org.apache.cxf.common.jaxb.JAXBContextCache$2.run(JAXBContextCache.java:267)[cxf-api-2.7.4.jar:2.7.4]
    at org.apache.cxf.common.jaxb.JAXBContextCache$2.run(JAXBContextCache.java:265)[cxf-api-2.7.4.jar:2.7.4]
    at java.security.AccessController.doPrivileged(Native Method)[:1.6.0_25]
    at org.apache.cxf.common.jaxb.JAXBContextCache.createContext(JAXBContextCache.java:265)[cxf-api-2.7.4.jar:2.7.4]
    at org.apache.cxf.common.jaxb.JAXBContextCache.getCachedContextAndSchemas(JAXBContextCache.java:172)[cxf-api-2.7.4.jar:2.7.4]
    at org.apache.cxf.jaxb.JAXBDataBinding.createJAXBContextAndSchemas(JAXBDataBinding.java:464)[cxf-rt-databinding-jaxb-2.7.4.jar:2.7.4]
    at org.apache.cxf.jaxb.JAXBDataBinding.initialize(JAXBDataBinding.java:330)[cxf-rt-databinding-jaxb-2.7.4.jar:2.7.4]
    at org.apache.cxf.service.factory.AbstractServiceFactoryBean.initializeDataBindings(AbstractServiceFactoryBean.java:86)[cxf-rt-core-2.7.4.jar:2.7.4]
    at org.apache.cxf.service.factory.ReflectionServiceFactoryBean.buildServiceFromClass(ReflectionServiceFactoryBean.java:478)[cxf-rt-core-2.7.4.jar:2.7.4]
    at org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean.buildServiceFromClass(JaxWsServiceFactoryBean.java:690)[cxf-rt-frontend-jaxws-2.7.4.jar:2.7.4]
    at org.apache.cxf.service.factory.ReflectionServiceFactoryBean.initializeServiceModel(ReflectionServiceFactoryBean.java:540)[cxf-rt-core-2.7.4.jar:2.7.4]
    at org.apache.cxf.service.factory.ReflectionServiceFactoryBean.create(ReflectionServiceFactoryBean.java:252)[cxf-rt-core-2.7.4.jar:2.7.4]
    at org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean.create(JaxWsServiceFactoryBean.java:205)[cxf-rt-frontend-jaxws-2.7.4.jar:2.7.4]
    at org.apache.cxf.frontend.AbstractWSDLBasedEndpointFactory.createEndpoint(AbstractWSDLBasedEndpointFactory.java:102)[cxf-rt-frontend-simple-2.7.4.jar:2.7.4]
    at org.apache.cxf.frontend.ClientFactoryBean.create(ClientFactoryBean.java:90)[cxf-rt-frontend-simple-2.7.4.jar:2.7.4]
    at org.apache.cxf.frontend.ClientProxyFactoryBean.create(ClientProxyFactoryBean.java:156)[cxf-rt-frontend-simple-2.7.4.jar:2.7.4]
    at org.apache.cxf.jaxws.JaxWsProxyFactoryBean.create(JaxWsProxyFactoryBean.java:156)[cxf-rt-frontend-jaxws-2.7.4.jar:2.7.4]

I used the version 2.2.5 but I've been taking a look to the newest version(2.2.7 and 2.2.7-b63) and there the message string is still the same. So I think this issue is still present

Affected Versions

[2.2.5, 2.2.7]

glassfishrobot commented 10 years ago

Reported by soilworker

glassfishrobot commented 10 years ago

soilworker said: I see now that it only appears with the german language(Messages_de.properties).

glassfishrobot commented 8 years ago

afavieres said: I have this bug with english language.

glassfishrobot commented 10 years ago

Was assigned to yaroska

glassfishrobot commented 7 years ago

This issue was imported from java.net JIRA JAXB-1017