[jira] [Commented] (SLING-8155) AuthRequestLoginTest and SlingSessionInfoTest fail with org.mozilla.javascript.EvaluatorException: syntax error

2018-12-04 Thread Robert Munteanu (JIRA)


[ 
https://issues.apache.org/jira/browse/SLING-8155?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16708489#comment-16708489
 ] 

Robert Munteanu commented on SLING-8155:


Ack, thanks [~jebailey]

> AuthRequestLoginTest and SlingSessionInfoTest fail with 
> org.mozilla.javascript.EvaluatorException: syntax error
> ---
>
> Key: SLING-8155
> URL: https://issues.apache.org/jira/browse/SLING-8155
> Project: Sling
>  Issue Type: Bug
>  Components: Testing
>Reporter: Robert Munteanu
>Assignee: Jason E Bailey
>Priority: Major
>
> Sometimes after Sling 11 we started getting IT failures does to JS errors 
> when evaluated on the client side, in the ITs:
> {noformat}[ERROR] Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time 
> elapsed: 0.007 s <<< FAILURE! - in 
> org.apache.sling.launchpad.webapp.integrationtest.login.AuthRequestLoginTest
> [ERROR] 
> testForcedLogin(org.apache.sling.launchpad.webapp.integrationtest.login.AuthRequestLoginTest)
>   Time elapsed: 0.007 s  <<< ERROR!
> java.io.IOException: While executing 
> [out.println(data.userID)]:org.mozilla.javascript.EvaluatorException: syntax 
> error (JavascriptEngine#1)
>   at 
> org.apache.sling.launchpad.webapp.integrationtest.login.AuthRequestLoginTest.testForcedLogin(AuthRequestLoginTest.java:41)
> Caused by: org.mozilla.javascript.EvaluatorException: syntax error 
> (JavascriptEngine#1)
>   at 
> org.apache.sling.launchpad.webapp.integrationtest.login.AuthRequestLoginTest.testForcedLogin(AuthRequestLoginTest.java:41)
> [ERROR] Tests run: 2, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.006 
> s <<< FAILURE! - in 
> org.apache.sling.launchpad.webapp.integrationtest.servlets.post.SlingSessionInfoTest
> [ERROR] 
> testSessionInfo(org.apache.sling.launchpad.webapp.integrationtest.servlets.post.SlingSessionInfoTest)
>   Time elapsed: 0.001 s  <<< ERROR!
> java.io.IOException: While executing [out.println(data.userID + '.' + typeof 
> data.authType)]:org.mozilla.javascript.EvaluatorException: syntax error 
> (JavascriptEngine#1)
>   at 
> org.apache.sling.launchpad.webapp.integrationtest.servlets.post.SlingSessionInfoTest.testSessionInfo(SlingSessionInfoTest.java:35)
> Caused by: org.mozilla.javascript.EvaluatorException: syntax error 
> (JavascriptEngine#1)
>   at 
> org.apache.sling.launchpad.webapp.integrationtest.servlets.post.SlingSessionInfoTest.testSessionInfo(SlingSessionInfoTest.java:35)
> {noformat}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (SLING-8155) AuthRequestLoginTest and SlingSessionInfoTest fail with org.mozilla.javascript.EvaluatorException: syntax error

2018-12-03 Thread Jason E Bailey (JIRA)


[ 
https://issues.apache.org/jira/browse/SLING-8155?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16707656#comment-16707656
 ] 

Jason E Bailey commented on SLING-8155:
---

The issue with the info.sessionInfo.json has to do with the use of the 
JsonGenerator that I switched too.

When I initially implemented this, I closed the JsonGenerator when I finished. 
This created a problem where it closed the underlying response writer, which 
was then attempted to be closed later. So I changed the code to leave the 
JsonGenerator unclosed so that it wouldn't close the response writer.

This then has created an issue, where the JsonGenerator isn't flushing it's 
buffer to the response writer and that's why there's no response being written. 
Note that this is at the JsonGenerator implementation level. If I flush the 
underlying response writer, it doesn't help.

Still working on best solution for this.

 

> AuthRequestLoginTest and SlingSessionInfoTest fail with 
> org.mozilla.javascript.EvaluatorException: syntax error
> ---
>
> Key: SLING-8155
> URL: https://issues.apache.org/jira/browse/SLING-8155
> Project: Sling
>  Issue Type: Bug
>  Components: Testing
>Reporter: Robert Munteanu
>Assignee: Radu Cotescu
>Priority: Major
>
> Sometimes after Sling 11 we started getting IT failures does to JS errors 
> when evaluated on the client side, in the ITs:
> {noformat}[ERROR] Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time 
> elapsed: 0.007 s <<< FAILURE! - in 
> org.apache.sling.launchpad.webapp.integrationtest.login.AuthRequestLoginTest
> [ERROR] 
> testForcedLogin(org.apache.sling.launchpad.webapp.integrationtest.login.AuthRequestLoginTest)
>   Time elapsed: 0.007 s  <<< ERROR!
> java.io.IOException: While executing 
> [out.println(data.userID)]:org.mozilla.javascript.EvaluatorException: syntax 
> error (JavascriptEngine#1)
>   at 
> org.apache.sling.launchpad.webapp.integrationtest.login.AuthRequestLoginTest.testForcedLogin(AuthRequestLoginTest.java:41)
> Caused by: org.mozilla.javascript.EvaluatorException: syntax error 
> (JavascriptEngine#1)
>   at 
> org.apache.sling.launchpad.webapp.integrationtest.login.AuthRequestLoginTest.testForcedLogin(AuthRequestLoginTest.java:41)
> [ERROR] Tests run: 2, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.006 
> s <<< FAILURE! - in 
> org.apache.sling.launchpad.webapp.integrationtest.servlets.post.SlingSessionInfoTest
> [ERROR] 
> testSessionInfo(org.apache.sling.launchpad.webapp.integrationtest.servlets.post.SlingSessionInfoTest)
>   Time elapsed: 0.001 s  <<< ERROR!
> java.io.IOException: While executing [out.println(data.userID + '.' + typeof 
> data.authType)]:org.mozilla.javascript.EvaluatorException: syntax error 
> (JavascriptEngine#1)
>   at 
> org.apache.sling.launchpad.webapp.integrationtest.servlets.post.SlingSessionInfoTest.testSessionInfo(SlingSessionInfoTest.java:35)
> Caused by: org.mozilla.javascript.EvaluatorException: syntax error 
> (JavascriptEngine#1)
>   at 
> org.apache.sling.launchpad.webapp.integrationtest.servlets.post.SlingSessionInfoTest.testSessionInfo(SlingSessionInfoTest.java:35)
> {noformat}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (SLING-8155) AuthRequestLoginTest and SlingSessionInfoTest fail with org.mozilla.javascript.EvaluatorException: syntax error

2018-12-03 Thread Jason E Bailey (JIRA)


[ 
https://issues.apache.org/jira/browse/SLING-8155?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16707659#comment-16707659
 ] 

Jason E Bailey commented on SLING-8155:
---

This same issue is what's causing the CreateUserTest to fail

> AuthRequestLoginTest and SlingSessionInfoTest fail with 
> org.mozilla.javascript.EvaluatorException: syntax error
> ---
>
> Key: SLING-8155
> URL: https://issues.apache.org/jira/browse/SLING-8155
> Project: Sling
>  Issue Type: Bug
>  Components: Testing
>Reporter: Robert Munteanu
>Assignee: Radu Cotescu
>Priority: Major
>
> Sometimes after Sling 11 we started getting IT failures does to JS errors 
> when evaluated on the client side, in the ITs:
> {noformat}[ERROR] Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time 
> elapsed: 0.007 s <<< FAILURE! - in 
> org.apache.sling.launchpad.webapp.integrationtest.login.AuthRequestLoginTest
> [ERROR] 
> testForcedLogin(org.apache.sling.launchpad.webapp.integrationtest.login.AuthRequestLoginTest)
>   Time elapsed: 0.007 s  <<< ERROR!
> java.io.IOException: While executing 
> [out.println(data.userID)]:org.mozilla.javascript.EvaluatorException: syntax 
> error (JavascriptEngine#1)
>   at 
> org.apache.sling.launchpad.webapp.integrationtest.login.AuthRequestLoginTest.testForcedLogin(AuthRequestLoginTest.java:41)
> Caused by: org.mozilla.javascript.EvaluatorException: syntax error 
> (JavascriptEngine#1)
>   at 
> org.apache.sling.launchpad.webapp.integrationtest.login.AuthRequestLoginTest.testForcedLogin(AuthRequestLoginTest.java:41)
> [ERROR] Tests run: 2, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.006 
> s <<< FAILURE! - in 
> org.apache.sling.launchpad.webapp.integrationtest.servlets.post.SlingSessionInfoTest
> [ERROR] 
> testSessionInfo(org.apache.sling.launchpad.webapp.integrationtest.servlets.post.SlingSessionInfoTest)
>   Time elapsed: 0.001 s  <<< ERROR!
> java.io.IOException: While executing [out.println(data.userID + '.' + typeof 
> data.authType)]:org.mozilla.javascript.EvaluatorException: syntax error 
> (JavascriptEngine#1)
>   at 
> org.apache.sling.launchpad.webapp.integrationtest.servlets.post.SlingSessionInfoTest.testSessionInfo(SlingSessionInfoTest.java:35)
> Caused by: org.mozilla.javascript.EvaluatorException: syntax error 
> (JavascriptEngine#1)
>   at 
> org.apache.sling.launchpad.webapp.integrationtest.servlets.post.SlingSessionInfoTest.testSessionInfo(SlingSessionInfoTest.java:35)
> {noformat}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (SLING-8155) AuthRequestLoginTest and SlingSessionInfoTest fail with org.mozilla.javascript.EvaluatorException: syntax error

2018-12-03 Thread Robert Munteanu (JIRA)


[ 
https://issues.apache.org/jira/browse/SLING-8155?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16707350#comment-16707350
 ] 

Robert Munteanu commented on SLING-8155:


Seems that the root error is the same for 

{noformat}[ERROR] 
testCreateUser(org.apache.sling.launchpad.webapp.integrationtest.userManager.CreateUserTest)
  Time elapsed: 0.027 s  <<< ERROR!
javax.json.stream.JsonParsingException: Unexpected character '' (Codepoint: 0) 
on [lineNumber=1, columnNumber=1, streamOffset=0]. Reason is [[End of file hit 
too early]]
at 
org.apache.sling.launchpad.webapp.integrationtest.userManager.CreateUserTest.testCreateUser(CreateUserTest.java:111)

[ERROR] 
testAuthorizedCreateUser(org.apache.sling.launchpad.webapp.integrationtest.userManager.CreateUserTest)
  Time elapsed: 0.051 s  <<< ERROR!
javax.json.stream.JsonParsingException: Unexpected character '' (Codepoint: 0) 
on [lineNumber=1, columnNumber=1, streamOffset=0]. Reason is [[End of file hit 
too early]]
at 
org.apache.sling.launchpad.webapp.integrationtest.userManager.CreateUserTest.testAuthorizedCreateUser(CreateUserTest.java:164)
{noformat}

> AuthRequestLoginTest and SlingSessionInfoTest fail with 
> org.mozilla.javascript.EvaluatorException: syntax error
> ---
>
> Key: SLING-8155
> URL: https://issues.apache.org/jira/browse/SLING-8155
> Project: Sling
>  Issue Type: Bug
>  Components: Testing
>Reporter: Robert Munteanu
>Assignee: Robert Munteanu
>Priority: Major
>
> Sometimes after Sling 11 we started getting IT failures does to JS errors 
> when evaluated on the client side, in the ITs:
> {noformat}[ERROR] Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time 
> elapsed: 0.007 s <<< FAILURE! - in 
> org.apache.sling.launchpad.webapp.integrationtest.login.AuthRequestLoginTest
> [ERROR] 
> testForcedLogin(org.apache.sling.launchpad.webapp.integrationtest.login.AuthRequestLoginTest)
>   Time elapsed: 0.007 s  <<< ERROR!
> java.io.IOException: While executing 
> [out.println(data.userID)]:org.mozilla.javascript.EvaluatorException: syntax 
> error (JavascriptEngine#1)
>   at 
> org.apache.sling.launchpad.webapp.integrationtest.login.AuthRequestLoginTest.testForcedLogin(AuthRequestLoginTest.java:41)
> Caused by: org.mozilla.javascript.EvaluatorException: syntax error 
> (JavascriptEngine#1)
>   at 
> org.apache.sling.launchpad.webapp.integrationtest.login.AuthRequestLoginTest.testForcedLogin(AuthRequestLoginTest.java:41)
> [ERROR] Tests run: 2, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.006 
> s <<< FAILURE! - in 
> org.apache.sling.launchpad.webapp.integrationtest.servlets.post.SlingSessionInfoTest
> [ERROR] 
> testSessionInfo(org.apache.sling.launchpad.webapp.integrationtest.servlets.post.SlingSessionInfoTest)
>   Time elapsed: 0.001 s  <<< ERROR!
> java.io.IOException: While executing [out.println(data.userID + '.' + typeof 
> data.authType)]:org.mozilla.javascript.EvaluatorException: syntax error 
> (JavascriptEngine#1)
>   at 
> org.apache.sling.launchpad.webapp.integrationtest.servlets.post.SlingSessionInfoTest.testSessionInfo(SlingSessionInfoTest.java:35)
> Caused by: org.mozilla.javascript.EvaluatorException: syntax error 
> (JavascriptEngine#1)
>   at 
> org.apache.sling.launchpad.webapp.integrationtest.servlets.post.SlingSessionInfoTest.testSessionInfo(SlingSessionInfoTest.java:35)
> {noformat}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (SLING-8155) AuthRequestLoginTest and SlingSessionInfoTest fail with org.mozilla.javascript.EvaluatorException: syntax error

2018-12-03 Thread Robert Munteanu (JIRA)


[ 
https://issues.apache.org/jira/browse/SLING-8155?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16707333#comment-16707333
 ] 

Robert Munteanu commented on SLING-8155:


It seems that when running the tests the {{info.sessionInfo.json}} endpoint 
return an empty content. The root cause found the sling logs is

{noformat}03.12.2018 16:02:31.703 *WARN* [EventAdminAsyncThread #6] 
org.apache.sling.scripting.javascript.internal.RhinoJavaScriptEngineFactory 
addHostObjects: Cannot prepare host object class 
org.apache.sling.scripting.javascript.wrapper.Scriptabl
eResource
java.lang.NullPointerException: null
at 
org.apache.sling.scripting.javascript.internal.RhinoJavaScriptEngineFactory.addHostObjects(RhinoJavaScriptEngineFactory.java:344)
 [org.apache.sling.scripting.javascript:3.0.4]
at 
org.apache.sling.scripting.javascript.internal.RhinoJavaScriptEngineFactory.getRootScope(RhinoJavaScriptEngineFactory.java:195)
 [org.apache.sling.scripting.javascript:3.0.4]
at 
org.apache.sling.scripting.javascript.internal.RhinoJavaScriptEngineFactory.getScriptEngine(RhinoJavaScriptEngineFactory.java:142)
 [org.apache.sling.scripting.javascript:3.0.4]
at 
org.apache.sling.scripting.core.impl.jsr223.SortableScriptEngineFactory.getScriptEngine(SortableScriptEngineFactory.java:113)
 [org.apache.sling.scripting.core:2.0.54]
at 
org.apache.sling.scripting.core.impl.ScriptCacheImpl.handleEvent(ScriptCacheImpl.java:291)
 [org.apache.sling.scripting.core:2.0.54]
at 
org.apache.felix.eventadmin.impl.handler.EventHandlerProxy.sendEvent(EventHandlerProxy.java:415)
at 
org.apache.felix.eventadmin.impl.tasks.HandlerTask.runWithoutBlacklistTiming(HandlerTask.java:82)
 [org.apache.felix.eventadmin:1.5.0]
at 
org.apache.felix.eventadmin.impl.tasks.SyncDeliverTasks.execute(SyncDeliverTasks.java:104)
 [org.apache.felix.eventadmin:1.5.0]
at 
org.apache.felix.eventadmin.impl.tasks.AsyncDeliverTasks$TaskExecuter.run(AsyncDeliverTasks.java:166)
 [org.apache.felix.eventadmin:1.5.0]
at 
java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at 
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at 
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748){noformat}

[~radu.cotescu] - could you make a quick assessment about why this happens?

> AuthRequestLoginTest and SlingSessionInfoTest fail with 
> org.mozilla.javascript.EvaluatorException: syntax error
> ---
>
> Key: SLING-8155
> URL: https://issues.apache.org/jira/browse/SLING-8155
> Project: Sling
>  Issue Type: Bug
>  Components: Testing
>Reporter: Robert Munteanu
>Assignee: Robert Munteanu
>Priority: Major
>
> Sometimes after Sling 11 we started getting IT failures does to JS errors 
> when evaluated on the client side, in the ITs:
> {noformat}[ERROR] Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time 
> elapsed: 0.007 s <<< FAILURE! - in 
> org.apache.sling.launchpad.webapp.integrationtest.login.AuthRequestLoginTest
> [ERROR] 
> testForcedLogin(org.apache.sling.launchpad.webapp.integrationtest.login.AuthRequestLoginTest)
>   Time elapsed: 0.007 s  <<< ERROR!
> java.io.IOException: While executing 
> [out.println(data.userID)]:org.mozilla.javascript.EvaluatorException: syntax 
> error (JavascriptEngine#1)
>   at 
> org.apache.sling.launchpad.webapp.integrationtest.login.AuthRequestLoginTest.testForcedLogin(AuthRequestLoginTest.java:41)
> Caused by: org.mozilla.javascript.EvaluatorException: syntax error 
> (JavascriptEngine#1)
>   at 
> org.apache.sling.launchpad.webapp.integrationtest.login.AuthRequestLoginTest.testForcedLogin(AuthRequestLoginTest.java:41)
> [ERROR] Tests run: 2, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.006 
> s <<< FAILURE! - in 
> org.apache.sling.launchpad.webapp.integrationtest.servlets.post.SlingSessionInfoTest
> [ERROR] 
> testSessionInfo(org.apache.sling.launchpad.webapp.integrationtest.servlets.post.SlingSessionInfoTest)
>   Time elapsed: 0.001 s  <<< ERROR!
> java.io.IOException: While executing [out.println(data.userID + '.' + typeof 
> data.authType)]:org.mozilla.javascript.EvaluatorException: syntax error 
> (JavascriptEngine#1)
>   at 
> org.apache.sling.launchpad.webapp.integrationtest.servlets.post.SlingSessionInfoTest.testSessionInfo(SlingSessionInfoTest.java:35)
> Caused by: org.mozilla.javascript.EvaluatorException: syntax error 
> (JavascriptEngine#1)
>   at 
>