当前位置: 代码迷 >> Eclipse >> Agent Controller XML解析出错.情!
  详细解决方案

Agent Controller XML解析出错.情!

热度:746   发布时间:2016-04-23 15:01:27
Agent Controller XML解析出错.情高手指点!!
我在用Agent   Controller   进行远程的数据收集时   client   端用的JAVA   ,agent   端用的c++.出现如下错误,程序最终还是可以得出结果.但速度很慢,大概要5到8分钟,这显然不能达到要求.   但我在client   端用c++   写的程序却可以很好的跟agent通信....
我的环境:winxp   +sp2   ,   agntctrl.win_ia32-TPTP-4.2.1.rar   ,   tptpdc.win_ia32-TPTP-4.2.1.zip
j2sdk1.4.2_07   ,   VC++6.0   .
不知道为什么无法解析XML,
下面是出错信息和部分代码:
Connecting   to   Host   localhost
Connecting   to   AC..
Connected   to   localhost   at   port   number   10006
org.xml.sax.SAXParseException:   下一个字符必须是 "> "   终止组件   "Cmd "。
at   org.apache.crimson.parser.Parser2.fatal(Unknown   Source)
at   org.apache.crimson.parser.Parser2.fatal(Unknown   Source)
at   org.apache.crimson.parser.Parser2.nextChar(Unknown   Source)
at   org.apache.crimson.parser.Parser2.maybeElement(Unknown   Source)
at   org.apache.crimson.parser.Parser2.parseInternal(Unknown   Source)
at   org.apache.crimson.parser.Parser2.parse(Unknown   Source)
at   org.apache.crimson.parser.XMLReaderImpl.parse(Unknown   Source)
at   javax.xml.parsers.SAXParser.parse(Unknown   Source)
at   org.eclipse.tptp.platform.execution.util.internal.TPTPXMLParse.setParser(TPTPXMLParse.java:105)
at   org.eclipse.tptp.platform.execution.client.core.internal.ControlMessage.readACCommands(ControlMessage.java:421)
at   org.eclipse.tptp.platform.execution.client.core.internal.ControlMessage.readFromBuffer(ControlMessage.java:301)
at   org.eclipse.tptp.platform.execution.client.core.internal.ConnectionImpl.processControlMessage(ConnectionImpl.java:803)
at   org.eclipse.tptp.platform.execution.client.core.internal.ConnectionImpl$SocketReaderThread.run(ConnectionImpl.java:1021)
org.xml.sax.SAXParseException:   下一个字符必须是 "> "   终止组件   "Cmd "。
at   org.apache.crimson.parser.Parser2.fatal(Unknown   Source)
at   org.apache.crimson.parser.Parser2.fatal(Unknown   Source)
at   org.apache.crimson.parser.Parser2.nextChar(Unknown   Source)
at   org.apache.crimson.parser.Parser2.maybeElement(Unknown   Source)
at   org.apache.crimson.parser.Parser2.parseInternal(Unknown   Source)
at   org.apache.crimson.parser.Parser2.parse(Unknown   Source)
at   org.apache.crimson.parser.XMLReaderImpl.parse(Unknown   Source)
at   javax.xml.parsers.SAXParser.parse(Unknown   Source)
at   org.eclipse.tptp.platform.execution.util.internal.TPTPXMLParse.setParser(TPTPXMLParse.java:105)
at   org.eclipse.tptp.platform.execution.client.core.internal.AgentController.getAgent(AgentController.java:279)
at   org.eclipse.tptp.platform.execution.client.core.internal.AgentController.getAgent(AgentController.java:193)
at   org.eclipse.tptp.platform.execution.samples.SampleClientAC.main(SampleClientAC.java:92)
org.eclipse.tptp.platform.execution.exceptions.TimeoutException:   Launching   Process   command   timed   out.
at   org.eclipse.tptp.platform.execution.client.agent.internal.AgentImpl.startMonitoring(AgentImpl.java:438)
at   org.eclipse.tptp.platform.execution.samples.SampleClientAC.main(SampleClientAC.java:101)

Client   断JAVA程序代码:
public   Tsdriver   (String   localhost,int   port){

this.localhost=localhost;
this.port=port;
//System.out.println( "Connecting   to   Host:   "+   this.localhost   + "   port: "+this.port);
创建一个AC节点
INode   SampleNode   =   null;

IAgentController   ac   =   null;
  相关解决方案