Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test failure on fresh clone: RequestDispatcherSpec.shouldSend404IfTemplateIsMissing #343

Closed
evanleonard opened this issue Apr 18, 2017 · 8 comments

Comments

@evanleonard
Copy link
Contributor

$git clone https://github.com/javalite/activeweb.git
$cd activeweb
$mvn test

...

Tests run: 30, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.435 sec <<< FAILURE! - in org.javalite.activeweb.RequestDispatcherSpec
shouldSend404IfTemplateIsMissing(org.javalite.activeweb.RequestDispatcherSpec) Time elapsed: 0.019 sec <<< ERROR!
java.lang.ClassCastException: java.lang.String cannot be cast to java.util.Map
at org.javalite.activeweb.RequestDispatcherSpec.shouldSend404IfTemplateIsMissing(RequestDispatcherSpec.java:245)

@evanleonard
Copy link
Contributor Author

$java -version
java version "1.8.0_112"
Java(TM) SE Runtime Environment (build 1.8.0_112-b16)
Java HotSpot(TM) 64-Bit Server VM (build 25.112-b16, mixed mode)

@ipolevoy
Copy link
Member

@evanleonard I cannot reproduce, please see attached file
out.log.zip

java -version
java version "1.8.0_31"
Java(TM) SE Runtime Environment (build 1.8.0_31-b13)
Java HotSpot(TM) 64-Bit Server VM (build 25.31-b07, mixed mode)

$lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 16.04.1 LTS
Release: 16.04
Codename: xenial

What OS are you using?

@evanleonard
Copy link
Contributor Author

MacOS Sierra 10.12.4

@evanleonard
Copy link
Contributor Author

When I do "mvn -Dmaven.surefire.debug test" and remote-debug via intelliJ I can see that the value of "Map message = (Map) log.get("message");" is a String:

"rendering template: '/hello/no-view' with layout: '/layouts/default_layout"

So the cast fails.
Oddly, when I debug just the method directly from within IntelliJ the test passes.

@evanleonard
Copy link
Contributor Author

It looks like there is an extra entry in the "lines" variable. in the failure case I see 4 entries, and in the success case I only see 3. Here's the full value of "lines" in the fail case:

{"level":"INFO","timestamp":"Wed Apr 19 14:22:50 PDT 2017","thread":"main","logger":"org.javalite.activeweb.RequestDispatcher","message":{"info":"executing controller","controller":"app.controllers.HelloController","action":"no-view","method":"GET"}}

{"level":"INFO","timestamp":"Wed Apr 19 14:26:06 PDT 2017","thread":"main","logger":"org.javalite.activeweb.freemarker.FreeMarkerTemplateManager","message":"rendering template: '/hello/no-view' with layout: '/layouts/default_layout"}

{"level":"INFO","timestamp":"Wed Apr 19 14:26:24 PDT 2017","thread":"main","logger":"org.javalite.activeweb.RequestDispatcher","message":{"controller":"app.controllers.HelloController","action":"no-view","duration_millis":253203,"method":"GET","url":"http://localhost","error":"Failed to find template: 'src/test/views/hello/no-view.ftl', with layout: 'src/test/views/layouts/default_layout'","status":404}}

{"level":"INFO","timestamp":"Wed Apr 19 14:27:03 PDT 2017","thread":"main","logger":"org.javalite.activeweb.freemarker.FreeMarkerTemplateManager","message":"rendering template: '/system/404' with layout: '/layouts/default_layout"}

@ipolevoy
Copy link
Member

ipolevoy commented Apr 20, 2017

@evanleonard I got the same problem on Windows, while Linux build is passing. I will have to look later, if you have any ideas shoot! Otherwise it will be taken care of on the weekend.

ipolevoy pushed a commit that referenced this issue Apr 26, 2017
@ipolevoy
Copy link
Member

@evanleonard see if this works for you

@ipolevoy
Copy link
Member

@evanleonard did you test?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants