среда, 30 июля 2014 г.

четверг, 13 февраля 2014 г.

Java applications are blocked by your security settings.

Trying to run the Java applications with Java version 7 Update 51, generates messages that says "Java applications are blocked by your security settings."



https://www.java.com/en/download/help/java_blocked.xml

Workaround:

Java Control Panel
Security tab
Edit Site
Add http://ea-dev.bashneft.ru:9080

IBM FileNet P8 ports, IBM WebSphere Ports

IBM FileNet:
http://www-01.ibm.com/support/knowledgecenter/SSNW2F_5.1.0/com.ibm.p8.planprepare.doc/p8pap044.htm


IBM WebSphere 7.0, 8.0

Table 1. Port definitions for WebSphere Application Server Version 7.0 and Version 8.0 .
The table lists port names and the default values of the port numbers.
Port Name Default Value Files
Application Server Administrative Agent Job Manager Secure Proxy Server Administrative Subsystem
Administrative Console Port (WC_adminhost) 9060 9060 9960 ---- ---- serverindex.xml and virtualhosts.xml
Administrative Console Secure Port (WC_adminhost_secure) 9043 9043 9943 ---- ----
HTTP Transport Port (WC_defaulthost) 9080 ---- ---- 80 ----
HTTPS Transport Secure Port (WC_defaulthost_secure) 9443 ---- ---- 443 ----
Bootstrap Port (BOOTSTRAP_ADDRESS) 2809 9807 9808 ---- ---- serverindex.xml
Cell Discovery Address (CELL_DISCOVERY_ADDRESS) ---- ---- ---- ---- ----
CSIV2 Client Authentication Listener Port (CSIV2_SSL_MUTUALAUTH_LISTENER_ADDRESS) 9402 9402 9402 ---- ----
CSIV2 Server Authentication Listener Port (CSIV2_SSL_SERVERAUTH_LISTENER_ADDRESS) 9403 9403 9403 ---- ----
High Availability Manager Communication Port (DCS_UNICAST_ADDRESS) 9353 ---- ---- ---- ----
Internal JMS Server Port (JMSSERVER_SECURITY_PORT) 5557 ---- ---- ---- ----
IPC Connector Port (IPC_CONNECTOR_ADDRESS) 9633 9630 9631 9633 9634
MQ Transport Port (SIB_MQ_ENDPOINT_ ADDRESS) 5558 ---- ---- ---- ----
MQ Transport Secure Port (SIB_MQ_ENDPOINT_SECURE_ADDRESS) 5578 ---- ---- ---- ----
ORB Listener Port (ORB_LISTENER_ADDRESS) 9100 9098 9099 ---- ---- serverindex.xml
RMI Connector Port (RMI_CONNECTOR_ADDRESS) ---- ---- ---- ---- 9810
JSR 160 RMI Connector Port (JSR160RMI_CONNECTOR_ADDRESS) ---- ---- ---- ---- 9811
SAS_SSL_SERVERAUTH_LISTENER_ADDRESS 9401 9401 9401 ---- ----
Service Integration Port (SIB_ENDPOINT_ADDRESS) 7276 ---- ---- ---- ----
Service Integration Secure Port (SIB_ENDPOINT_SECURE_ADDRESS) 7286 ---- ---- ---- ----
SIP Container Port (SIP_DEFAULTHOST) 5060 ---- ---- 5060 ----
SIP Container Secure Port (SIP_DEFAULTHOST_SECURE) 5061 ---- ---- 5061 ----
SOAP Connector Port (SOAP_CONNECTOR_ADDRESS) 8880 8877 8876 ---- 8881
IBM® HTTP Server Port 80 ---- ---- ---- ---- virtualhosts.xml, plugin-cfg.xml, and web_ server_ root/conf/ httpd.conf
IBM HTTPS Server Administration Port 8008 ---- ---- ---- ---- web_ server_ root/conf/ admin.conf
http://www-01.ibm.com/support/knowledgecenter/SSEQTP_8.0.0/com.ibm.websphere.migration.base.iseries.doc/info/iseries/ae/rmig_portnumber.html

четверг, 14 ноября 2013 г.

пятница, 18 октября 2013 г.

CDATA wraper feature

Казалось бы просто веб-сервис: на входе и выходе строка:
    public String processByJavaAdapter(String data, FreeMarkerVars[] reportContext, String className) throws Exception
    {
     ..
    }
Если строка XML, то возвращается обертка в CDATA:
<ns2:processByJavaAdapterResponse xmlns:ns2="http://wsi.reg.sitronics.com/">
      </ns2:processByJavaAdapterResponse>
         <return><![CDATA[<?xml version="1.0" encoding="UTF-8"?>
         <error>
   <faultcode>Нет связи с сервером</faultcode>
   <fault></fault>
   </error>]]></return>


А вот не всегда.
Иногда ответ приходит таким:

<ns2:processByJavaAdapterResponse xmlns:ns2="http://wsi.reg.sitronics.com/">
         <return>&lt;?xml version="1.0" encoding="UTF-8"?>
  &lt;faultcode>Нет связи с сервером&lt;/faultcode></return>
      </ns2:processByJavaAdapterResponse>


И это не баг, а фича :-)
Иногда веб-сервису кажется что такой способ обертки XML более лучший.

четверг, 3 октября 2013 г.

Поменять значение в XML

Требуется поменять значение, спрятанное глубоко в XML.

<smev:RequestIdRef>{219F416E-4DB7-43DA-AFED-2EFFDD67C32A}</smev:RequestIdRef>



import org.apache.xpath.XPathAPI;

...



String respBody = "....";// XML
Element root = getXmlRoot(respBody);
Node requestIdRefNode = getXPath(root, "//*[local-name() = 'RequestIdRef']");
requestIdRefNode.setTextContent("New value");

public static final Element getXmlRoot(String xmlData) throws Exception
{
        // logger.info("Trying get root from: " + xmlData);
        DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
        factory.setNamespaceAware(true);
        DocumentBuilder builder = factory.newDocumentBuilder();
        return builder.parse(new InputSource(new StringReader(xmlData))).getDocumentElement();
}

public static final Node getXPath(Element xmlData, String path) throws Exception

{
       Node nodes = null;    
       nodes = XPathAPI.selectSingleNode(xmlData,
                                 String.format("%s", path));
       return nodes;
 } 
Альтернативный способ, без использование XPathAPI:
    public static Document getXMLDocument(String xmlSource) throws Exception
    {
        DocumentBuilderFactory domFactory = DocumentBuilderFactory.newInstance();
        DocumentBuilder builder = domFactory.newDocumentBuilder();
        return builder.parse(new InputSource(new StringReader(xmlSource)));
    }
 
    public static Node getXMLTagContent(Document document, String nodeExpression) throws XPathExpressionException
    {
        Node node = null;
        XPathFactory factory = XPathFactory.newInstance();
        XPath xpath = factory.newXPath();
        XPathExpression expression = xpath.compile(nodeExpression);
        if (document != null)
            node = (Node) expression.evaluate(document, XPathConstants.NODE);
        return node;
    }