From 83a9b613836910f7edc370c2fe60fa2268dc4461 Mon Sep 17 00:00:00 2001 From: clemenso Date: Mon, 1 Mar 2010 17:47:58 +0000 Subject: add redirect for CreateXMLSignatureResponse (top level) type git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@643 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4 --- .../java/at/gv/egiz/bku/slcommands/SLCommandFactory.java | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'bkucommon/src') diff --git a/bkucommon/src/main/java/at/gv/egiz/bku/slcommands/SLCommandFactory.java b/bkucommon/src/main/java/at/gv/egiz/bku/slcommands/SLCommandFactory.java index 8e3f6ece..ab2f08cc 100644 --- a/bkucommon/src/main/java/at/gv/egiz/bku/slcommands/SLCommandFactory.java +++ b/bkucommon/src/main/java/at/gv/egiz/bku/slcommands/SLCommandFactory.java @@ -169,13 +169,19 @@ public class SLCommandFactory { private synchronized void ensureJaxbContext() { if (jaxbContext == null) { try { + // add top-level types explicitly to jaxb context, otherwise the unmarshaller won't find them. + // cf. http://forums.java.net/jive/thread.jspa?threadID=75778&tstart=0 + String slImplPkg = at.gv.egiz.slbinding.impl.CreateXMLSignatureResponseType.class.getPackage().getName(); + String slPkg = at.buergerkarte.namespaces.securitylayer._1.ObjectFactory.class.getPackage().getName(); String xmldsigPkg = org.w3._2000._09.xmldsig_.ObjectFactory.class.getPackage().getName(); String cardChannelPkg = at.buergerkarte.namespaces.cardchannel.ObjectFactory.class.getPackage().getName(); String slPkgLegacy1_0 = at.buergerkarte.namespaces.securitylayer._20020225_.ObjectFactory.class.getPackage().getName(); String slPkgLegacy1_1 = at.buergerkarte.namespaces.securitylayer._20020831_.ObjectFactory.class.getPackage().getName(); - setJaxbContext(JAXBContext.newInstance(slPkg + ":" + xmldsigPkg + ":" + cardChannelPkg - + ":" + slPkgLegacy1_0 + ":" + slPkgLegacy1_1)); + String contextPath = slImplPkg + ":" + slPkg + ":" + xmldsigPkg + ":" + cardChannelPkg + + ":" + slPkgLegacy1_0 + ":" + slPkgLegacy1_1; + log.debug("jaxb context path: " + contextPath); + setJaxbContext(JAXBContext.newInstance(contextPath)); } catch (JAXBException e) { log.error("Failed to setup JAXBContext security layer request.", e); throw new SLRuntimeException(e); @@ -378,7 +384,7 @@ public class SLCommandFactory { SLCommand slCommand; try { slCommand = implClass.newInstance(); - log.debug("SLCommand " + slCommand.getName() + " created."); + log.debug("SLCommand " + slCommand.getClass().toString() + " created."); } catch (InstantiationException e) { // unexpected error log.error("Failed to instantiate security layer command implementation.", -- cgit v1.2.3