private <T> void logAndThrowPolicyException(T dataClass) { org.apache.cxf.common.i18n.Message msg = new org.apache.cxf.common.i18n.Message("INCOMPATIBLE_HTTPCLIENTPOLICY_ASSERTIONS", LOG, dataClass.getClass()); LOG.severe(msg.toString()); throw new PolicyException(msg); }
public MyFilter() { try { //URL url = this.getClass().getClassLoader().getResource("antisamy-slashdot-1.4.4.xml"); LOG.info("After getResource"); //access you xml file here directly. File Wadafak = new File("antisamy-slashdot-1.4.4.xml"); LOG.info("After getFile "+Wadafak.getName()); Policy policy = Policy.getInstance(url.getFile()); antiSamy = new AntiSamy(policy); } catch (PolicyException e) { throw new IllegalStateException(e.getMessage(), e); } }
+ "this request was satisfied. However, this exception will not result in " + "a fault. The exception raised is: " + e.toString()); return;
} catch (WebServiceException wex) { PolicyException ex = (PolicyException)wex.getCause(); assertEquals("INCOMPATIBLE_HTTPCLIENTPOLICY_ASSERTIONS", ex.getCode());
+ "this request was satisfied. However, this exception will not result in " + "a fault. The exception raised is: " + e.toString()); return;
private <T> void logAndThrowPolicyException(T dataClass) { org.apache.cxf.common.i18n.Message msg = new org.apache.cxf.common.i18n.Message("INCOMPATIBLE_HTTPCLIENTPOLICY_ASSERTIONS", LOG, dataClass.getClass()); LOG.severe(msg.toString()); throw new PolicyException(msg); }
public MyFilter() { try { URL url = this.getClass().getClassLoader().getResource("/antisamy-slashdot-1.4.4.xml"); LOG.info("After getResource"); //access you xml file here directly. File Wadafak = new File(url.getFile()); LOG.info("After getFile "+Wadafak.getName()); Policy policy = Policy.getInstance(url.getFile()); antiSamy = new AntiSamy(policy); } catch (PolicyException e) { throw new IllegalStateException(e.getMessage(), e); } }
protected AssertionBuilder<?> handleNoRegisteredBuilder(QName qname) { if (ignoreUnknownAssertions) { boolean alreadyWarned = ignored.contains(qname); if (!alreadyWarned) { ignored.add(qname); Message m = new Message("NO_ASSERTIONBUILDER_EXC", BUNDLE, qname.toString()); LOG.warning(m.toString()); } return new XMLPrimitiveAssertionBuilder(); } Message m = new Message("NO_ASSERTIONBUILDER_EXC", BUNDLE, qname.toString()); throw new PolicyException(m); }
LOG.log(Level.SEVERE, "Inbound policy verification failed: " + ex.getMessage()); if (ex.getMessage().indexOf("Addressing") > -1) { throw new Fault("A required header representing a Message Addressing Property " + "is not present", LOG)
protected AssertionBuilder<?> handleNoRegisteredBuilder(QName qname) { if (ignoreUnknownAssertions) { boolean alreadyWarned = ignored.contains(qname); if (!alreadyWarned) { ignored.add(qname); Message m = new Message("NO_ASSERTIONBUILDER_EXC", BUNDLE, qname.toString()); LOG.warning(m.toString()); } return new XMLPrimitiveAssertionBuilder(); } Message m = new Message("NO_ASSERTIONBUILDER_EXC", BUNDLE, qname.toString()); throw new PolicyException(m); }
LOG.log(Level.SEVERE, "Inbound policy verification failed: " + ex.getMessage()); if (ex.getMessage().indexOf("Addressing") > -1) { throw new Fault("A required header representing a Message Addressing Property " + "is not present", LOG)
protected synchronized JAXBContext createJAXBContext() { if (context == null) { try { Class<?> clz = EndpointReferenceType.class; String pkg = PackageUtils.getPackageName(clz); context = JAXBContext.newInstance(pkg, clz.getClassLoader()); } catch (JAXBException ex) { throw new PolicyException(new Message("EPR_DOMAIN_EXPRESSION_BUILDER_INIT_EXC", BUNDLE, (Object[])null), ex); } } return context; } }
protected synchronized JAXBContext createJAXBContext() { if (context == null) { try { Class<?> clz = EndpointReferenceType.class; String pkg = PackageUtils.getPackageName(clz); context = JAXBContext.newInstance(pkg, clz.getClassLoader()); } catch (JAXBException ex) { throw new PolicyException(new Message("EPR_DOMAIN_EXPRESSION_BUILDER_INIT_EXC", BUNDLE, (Object[])null), ex); } } return context; } }
public DomainExpression build(Element element) { loadDynamic(); DomainExpressionBuilder builder; QName qname = new QName(element.getNamespaceURI(), element.getLocalName()); builder = get(qname); if (null == builder) { throw new PolicyException(new Message("NO_DOMAINEXPRESSIONBUILDER_EXC", BUNDLE, qname.toString())); } return builder.build(element); } }
public DomainExpression build(Element element) { loadDynamic(); DomainExpressionBuilder builder; QName qname = new QName(element.getNamespaceURI(), element.getLocalName()); builder = get(qname); if (null == builder) { throw new PolicyException(new Message("NO_DOMAINEXPRESSIONBUILDER_EXC", BUNDLE, qname.toString())); } return builder.build(element); } }
protected void checkResolved(PolicyReference ref, Policy p) { if (null == p) { throw new PolicyException(new Message("UNRESOLVED_POLICY_REFERENCE_EXC", BUNDLE, ref.getURI())); } } }
protected void checkResolved(PolicyReference ref, Policy p) { if (null == p) { throw new PolicyException(new Message("UNRESOLVED_POLICY_REFERENCE_EXC", BUNDLE, ref.getURI())); } } }
throw new PolicyException(new Message("NO_ALTERNATIVE_EXC", BUNDLE, error.toString()));
throw new PolicyException(new Message("NO_ALTERNATIVE_EXC", BUNDLE, error.toString()));
doc = StaxUtils.read(is.getByteStream()); } catch (Exception ex) { throw new PolicyException(ex); } finally { resolver.close();