Question

I am trying to run JSCover on Windows 7, I have placed files I want to test in ~\JSCover-0.2.0\doc\example
Two of my files are producing 500 (Internal Server Error) errors, while jquery jasmine and other libraries are loaded fine.

Error:

org.mozilla.javascript.EvaluatorException: illegal character (/onTheMove-Tree.js#1)
at org.mozilla.javascript.DefaultErrorReporter.runtimeError(DefaultErrorReporter.java:77)
at org.mozilla.javascript.DefaultErrorReporter.error(DefaultErrorReporter.java:64)
at org.mozilla.javascript.Parser.addError(Parser.java:188)
at org.mozilla.javascript.Parser.addError(Parser.java:166)
at org.mozilla.javascript.Parser.addError(Parser.java:162)
at org.mozilla.javascript.TokenStream.getToken(TokenStream.java:832)
at org.mozilla.javascript.Parser.peekToken(Parser.java:296)
at org.mozilla.javascript.Parser.name(Parser.java:2880)
at org.mozilla.javascript.Parser.primaryExpr(Parser.java:2792)
at org.mozilla.javascript.Parser.memberExpr(Parser.java:2418)
at org.mozilla.javascript.Parser.unaryExpr(Parser.java:2316)
at org.mozilla.javascript.Parser.mulExpr(Parser.java:2241)
at org.mozilla.javascript.Parser.addExpr(Parser.java:2225)
at org.mozilla.javascript.Parser.shiftExpr(Parser.java:2206)
at org.mozilla.javascript.Parser.relExpr(Parser.java:2181)
at org.mozilla.javascript.Parser.eqExpr(Parser.java:2153)
at org.mozilla.javascript.Parser.bitAndExpr(Parser.java:2142)
at org.mozilla.javascript.Parser.bitXorExpr(Parser.java:2131)
at org.mozilla.javascript.Parser.bitOrExpr(Parser.java:2120)
at org.mozilla.javascript.Parser.andExpr(Parser.java:2109)
at org.mozilla.javascript.Parser.orExpr(Parser.java:2098)
at org.mozilla.javascript.Parser.condExpr(Parser.java:2062)
at org.mozilla.javascript.Parser.assignExpr(Parser.java:2033)
at org.mozilla.javascript.Parser.expr(Parser.java:2012)
at org.mozilla.javascript.Parser.nameOrLabel(Parser.java:1765)
at org.mozilla.javascript.Parser.statementHelper(Parser.java:1032)
at org.mozilla.javascript.Parser.statement(Parser.java:901)
at org.mozilla.javascript.Parser.parse(Parser.java:540)
at org.mozilla.javascript.Parser.parse(Parser.java:478)
at jscover.instrument.SourceProcessor.instrumentSource(SourceProcessor.java:408)
at jscover.instrument.SourceProcessor.processSourceWithoutHeader(SourceProcessor.java:394)
at jscover.instrument.SourceProcessor.processSource(SourceProcessor.java:386)
at jscover.instrument.SourceProcessor.processSourceForServer(SourceProcessor.java:375)
at jscover.instrument.InstrumenterService.instrumentJSForWebServer(InstrumenterService.java:360)
at jscover.server.InstrumentingRequestHandler.handleGet(InstrumentingRequestHandler.java:436)
at jscover.server.HttpServer.run(HttpServer.java:403)

I have checked around and commonly proposed solution is to change encoding java -Dfile.encoding=UTF-8 -jar JSCover-all.jar however result is not different in my case.
Am I running it on wrong .jar? enter image description here

I am stopping running example-server.bat then running command then starting example-server.bat again after changing encoding.

UPDATE: I have checked and my System encoding is ISO-8859-1, but java -Dfile.encoding=ISO-8859-1 -jar JSCover-all.jar still does not produce any effect.
I have also tried specifying full path without any luck

C:\Users\Administrator\Downloads\JSCover-0.2.0\target\dist>java -Dfile.encoding=
ISO-8859-1 -jar "C:\Users\Administrator\Downloads\JSCover-0.2.0\target\dist\JSCo
ver-all.jar"

How do I check what encoding JSCover server is running on? to confirm if my change has taken effect.

Was it helpful?

Solution

This is not a proper solution but more of a temporary hack to workaround this problem:
What I did I opened files that give me 500 (Internal Server Error) in Notepadd++ and then changed encoding to 'Convert to UTF-8 without BOM'.
That allowed me to go past this problem, so technically it is a way to go around this, however I would like someone to propose a better solution.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top