List of usage examples for javax.xml.stream FactoryConfigurationError printStackTrace
public void printStackTrace()
From source file:org.elissa.web.server.TransformerServlet.java
private void revisitSequenceFlows(Definitions def, String orig) { try {/*from w ww . j a v a 2 s .c om*/ Map<String, Map<String, String>> sequenceFlowMapping = new HashMap<String, Map<String, String>>(); XMLInputFactory factory = XMLInputFactory.newInstance(); XMLStreamReader reader = factory.createXMLStreamReader(new StringReader(orig)); while (reader.hasNext()) { if (reader.next() == XMLStreamReader.START_ELEMENT) { if ("sequenceFlow".equals(reader.getLocalName())) { String id = ""; String source = ""; String target = ""; for (int i = 0; i < reader.getAttributeCount(); i++) { if ("id".equals(reader.getAttributeLocalName(i))) { id = reader.getAttributeValue(i); } if ("sourceRef".equals(reader.getAttributeLocalName(i))) { source = reader.getAttributeValue(i); } if ("targetRef".equals(reader.getAttributeLocalName(i))) { target = reader.getAttributeValue(i); } } Map<String, String> valueMap = new HashMap<String, String>(); valueMap.put("sourceRef", source); valueMap.put("targetRef", target); sequenceFlowMapping.put(id, valueMap); } } } List<RootElement> rootElements = def.getRootElements(); for (RootElement root : rootElements) { if (root instanceof Process) { Process process = (Process) root; List<FlowElement> flowElements = process.getFlowElements(); for (FlowElement fe : flowElements) { if (fe instanceof SequenceFlow) { SequenceFlow sf = (SequenceFlow) fe; if (sequenceFlowMapping.containsKey(sf.getId())) { sf.setSourceRef( getFlowNode(def, sequenceFlowMapping.get(sf.getId()).get("sourceRef"))); sf.setTargetRef( getFlowNode(def, sequenceFlowMapping.get(sf.getId()).get("targetRef"))); } else { _logger.error("Could not find mapping for sequenceFlow: " + sf.getId()); } } } } } } catch (FactoryConfigurationError e) { _logger.error(e.getMessage()); e.printStackTrace(); } catch (Exception e) { _logger.error(e.getMessage()); e.printStackTrace(); } }
From source file:org.socraticgrid.workbench.security.wso2.SamlConsumer.java
public String buildRequestMessage(String pIssuerUrl, String pUrl) { // AuthnRequest message creation AuthnRequest authnRequest;/* w ww . j av a2 s. c om*/ String encodedRequestMessage = null; issuerUrl = pIssuerUrl; consumerUrl = pUrl; try { DefaultBootstrap.bootstrap(); } catch (ConfigurationException e) { e.printStackTrace(); } catch (FactoryConfigurationError exc) { exc.printStackTrace(); } authnRequest = this.buildAuthnRequestObject(); // Encoding the object try { encodedRequestMessage = encodeAuthnRequest(authnRequest); } catch (MarshallingException e) { e.printStackTrace(); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } // The complete URL compUrl = redirectionUrl + "?SAMLRequest=" + encodedRequestMessage + "&RelayState=" + relayState; return compUrl; }