问:
Getting Error " while building message, Unexpected close tag ; expected
 "in esb after building xml payload to pass in dss endpoint wso2
I am getting below error in esb after building xml payload to pass in dss endpoint wso2.

```<code>ERROR {org.apache.synapse.mediators.base.SequenceMediator} -  Error while building message {org.apache.synapse.mediators.base.SequenceMediator}
org.apache.axiom.om.OMException: com.ctc.wstx.exc.WstxParsingException: Unexpected close tag </body>; expected </HR>.
 at [row,col {unknown-source}]: [37,187]
    at org.apache.axiom.om.impl.builder.StAXOMBuilder.next(StAXOMBuilder.java:296)
    at org.apache.axiom.om.impl.llom.OMSerializableImpl.build(OMSerializableImpl.java:78)
    at org.apache.axiom.om.impl.llom.OMElementImpl.build(OMElementImpl.java:722)
    at org.apache.axiom.om.impl.llom.OMElementImpl.detach(OMElementImpl.java:700)
    at org.apache.axiom.om.impl.llom.OMNodeImpl.setParent(OMNodeImpl.java:105)
    at org.apache.axiom.om.impl.llom.OMElementImpl.addChild(OMElementImpl.java:296)
    at org.apache.axiom.om.impl.llom.OMElementImpl.addChild(OMElementImpl.java:212)
    at org.apache.axiom.soap.impl.llom.SOAPBodyImpl.addChild(SOAPBodyImpl.java:231)
    at org.apache.axis2.transport.TransportUtils.createSOAPEnvelope(TransportUtils.java:161)
    at org.apache.synapse.transport.passthru.util.RelayUtils.builldMessage(RelayUtils.java:146)
    at org.apache.synapse.transport.passthru.util.RelayUtils.buildMessage(RelayUtils.java:100)
    at org.apache.synapse.mediators.AbstractListMediator.buildMessage(AbstractListMediator.java:140)
    at org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractListMediator.java:83)
    at org.apache.synapse.mediators.eip.splitter.IterateMediator.mediate(IterateMediator.java:256)
    at org.apache.synapse.mediators.base.SequenceMediator.mediate(SequenceMediator.java:267)
    at org.apache.synapse.core.axis2.Axis2SynapseEnvironment.mediateFromContinuationStateStack(Axis2SynapseEnvironment.java:766)
    at org.apache.synapse.core.axis2.Axis2SynapseEnvironment.injectMessage(Axis2SynapseEnvironment.java:282)
    at org.apache.synapse.core.axis2.SynapseCallbackReceiver.handleMessage(SynapseCallbackReceiver.java:554)
    at org.apache.synapse.core.axis2.SynapseCallbackReceiver.receive(SynapseCallbackReceiver.java:188)
    at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:180)
    at org.apache.synapse.transport.passthru.ClientWorker.run(ClientWorker.java:261)
    at org.apache.axis2.transport.base.threads.NativeWorkerPool$1.run(NativeWorkerPool.java:172)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:748)
</code>```

My XML payload is

```<code>TID: [-1234] [] [2017-07-04 10:29:08,141]  INFO {org.apache.synapse.mediators.builtin.LogMediator} -  To: http://www.w3.org/2005/08/addressing/anonymous, WSAction: , SOAPAction: , MessageID: urn:uuid:4784a7be-95f8-4752-bdd2-e29fe8aedcaf, Direction: request, Envelope: <?xml version='1.0' encoding='utf-8'?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"><soapenv:Body><p:_getjacdevice_batch_req xmlns:p="http://ws.wso2.org/dataservice">
  <_getjacdevice xmlns="http://ws.wso2.org/dataservice">
    <xs:JACDeviceId xmlns:xs="http://ws.wso2.org/dataservice">215766</xs:JACDeviceId>
    <xs:Make xmlns:xs="http://ws.wso2.org/dataservice">HP</xs:Make>
    <xs:Model xmlns:xs="http://ws.wso2.org/dataservice">HP COLOR LASERJET CP4520 SERIES</xs:Model>
    <xs:SerialNumber xmlns:xs="http://ws.wso2.org/dataservice">JPDXG57J7Y</xs:SerialNumber>
    <xs:IPv4 xmlns:xs="http://ws.wso2.org/dataservice">xx</xs:IPv4>
    <xs:MAC xmlns:xs="http://ws.wso2.org/dataservice">C4346B197FBC</xs:MAC>
    <xs:Hostname xmlns:xs="http://ws.wso2.org/dataservice">xxx</xs:Hostname>
    <xs:FirstScanDate xmlns:xs="http://ws.wso2.org/dataservice">2017-07-04T04:16:16Z</xs:FirstScanDate>
    <xs:LastScanDate xmlns:xs="http://ws.wso2.org/dataservice">2017-07-04T04:16:16Z</xs:LastScanDate>
    <xs:Managed xmlns:xs="http://ws.wso2.org/dataservice">1</xs:Managed>
    <xs:LastAttemptedContactTime xmlns:xs="http://ws.wso2.org/dataservice">2017-07-04T04:16:16Z</xs:LastAttemptedContactTime>
    <xs:CredentialProfileStatus xmlns:xs="http://ws.wso2.org/dataservice">HP COLOR LASERJET CP4520 SERIES</xs:CredentialProfileStatus>
    <xs:JACCredentialProfileId xmlns:xs="http://ws.wso2.org/dataservice">11</xs:JACCredentialProfileId>
    <xs:FirmwareVersion xmlns:xs="http://ws.wso2.org/dataservice">HP COLOR LASERJET CP4520 SERIES</xs:FirmwareVersion>
    <xs:FirmwareDateCode xmlns:xs="http://ws.wso2.org/dataservice">HP COLOR LASERJET CP4520 SERIES</xs:FirmwareDateCode>
    <xs:JACAccountID xmlns:xs="http://ws.wso2.org/dataservice">3113</xs:JACAccountID>
  </_getjacdevice>
<_getjacdevice xmlns="http://ws.wso2.org/dataservice">
    <xs:JACDeviceId xmlns:xs="http://ws.wso2.org/dataservice">224986</xs:JACDeviceId>
    <xs:Make xmlns:xs="http://ws.wso2.org/dataservice">HP</xs:Make>
    <xs:Model xmlns:xs="http://ws.wso2.org/dataservice">HP PAGEWIDE PRO MFP 777HC</xs:Model>
    <xs:SerialNumber xmlns:xs="http://ws.wso2.org/dataservice">MY73H5E00H</xs:SerialNumber>
    <xs:IPv4 xmlns:xs="http://ws.wso2.org/dataservice">xxx</xs:IPv4>
    <xs:MAC xmlns:xs="http://ws.wso2.org/dataservice">30E171F53085</xs:MAC>
    <xs:Hostname xmlns:xs="http://ws.wso2.org/dataservice">xx</xs:Hostname>
    <xs:FirstScanDate xmlns:xs="http://ws.wso2.org/dataservice">2017-07-04T03:32:30Z</xs:FirstScanDate>
    <xs:LastScanDate xmlns:xs="http://ws.wso2.org/dataservice">2017-07-04T03:32:30Z</xs:LastScanDate>
    <xs:Managed xmlns:xs="http://ws.wso2.org/dataservice">1</xs:Managed>
    <xs:LastAttemptedContactTime xmlns:xs="http://ws.wso2.org/dataservice">2017-07-04T03:32:30Z</xs:LastAttemptedContactTime>
    <xs:CredentialProfileStatus xmlns:xs="http://ws.wso2.org/dataservice">HP PAGEWIDE PRO MFP 777HC</xs:CredentialProfileStatus>
    <xs:JACCredentialProfileId xmlns:xs="http://ws.wso2.org/dataservice">11</xs:JACCredentialProfileId>
    <xs:FirmwareVersion xmlns:xs="http://ws.wso2.org/dataservice">HP PAGEWIDE PRO MFP 777HC</xs:FirmwareVersion>
    <xs:FirmwareDateCode xmlns:xs="http://ws.wso2.org/dataservice">HP PAGEWIDE PRO MFP 777HC</xs:FirmwareDateCode>
    <xs:JACAccountID xmlns:xs="http://ws.wso2.org/dataservice">3113</xs:JACAccountID>
  </_getjacdevice>
</p:_getjacdevice_batch_req></soapenv:Body></soapenv:Envelope> {org.apache.synapse.mediators.builtin.LogMediator}
</code>```

My DSS endpoint is expecting request as below

```<code><body>
   <p:_getjacdevice_batch_req xmlns:p="http://ws.wso2.org/dataservice">
      <!--1 or more occurrences-->
      <_getjacdevice xmlns="http://ws.wso2.org/dataservice">
         <!--Exactly 1 occurrence-->
         <xs:JACDeviceId xmlns:xs="http://ws.wso2.org/dataservice">1</xs:JACDeviceId>
         <!--Exactly 1 occurrence-->
         <xs:Make xmlns:xs="http://ws.wso2.org/dataservice">HP</xs:Make>
         <!--Exactly 1 occurrence-->
         <xs:Model xmlns:xs="http://ws.wso2.org/dataservice">HP CM8060 Color MFP</xs:Model>
         <!--Exactly 1 occurrence-->
         <xs:SerialNumber xmlns:xs="http://ws.wso2.org/dataservice">SerialNumberZ</xs:SerialNumber>
         <!--Exactly 1 occurrence-->
         <xs:IPv4 xmlns:xs="http://ws.wso2.org/dataservice">IPV4z</xs:IPv4>
         <!--Exactly 1 occurrence-->
         <xs:MAC xmlns:xs="http://ws.wso2.org/dataservice">MACZZ</xs:MAC>
         <!--Exactly 1 occurrence-->
         <xs:Hostname xmlns:xs="http://ws.wso2.org/dataservice">HOST NAMEZ</xs:Hostname>
         <!--Exactly 1 occurrence-->
         <xs:FirstScanDate xmlns:xs="http://ws.wso2.org/dataservice">2017-06-06 10:33:42.773</xs:FirstScanDate>
         <!--Exactly 1 occurrence-->
         <xs:LastScanDate xmlns:xs="http://ws.wso2.org/dataservice">2017-06-06 10:33:42.773</xs:LastScanDate>
         <!--Exactly 1 occurrence-->
         <xs:Managed xmlns:xs="http://ws.wso2.org/dataservice">1</xs:Managed>
         <!--Exactly 1 occurrence-->
         <xs:LastAttemptedContactTime xmlns:xs="http://ws.wso2.org/dataservice">2017-06-06 10:33:42.773</xs:LastAttemptedContactTime>
         <!--Exactly 1 occurrence-->
         <xs:CredentialProfileStatus xmlns:xs="http://ws.wso2.org/dataservice">aa</xs:CredentialProfileStatus>
         <!--Exactly 1 occurrence-->
         <xs:JACCredentialProfileId xmlns:xs="http://ws.wso2.org/dataservice">1</xs:JACCredentialProfileId>
         <!--Exactly 1 occurrence-->
         <xs:FirmwareVersion xmlns:xs="http://ws.wso2.org/dataservice">bb</xs:FirmwareVersion>
         <!--Exactly 1 occurrence-->
         <xs:FirmwareDateCode xmlns:xs="http://ws.wso2.org/dataservice">cc</xs:FirmwareDateCode>
         <!--Exactly 1 occurrence-->
         <xs:JACAccountID xmlns:xs="http://ws.wso2.org/dataservice">3113</xs:JACAccountID>
      </_getjacdevice>
      <_getjacdevice xmlns="http://ws.wso2.org/dataservice">
         <xs:JACDeviceId xmlns:xs="http://ws.wso2.org/dataservice">9</xs:JACDeviceId>
         <!--Exactly 1 occurrence-->
         <xs:Make xmlns:xs="http://ws.wso2.org/dataservice">HPjj</xs:Make>
         <!--Exactly 1 occurrence-->
         <xs:Model xmlns:xs="http://ws.wso2.org/dataservice">HP CM8060 Color MFP20000</xs:Model>
         <!--Exactly 1 occurrence-->
         <xs:SerialNumber xmlns:xs="http://ws.wso2.org/dataservice">SerialNumberkkZ</xs:SerialNumber>
         <!--Exactly 1 occurrence-->
         <xs:IPv4 xmlns:xs="http://ws.wso2.org/dataservice">IPV4zjj</xs:IPv4>
         <!--Exactly 1 occurrence-->
         <xs:MAC xmlns:xs="http://ws.wso2.org/dataservice">MACZZjj</xs:MAC>
         <!--Exactly 1 occurrence-->
         <xs:Hostname xmlns:xs="http://ws.wso2.org/dataservice">HOST NAMEjjZ</xs:Hostname>
         <!--Exactly 1 occurrence-->
         <xs:FirstScanDate xmlns:xs="http://ws.wso2.org/dataservice">2017-06-06 10:33:42.773</xs:FirstScanDate>
         <!--Exactly 1 occurrence-->
         <xs:LastScanDate xmlns:xs="http://ws.wso2.org/dataservice">2017-06-06 10:33:42.773</xs:LastScanDate>
         <!--Exactly 1 occurrence-->
         <xs:Managed xmlns:xs="http://ws.wso2.org/dataservice">1</xs:Managed>
         <!--Exactly 1 occurrence-->
         <xs:LastAttemptedContactTime xmlns:xs="http://ws.wso2.org/dataservice">2017-06-06 10:33:42.773</xs:LastAttemptedContactTime>
         <!--Exactly 1 occurrence-->
         <xs:CredentialProfileStatus xmlns:xs="http://ws.wso2.org/dataservice">aa</xs:CredentialProfileStatus>
         <!--Exactly 1 occurrence-->
         <xs:JACCredentialProfileId xmlns:xs="http://ws.wso2.org/dataservice">1</xs:JACCredentialProfileId>
         <!--Exactly 1 occurrence-->
         <xs:FirmwareVersion xmlns:xs="http://ws.wso2.org/dataservice">bb</xs:FirmwareVersion>
         <!--Exactly 1 occurrence-->
         <xs:FirmwareDateCode xmlns:xs="http://ws.wso2.org/dataservice">cc</xs:FirmwareDateCode>
         <!--Exactly 1 occurrence-->
         <xs:JACAccountID xmlns:xs="http://ws.wso2.org/dataservice">3113</xs:JACAccountID>
      </_getjacdevice>
   </p:_getjacdevice_batch_req>
</body>
</code>```

答:
I got it working by adding below line before calling my endpoint.</p>

```<code><property name="messageType" scope="axis2" type="STRING" value="application/xml"/>
</code>```

Title: Getting Error " while building message, Unexpected close tag </body>; expected </HR> "in esb after building xml payload to pass in dss endpoint wso2

Body:
I am getting below error in esb after building xml payload to pass in dss endpoint wso2.

ERROR {org.apache.synapse.mediators.base.SequenceMediator} -  Error while building message {org.apache.synapse.mediators.base.SequenceMediator}
org.apache.axiom.om.OMException: com.ctc.wstx.exc.WstxParsingException: Unexpected close tag ; expected
.
 at [row,col {unknown-source}]: [37,187]
    at org.apache.axiom.om.impl.builder.StAXOMBuilder.next(StAXOMBuilder.java:296)
    at org.apache.axiom.om.impl.llom.OMSerializableImpl.build(OMSerializableImpl.java:78)
    at org.apache.axiom.om.impl.llom.OMElementImpl.build(OMElementImpl.java:722)
    at org.apache.axiom.om.impl.llom.OMElementImpl.detach(OMElementImpl.java:700)
    at org.apache.axiom.om.impl.llom.OMNodeImpl.setParent(OMNodeImpl.java:105)
    at org.apache.axiom.om.impl.llom.OMElementImpl.addChild(OMElementImpl.java:296)
    at org.apache.axiom.om.impl.llom.OMElementImpl.addChild(OMElementImpl.java:212)
    at org.apache.axiom.soap.impl.llom.SOAPBodyImpl.addChild(SOAPBodyImpl.java:231)
    at org.apache.axis2.transport.TransportUtils.createSOAPEnvelope(TransportUtils.java:161)
    at org.apache.synapse.transport.passthru.util.RelayUtils.builldMessage(RelayUtils.java:146)
    at org.apache.synapse.transport.passthru.util.RelayUtils.buildMessage(RelayUtils.java:100)
    at org.apache.synapse.mediators.AbstractListMediator.buildMessage(AbstractListMediator.java:140)
    at org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractListMediator.java:83)
    at org.apache.synapse.mediators.eip.splitter.IterateMediator.mediate(IterateMediator.java:256)
    at org.apache.synapse.mediators.base.SequenceMediator.mediate(SequenceMediator.java:267)
    at org.apache.synapse.core.axis2.Axis2SynapseEnvironment.mediateFromContinuationStateStack(Axis2SynapseEnvironment.java:766)
    at org.apache.synapse.core.axis2.Axis2SynapseEnvironment.injectMessage(Axis2SynapseEnvironment.java:282)
    at org.apache.synapse.core.axis2.SynapseCallbackReceiver.handleMessage(SynapseCallbackReceiver.java:554)
    at org.apache.synapse.core.axis2.SynapseCallbackReceiver.receive(SynapseCallbackReceiver.java:188)
    at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:180)
    at org.apache.synapse.transport.passthru.ClientWorker.run(ClientWorker.java:261)
    at org.apache.axis2.transport.base.threads.NativeWorkerPool$1.run(NativeWorkerPool.java:172)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:748)

My XML payload is

TID: [-1234] [] [2017-07-04 10:29:08,141]  INFO {org.apache.synapse.mediators.builtin.LogMediator} -  To: http://www.w3.org/2005/08/addressing/anonymous, WSAction: , SOAPAction: , MessageID: urn:uuid:4784a7be-95f8-4752-bdd2-e29fe8aedcaf, Direction: request, Envelope: <?xml version='1.0' encoding='utf-8'?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"><soapenv:Body>

  <_getjacdevice xmlns="http://ws.wso2.org/dataservice">
    <xs:JACDeviceId xmlns:xs="http://ws.wso2.org/dataservice">215766</xs:JACDeviceId>
    <xs:Make xmlns:xs="http://ws.wso2.org/dataservice">HP</xs:Make>
    <xs:Model xmlns:xs="http://ws.wso2.org/dataservice">HP COLOR LASERJET CP4520 SERIES</xs:Model>
    <xs:SerialNumber xmlns:xs="http://ws.wso2.org/dataservice">JPDXG57J7Y</xs:SerialNumber>
    <xs:IPv4 xmlns:xs="http://ws.wso2.org/dataservice">xx</xs:IPv4>
    <xs:MAC xmlns:xs="http://ws.wso2.org/dataservice">C4346B197FBC</xs:MAC>
    <xs:Hostname xmlns:xs="http://ws.wso2.org/dataservice">xxx</xs:Hostname>
    <xs:FirstScanDate xmlns:xs="http://ws.wso2.org/dataservice">2017-07-04T04:16:16Z</xs:FirstScanDate>
    <xs:LastScanDate xmlns:xs="http://ws.wso2.org/dataservice">2017-07-04T04:16:16Z</xs:LastScanDate>
    <xs:Managed xmlns:xs="http://ws.wso2.org/dataservice">1</xs:Managed>
    <xs:LastAttemptedContactTime xmlns:xs="http://ws.wso2.org/dataservice">2017-07-04T04:16:16Z</xs:LastAttemptedContactTime>
    <xs:CredentialProfileStatus xmlns:xs="http://ws.wso2.org/dataservice">HP COLOR LASERJET CP4520 SERIES</xs:CredentialProfileStatus>
    <xs:JACCredentialProfileId xmlns:xs="http://ws.wso2.org/dataservice">11</xs:JACCredentialProfileId>
    <xs:FirmwareVersion xmlns:xs="http://ws.wso2.org/dataservice">HP COLOR LASERJET CP4520 SERIES</xs:FirmwareVersion>
    <xs:FirmwareDateCode xmlns:xs="http://ws.wso2.org/dataservice">HP COLOR LASERJET CP4520 SERIES</xs:FirmwareDateCode>
    <xs:JACAccountID xmlns:xs="http://ws.wso2.org/dataservice">3113</xs:JACAccountID>
  </_getjacdevice>
<_getjacdevice xmlns="http://ws.wso2.org/dataservice">
    <xs:JACDeviceId xmlns:xs="http://ws.wso2.org/dataservice">224986</xs:JACDeviceId>
    <xs:Make xmlns:xs="http://ws.wso2.org/dataservice">HP</xs:Make>
    <xs:Model xmlns:xs="http://ws.wso2.org/dataservice">HP PAGEWIDE PRO MFP 777HC</xs:Model>
    <xs:SerialNumber xmlns:xs="http://ws.wso2.org/dataservice">MY73H5E00H</xs:SerialNumber>
    <xs:IPv4 xmlns:xs="http://ws.wso2.org/dataservice">xxx</xs:IPv4>
    <xs:MAC xmlns:xs="http://ws.wso2.org/dataservice">30E171F53085</xs:MAC>
    <xs:Hostname xmlns:xs="http://ws.wso2.org/dataservice">xx</xs:Hostname>
    <xs:FirstScanDate xmlns:xs="http://ws.wso2.org/dataservice">2017-07-04T03:32:30Z</xs:FirstScanDate>
    <xs:LastScanDate xmlns:xs="http://ws.wso2.org/dataservice">2017-07-04T03:32:30Z</xs:LastScanDate>
    <xs:Managed xmlns:xs="http://ws.wso2.org/dataservice">1</xs:Managed>
    <xs:LastAttemptedContactTime xmlns:xs="http://ws.wso2.org/dataservice">2017-07-04T03:32:30Z</xs:LastAttemptedContactTime>
    <xs:CredentialProfileStatus xmlns:xs="http://ws.wso2.org/dataservice">HP PAGEWIDE PRO MFP 777HC</xs:CredentialProfileStatus>
    <xs:JACCredentialProfileId xmlns:xs="http://ws.wso2.org/dataservice">11</xs:JACCredentialProfileId>
    <xs:FirmwareVersion xmlns:xs="http://ws.wso2.org/dataservice">HP PAGEWIDE PRO MFP 777HC</xs:FirmwareVersion>
    <xs:FirmwareDateCode xmlns:xs="http://ws.wso2.org/dataservice">HP PAGEWIDE PRO MFP 777HC</xs:FirmwareDateCode>
    <xs:JACAccountID xmlns:xs="http://ws.wso2.org/dataservice">3113</xs:JACAccountID>
  </_getjacdevice>

</soapenv:Body></soapenv:Envelope> {org.apache.synapse.mediators.builtin.LogMediator}

My DSS endpoint is expecting request as below

      <_getjacdevice xmlns="http://ws.wso2.org/dataservice">

         <xs:JACDeviceId xmlns:xs="http://ws.wso2.org/dataservice">1</xs:JACDeviceId>

         <xs:Make xmlns:xs="http://ws.wso2.org/dataservice">HP</xs:Make>

         <xs:Model xmlns:xs="http://ws.wso2.org/dataservice">HP CM8060 Color MFP</xs:Model>

         <xs:SerialNumber xmlns:xs="http://ws.wso2.org/dataservice">SerialNumberZ</xs:SerialNumber>

         <xs:IPv4 xmlns:xs="http://ws.wso2.org/dataservice">IPV4z</xs:IPv4>

         <xs:MAC xmlns:xs="http://ws.wso2.org/dataservice">MACZZ</xs:MAC>

         <xs:Hostname xmlns:xs="http://ws.wso2.org/dataservice">HOST NAMEZ</xs:Hostname>

         <xs:FirstScanDate xmlns:xs="http://ws.wso2.org/dataservice">2017-06-06 10:33:42.773</xs:FirstScanDate>

         <xs:LastScanDate xmlns:xs="http://ws.wso2.org/dataservice">2017-06-06 10:33:42.773</xs:LastScanDate>

         <xs:Managed xmlns:xs="http://ws.wso2.org/dataservice">1</xs:Managed>

         <xs:LastAttemptedContactTime xmlns:xs="http://ws.wso2.org/dataservice">2017-06-06 10:33:42.773</xs:LastAttemptedContactTime>

         <xs:CredentialProfileStatus xmlns:xs="http://ws.wso2.org/dataservice">aa</xs:CredentialProfileStatus>

         <xs:JACCredentialProfileId xmlns:xs="http://ws.wso2.org/dataservice">1</xs:JACCredentialProfileId>

         <xs:FirmwareVersion xmlns:xs="http://ws.wso2.org/dataservice">bb</xs:FirmwareVersion>

         <xs:FirmwareDateCode xmlns:xs="http://ws.wso2.org/dataservice">cc</xs:FirmwareDateCode>

         <xs:JACAccountID xmlns:xs="http://ws.wso2.org/dataservice">3113</xs:JACAccountID>
      </_getjacdevice>
      <_getjacdevice xmlns="http://ws.wso2.org/dataservice">
         <xs:JACDeviceId xmlns:xs="http://ws.wso2.org/dataservice">9</xs:JACDeviceId>

         <xs:Make xmlns:xs="http://ws.wso2.org/dataservice">HPjj</xs:Make>

         <xs:Model xmlns:xs="http://ws.wso2.org/dataservice">HP CM8060 Color MFP20000</xs:Model>

         <xs:SerialNumber xmlns:xs="http://ws.wso2.org/dataservice">SerialNumberkkZ</xs:SerialNumber>

         <xs:IPv4 xmlns:xs="http://ws.wso2.org/dataservice">IPV4zjj</xs:IPv4>

         <xs:MAC xmlns:xs="http://ws.wso2.org/dataservice">MACZZjj</xs:MAC>

         <xs:Hostname xmlns:xs="http://ws.wso2.org/dataservice">HOST NAMEjjZ</xs:Hostname>

         <xs:FirstScanDate xmlns:xs="http://ws.wso2.org/dataservice">2017-06-06 10:33:42.773</xs:FirstScanDate>

         <xs:LastScanDate xmlns:xs="http://ws.wso2.org/dataservice">2017-06-06 10:33:42.773</xs:LastScanDate>

         <xs:Managed xmlns:xs="http://ws.wso2.org/dataservice">1</xs:Managed>

         <xs:LastAttemptedContactTime xmlns:xs="http://ws.wso2.org/dataservice">2017-06-06 10:33:42.773</xs:LastAttemptedContactTime>

         <xs:CredentialProfileStatus xmlns:xs="http://ws.wso2.org/dataservice">aa</xs:CredentialProfileStatus>

         <xs:JACCredentialProfileId xmlns:xs="http://ws.wso2.org/dataservice">1</xs:JACCredentialProfileId>

         <xs:FirmwareVersion xmlns:xs="http://ws.wso2.org/dataservice">bb</xs:FirmwareVersion>

         <xs:FirmwareDateCode xmlns:xs="http://ws.wso2.org/dataservice">cc</xs:FirmwareDateCode>

         <xs:JACAccountID xmlns:xs="http://ws.wso2.org/dataservice">3113</xs:JACAccountID>
      </_getjacdevice>

Body:
I got it working by adding below line before calling my endpoint.

<property name="messageType" scope="axis2" type="STRING" value="application/xml"/>


来源: stackexchange

问:
Perfmon metrics collector error
When I run the test, I got this error:

2017-07-01 18:21:14,752 ERROR o.a.j.JMeter: Uncaught exception:
  java.lang.NoSuchMethodError: org.apache.jmeter.samplers.SampleSaveConfiguration.setFormatter(Ljava/text/DateFormat;)

I've tried this solution but it doesn't work
https://groups.google.com/forum/?hl=ru#!topic/jmeter-plugins/5HFRZaH9suQ

I would be appreciated for any help.

答:
setFormatter function exists in Jmeter 3.1 and not in Jmeter 3.2

Work with Jmeter 3.1 until a fix will be done to PerfMon plugin

ContentLicense: CC BY-SA 3.0

Title: Perfmon metrics collector error


问:
How do I perform calculations on a string in pandas?
I have a dataframe like this:

```<code>Country     Sales    Assets
China       4B        320B
China       3B        125B
India       112M      100B
USA         39M       200B...
</code>```

The Sales and assests columns have some values in billions and some in millions. Billions are denoted by B and millions as M. Now I want to check the total sales of a country but I can't do so as the values are object type. So I stripped the B from the columns and tried converting them to float values. But the values like 39M cause a problem.

Since 1 billion=1000 million, I want to convert the values in millions to that in billions. Like the values like 39M should be converted to 0.039B. So later I can strip off all the B's and convert them to float.

How do I do that?

答:
I think you can use if need output in billions:

apply because process multiple columns with lambda function

first remove last char by indexing with str and convert to int

multiple by mul with replaced values of dict

last convert to float by astype

```<code>cols = ['Sales','Assets']
d = {'M': 10**-3, 'B':1}
df[cols] = df[cols].apply(lambda x: x.str[:-1]
                                     .astype(int).mul(x.replace(d, regex=True))
                                     .astype(float))
print (df)
  Country  Sales  Assets
0   China  4.000   320.0
1   China  3.000   125.0
2   India  0.112   100.0
3     USA  0.039   200.0
</code>```

If you want change values to numbers only change dict values:

```<code>d = {'M': 10**6, 'B':10**9}
#same solution
print (df)
  Country         Sales        Assets
0   China  4.000000e+09  3.200000e+11
1   China  3.000000e+09  1.250000e+11
2   India  1.120000e+08  1.000000e+11
3     USA  3.900000e+07  2.000000e+11
</code>```

Body:
I have a dataframe like this:

Country     Sales    Assets
China       4B        320B
China       3B        125B
India       112M      100B
USA         39M       200B...

The Sales and assests columns have some values in billions and some in millions. Billions are denoted by B and millions as M. Now I want to check the total sales of a country but I can't do so as the values are object type. So I stripped the B from the columns and tried converting them to float values. But the values like 39M cause a problem.

Since 1 billion=1000 million, I want to convert the values in millions to that in billions. Like the values like 39M should be converted to 0.039B. So later I can strip off all the B's and convert them to float.

How do I do that?

Body:
I think you can use if need output in billions:

apply because process multiple columns with lambda function

first remove last char by indexing with str and convert to int

multiple by mul with replaced values of dict

last convert to float by astype

cols = ['Sales','Assets']
d = {'M': 10**-3, 'B':1}
df[cols] = df[cols].apply(lambda x: x.str[:-1]
                                     .astype(int).mul(x.replace(d, regex=True))
                                     .astype(float))
print (df)
  Country  Sales  Assets
0   China  4.000   320.0
1   China  3.000   125.0
2   India  0.112   100.0
3     USA  0.039   200.0

If you want change values to numbers only change dict values:

d = {'M': 10**6, 'B':10**9}
#same solution
print (df)
  Country         Sales        Assets
0   China  4.000000e+09  3.200000e+11
1   China  3.000000e+09  1.250000e+11
2   India  1.120000e+08  1.000000e+11
3     USA  3.900000e+07  2.000000e+11


问:
JS:Want to animate on clicking the button
I want to animate/colorify the div on clicking the button 'Animate'
Can you test my code and suggest some changes or add some code ?

My code looks like this:-

.anime {
  animation: coloranimate 5s;
  width: 100px;
  height: 100px;
  border: 1px solid black;
  background: red;
}

@keyframes coloranimate {
  from {
    background: green;
  }
  to {
    background: yellow;
    border: 4px solid black;
  }
}

@-webkit-keyframes coloranimate {
  from {
    background: green;
  }
  to {
    background: yellow;
    border: 4px solid black;
  }
}```
<pre class="snippet-code-html lang-html prettyprint-override"><code><script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<div id="anime" class="anime">
</div>
<button>Animate</button></code>```

I want to animate/colorify the div using the animate button.

答:
Add a class on click via javascript on the #anime element which then has the animation ...

$('.myButton').on('click', function(){
    $('#anime').addClass('animate-now');
});```
<pre class="snippet-code-css lang-css prettyprint-override"><code>.anime {
  width: 100px;
  height: 100px;
  border: 1px solid black;
  background: red;
}

@keyframes coloranimate {
  from {
    background: green;
  }
  to {
    background: yellow;
    border: 4px solid black;
  }
}

@-webkit-keyframes coloranimate {
  from {
    background: green;
  }
  to {
    background: yellow;
    border: 4px solid black;
  }
}

.anime.animate-now {
  animation: coloranimate 5s;
}</code>```

<button class="myButton">Animate</button>```

Body:
I want to animate/colorify the div on clicking the button 'Animate'
Can you test my code and suggest some changes or add some code ?

My code looks like this:-

.anime {
  animation: coloranimate 5s;
  width: 100px;
  height: 100px;
  border: 1px solid black;
  background: red;
}

@keyframes coloranimate {
  from {
    background: green;
  }
  to {
    background: yellow;
    border: 4px solid black;
  }
}

@-webkit-keyframes coloranimate {
  from {
    background: green;
  }
  to {
    background: yellow;
    border: 4px solid black;
  }
}

<button>Animate</button>

I want to animate/colorify the div using the animate button.

Body:
Add a class on click via javascript on the #anime element which then has the animation ...

$('.myButton').on('click', function(){
    $('#anime').addClass('animate-now');
});

.anime {
  width: 100px;
  height: 100px;
  border: 1px solid black;
  background: red;
}

@keyframes coloranimate {
  from {
    background: green;
  }
  to {
    background: yellow;
    border: 4px solid black;
  }
}

@-webkit-keyframes coloranimate {
  from {
    background: green;
  }
  to {
    background: yellow;
    border: 4px solid black;
  }
}

.anime.animate-now {
  animation: coloranimate 5s;
}

<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<div id="anime" class="anime">
</div>
<button class="myButton">Animate</button>


问:
Failing azure git deploys due to jquery typings errors
I'm building a scheduling application that uses the syncfusion scheduler component (an ng2 wrapper around a jquery plugin essentially). Following their documentation I've added both jquery and the associated TS typings, and everything is working fine locally after some upgrading of npm versions.

When git deploying to azure for testing and demoing, my builds are failing. Initially the error was as follows:

Cannot find module 'validate-npm-package-license'

This isn't a package I've had to install, but I presume it's necessary to prove that my company own a license for these controls (which we do). I've got an open support call with syncfusion but hoping to progress this without waiting too long! Not sure if it's a valid fix but adding a prepublish script of:

```<code>"prepublish": "npm install -g validate-npm-package-license"
</code>```

seems to have fixed this issue. However, the next build failed with no real reason given, other than the process exited. In past experiences the occasional azure git deploy has failed randomly like this before passing on a redeploy so I tried that, but now receive hundreds of jquery typings errors such as:

ERROR in [at-loader] ./node_modules/@types/jquery/index.d.ts:41:40
            TS1005: ',' expected.

ERROR in [at-loader] ./node_modules/@types/jquery/index.d.ts:4332:52
            TS1139: Type parameter declaration expected.

ERROR in [at-loader] ./node_modules/@types/jquery/index.d.ts:35:23
            TS2314: Generic type 'JQueryStatic' requires 2 type argument(s).

etc etc.

I've already had to downgrade to a much older version of these typings to fix local build errors, but I'm unsure as to why this is now failing in azure.

I've forced the azure node version to 8.0.0 with the environment variable, and this then yields an npm version of 5.0.0, and this is my current package.json file:

```<code>{
  "name": "scheduler",
  "version": "0.0.0",
  "scripts": {
    "prepublish": "npm install -g validate-npm-package-license",
    "build": "webpack",
    "copy-ej": "xcopy node_modules\\syncfusion-javascript\\Content\\ej wwwroot\\dist\\ej /y /s /i",
    "postinstall": "npm run copy-ej",
    "test": "karma start ClientApp/test/karma.conf.js"
  },
  "dependencies": {
    "@angular/common": "^2.4.5",
    "@angular/compiler": "^2.4.5",
    "@angular/core": "^2.4.5",
    "@angular/forms": "^2.4.5",
    "@angular/http": "^2.4.5",
    "@angular/platform-browser": "^2.4.5",
    "@angular/platform-browser-dynamic": "^2.4.5",
    "@angular/platform-server": "^2.4.5",
    "@angular/router": "^3.4.5",
    "@types/ej.web.all": "^15.2.3",
    "@types/jquery": "^2.0.42",
    "@types/node": "^6.0.42",
    "angular2-jwt": "^0.2.3",
    "angular2-platform-node": "~2.0.11",
    "angular2-template-loader": "^0.6.2",
    "angular2-universal": "^2.1.0-rc.1",
    "angular2-universal-patch": "^0.2.1",
    "angular2-universal-polyfills": "^2.1.0-rc.1",
    "aspnet-prerendering": "^2.0.0",
    "aspnet-webpack": "^1.0.17",
    "awesome-typescript-loader": "^3.0.0",
    "bootstrap": "^3.3.7",
    "css": "^2.2.1",
    "css-loader": "^0.25.0",
    "ej-angular2": "^15.2.43",
    "es6-shim": "^0.35.1",
    "event-source-polyfill": "^0.0.7",
    "expose-loader": "^0.7.1",
    "extract-text-webpack-plugin": "^2.0.0-rc",
    "file-loader": "^0.9.0",
    "html-loader": "^0.4.4",
    "isomorphic-fetch": "^2.2.1",
    "jquery": "^2.2.1",
    "json-loader": "^0.5.4",
    "ngx-bootstrap": "^1.7.0",
    "preboot": "^4.5.2",
    "raw-loader": "^0.5.1",
    "rxjs": "5.4.1",
    "style-loader": "^0.13.1",
    "syncfusion-javascript": "^15.2.43",
    "to-string-loader": "^1.1.5",
    "typescript": "2.2.1",
    "url-loader": "^0.5.7",
    "webpack": "^2.2.0",
    "webpack-hot-middleware": "^2.12.2",
    "webpack-merge": "^0.14.1",
    "zone.js": "0.8.12"
  },
  "devDependencies": {
    "@types/chai": "^3.4.34",
    "@types/jasmine": "^2.5.37",
    "chai": "^3.5.0",
    "jasmine-core": "^2.5.2",
    "karma": "^1.3.0",
    "karma-chai": "^0.1.0",
    "karma-chrome-launcher": "^2.0.0",
    "karma-cli": "^1.0.1",
    "karma-jasmine": "^1.0.2",
    "karma-webpack": "^1.8.0"
  }
}
</code>```

Any suggestions on what might be causing this?
Cheers

答:
The similar issue can be found here: @types/jquery giving breaking solution while Gulp build.

As @leonard-thieu pointed out,

@types/jquery requires TypeScript 2.3 or higher.   If you're getting
  errors similar to

error TS2314: Generic type 'Deferred' requires 4 type argument(s).

error TS1005: ',' expected.

You need to upgrade to typescript@2.3 or later.

You may also need to upgrade @types/jquery to 3.2.5.

Body:
I'm building a scheduling application that uses the syncfusion scheduler component (an ng2 wrapper around a jquery plugin essentially). Following their documentation I've added both jquery and the associated TS typings, and everything is working fine locally after some upgrading of npm versions.

When git deploying to azure for testing and demoing, my builds are failing. Initially the error was as follows:

Cannot find module 'validate-npm-package-license'

This isn't a package I've had to install, but I presume it's necessary to prove that my company own a license for these controls (which we do). I've got an open support call with syncfusion but hoping to progress this without waiting too long! Not sure if it's a valid fix but adding a prepublish script of:

"prepublish": "npm install -g validate-npm-package-license"

seems to have fixed this issue. However, the next build failed with no real reason given, other than the process exited. In past experiences the occasional azure git deploy has failed randomly like this before passing on a redeploy so I tried that, but now receive hundreds of jquery typings errors such as:

ERROR in [at-loader] ./node_modules/@types/jquery/index.d.ts:41:40
            TS1005: ',' expected.

ERROR in [at-loader] ./node_modules/@types/jquery/index.d.ts:4332:52
            TS1139: Type parameter declaration expected.

ERROR in [at-loader] ./node_modules/@types/jquery/index.d.ts:35:23
            TS2314: Generic type 'JQueryStatic' requires 2 type argument(s).

etc etc.

I've already had to downgrade to a much older version of these typings to fix local build errors, but I'm unsure as to why this is now failing in azure.

I've forced the azure node version to 8.0.0 with the environment variable, and this then yields an npm version of 5.0.0, and this is my current package.json file:

{
  "name": "scheduler",
  "version": "0.0.0",
  "scripts": {
    "prepublish": "npm install -g validate-npm-package-license",
    "build": "webpack",
    "copy-ej": "xcopy node_modules\\syncfusion-javascript\\Content\\ej wwwroot\\dist\\ej /y /s /i",
    "postinstall": "npm run copy-ej",
    "test": "karma start ClientApp/test/karma.conf.js"
  },
  "dependencies": {
    "@angular/common": "^2.4.5",
    "@angular/compiler": "^2.4.5",
    "@angular/core": "^2.4.5",
    "@angular/forms": "^2.4.5",
    "@angular/http": "^2.4.5",
    "@angular/platform-browser": "^2.4.5",
    "@angular/platform-browser-dynamic": "^2.4.5",
    "@angular/platform-server": "^2.4.5",
    "@angular/router": "^3.4.5",
    "@types/ej.web.all": "^15.2.3",
    "@types/jquery": "^2.0.42",
    "@types/node": "^6.0.42",
    "angular2-jwt": "^0.2.3",
    "angular2-platform-node": "~2.0.11",
    "angular2-template-loader": "^0.6.2",
    "angular2-universal": "^2.1.0-rc.1",
    "angular2-universal-patch": "^0.2.1",
    "angular2-universal-polyfills": "^2.1.0-rc.1",
    "aspnet-prerendering": "^2.0.0",
    "aspnet-webpack": "^1.0.17",
    "awesome-typescript-loader": "^3.0.0",
    "bootstrap": "^3.3.7",
    "css": "^2.2.1",
    "css-loader": "^0.25.0",
    "ej-angular2": "^15.2.43",
    "es6-shim": "^0.35.1",
    "event-source-polyfill": "^0.0.7",
    "expose-loader": "^0.7.1",
    "extract-text-webpack-plugin": "^2.0.0-rc",
    "file-loader": "^0.9.0",
    "html-loader": "^0.4.4",
    "isomorphic-fetch": "^2.2.1",
    "jquery": "^2.2.1",
    "json-loader": "^0.5.4",
    "ngx-bootstrap": "^1.7.0",
    "preboot": "^4.5.2",
    "raw-loader": "^0.5.1",
    "rxjs": "5.4.1",
    "style-loader": "^0.13.1",
    "syncfusion-javascript": "^15.2.43",
    "to-string-loader": "^1.1.5",
    "typescript": "2.2.1",
    "url-loader": "^0.5.7",
    "webpack": "^2.2.0",
    "webpack-hot-middleware": "^2.12.2",
    "webpack-merge": "^0.14.1",
    "zone.js": "0.8.12"
  },
  "devDependencies": {
    "@types/chai": "^3.4.34",
    "@types/jasmine": "^2.5.37",
    "chai": "^3.5.0",
    "jasmine-core": "^2.5.2",
    "karma": "^1.3.0",
    "karma-chai": "^0.1.0",
    "karma-chrome-launcher": "^2.0.0",
    "karma-cli": "^1.0.1",
    "karma-jasmine": "^1.0.2",
    "karma-webpack": "^1.8.0"
  }
}

Any suggestions on what might be causing this?
Cheers


问:
Facebook webhook making multiple calls for the same message?
I made and echo bot on AWS with Python and serverless.

I keep getting the same request again and again.
I read the faq where it says u have to deliver a status code 200 else it will keep retrying the webhook.

I'm not sure How I do this.

I have noticed that the sequence number is always the same for the calls so I assume the reply I sent was not acknowledged.
my code is here

```<code>import os
import json
import requests
import random
from datetime import datetime
######################
# helper functions
######################
##recursively look/return for an item in dict given key
def find_item(obj, key):
    item = None
    if key in obj: return obj[key]
    for k, v in obj.items():
        if isinstance(v,dict):
            item = find_item(v, key)
            if item is not None:
                return item

##recursivley check for items in a dict given key
def keys_exist(obj, keys):
    for key in keys:
        if find_item(obj, key) is None:
            return(False)
    return(True)

##send txt via messenger to id
def send_message(send_id, msg_txt):
    print("Send message called")
    print (datetime.utcnow().strftime('%Y-%m-%d %H:%M:%S.%f')[:-3])
    params  = {"statusCode": 200,"access_token": os.environment['accesstoken']}
    headers = {"statusCode": "200","Content-Type": "application/json"}
    data = json.dumps({"statusCode": "200","recipient": {"id": send_id},
                       "message": {"text": msg_txt}})

    r = requests.post("https://graph.facebook.com/v2.9/me/messages", params=params, headers=headers, data=data)
    print (r.text)

    if r.status_code != 200:
        print(r.status_code)
        print(r.text)

#-----------------------------------------------------------

def hello(event, context):
    #debug
    event=json.loads(json.dumps(event))
    print("event:" )
    print(event)
    # print("context")
    # print(context)

    #handle webhook challenge
    try:

        if keys_exist(event, ["queryStringParameters","hub.verify_token","hub.challenge"]):
            print("subscribe to webhook invoked")
            v_token   = str(find_item(event, 'hub.verify_token'))
            challenge = find_item(event, 'hub.challenge')
            if ("strongtoken" == v_token):
                response = {
                    "statusCode": 200,
                    "body": str(challenge)
                }
                print(challenge)
                return response

        #handle messaging events
        if keys_exist(event, ['body']):
            event_entry=json.loads(event['body'])
            if ((len(event_entry['entry'])>0) & (keys_exist(event_entry['entry'][0],['messaging'])) ):
                messaging_event = event_entry['entry'][0]['messaging'][0]
                if (keys_exist(messaging_event,['message'])):
                    msg_txt   = messaging_event['message']['text']
                    sender_id = messaging_event['sender']['id']
                    print(sender_id)
                    first_word = msg_txt.split(" ")[0]
                    send_message(sender_id, msg_txt)
                else:
                    print("Did not send message")
                    pass
            else:
                print("Did not send message")
                pass

        else:
            pass
    except:
        pass
</code>```

I have given the status code 200 in soo many places and I'm not sure y I still keep getting the same problem.

答:
I am from Java background but still I will try to help you.

In handle webhook challenge I can see you returning 200 status code

But in handle messaging block 200 is not returned You have set 200 status code in send message. But it will not work you have to return 200 from handle messaging block.

Also 200 should be returned even if any exception occurs in this block otherwise on exception it will get blocked. So may be in finally block you can return 200.

Body:
I made and echo bot on AWS with Python and serverless.

I keep getting the same request again and again.
I read the faq where it says u have to deliver a status code 200 else it will keep retrying the webhook.

I'm not sure How I do this.

I have noticed that the sequence number is always the same for the calls so I assume the reply I sent was not acknowledged.
my code is here

import os
import json
import requests
import random
from datetime import datetime
######################
# helper functions
######################
##recursively look/return for an item in dict given key
def find_item(obj, key):
    item = None
    if key in obj: return obj[key]
    for k, v in obj.items():
        if isinstance(v,dict):
            item = find_item(v, key)
            if item is not None:
                return item

##recursivley check for items in a dict given key
def keys_exist(obj, keys):
    for key in keys:
        if find_item(obj, key) is None:
            return(False)
    return(True)

##send txt via messenger to id
def send_message(send_id, msg_txt):
    print("Send message called")
    print (datetime.utcnow().strftime('%Y-%m-%d %H:%M:%S.%f')[:-3])
    params  = {"statusCode": 200,"access_token": os.environment['accesstoken']}
    headers = {"statusCode": "200","Content-Type": "application/json"}
    data = json.dumps({"statusCode": "200","recipient": {"id": send_id},
                       "message": {"text": msg_txt}})

    r = requests.post("https://graph.facebook.com/v2.9/me/messages", params=params, headers=headers, data=data)
    print (r.text)

    if r.status_code != 200:
        print(r.status_code)
        print(r.text)

#-----------------------------------------------------------

def hello(event, context):
    #debug
    event=json.loads(json.dumps(event))
    print("event:" )
    print(event)
    # print("context")
    # print(context)

    #handle webhook challenge
    try:

        if keys_exist(event, ["queryStringParameters","hub.verify_token","hub.challenge"]):
            print("subscribe to webhook invoked")
            v_token   = str(find_item(event, 'hub.verify_token'))
            challenge = find_item(event, 'hub.challenge')
            if ("strongtoken" == v_token):
                response = {
                    "statusCode": 200,
                    "body": str(challenge)
                }
                print(challenge)
                return response

        #handle messaging events
        if keys_exist(event, ['body']):
            event_entry=json.loads(event['body'])
            if ((len(event_entry['entry'])>0) & (keys_exist(event_entry['entry'][0],['messaging'])) ):
                messaging_event = event_entry['entry'][0]['messaging'][0]
                if (keys_exist(messaging_event,['message'])):
                    msg_txt   = messaging_event['message']['text']
                    sender_id = messaging_event['sender']['id']
                    print(sender_id)
                    first_word = msg_txt.split(" ")[0]
                    send_message(sender_id, msg_txt)
                else:
                    print("Did not send message")
                    pass
            else:
                print("Did not send message")
                pass

        else:
            pass
    except:
        pass

I have given the status code 200 in soo many places and I'm not sure y I still keep getting the same problem.


问:
How to build a layout of single line and multi line labels in iOS autolayout?
I have an application in swift,and have encountered an autolayout issue. I've come up with the solution to it, but it doesn't seem to work as expected.

So, here's the issue:
I have two labels in a table view cell. The first one should only have one line, and the second one must have as many lines as needed and take up as much vertical space as needed. The first label should always be shown fully and, therefore, determine the position, the size, and the number of lines of the second label. Texts for both are set programmatically when drawing the cell, of course.

The solution seems to be pretty simple: Anchor the first label to the left, center it vertically, anchor the second label to the parent top, right, bottom and the right side of the first one. Set the number of lines to 0 for the second label. The editor shows no warnings or errors.

This is how it looks like:

In most cases it looks good, like on the picture below, but sometimes not (red arrows at the picture below):

The first label should have absolute priority and never be truncated, wrapped, or cut, but this happens. What am I doing wrong?

UPD: For the question to be more clear, the first label is so called 'margin label', it represents the margin and the indicator of the cell. This is done to imitate a tree structure. The second is, of course, the text itself. '>' is for the closed comment, 'v' is for the opened.

答:
Select the first label (the >) and go into the measurements panel in Interface Builder.

Near the bottom it will have a value for "Content Compression Resistance". Currently it will be 251 or 751 (I can't remember which) and it will be equal to the other label.

Change this value to 1000. This will stop it from compressing and make the second label compress instead.


问:
BDD Gherkin Selenium Java - Error Trouble shooting
```<code>    package cucumberselelniumgherkin;

    import java.util.concurrent.TimeUnit;

    import org.junit.Assert;
    import org.openqa.selenium.By;
    import org.openqa.selenium.WebDriver;
    import org.openqa.selenium.WebElement;
    import org.openqa.selenium.firefox.FirefoxDriver;

    import cucumber.api.java.After;
    import cucumber.api.java.Before;
    import cucumber.api.java.en.Given;
    import cucumber.api.java.en.Then;
    import cucumber.api.java.en.When;

    public class test {

        public WebDriver driver;

         @Before
            public void setup() {
                driver = new FirefoxDriver();
        }

        @Given("^I open google$")
        public void I_open_google() {
            //Set implicit wait of 10 seconds and launch google
            driver.manage().timeouts().implicitlyWait(5, TimeUnit.SECONDS);
            driver.get("https://www.google.co.in");
        }

        @When("^I enter \"([^\"]*)\" in search textbox$")
        public void I_enter_in_search_textbox(String additionTerms) {
            //Write term in google textbox
            WebElement googleTextBox = driver.findElement(By.id("gbqfq"));
            googleTextBox.sendKeys(additionTerms);

            //Click on searchButton
            WebElement searchButton = driver.findElement(By.id("gbqfb"));
            searchButton.click();
        }

        @Then("^I should get result as \"([^\"]*)\"$")
        public void I_should_get_correct_result(String expectedResult) {
            //Get result from calculator
            WebElement calculatorTextBox = driver.findElement(By.id("cwos"));
            String result = calculatorTextBox.getText();

            //Verify that result of 2+2 is 4
            Assert.assertEquals(result, expectedResult);

            driver.close();
        }

         @After
          public void closeBrowser() {
          driver.quit();
         }

    }
</code>```

When I am trying to run it as maven test getting the below mentioned    error, please help this is my first attempt in getting into BDD    stuff, whats wrong in the code. Please suggest what can i do to fix this its been bothering my mind so much !

```<code>        [INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building bddSel 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO] Downloading: https://repo.maven.apache.org/maven2/org/seleniumhq/selenium/selenium-api/maven-metadata.xml
[INFO] Downloaded: https://repo.maven.apache.org/maven2/org/seleniumhq/selenium/selenium-api/maven-metadata.xml (3 KB at 1.3 KB/sec)
[INFO] Downloading: https://repo.maven.apache.org/maven2/org/seleniumhq/selenium/selenium-support/maven-metadata.xml
[INFO] Downloaded: https://repo.maven.apache.org/maven2/org/seleniumhq/selenium/selenium-support/maven-metadata.xml (4 KB at 6.7 KB/sec)
[INFO] Downloading: https://repo.maven.apache.org/maven2/info/cukes/cucumber-junit/1.2.5/cucumber-junit-1.2.5.pom
[INFO] Downloaded: https://repo.maven.apache.org/maven2/info/cukes/cucumber-junit/1.2.5/cucumber-junit-1.2.5.pom (3 KB at 5.3 KB/sec)
[INFO] Downloading: https://repo.maven.apache.org/maven2/info/cukes/cucumber-junit/1.2.5/cucumber-junit-1.2.5.jar
[INFO] Downloaded: https://repo.maven.apache.org/maven2/info/cukes/cucumber-junit/1.2.5/cucumber-junit-1.2.5.jar (22 KB at 27.4 KB/sec)
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ bddSel ---
[WARNING] Using platform encoding (Cp1252 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] skip non existing resourceDirectory E:\workspace\bddSel\src\main\resources
[INFO]
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ bddSel ---
[INFO] Changes detected - recompiling the module!
[WARNING] File encoding has not been set, using platform encoding Cp1252, i.e. build is platform dependent!
[INFO] Compiling 2 source files to E:\workspace\bddSel\target\classes
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] error reading C:\Users\Avinash\.m2\repository\org\apache\commons\commons-lang3\3.5\commons-lang3-3.5.jar; invalid LOC header (bad signature)
[ERROR] error reading C:\Users\Avinash\.m2\repository\net\sourceforge\cssparser\cssparser\0.9.22\cssparser-0.9.22.jar; invalid LOC header (bad signature)
[ERROR] error reading C:\Users\Avinash\.m2\repository\net\sourceforge\htmlunit\htmlunit\2.26\htmlunit-2.26.jar; invalid CEN header (bad signature)
[ERROR] /E:/workspace/bddSel/src/main/java/cucumberselelniumgherkin/test.java:[6,17] package org.junit does not exist
[ERROR] /E:/workspace/bddSel/src/main/java/cucumberselelniumgherkin/test.java:[12,25] package cucumber.api.java does not exist
[ERROR] /E:/workspace/bddSel/src/main/java/cucumberselelniumgherkin/test.java:[13,25] package cucumber.api.java does not exist
[ERROR] /E:/workspace/bddSel/src/main/java/cucumberselelniumgherkin/test.java:[14,28] package cucumber.api.java.en does not exist
[ERROR] /E:/workspace/bddSel/src/main/java/cucumberselelniumgherkin/test.java:[15,28] package cucumber.api.java.en does not exist
[ERROR] /E:/workspace/bddSel/src/main/java/cucumberselelniumgherkin/test.java:[16,28] package cucumber.api.java.en does not exist
[ERROR] /E:/workspace/bddSel/src/main/java/cucumberselelniumgherkin/test.java:[23,11] cannot find symbol
  symbol:   class Before
  location: class cucumberselelniumgherkin.test
[ERROR] /E:/workspace/bddSel/src/main/java/cucumberselelniumgherkin/test.java:[28,10] cannot find symbol
  symbol:   class Given
  location: class cucumberselelniumgherkin.test
[ERROR] /E:/workspace/bddSel/src/main/java/cucumberselelniumgherkin/test.java:[35,10] cannot find symbol
  symbol:   class When
  location: class cucumberselelniumgherkin.test
[ERROR] /E:/workspace/bddSel/src/main/java/cucumberselelniumgherkin/test.java:[46,10] cannot find symbol
  symbol:   class Then
  location: class cucumberselelniumgherkin.test
[ERROR] /E:/workspace/bddSel/src/main/java/cucumberselelniumgherkin/test.java:[58,11] cannot find symbol
  symbol:   class After
  location: class cucumberselelniumgherkin.test
[ERROR] /E:/workspace/bddSel/src/main/java/cucumberselelniumgherkin/test.java:[53,17] cannot find symbol
  symbol:   variable Assert
  location: class cucumberselelniumgherkin.test
[INFO] 15 errors
[INFO] -------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 10.233 s
[INFO] Finished at: 2017-07-05T09:45:37+10:00
[INFO] Final Memory: 19M/152M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project bddSel: Compilation failure: Compilation failure:
[ERROR] error reading C:\Users\Avinash\.m2\repository\org\apache\commons\commons-lang3\3.5\commons-lang3-3.5.jar; invalid LOC header (bad signature)
[ERROR] error reading C:\Users\Avinash\.m2\repository\net\sourceforge\cssparser\cssparser\0.9.22\cssparser-0.9.22.jar; invalid LOC header (bad signature)
[ERROR] error reading C:\Users\Avinash\.m2\repository\net\sourceforge\htmlunit\htmlunit\2.26\htmlunit-2.26.jar; invalid CEN header (bad signature)
[ERROR] /E:/workspace/bddSel/src/main/java/cucumberselelniumgherkin/test.java:[6,17] package org.junit does not exist
[ERROR] /E:/workspace/bddSel/src/main/java/cucumberselelniumgherkin/test.java:[12,25] package cucumber.api.java does not exist
[ERROR] /E:/workspace/bddSel/src/main/java/cucumberselelniumgherkin/test.java:[13,25] package cucumber.api.java does not exist
[ERROR] /E:/workspace/bddSel/src/main/java/cucumberselelniumgherkin/test.java:[14,28] package cucumber.api.java.en does not exist
[ERROR] /E:/workspace/bddSel/src/main/java/cucumberselelniumgherkin/test.java:[15,28] package cucumber.api.java.en does not exist
[ERROR] /E:/workspace/bddSel/src/main/java/cucumberselelniumgherkin/test.java:[16,28] package cucumber.api.java.en does not exist
[ERROR] /E:/workspace/bddSel/src/main/java/cucumberselelniumgherkin/test.java:[23,11] cannot find symbol
[ERROR] symbol:   class Before
[ERROR] location: class cucumberselelniumgherkin.test
[ERROR] /E:/workspace/bddSel/src/main/java/cucumberselelniumgherkin/test.java:[28,10] cannot find symbol
[ERROR] symbol:   class Given
[ERROR] location: class cucumberselelniumgherkin.test
[ERROR] /E:/workspace/bddSel/src/main/java/cucumberselelniumgherkin/test.java:[35,10] cannot find symbol
[ERROR] symbol:   class When
[ERROR] location: class cucumberselelniumgherkin.test
[ERROR] /E:/workspace/bddSel/src/main/java/cucumberselelniumgherkin/test.java:[46,10] cannot find symbol
[ERROR] symbol:   class Then
[ERROR] location: class cucumberselelniumgherkin.test
[ERROR] /E:/workspace/bddSel/src/main/java/cucumberselelniumgherkin/test.java:[58,11] cannot find symbol
[ERROR] symbol:   class After
[ERROR] location: class cucumberselelniumgherkin.test
[ERROR] /E:/workspace/bddSel/src/main/java/cucumberselelniumgherkin/test.java:[53,17] cannot find symbol
[ERROR] symbol:   variable Assert
[ERROR] location: class cucumberselelniumgherkin.test
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
</code>```

Below is the POM from the project - Thank you so much for your reply. I am so stuck :( help please. I have tried almost everything cant seem to figure it out. I am new to Selenium and bdd so trying to learn. So grateful for your response.

```<code><project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <groupId>CucumberJavaProject</groupId>
  <artifactId>bddSel</artifactId>
  <version>0.0.1-SNAPSHOT</version>
  <dependencies>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>4.12</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.seleniumhq.selenium</groupId>
            <artifactId>selenium-java</artifactId>
            <version>3.4.0</version>
        </dependency>
        <dependency>
            <groupId>info.cukes</groupId>
            <artifactId>cucumber-java</artifactId>
            <version>1.2.5</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>info.cukes</groupId>
            <artifactId>cucumber-junit</artifactId>
            <version>1.1.2</version>
            <scope>test</scope>
        </dependency>
    </dependencies>
</project>
</code>```

答:
it seems like some jar file is corrupted. This is not the best solution but might work from you. Please delete all the files under following folder and re-download them using maven.

For windows

```<code>C:\Users\<username>\.m2\repository folder
</code>```

for linux

```<code>/home/egnyte/.m2/repository
</code>```

To download again you can right click on your project on your favourtie IDE and there you can find the option. you you can use command line and run

```<code>mvn clean test
</code>```

Body:
    package cucumberselelniumgherkin;

    import java.util.concurrent.TimeUnit;

    import org.junit.Assert;
    import org.openqa.selenium.By;
    import org.openqa.selenium.WebDriver;
    import org.openqa.selenium.WebElement;
    import org.openqa.selenium.firefox.FirefoxDriver;

    import cucumber.api.java.After;
    import cucumber.api.java.Before;
    import cucumber.api.java.en.Given;
    import cucumber.api.java.en.Then;
    import cucumber.api.java.en.When;

    public class test {

        public WebDriver driver;

         @Before
            public void setup() {
                driver = new FirefoxDriver();
        }

        @Given("^I open google$")
        public void I_open_google() {
            //Set implicit wait of 10 seconds and launch google
            driver.manage().timeouts().implicitlyWait(5, TimeUnit.SECONDS);
            driver.get("https://www.google.co.in");
        }

        @When("^I enter \"([^\"]*)\" in search textbox$")
        public void I_enter_in_search_textbox(String additionTerms) {
            //Write term in google textbox
            WebElement googleTextBox = driver.findElement(By.id("gbqfq"));
            googleTextBox.sendKeys(additionTerms);

            //Click on searchButton
            WebElement searchButton = driver.findElement(By.id("gbqfb"));
            searchButton.click();
        }

        @Then("^I should get result as \"([^\"]*)\"$")
        public void I_should_get_correct_result(String expectedResult) {
            //Get result from calculator
            WebElement calculatorTextBox = driver.findElement(By.id("cwos"));
            String result = calculatorTextBox.getText();

            //Verify that result of 2+2 is 4
            Assert.assertEquals(result, expectedResult);

            driver.close();
        }

         @After
          public void closeBrowser() {
          driver.quit();
         }

    }

When I am trying to run it as maven test getting the below mentioned    error, please help this is my first attempt in getting into BDD    stuff, whats wrong in the code. Please suggest what can i do to fix this its been bothering my mind so much !

        [INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building bddSel 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO] Downloading: https://repo.maven.apache.org/maven2/org/seleniumhq/selenium/selenium-api/maven-metadata.xml
[INFO] Downloaded: https://repo.maven.apache.org/maven2/org/seleniumhq/selenium/selenium-api/maven-metadata.xml (3 KB at 1.3 KB/sec)
[INFO] Downloading: https://repo.maven.apache.org/maven2/org/seleniumhq/selenium/selenium-support/maven-metadata.xml
[INFO] Downloaded: https://repo.maven.apache.org/maven2/org/seleniumhq/selenium/selenium-support/maven-metadata.xml (4 KB at 6.7 KB/sec)
[INFO] Downloading: https://repo.maven.apache.org/maven2/info/cukes/cucumber-junit/1.2.5/cucumber-junit-1.2.5.pom
[INFO] Downloaded: https://repo.maven.apache.org/maven2/info/cukes/cucumber-junit/1.2.5/cucumber-junit-1.2.5.pom (3 KB at 5.3 KB/sec)
[INFO] Downloading: https://repo.maven.apache.org/maven2/info/cukes/cucumber-junit/1.2.5/cucumber-junit-1.2.5.jar
[INFO] Downloaded: https://repo.maven.apache.org/maven2/info/cukes/cucumber-junit/1.2.5/cucumber-junit-1.2.5.jar (22 KB at 27.4 KB/sec)
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ bddSel ---
[WARNING] Using platform encoding (Cp1252 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] skip non existing resourceDirectory E:\workspace\bddSel\src\main\resources
[INFO]
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ bddSel ---
[INFO] Changes detected - recompiling the module!
[WARNING] File encoding has not been set, using platform encoding Cp1252, i.e. build is platform dependent!
[INFO] Compiling 2 source files to E:\workspace\bddSel\target\classes
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] error reading C:\Users\Avinash\.m2\repository\org\apache\commons\commons-lang3\3.5\commons-lang3-3.5.jar; invalid LOC header (bad signature)
[ERROR] error reading C:\Users\Avinash\.m2\repository\net\sourceforge\cssparser\cssparser\0.9.22\cssparser-0.9.22.jar; invalid LOC header (bad signature)
[ERROR] error reading C:\Users\Avinash\.m2\repository\net\sourceforge\htmlunit\htmlunit\2.26\htmlunit-2.26.jar; invalid CEN header (bad signature)
[ERROR] /E:/workspace/bddSel/src/main/java/cucumberselelniumgherkin/test.java:[6,17] package org.junit does not exist
[ERROR] /E:/workspace/bddSel/src/main/java/cucumberselelniumgherkin/test.java:[12,25] package cucumber.api.java does not exist
[ERROR] /E:/workspace/bddSel/src/main/java/cucumberselelniumgherkin/test.java:[13,25] package cucumber.api.java does not exist
[ERROR] /E:/workspace/bddSel/src/main/java/cucumberselelniumgherkin/test.java:[14,28] package cucumber.api.java.en does not exist
[ERROR] /E:/workspace/bddSel/src/main/java/cucumberselelniumgherkin/test.java:[15,28] package cucumber.api.java.en does not exist
[ERROR] /E:/workspace/bddSel/src/main/java/cucumberselelniumgherkin/test.java:[16,28] package cucumber.api.java.en does not exist
[ERROR] /E:/workspace/bddSel/src/main/java/cucumberselelniumgherkin/test.java:[23,11] cannot find symbol
  symbol:   class Before
  location: class cucumberselelniumgherkin.test
[ERROR] /E:/workspace/bddSel/src/main/java/cucumberselelniumgherkin/test.java:[28,10] cannot find symbol
  symbol:   class Given
  location: class cucumberselelniumgherkin.test
[ERROR] /E:/workspace/bddSel/src/main/java/cucumberselelniumgherkin/test.java:[35,10] cannot find symbol
  symbol:   class When
  location: class cucumberselelniumgherkin.test
[ERROR] /E:/workspace/bddSel/src/main/java/cucumberselelniumgherkin/test.java:[46,10] cannot find symbol
  symbol:   class Then
  location: class cucumberselelniumgherkin.test
[ERROR] /E:/workspace/bddSel/src/main/java/cucumberselelniumgherkin/test.java:[58,11] cannot find symbol
  symbol:   class After
  location: class cucumberselelniumgherkin.test
[ERROR] /E:/workspace/bddSel/src/main/java/cucumberselelniumgherkin/test.java:[53,17] cannot find symbol
  symbol:   variable Assert
  location: class cucumberselelniumgherkin.test
[INFO] 15 errors
[INFO] -------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 10.233 s
[INFO] Finished at: 2017-07-05T09:45:37+10:00
[INFO] Final Memory: 19M/152M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project bddSel: Compilation failure: Compilation failure:
[ERROR] error reading C:\Users\Avinash\.m2\repository\org\apache\commons\commons-lang3\3.5\commons-lang3-3.5.jar; invalid LOC header (bad signature)
[ERROR] error reading C:\Users\Avinash\.m2\repository\net\sourceforge\cssparser\cssparser\0.9.22\cssparser-0.9.22.jar; invalid LOC header (bad signature)
[ERROR] error reading C:\Users\Avinash\.m2\repository\net\sourceforge\htmlunit\htmlunit\2.26\htmlunit-2.26.jar; invalid CEN header (bad signature)
[ERROR] /E:/workspace/bddSel/src/main/java/cucumberselelniumgherkin/test.java:[6,17] package org.junit does not exist
[ERROR] /E:/workspace/bddSel/src/main/java/cucumberselelniumgherkin/test.java:[12,25] package cucumber.api.java does not exist
[ERROR] /E:/workspace/bddSel/src/main/java/cucumberselelniumgherkin/test.java:[13,25] package cucumber.api.java does not exist
[ERROR] /E:/workspace/bddSel/src/main/java/cucumberselelniumgherkin/test.java:[14,28] package cucumber.api.java.en does not exist
[ERROR] /E:/workspace/bddSel/src/main/java/cucumberselelniumgherkin/test.java:[15,28] package cucumber.api.java.en does not exist
[ERROR] /E:/workspace/bddSel/src/main/java/cucumberselelniumgherkin/test.java:[16,28] package cucumber.api.java.en does not exist
[ERROR] /E:/workspace/bddSel/src/main/java/cucumberselelniumgherkin/test.java:[23,11] cannot find symbol
[ERROR] symbol:   class Before
[ERROR] location: class cucumberselelniumgherkin.test
[ERROR] /E:/workspace/bddSel/src/main/java/cucumberselelniumgherkin/test.java:[28,10] cannot find symbol
[ERROR] symbol:   class Given
[ERROR] location: class cucumberselelniumgherkin.test
[ERROR] /E:/workspace/bddSel/src/main/java/cucumberselelniumgherkin/test.java:[35,10] cannot find symbol
[ERROR] symbol:   class When
[ERROR] location: class cucumberselelniumgherkin.test
[ERROR] /E:/workspace/bddSel/src/main/java/cucumberselelniumgherkin/test.java:[46,10] cannot find symbol
[ERROR] symbol:   class Then
[ERROR] location: class cucumberselelniumgherkin.test
[ERROR] /E:/workspace/bddSel/src/main/java/cucumberselelniumgherkin/test.java:[58,11] cannot find symbol
[ERROR] symbol:   class After
[ERROR] location: class cucumberselelniumgherkin.test
[ERROR] /E:/workspace/bddSel/src/main/java/cucumberselelniumgherkin/test.java:[53,17] cannot find symbol
[ERROR] symbol:   variable Assert
[ERROR] location: class cucumberselelniumgherkin.test
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException

Below is the POM from the project - Thank you so much for your reply. I am so stuck :( help please. I have tried almost everything cant seem to figure it out. I am new to Selenium and bdd so trying to learn. So grateful for your response.

<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <groupId>CucumberJavaProject</groupId>
  <artifactId>bddSel</artifactId>
  <version>0.0.1-SNAPSHOT</version>
  <dependencies>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>4.12</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.seleniumhq.selenium</groupId>
            <artifactId>selenium-java</artifactId>
            <version>3.4.0</version>
        </dependency>
        <dependency>
            <groupId>info.cukes</groupId>
            <artifactId>cucumber-java</artifactId>
            <version>1.2.5</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>info.cukes</groupId>
            <artifactId>cucumber-junit</artifactId>
            <version>1.1.2</version>
            <scope>test</scope>
        </dependency>
    </dependencies>
</project>

Body:
it seems like some jar file is corrupted. This is not the best solution but might work from you. Please delete all the files under following folder and re-download them using maven.

For windows

C:\Users\<username>\.m2\repository folder

for linux

/home/egnyte/.m2/repository

To download again you can right click on your project on your favourtie IDE and there you can find the option. you you can use command line and run

mvn clean test


问:
Returning a value of match in images from feature point detection
I'm using a feature point detection algorithm I found in a tutorial as shown below. The output of this code are lines drawn between the two images where feature points match.

Here's what I would like to know: Is there a way to return some value (floating point value) to determine if the two images are almost same, somewhat similar or not same?

```<code>def feature_matching():

    img1 = cv2.imread('image1.jpeg', 0)

    img2 = cv2.imread('image2.jpeg', 0)

    # Initiate SIFT detector
    sift = cv2.SIFT()

    # find the keypoints and descriptors with SIFT
    kp1, des1 = sift.detectAndCompute(img1,None)
    kp2, des2 = sift.detectAndCompute(img2,None)

    # BFMatcher with default params
    bf = cv2.BFMatcher()
    matches = bf.knnMatch(des1,des2, k=2)

    # Apply ratio test
    good = []
    for m,n in matches:
        if m.distance < 0.75*n.distance:
            good.append(m)

    #gray1 = cv2.cvtColor(img1,cv2.COLOR_BGR2GRAY)
    #gray2 = cv2.cvtColor(img2,cv2.COLOR_BGR2GRAY)
    # cv2.drawMatchesKnn expects list of lists as matches.
    img3 = drawMatches(img1,kp1,img2,kp2,good)

    plt.imshow(img3),plt.show()
</code>```

答:
You have a measure in the code itself. You are aggrating points that match in the list good. So you can check that if you have more than several points in the list good it means that the images match.
Also you can ask for a better match score between points in the line
 if m.distance < 0.75*n.distance:
            good.append(m)
Change to a lower corresponding value for example
if m.distance < 0.3*n.distance:
            good.append(m)</p>

Body:
I'm using a feature point detection algorithm I found in a tutorial as shown below. The output of this code are lines drawn between the two images where feature points match.

Here's what I would like to know: Is there a way to return some value (floating point value) to determine if the two images are almost same, somewhat similar or not same?

def feature_matching():

    img1 = cv2.imread('image1.jpeg', 0)

    img2 = cv2.imread('image2.jpeg', 0)

    # Initiate SIFT detector
    sift = cv2.SIFT()

    # find the keypoints and descriptors with SIFT
    kp1, des1 = sift.detectAndCompute(img1,None)
    kp2, des2 = sift.detectAndCompute(img2,None)

    # BFMatcher with default params
    bf = cv2.BFMatcher()
    matches = bf.knnMatch(des1,des2, k=2)

    # Apply ratio test
    good = []
    for m,n in matches:
        if m.distance < 0.75*n.distance:
            good.append(m)

    #gray1 = cv2.cvtColor(img1,cv2.COLOR_BGR2GRAY)
    #gray2 = cv2.cvtColor(img2,cv2.COLOR_BGR2GRAY)
    # cv2.drawMatchesKnn expects list of lists as matches.
    img3 = drawMatches(img1,kp1,img2,kp2,good)

    plt.imshow(img3),plt.show()


问:
TFS - Add work item to specific project
I'm relatively new to developing with tfs (only used git before).

I'm connecting to a server, which contains a decent amount of projects.
When I create a new work item, I can select only the server below 'classification' and not the specific project.

How can I allocate a work item directly to a project instead of the server?
Thanks!

答:
You could directly create work item  under the specific team project.  The simplest and effective way is through web portal.

Project--Work--New Work Item--Work Item Type

After this the a work item directly  allocated  to this project instead of the server.

In work item, several features depend on the team project or team that
  you have selected. For example, dashboards, backlogs, and board views
  will change depending on the context selected.

When you add a work item, the system references the default area and
  iteration paths defined for the team context. Work items you add
  from the team dashboard (new work item widget) and queries page are
  assigned the team default iteration. Work items you add from a team
  backlog or board, are assigned the team default backlog iteration.

You navigate to your team context from the top navigation bar.

If you are new to tfs work item, suggest you take a look at related tutorial in MSDN: Plan and track your project with work items. Besides in TFS, there is a concept of permission, also make sure your account have enough permission for the project and adding work item.

Title: TFS - Add work item to specific project


问:
Scroll textbox to the bottom automatically
I have a UserForm with TextBox and a vertical scrollbar. Text is appended to the textbox in the following way:

```<code> UserForm1.TextBox1.Value = UserForm1.TextBox1.Value & "**Opened file " & i & "**" & vbNewLine
</code>```

When there is too much text to show, the scrollbar doesn't scroll down to show the added text. I need to see that text in the process of the macro running.

I tried

```<code>UserForm1.TextBox1.CurLine = -1
</code>```

and

```<code>UserForm1.TextBox1.CurLine = UserForm1.TextBox1.LineCount-1
</code>```

答:
Here is the answer from

Auto scroll to bottom with a textbox

```<code>AppendText "Bla de bla bla."

sub AppendText(strText As String)
    with txtStatus
        .setfocus '//required
        .value = .value & strText & vbNewLine
        .selstart = len(.Value)
    end with
end sub
</code>```

ContentLicense: CC BY-SA 4.0

Body:
I have a UserForm with TextBox and a vertical scrollbar. Text is appended to the textbox in the following way:

 UserForm1.TextBox1.Value = UserForm1.TextBox1.Value & "**Opened file " & i & "**" & vbNewLine

When there is too much text to show, the scrollbar doesn't scroll down to show the added text. I need to see that text in the process of the macro running.

I tried

UserForm1.TextBox1.CurLine = -1

and

UserForm1.TextBox1.CurLine = UserForm1.TextBox1.LineCount-1

Body:
Here is the answer from

Auto scroll to bottom with a textbox

AppendText "Bla de bla bla."

sub AppendText(strText As String)
    with txtStatus
        .setfocus '//required
        .value = .value & strText & vbNewLine
        .selstart = len(.Value)
    end with
end sub


问:
getter method throwing StackOverflowError
I am trying to use data binding in the Android. But end up getting the StackOverflow error.

loginViewModel.kt

```<code>class loginViewModel(): BaseObservable() {

    @Bindable
    var errorEmail:String?=null
        get() {
            if (userEmailAddress.isNullOrBlank())
                return "Please Enter the Email Address"
            else if (!isValidEmail(userEmailAddress))
                return "Enter Valid Email Id."
            else
                return null
        }

    var userEmailAddress:String= String()
        set(userEmailAddress){
            field=userEmailAddress
            notifyPropertyChanged(R.id.email_address)
            /*to check Email for validation on every character inserted by user*/
            notifyPropertyChanged(BR.errorEmail)

        }
        get() {
        return userEmailAddress
    }

}
</code>```

Error log:

```<code>07-04 13:54:15.435 6865-6865/com.example.itstym.reminder D/AndroidRuntime: Shutting down VM
07-04 13:54:15.513 6865-6865/com.example.itstym.reminder E/AndroidRuntime: FATAL EXCEPTION: main
                                                                           Process: com.example.itstym.reminder, PID: 6865
                                                                           java.lang.StackOverflowError: stack size 8MB
                                                                               at com.example.itstym.reminder.loginViewModel.getUserEmailAddress(loginViewModel.kt:49)
                                                                               at com.example.itstym.reminder.loginViewModel.getUserEmailAddress(loginViewModel.kt:49)
</code>```

I know StackOverflow error occurs when there is any recursive call but I am not able to figure out how to solve this error?

```<code><?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android"
        xmlns:app="http://schemas.android.com/apk/res-auto"
        xmlns:tools="http://schemas.android.com/tools">

    <data class="ActivityMainBinding">
        <variable
            name="login"
            type="com.example.itstym.reminder.loginViewModel" />
    </data>

<android.support.constraint.ConstraintLayout
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context="com.example.itstym.reminder.MainActivity">

    <EditText
        app:error="@{login.errorEmail}"
        android:text="@{login.userEmailAddress}"
        android:hint="Email Address"
        android:id="@+id/email_address"
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        android:layout_marginEnd="8dp"
        android:layout_marginStart="8dp"
        android:ems="10"
        android:inputType="textPersonName"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toTopOf="parent"
        android:layout_marginTop="24dp"/>

</layout>
</code>```

答:
You should use field in your getter as well, otherwise it will recursively call itself:

```<code>var userEmailAddress: String = String()
    set(userEmailAddress){
        field = userEmailAddress
        ...
    }
    get() {
        return field // <-- here
    }
</code>```

Body:
I am trying to use data binding in the Android. But end up getting the StackOverflow error.

loginViewModel.kt

class loginViewModel(): BaseObservable() {

    @Bindable
    var errorEmail:String?=null
        get() {
            if (userEmailAddress.isNullOrBlank())
                return "Please Enter the Email Address"
            else if (!isValidEmail(userEmailAddress))
                return "Enter Valid Email Id."
            else
                return null
        }

    var userEmailAddress:String= String()
        set(userEmailAddress){
            field=userEmailAddress
            notifyPropertyChanged(R.id.email_address)
            /*to check Email for validation on every character inserted by user*/
            notifyPropertyChanged(BR.errorEmail)

        }
        get() {
        return userEmailAddress
    }

}

Error log:

07-04 13:54:15.435 6865-6865/com.example.itstym.reminder D/AndroidRuntime: Shutting down VM
07-04 13:54:15.513 6865-6865/com.example.itstym.reminder E/AndroidRuntime: FATAL EXCEPTION: main
                                                                           Process: com.example.itstym.reminder, PID: 6865
                                                                           java.lang.StackOverflowError: stack size 8MB
                                                                               at com.example.itstym.reminder.loginViewModel.getUserEmailAddress(loginViewModel.kt:49)
                                                                               at com.example.itstym.reminder.loginViewModel.getUserEmailAddress(loginViewModel.kt:49)

I know StackOverflow error occurs when there is any recursive call but I am not able to figure out how to solve this error?

<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android"
        xmlns:app="http://schemas.android.com/apk/res-auto"
        xmlns:tools="http://schemas.android.com/tools">

    <data class="ActivityMainBinding">
        <variable
            name="login"
            type="com.example.itstym.reminder.loginViewModel" />
    </data>

<android.support.constraint.ConstraintLayout
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context="com.example.itstym.reminder.MainActivity">

    <EditText
        app:error="@{login.errorEmail}"
        android:text="@{login.userEmailAddress}"
        android:hint="Email Address"
        android:id="@+id/email_address"
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        android:layout_marginEnd="8dp"
        android:layout_marginStart="8dp"
        android:ems="10"
        android:inputType="textPersonName"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toTopOf="parent"
        android:layout_marginTop="24dp"/>

</layout>

Body:
You should use field in your getter as well, otherwise it will recursively call itself:

var userEmailAddress: String = String()
    set(userEmailAddress){
        field = userEmailAddress
        ...
    }
    get() {
        return field // <-- here
    }


问:
Give different ID to each element in for loop
I have a far loop which check the number and output the result to number of that.

For exmaple, in below picture the "cut image" is displayed in multiples times. I have  tag in the far loop so it outputs the image according to number of times. And that number come from database.

MY Question.
Obviously all the images in first row will have same ID. Currently user can only click the first image of the row. I would like to give each element different ID  if possible. Than I would like to use JQuery to add click event. So if I click on 4th image in first row, it alert message and if i click 5th image it shows different alert message.

How I can assign different ID to each element in far loop so  it does only make first Image clickable but instead all elements clickable.

My loop

```<code> <table class="table table-bordered">
    <thead>
    <tbody>
      <tr>
        <?php
        for($x=0; $x < $row['noof10s_vnr']; $x++){
            ?>

            <td><img alt="" class="yellow-process center-block " id ="cut-full-roll-<?php echo $row['id_vnr']; ?>" name="<?php echo $row['id_vnr']; ?>" src="../../css/icons/vinyl-rolls/cut.png"></td>
        <?php
        }
        ?>

      </tr>
    </tbody>
  </table>
</code>```

My jquery selector
If I can give each element different ID, than I can do something like this to add clicked event to clicked image.

```<code>jQuery( "#vinyl-roll-down-<?php echo $row['id_vnr']; ?>" ).click(function() {
</code>```

But I need help assign different unique to each element in far loop.

Thanks in advance.

答:
```<code>$( ".yellow-process" ).bind("click",function() {
    var selected = $(this).attr("id");
    alert(selected); // to show the selected image id
    // use the variable selected to do something with it.
});
</code>```

Your php code written in the right way and working as expected just for jquery above is the working code

Body:
I have a far loop which check the number and output the result to number of that.

For exmaple, in below picture the "cut image" is displayed in multiples times. I have  tag in the far loop so it outputs the image according to number of times. And that number come from database.

MY Question.
Obviously all the images in first row will have same ID. Currently user can only click the first image of the row. I would like to give each element different ID  if possible. Than I would like to use JQuery to add click event. So if I click on 4th image in first row, it alert message and if i click 5th image it shows different alert message.

How I can assign different ID to each element in far loop so  it does only make first Image clickable but instead all elements clickable.

My loop

        <?php
        for($x=0; $x < $row['noof10s_vnr']; $x++){
            ?>

            <img alt="" class="yellow-process center-block " id ="cut-full-roll-<?php echo $row['id_vnr']; ?>" name="<?php echo $row['id_vnr']; ?>" src="../../css/icons/vinyl-rolls/cut.png">
        <?php
        }
        ?>

My jquery selector
If I can give each element different ID, than I can do something like this to add clicked event to clicked image.

jQuery( "#vinyl-roll-down-<?php echo $row['id_vnr']; ?>" ).click(function() {

But I need help assign different unique to each element in far loop.

Thanks in advance.

Body:
$( ".yellow-process" ).bind("click",function() {
    var selected = $(this).attr("id");
    alert(selected); // to show the selected image id
    // use the variable selected to do something with it.
});

Your php code written in the right way and working as expected just for jquery above is the working code


问:
What common database is used with ASP?
I know PHP and how to use MySQL with it but now I am moving onto ASP but which common database is used with ASP (ie. the equivalent to MySQL)?</p>

答:
It is Sql Server (Express editions are free) but you shouldn't let this be your only deciding factor. Besides, it doesn't really matter. The db is the back end, unseen by your clients, and you can connect to many, many types of DBs from ASP just as well as to Sql Server.

Your main consideration should be features, scalability etc. For the sake of picking up this dev stack quickly I would suggest sticking with MySql for you. That would be one less rather large piece of technology to learn!

Also: Are you moving onto ASP (classic) or ASP.NET? If it is ASP I would recommend that you reconsider and choose a more modern web development methodology such as ASP.NET MVC or Silverlight. I think that you will find ASP.NET MVC to your liking. In some ways it feels like ASP or PHP of old but with much more flexibility.

ContentLicense: CC BY-SA 2.5

Title: What common database is used with ASP?