kwatters / program-ab

ProgramAB - KWatters' fork. This is a custom version of ProgramAB that extends some functionality to support more features and better integration with MyRobotLab.
Apache License 2.0
2 stars 4 forks source link

Check for corrupted aiml files #3

Open moz4r opened 6 years ago

moz4r commented 6 years ago

Kwatters, I not yet tested your last mods, maybe we can intercept NPE now. This is the issue, if there is some corrupted aiml in the set : ( seem not blocking inside eclipse, but cause issues inside standalone jar )

[Fatal Error] client_profile.aiml:877:33: XML document structures must start and end within the same entity. AIMLToCategories: org.xml.sax.SAXParseException; systemId: file:/C:/Users/moz4r/git/myrobotlab/ProgramAB/bots/en-US/aiml/client_profile.aiml; lineNumber: 877; columnNumber: 33; XML document structures must start and end within the same entity. Problem loading client_profile.aiml contactaction.aiml org.xml.sax.SAXParseException; systemId: file:/C:/Users/moz4r/git/myrobotlab/ProgramAB/bots/en-US/aiml/client_profile.aiml; lineNumber: 877; columnNumber: 33; XML document structures must start and end within the same entity. at org.apache.xerces.parsers.DOMParser.parse(Unknown Source) at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(Unknown Source) at javax.xml.parsers.DocumentBuilder.parse(Unknown Source) at org.alicebot.ab.utils.DomUtils.parseFile(DomUtils.java:30) at org.alicebot.ab.AIMLProcessor.AIMLToCategories(AIMLProcessor.java:119) at org.alicebot.ab.Bot.addCategoriesFromAIML(Bot.java:242) at org.alicebot.ab.Bot.<init>(Bot.java:169) at org.alicebot.ab.Bot.<init>(Bot.java:108) at org.myrobotlab.service.ProgramAB.startSession(ProgramAB.java:679) at org.myrobotlab.service.ProgramAB.startSession(ProgramAB.java:650) at org.myrobotlab.service.ProgramAB.main(ProgramAB.java:908) java.lang.NullPointerException at org.alicebot.ab.Bot.addMoreCategories(Bot.java:211) at org.alicebot.ab.Bot.addCategoriesFromAIML(Bot.java:243) at org.alicebot.ab.Bot.<init>(Bot.java:169) at org.alicebot.ab.Bot.<init>(Bot.java:108) at org.myrobotlab.service.ProgramAB.startSession(ProgramAB.java:679) at org.myrobotlab.service.ProgramAB.startSession(ProgramAB.java:650) at org.myrobotlab.service.ProgramAB.main(ProgramAB.java:908) [Fatal Error] contactaction.aiml:866:453: XML document structures must start and end within the same entity. AIMLToCategories: org.xml.sax.SAXParseException; systemId: file:/C:/Users/moz4r/git/myrobotlab/ProgramAB/bots/en-US/aiml/contactaction.aiml; lineNumber: 866; columnNumber: 453; XML document structures must start and end within the same entity. org.xml.sax.SAXParseException; systemId: file:/C:/Users/moz4r/git/myrobotlab/ProgramAB/bots/en-US/aiml/contactaction.aiml; lineNumber: 866; columnNumber: 453; XML document structures must start and end within the same entity. at org.apache.xerces.parsers.DOMParser.parse(Unknown Source) at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(Unknown Source) at javax.xml.parsers.DocumentBuilder.parse(Unknown Source) at org.alicebot.ab.utils.DomUtils.parseFile(DomUtils.java:30) at org.alicebot.ab.AIMLProcessor.AIMLToCategories(AIMLProcessor.java:119) at org.alicebot.ab.Bot.addCategoriesFromAIML(Bot.java:242) at org.alicebot.ab.Bot.<init>(Bot.java:169) at org.alicebot.ab.Bot.<init>(Bot.java:108) at org.myrobotlab.service.ProgramAB.startSession(ProgramAB.java:679) at org.myrobotlab.service.ProgramAB.startSession(ProgramAB.java:650) at org.myrobotlab.service.ProgramAB.main(ProgramAB.java:908) Problem loading contactaction.aiml java.lang.NullPointerException at org.alicebot.ab.Bot.addMoreCategories(Bot.java:211) at org.alicebot.ab.Bot.addCategoriesFromAIML(Bot.java:243) at org.alicebot.ab.Bot.<init>(Bot.java:169) at org.alicebot.ab.Bot.<init>(Bot.java:108) at org.myrobotlab.service.ProgramAB.startSession(ProgramAB.java:679) at org.myrobotlab.service.ProgramAB.startSession(ProgramAB.java:650) at org.myrobotlab.service.ProgramAB.main(ProgramAB.java:908)

kwatters commented 6 years ago

these are properly logged in the myrobotlab.log file now.. previously these were just written to stdout, so you'd never know they were happening.