jcase16 - 2006-06-06

I am writing code to login in to a webpage to periodically check information for my personal use.  The code I am using, used to work, but stopped working a couple of months ago.  I have tried everything that I can think of and am to the point that I'm debating finding something else to try this because I need this to work.  If you can help with anything, please do.  This is very frustrating as you all know. 

Here's how it works.  I grab the site, I put in my name and password, then submit the form.  What returns is undecipherable to me.  It appears as if it is loading an error page that says the site has moved.  As far as I can tell this page doesn't exist when I try to find it.  One other thing I noticed is that it gives the error: "java.lang.RuntimeException: Event 'return resetCookies();"

I do not know javascript well enough to understand this.  Also, I don't think it is the root cause since it is not the first error thrown, but I'm I could very well be wrong.  Please help if you can.

Here is the code, followed by the error:

try{
   WebConversation wc = new WebConversation();
   WebRequest     req = new GetMethodWebRequest( "https://login.byu.edu/login.fcc" );
   WebResponse   resp = wc.getResponse( req );
   WebForm[] form = resp.getForms();
   String[] params = form[0].getParameterNames();
   WebLink[] links = resp.getLinks();
   form[0].setParameter(params[0], "####");
   form[0].setParameter(params[2], "####");
   resp = form[0].submit();
   System.out.println(resp.getText());
}catch(Exception e){e.printStackTrace();}

Error message:

SyntaxError: syntax error (httpunit; )
        at org.mozilla.javascript.NativeGlobal.constructError(NativeGlobal.java:597)
        at org.mozilla.javascript.TokenStream.reportSyntaxError(TokenStream.java:1324)
        at org.mozilla.javascript.Parser.reportError(Parser.java:73)
        at org.mozilla.javascript.Parser.primaryExpr(Parser.java:1411)
        at org.mozilla.javascript.Parser.memberExpr(Parser.java:1201)
        at org.mozilla.javascript.Parser.unaryExpr(Parser.java:1115)
        at org.mozilla.javascript.Parser.mulExpr(Parser.java:1062)
        at org.mozilla.javascript.Parser.addExpr(Parser.java:1045)
        at org.mozilla.javascript.Parser.shiftExpr(Parser.java:1032)
        at org.mozilla.javascript.Parser.relExpr(Parser.java:1015)
        at org.mozilla.javascript.Parser.eqExpr(Parser.java:1002)
        at org.mozilla.javascript.Parser.bitAndExpr(Parser.java:991)
        at org.mozilla.javascript.Parser.bitXorExpr(Parser.java:980)
        at org.mozilla.javascript.Parser.bitOrExpr(Parser.java:969)
        at org.mozilla.javascript.Parser.andExpr(Parser.java:957)
        at org.mozilla.javascript.Parser.orExpr(Parser.java:945)
        at org.mozilla.javascript.Parser.condExpr(Parser.java:928)
        at org.mozilla.javascript.Parser.assignExpr(Parser.java:909)
        at org.mozilla.javascript.Parser.expr(Parser.java:898)
        at org.mozilla.javascript.Parser.statementHelper(Parser.java:791)
        at org.mozilla.javascript.Parser.statement(Parser.java:387)
        at org.mozilla.javascript.Parser.parse(Parser.java:128)
        at org.mozilla.javascript.Context.compile(Context.java:2053)
        at org.mozilla.javascript.Context.compile(Context.java:2006)
        at org.mozilla.javascript.Context.compileReader(Context.java:899)
        at org.mozilla.javascript.Context.evaluateReader(Context.java:817)
        at org.mozilla.javascript.Context.evaluateString(Context.java:784)
        at com.meterware.httpunit.javascript.JavaScript$JavaScriptEngine.executeScript(JavaScript.java:132)
        at com.meterware.httpunit.scripting.ScriptableDelegate.runScript(ScriptableDelegate.java:65)
        at com.meterware.httpunit.parsing.ScriptFilter.getTranslatedScript(ScriptFilter.java:151)
        at com.meterware.httpunit.parsing.ScriptFilter.endElement(ScriptFilter.java:131)
        at org.cyberneko.html.filters.DefaultFilter.endElement(Unknown Source)
        at org.cyberneko.html.filters.NamespaceBinder.endElement(Unknown Source)
        at org.cyberneko.html.HTMLTagBalancer.callEndElement(Unknown Source)
        at org.cyberneko.html.HTMLTagBalancer.endElement(Unknown Source)
        at org.cyberneko.html.HTMLScanner$SpecialScanner.scan(Unknown Source)
        at org.cyberneko.html.HTMLScanner.scanDocument(Unknown Source)
        at org.cyberneko.html.HTMLConfiguration.parse(Unknown Source)
        at org.cyberneko.html.HTMLConfiguration.parse(Unknown Source)
        at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
        at org.apache.xerces.parsers.DOMParser.parse(Unknown Source)
        at com.meterware.httpunit.parsing.NekoHTMLParser.parse(NekoHTMLParser.java:41)
        at com.meterware.httpunit.HTMLPage.parse(HTMLPage.java:255)
        at com.meterware.httpunit.WebResponse.getReceivedPage(WebResponse.java:1109)
        at com.meterware.httpunit.WebResponse.getFrames(WebResponse.java:1098)
        at com.meterware.httpunit.WebResponse.getFrameRequests(WebResponse.java:875)
        at com.meterware.httpunit.FrameHolder.updateFrames(FrameHolder.java:179)
        at com.meterware.httpunit.WebWindow.updateFrameContents(WebWindow.java:252)
        at com.meterware.httpunit.WebClient.updateFrameContents(WebClient.java:485)
        at com.meterware.httpunit.WebWindow.updateWindow(WebWindow.java:146)
        at com.meterware.httpunit.WebWindow.getSubframeResponse(WebWindow.java:130)
        at com.meterware.httpunit.WebWindow.getResponse(WebWindow.java:121)
        at com.meterware.httpunit.WebWindow.updateWindow(WebWindow.java:144)
        at com.meterware.httpunit.WebWindow.getSubframeResponse(WebWindow.java:130)
        at com.meterware.httpunit.WebWindow.getResponse(WebWindow.java:121)
        at com.meterware.httpunit.WebWindow.updateWindow(WebWindow.java:144)
        at com.meterware.httpunit.WebWindow.getSubframeResponse(WebWindow.java:130)
        at com.meterware.httpunit.WebWindow.getResponse(WebWindow.java:121)
        at com.meterware.httpunit.WebWindow.sendRequest(WebWindow.java:110)
        at com.meterware.httpunit.WebRequestSource.submitRequest(WebRequestSource.java:253)
        at com.meterware.httpunit.WebForm$Scriptable.submit(WebForm.java:702)
        at com.meterware.httpunit.javascript.JavaScript$Form.jsFunction_submit(JavaScript.java:983)
        at inv2.invoke()
        at org.mozilla.javascript.FunctionObject.doInvoke(FunctionObject.java:498)
        at org.mozilla.javascript.FunctionObject.call(FunctionObject.java:413)
        at org.mozilla.javascript.ScriptRuntime.call(ScriptRuntime.java:1191)
        at org.mozilla.javascript.gen.c6.call(httpunit:57)
        at org.mozilla.javascript.Interpreter.interpret(Interpreter.java:2169)
        at org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:58)
        at com.meterware.httpunit.javascript.JavaScript$JavaScriptEngine.performEvent(JavaScript.java:172)
        at com.meterware.httpunit.scripting.ScriptableDelegate.doEvent(ScriptableDelegate.java:56)
        at com.meterware.httpunit.WebRequestSource.submitRequest(WebRequestSource.java:232)
        at com.meterware.httpunit.WebForm.submitRequest(WebForm.java:96)
        at com.meterware.httpunit.WebForm.doFormSubmit(WebForm.java:107)
        at com.meterware.httpunit.WebForm.submit(WebForm.java:69)
        at com.meterware.httpunit.WebForm.submit(WebForm.java:58)
        at edu.byu.isys403.jsc82.pagescraper.Main.main(Main.java:54)
org.mozilla.javascript.JavaScriptException: com.meterware.httpunit.ScriptException: Script '<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>302 Found</title>
</head><body>
<h1>Found</h1>
<p>The document has moved <a href="https://login.byu.edu/login.fcc?TYPE=33554433&amp;REALMOID=06-000e719e-d055-1d80-a271-831932cf0000&amp;GUID=&amp;SMAUTHREASON=0&amp;METHOD=GET&amp;SMAGENTNAME=$SM$iuSegVNP8%2bkqd3pDujmhr9ZhYtltvZXRubJ5cFd0nkDXojtOT2xoeA%3d%3d&amp;TARGET=$SM$https%3a%2f%2fy%2ebyu%2eedu%2fry%2fae%2fprod%2fjs%2fna%2ejs">here</a>.</p>
</body></html>' failed: SyntaxError: syntax error (httpunit; )
        at org.mozilla.javascript.JavaScriptException.wrapException(JavaScriptException.java:70)
        at org.mozilla.javascript.FunctionObject.call(FunctionObject.java:418)
        at org.mozilla.javascript.ScriptRuntime.call(ScriptRuntime.java:1191)
        at org.mozilla.javascript.gen.c6.call(httpunit:57)
        at org.mozilla.javascript.Interpreter.interpret(Interpreter.java:2169)
        at org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:58)
        at com.meterware.httpunit.javascript.JavaScript$JavaScriptEngine.performEvent(JavaScript.java:172)
        at com.meterware.httpunit.scripting.ScriptableDelegate.doEvent(ScriptableDelegate.java:56)
        at com.meterware.httpunit.WebRequestSource.submitRequest(WebRequestSource.java:232)
        at com.meterware.httpunit.WebForm.submitRequest(WebForm.java:96)
        at com.meterware.httpunit.WebForm.doFormSubmit(WebForm.java:107)
        at com.meterware.httpunit.WebForm.submit(WebForm.java:69)
        at com.meterware.httpunit.WebForm.submit(WebForm.java:58)
        at edu.byu.isys403.jsc82.pagescraper.Main.main(Main.java:54)
java.lang.RuntimeException: Event 'return resetCookies();' failed: org.mozilla.javascript.JavaScriptException: com.meterware.httpunit.ScriptException: Script '<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>302 Found</title>
</head><body>
<h1>Found</h1>
<p>The document has moved <a href="https://login.byu.edu/login.fcc?TYPE=33554433&amp;REALMOID=06-000e719e-d055-1d80-a271-831932cf0000&amp;GUID=&amp;SMAUTHREASON=0&amp;METHOD=GET&amp;SMAGENTNAME=$SM$iuSegVNP8%2bkqd3pDujmhr9ZhYtltvZXRubJ5cFd0nkDXojtOT2xoeA%3d%3d&amp;TARGET=$SM$https%3a%2f%2fy%2ebyu%2eedu%2fry%2fae%2fprod%2fjs%2fna%2ejs">here</a>.</p>
</body></html>' failed: SyntaxError: syntax error (httpunit; )
        at com.meterware.httpunit.javascript.JavaScript$JavaScriptEngine.handleScriptException(JavaScript.java:199)
        at com.meterware.httpunit.javascript.JavaScript$JavaScriptEngine.performEvent(JavaScript.java:175)
        at com.meterware.httpunit.scripting.ScriptableDelegate.doEvent(ScriptableDelegate.java:56)
        at com.meterware.httpunit.WebRequestSource.submitRequest(WebRequestSource.java:232)
        at com.meterware.httpunit.WebForm.submitRequest(WebForm.java:96)
        at com.meterware.httpunit.WebForm.doFormSubmit(WebForm.java:107)
        at com.meterware.httpunit.WebForm.submit(WebForm.java:69)
        at com.meterware.httpunit.WebForm.submit(WebForm.java:58)
        at edu.byu.isys403.jsc82.pagescraper.Main.main(Main.java:54)