yusongtaochn
yust此号已弃用
采纳率0%
2016-10-06 12:45 阅读 2.1k

webClient模拟登录网站报错

十月 06, 2016 8:42:18 下午 com.gargoylesoftware.htmlunit.IncorrectnessListenerImpl notify
警告: Obsolete content type encountered: 'text/javascript'.
十月 06, 2016 8:42:18 下午 com.gargoylesoftware.htmlunit.IncorrectnessListenerImpl notify
警告: Obsolete content type encountered: 'text/javascript'.
十月 06, 2016 8:42:18 下午 com.gargoylesoftware.htmlunit.IncorrectnessListenerImpl notify
警告: Obsolete content type encountered: 'text/javascript'.
十月 06, 2016 8:42:18 下午 com.gargoylesoftware.htmlunit.NicelyResynchronizingAjaxController processSynchron
信息: Re-synchronized call to http://172.16.51.37/notice_listJSON.html
十月 06, 2016 8:42:18 下午 com.gargoylesoftware.htmlunit.IncorrectnessListenerImpl notify
警告: Obsolete content type encountered: 'text/javascript'.
十月 06, 2016 8:42:19 下午 com.gargoylesoftware.htmlunit.IncorrectnessListenerImpl notify
警告: Obsolete content type encountered: 'text/javascript'.
十月 06, 2016 8:42:19 下午 com.gargoylesoftware.htmlunit.IncorrectnessListenerImpl notify
警告: Obsolete content type encountered: 'text/javascript'.
十月 06, 2016 8:42:19 下午 com.gargoylesoftware.htmlunit.IncorrectnessListenerImpl notify
警告: Obsolete content type encountered: 'text/javascript'.
十月 06, 2016 8:42:19 下午 com.gargoylesoftware.htmlunit.IncorrectnessListenerImpl notify
警告: Obsolete content type encountered: 'text/javascript'.
十月 06, 2016 8:42:19 下午 com.gargoylesoftware.htmlunit.IncorrectnessListenerImpl notify
警告: Obsolete content type encountered: 'text/javascript'.
十月 06, 2016 8:42:19 下午 com.gargoylesoftware.htmlunit.javascript.StrictErrorReporter error
严重: error: message=[missing { before function body] sourceName=[script in http://172.16.51.37/home_welcome.html from (85, 36) to (106, 10)] line=[87] lineSource=[ function initArray()...{ ] lineOffset=[26]
十月 06, 2016 8:42:19 下午 com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine handleJavaScriptException
信息: Caught script exception
======= EXCEPTION START ========
Exception class=[net.sourceforge.htmlunit.corejs.javascript.EvaluatorException]
com.gargoylesoftware.htmlunit.ScriptException: missing { before function body (script in http://172.16.51.37/home_welcome.html from (85, 36) to (106, 10)#87)
at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine$HtmlUnitContextAction.run(JavaScriptEngine.java:921)
at net.sourceforge.htmlunit.corejs.javascript.Context.call(Context.java:628)
at net.sourceforge.htmlunit.corejs.javascript.ContextFactory.call(ContextFactory.java:515)
at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine.compile(JavaScriptEngine.java:746)
at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine.compile(JavaScriptEngine.java:711)
at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine.execute(JavaScriptEngine.java:763)
at com.gargoylesoftware.htmlunit.html.HtmlPage.executeJavaScriptIfPossible(HtmlPage.java:904)
at com.gargoylesoftware.htmlunit.html.HtmlScript.executeInlineScriptIfNeeded(HtmlScript.java:307)
at com.gargoylesoftware.htmlunit.html.HtmlScript.executeScriptIfNeeded(HtmlScript.java:368)
at com.gargoylesoftware.htmlunit.html.HtmlScript$2.execute(HtmlScript.java:238)
at com.gargoylesoftware.htmlunit.html.HtmlScript.onAllChildrenAddedToPage(HtmlScript.java:257)
at com.gargoylesoftware.htmlunit.html.HTMLParser$HtmlUnitDOMBuilder.endElement(HTMLParser.java:772)
at org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown Source)
at com.gargoylesoftware.htmlunit.html.HTMLParser$HtmlUnitDOMBuilder.endElement(HTMLParser.java:729)
at net.sourceforge.htmlunit.cyberneko.HTMLTagBalancer.callEndElement(HTMLTagBalancer.java:1209)
at net.sourceforge.htmlunit.cyberneko.HTMLTagBalancer.endElement(HTMLTagBalancer.java:1111)
at net.sourceforge.htmlunit.cyberneko.filters.DefaultFilter.endElement(DefaultFilter.java:207)
at net.sourceforge.htmlunit.cyberneko.filters.NamespaceBinder.endElement(NamespaceBinder.java:337)
at net.sourceforge.htmlunit.cyberneko.HTMLScanner$ContentScanner.scanEndElement(HTMLScanner.java:3137)
at net.sourceforge.htmlunit.cyberneko.HTMLScanner$ContentScanner.scan(HTMLScanner.java:2100)
at net.sourceforge.htmlunit.cyberneko.HTMLScanner.scanDocument(HTMLScanner.java:927)
at net.sourceforge.htmlunit.cyberneko.HTMLConfiguration.parse(HTMLConfiguration.java:506)
at net.sourceforge.htmlunit.cyberneko.HTMLConfiguration.parse(HTMLConfiguration.java:459)
at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
at com.gargoylesoftware.htmlunit.html.HTMLParser$HtmlUnitDOMBuilder.parse(HTMLParser.java:979)
at com.gargoylesoftware.htmlunit.html.HTMLParser.parse(HTMLParser.java:241)
at com.gargoylesoftware.htmlunit.html.HTMLParser.parseHtml(HTMLParser.java:187)
at com.gargoylesoftware.htmlunit.DefaultPageCreator.createHtmlPage(DefaultPageCreator.java:269)
at com.gargoylesoftware.htmlunit.DefaultPageCreator.createPage(DefaultPageCreator.java:157)
at com.gargoylesoftware.htmlunit.WebClient.loadWebResponseInto(WebClient.java:512)
at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:386)
at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:304)
at com.gargoylesoftware.htmlunit.html.BaseFrameElement.loadInnerPageIfPossible(BaseFrameElement.java:184)
at com.gargoylesoftware.htmlunit.html.BaseFrameElement.loadInnerPage(BaseFrameElement.java:122)
at com.gargoylesoftware.htmlunit.html.HtmlPage.loadFrames(HtmlPage.java:1818)
at com.gargoylesoftware.htmlunit.html.HtmlPage.initialize(HtmlPage.java:226)
at com.gargoylesoftware.htmlunit.WebClient.loadWebResponseInto(WebClient.java:519)
at com.gargoylesoftware.htmlunit.WebClient.loadDownloadedResponses(WebClient.java:2147)
at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine.doProcessPostponedActions(JavaScriptEngine.java:946)
at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine.processPostponedActions(JavaScriptEngine.java:1033)
at com.gargoylesoftware.htmlunit.html.DomElement.click(DomElement.java:806)
at com.gargoylesoftware.htmlunit.html.DomElement.click(DomElement.java:749)
at com.gargoylesoftware.htmlunit.html.DomElement.click(DomElement.java:696)
at TestC.main(TestC.java:45)

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享

2条回答 默认 最新

  • yusongtaochn yust此号已弃用 2016-10-06 12:46

    Caused by: net.sourceforge.htmlunit.corejs.javascript.EvaluatorException: missing { before function body (script in http://172.16.51.37/home_welcome.html from (85, 36) to (106, 10)#87)
    at com.gargoylesoftware.htmlunit.javascript.StrictErrorReporter.error(StrictErrorReporter.java:65)
    at net.sourceforge.htmlunit.corejs.javascript.Parser.addError(Parser.java:188)
    at net.sourceforge.htmlunit.corejs.javascript.Parser.addError(Parser.java:167)
    at net.sourceforge.htmlunit.corejs.javascript.Parser.reportError(Parser.java:255)
    at net.sourceforge.htmlunit.corejs.javascript.Parser.reportError(Parser.java:244)
    at net.sourceforge.htmlunit.corejs.javascript.Parser.reportError(Parser.java:237)
    at net.sourceforge.htmlunit.corejs.javascript.Parser.parseFunctionBody(Parser.java:627)
    at net.sourceforge.htmlunit.corejs.javascript.Parser.function(Parser.java:829)
    at net.sourceforge.htmlunit.corejs.javascript.Parser.parse(Parser.java:548)
    at net.sourceforge.htmlunit.corejs.javascript.Parser.parse(Parser.java:492)
    at net.sourceforge.htmlunit.corejs.javascript.Context.compileImpl(Context.java:2660)
    at net.sourceforge.htmlunit.corejs.javascript.Context.compileString(Context.java:1623)
    at com.gargoylesoftware.htmlunit.javascript.HtmlUnitContextFactory$TimeoutContext.compileString(HtmlUnitContextFactory.java:172)
    at net.sourceforge.htmlunit.corejs.javascript.Context.compileString(Context.java:1615)
    at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine$2.doRun(JavaScriptEngine.java:737)
    at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine$HtmlUnitContextAction.run(JavaScriptEngine.java:906)
    ... 43 more
    Enclosed exception:
    net.sourceforge.htmlunit.corejs.javascript.EvaluatorException: missing { before function body (script in http://172.16.51.37/home_welcome.html from (85, 36) to (106, 10)#87)
    at com.gargoylesoftware.htmlunit.javascript.StrictErrorReporter.error(StrictErrorReporter.java:65)
    at net.sourceforge.htmlunit.corejs.javascript.Parser.addError(Parser.java:188)
    at net.sourceforge.htmlunit.corejs.javascript.Parser.addError(Parser.java:167)
    at net.sourceforge.htmlunit.corejs.javascript.Parser.reportError(Parser.java:255)
    at net.sourceforge.htmlunit.corejs.javascript.Parser.reportError(Parser.java:244)
    at net.sourceforge.htmlunit.corejs.javascript.Parser.reportError(Parser.java:237)
    at net.sourceforge.htmlunit.corejs.javascript.Parser.parseFunctionBody(Parser.java:627)
    at net.sourceforge.htmlunit.corejs.javascript.Parser.function(Parser.java:829)
    at net.sourceforge.htmlunit.corejs.javascript.Parser.parse(Parser.java:548)
    at net.sourceforge.htmlunit.corejs.javascript.Parser.parse(Parser.java:492)
    at net.sourceforge.htmlunit.corejs.javascript.Context.compileImpl(Context.java:2660)
    at net.sourceforge.htmlunit.corejs.javascript.Context.compileString(Context.java:1623)
    at com.gargoylesoftware.htmlunit.javascript.HtmlUnitContextFactory$TimeoutContext.compileString(HtmlUnitContextFactory.java:172)
    at net.sourceforge.htmlunit.corejs.javascript.Context.compileString(Context.java:1615)
    at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine$2.doRun(JavaScriptEngine.java:737)
    at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine$HtmlUnitContextAction.run(JavaScriptEngine.java:906)
    at net.sourceforge.htmlunit.corejs.javascript.Context.call(Context.java:628)
    at net.sourceforge.htmlunit.corejs.javascript.ContextFactory.call(ContextFactory.java:515)
    at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine.compile(JavaScriptEngine.java:746)
    at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine.compile(JavaScriptEngine.java:711)
    at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine.execute(JavaScriptEngine.java:763)
    at com.gargoylesoftware.htmlunit.html.HtmlPage.executeJavaScriptIfPossible(HtmlPage.java:904)
    at com.gargoylesoftware.htmlunit.html.HtmlScript.executeInlineScriptIfNeeded(HtmlScript.java:307)
    at com.gargoylesoftware.htmlunit.html.HtmlScript.executeScriptIfNeeded(HtmlScript.java:368)
    at com.gargoylesoftware.htmlunit.html.HtmlScript$2.execute(HtmlScript.java:238)
    at com.gargoylesoftware.htmlunit.html.HtmlScript.onAllChildrenAddedToPage(HtmlScript.java:257)
    at com.gargoylesoftware.htmlunit.html.HTMLParser$HtmlUnitDOMBuilder.endElement(HTMLParser.java:772)
    at org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown Source)
    at com.gargoylesoftware.htmlunit.html.HTMLParser$HtmlUnitDOMBuilder.endElement(HTMLParser.java:729)
    at net.sourceforge.htmlunit.cyberneko.HTMLTagBalancer.callEndElement(HTMLTagBalancer.java:1209)
    at net.sourceforge.htmlunit.cyberneko.HTMLTagBalancer.endElement(HTMLTagBalancer.java:1111)
    at net.sourceforge.htmlunit.cyberneko.filters.DefaultFilter.endElement(DefaultFilter.java:207)
    at net.sourceforge.htmlunit.cyberneko.filters.NamespaceBinder.endElement(NamespaceBinder.java:337)
    at net.sourceforge.htmlunit.cyberneko.HTMLScanner$ContentScanner.scanEndElement(HTMLScanner.java:3137)
    at net.sourceforge.htmlunit.cyberneko.HTMLScanner$ContentScanner.scan(HTMLScanner.java:2100)
    at net.sourceforge.htmlunit.cyberneko.HTMLScanner.scanDocument(HTMLScanner.java:927)
    at net.sourceforge.htmlunit.cyberneko.HTMLConfiguration.parse(HTMLConfiguration.java:506)
    at net.sourceforge.htmlunit.cyberneko.HTMLConfiguration.parse(HTMLConfiguration.java:459)
    at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
    at com.gargoylesoftware.htmlunit.html.HTMLParser$HtmlUnitDOMBuilder.parse(HTMLParser.java:979)
    at com.gargoylesoftware.htmlunit.html.HTMLParser.parse(HTMLParser.java:241)
    at com.gargoylesoftware.htmlunit.html.HTMLParser.parseHtml(HTMLParser.java:187)
    at com.gargoylesoftware.htmlunit.DefaultPageCreator.createHtmlPage(DefaultPageCreator.java:269)
    at com.gargoylesoftware.htmlunit.DefaultPageCreator.createPage(DefaultPageCreator.java:157)
    at com.gargoylesoftware.htmlunit.WebClient.loadWebResponseInto(WebClient.java:512)
    at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:386)
    at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:304)
    at com.gargoylesoftware.htmlunit.html.BaseFrameElement.loadInnerPageIfPossible(BaseFrameElement.java:184)
    at com.gargoylesoftware.htmlunit.html.BaseFrameElement.loadInnerPage(BaseFrameElement.java:122)
    at com.gargoylesoftware.htmlunit.html.HtmlPage.loadFrames(HtmlPage.java:1818)
    at com.gargoylesoftware.htmlunit.html.HtmlPage.initialize(HtmlPage.java:226)
    at com.gargoylesoftware.htmlunit.WebClient.loadWebResponseInto(WebClient.java:519)
    at com.gargoylesoftware.htmlunit.WebClient.loadDownloadedResponses(WebClient.java:2147)
    at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine.doProcessPostponedActions(JavaScriptEngine.java:946)
    at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine.processPostponedActions(JavaScriptEngine.java:1033)
    at com.gargoylesoftware.htmlunit.html.DomElement.click(DomElement.java:806)
    at com.gargoylesoftware.htmlunit.html.DomElement.click(DomElement.java:749)
    at com.gargoylesoftware.htmlunit.html.DomElement.click(DomElement.java:696)
    at TestC.main(TestC.java:45)
    == CALLING JAVASCRIPT ==

    today=new Date(); 
    function initArray()...{ 
    this.length=initArray.arguments.length 
    for(var i=0;i<this.length;i++) 
    this[i+1]=initArray.arguments[i] } 
    var d=new initArray( 
    "星期日", 
    "星期一", 
    "星期二", 
    "星期三", 
    "星期四", 
    "星期五", 
    "星期六"); 
    document.write( 
    "<font style='font-size:9pt;font-family: 宋体''> ", 
    today.getYear(),"年", 
    today.getMonth()+1,"月", 
    today.getDate(),"日", 
    d[today.getDay()+1], 
    "</font>" );  
    

    ======= EXCEPTION END ========

    点赞 评论 复制链接分享
  • yusongtaochn yust此号已弃用 2016-10-06 12:47

    有玩过这个的吗?求解答。

    点赞 评论 复制链接分享

相关推荐