XMPP error connecting to localhost

Hi ,

I am building a small use case where i am connecting my device making an xmpp connection through wifi to my localhost . In the hotspot window it is showing that the device is connected but when i access it through putty it is showing error as "

Exception in thread “main” XMPPError connecting to xx.xx.xx.xx:5222.: remote-server-error(502) XMPPError connecting to xx.xx.xx.xx:5222.

** – caused by: java.net.ConnectException: Connection timed out"**

How to solve this error?

Im openfire log i am getting error as "

org.jivesoftware.util.CertificateManager - Error decoding subjectAltName

java.lang.ClassCastException: org.bouncycastle.asn1.DERTaggedObject cannot be cast to org.bouncycastle.asn1.ASN1Sequence"

Anyone can help me ?

Thanks in advance

Nancy