pierredavidbelanger / chatter-bot-api

A Mono/.NET, JAVA, Python and PHP chatter bot API that supports Cleverbot, JabberWacky and Pandorabots.
181 stars 72 forks source link

The element type "hr" error -- JAVA #48

Closed thvardhan closed 7 years ago

thvardhan commented 7 years ago

Hello, I am hereby inform you that, this A.P.I. was working greatly however, Suddenly after today's evening when I executed the code I noticed this exception -> [Fatal Error] :6:3: The element type "hr" must be terminated by the matching end-tag "</hr>". [20:21:53] [DiscLoader/SEVERE]: org.xml.sax.SAXParseException; lineNumber: 6; columnNumber: 3; The element type "hr" must be terminated by the matching end-tag "</hr>". [20:21:53] [DiscLoader/SEVERE]: at com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(DOMParser.java:257) [20:21:53] [DiscLoader/SEVERE]: at com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:339) [20:21:53] [DiscLoader/SEVERE]: at javax.xml.parsers.DocumentBuilder.parse(DocumentBuilder.java:121) [20:21:53] [DiscLoader/SEVERE]: at com.google.code.chatterbotapi.Utils.xPathSearch(Utils.java:143) [20:21:53] [DiscLoader/SEVERE]: at com.google.code.chatterbotapi.Pandorabots$Session.think(Pandorabots.java:53) [20:21:53] [DiscLoader/SEVERE]: at com.google.code.chatterbotapi.Pandorabots$Session.think(Pandorabots.java:61) Its my first time experiencing this kind of exception with chatter-bot-api. This is my code -> try { message.channel.sendMessage(bot1session.think(a));/*a is never empty or null. Its a proper English sentence.*/ }catch (Exception e1){ e1.printStackTrace(); } Furthermore, I am using pandorabots bot. bot1 = factory.create(ChatterBotType.PANDORABOTS, "b0dafd24ee35a477");//Code from examples.

I hope you find this report valuable and fix this exception. Thank you

pierredavidbelanger commented 7 years ago

It is indeed a valuable report. I will have a look at this right now.

pierredavidbelanger commented 7 years ago

I found the cause.

Pandorabots API is now supporting secure (HTTPS) communications only (this is a good news), but every HTTP requests get redirected to HTTPS and the code do not follows the redirect, thus the error.

I will have to fix this is every port and release new versions.

I will do this today when I have a couple of minute.

Thank you

pierredavidbelanger commented 7 years ago

This should be fixed in all port of the master branch (and deployed to maven central as 1.4.7), and in the java port of the v2 branch (and deployed to maven central as 2.0.1)