Fix problem with parsing blueprint things that sometime result in JAXBElements instead of the actual type
Project: http://git-wip-us.apache.org/repos/asf/cxf/repo Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/71c95fa5 Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/71c95fa5 Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/71c95fa5 Branch: refs/heads/2.7.x-fixes Commit: 71c95fa5f3e2e2eae1d30568c9777729f6e52f05 Parents: 7f123f1 Author: Daniel Kulp <[email protected]> Authored: Tue Apr 8 14:48:08 2014 -0600 Committer: Daniel Kulp <[email protected]> Committed: Tue Apr 8 14:49:34 2014 -0600 ---------------------------------------------------------------------- .../blueprint/AbstractBPBeanDefinitionParser.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cxf/blob/71c95fa5/rt/core/src/main/java/org/apache/cxf/configuration/blueprint/AbstractBPBeanDefinitionParser.java ---------------------------------------------------------------------- diff --git a/rt/core/src/main/java/org/apache/cxf/configuration/blueprint/AbstractBPBeanDefinitionParser.java b/rt/core/src/main/java/org/apache/cxf/configuration/blueprint/AbstractBPBeanDefinitionParser.java index d2b57de..6be1e3c 100644 --- a/rt/core/src/main/java/org/apache/cxf/configuration/blueprint/AbstractBPBeanDefinitionParser.java +++ b/rt/core/src/main/java/org/apache/cxf/configuration/blueprint/AbstractBPBeanDefinitionParser.java @@ -337,7 +337,12 @@ public abstract class AbstractBPBeanDefinitionParser { public Object createJAXBBean(String v) { XMLStreamReader reader = StaxUtils.createXMLStreamReader(new StringReader(v)); try { - return ctx.createUnmarshaller().unmarshal(reader, cls); + Object o = ctx.createUnmarshaller().unmarshal(reader, cls); + if (o instanceof JAXBElement<?>) { + JAXBElement<?> el = (JAXBElement<?>)o; + o = el.getValue(); + } + return o; } catch (JAXBException e) { throw new RuntimeException(e); } finally {
