[jira] Updated: (SLING-2012) Sling Scala Hello World example concurrent access fails

2011-03-10 Thread Alex Parvulescu (JIRA)

 [ 
https://issues.apache.org/jira/browse/SLING-2012?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Alex Parvulescu updated SLING-2012:
---

Attachment: ScriptEngineTest.scala.zip

Attaching a new test file containing some tests that only use JSR223 api.
There is a multi threaded test that can server as a reference to this problem

I think this class should go into 
/contrib/scripting/scala/script/src/test/scala/org/apache/sling/scripting/scala

> Sling Scala Hello World example concurrent access fails
> ---
>
> Key: SLING-2012
> URL: https://issues.apache.org/jira/browse/SLING-2012
> Project: Sling
>  Issue Type: Bug
>  Components: Scripting
>Reporter: Alex Parvulescu
>Priority: Minor
> Attachments: SLING-2012-logs.zip, ScriptEngineTest.scala.zip
>
>
> https://cwiki.apache.org/confluence/display/SLING/Using+Scala+with+Sling
> Installed Scala Hello World. Checked 
> http://localhost:/content/helloworld.html it works!
> Next, hit refresh 2/3 times, it breaks with 500 errors. 
> I'll attach some error logs

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira


[jira] Commented: (SLING-2012) Sling Scala Hello World example concurrent access fails

2011-03-10 Thread JIRA

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

Michael Dürig commented on SLING-2012:
--

Thanks for the test cases. I can reproduce the issue now. I committed them at 
revision 1080252 so they can serve as a starting point for diagnosing this 
issue. 

> Sling Scala Hello World example concurrent access fails
> ---
>
> Key: SLING-2012
> URL: https://issues.apache.org/jira/browse/SLING-2012
> Project: Sling
>  Issue Type: Bug
>  Components: Scripting
>Reporter: Alex Parvulescu
>Priority: Minor
> Attachments: SLING-2012-logs.zip, ScriptEngineTest.scala.zip
>
>
> https://cwiki.apache.org/confluence/display/SLING/Using+Scala+with+Sling
> Installed Scala Hello World. Checked 
> http://localhost:/content/helloworld.html it works!
> Next, hit refresh 2/3 times, it breaks with 500 errors. 
> I'll attach some error logs

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira


[jira] Commented: (SLING-2012) Sling Scala Hello World example concurrent access fails

2011-03-10 Thread JIRA

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

Michael Dürig commented on SLING-2012:
--

The issue might be due to a race in ScalaScriptEngine#eval(): 

Thread A: acquires the write lock
Thread A: calls interpreter.compile
Thread A: leaves the write lock

Thread B: acquires the write lock
Thread B: calls interpreter.compile
Thread B: leaves the write lock

Thread A: acquires the read lock
Thread A: calls interpreter.execute

At this point Thread A will call the classes generated by the script of Thread 
B (*)

(*) the classes might be different due to the bindings wrapper generated on the 
fly. See SLING-1236

> Sling Scala Hello World example concurrent access fails
> ---
>
> Key: SLING-2012
> URL: https://issues.apache.org/jira/browse/SLING-2012
> Project: Sling
>  Issue Type: Bug
>  Components: Scripting
>Reporter: Alex Parvulescu
>Priority: Minor
> Attachments: SLING-2012-logs.zip, ScriptEngineTest.scala.zip
>
>
> https://cwiki.apache.org/confluence/display/SLING/Using+Scala+with+Sling
> Installed Scala Hello World. Checked 
> http://localhost:/content/helloworld.html it works!
> Next, hit refresh 2/3 times, it breaks with 500 errors. 
> I'll attach some error logs

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira


[jira] Updated: (SLING-2012) Sling Scala Hello World example concurrent access fails

2011-03-10 Thread Alex Parvulescu (JIRA)

 [ 
https://issues.apache.org/jira/browse/SLING-2012?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Alex Parvulescu updated SLING-2012:
---

Attachment: SLING-2012-dyn_var_fix.patch

see attached a small patch for the scala script engine.
it uses a DynamicVariable to synchronize access to the compilation.

Now the multi-threaded test appears to pass, but I have not tested the sling 
apps

> Sling Scala Hello World example concurrent access fails
> ---
>
> Key: SLING-2012
> URL: https://issues.apache.org/jira/browse/SLING-2012
> Project: Sling
>  Issue Type: Bug
>  Components: Scripting
>Reporter: Alex Parvulescu
>Priority: Minor
> Attachments: SLING-2012-dyn_var_fix.patch, SLING-2012-logs.zip, 
> ScriptEngineTest.scala.zip
>
>
> https://cwiki.apache.org/confluence/display/SLING/Using+Scala+with+Sling
> Installed Scala Hello World. Checked 
> http://localhost:/content/helloworld.html it works!
> Next, hit refresh 2/3 times, it breaks with 500 errors. 
> I'll attach some error logs

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira


Build failed in Jenkins: sling-contrib-1.5 » Scala Script Engine #677

2011-03-10 Thread Apache Hudson Server
See 


Changes:

[mduerig] SLING-2012 Sling Scala Hello World example concurrent access fails
adding unit test demonstrating the issue

--
[INFO] 
[INFO] Building Scala Script Engine
[INFO]task-segment: [clean, install]
[INFO] 
[INFO] artifact org.scala-tools:maven-scala-plugin: checking for updates from 
scala-tools.org
[INFO] artifact org.apache.maven.plugins:maven-eclipse-plugin: checking for 
updates from scala-tools.org
[INFO] snapshot org.apache.maven.plugins:maven-eclipse-plugin:2.9-SNAPSHOT: 
checking for updates from scala-tools.org
Downloading: 
http://scala-tools.org/repo-releases/org/apache/maven/plugins/maven-eclipse-plugin/2.9-SNAPSHOT/maven-eclipse-plugin-2.9-SNAPSHOT.pom
[INFO] Unable to find resource 
'org.apache.maven.plugins:maven-eclipse-plugin:pom:2.9-SNAPSHOT' in repository 
scala-tools.org (http://scala-tools.org/repo-releases)
Downloading: 
http://scala-tools.org/repo-releases/org/apache/maven/plugins/maven-eclipse-plugin/2.9-SNAPSHOT/maven-eclipse-plugin-2.9-SNAPSHOT.jar
[INFO] Unable to find resource 
'org.apache.maven.plugins:maven-eclipse-plugin:maven-plugin:2.9-SNAPSHOT' in 
repository scala-tools.org (http://scala-tools.org/repo-releases)
[INFO] [clean:clean {execution: default-clean}]
[INFO] Deleting file set: 

 (included: [**], excluded: [])
Downloading: 
http://scala-tools.org/repo-releases/org/apache/maven/plugins/maven-eclipse-plugin/2.9-SNAPSHOT/maven-eclipse-plugin-2.9-SNAPSHOT.jar
[INFO] Unable to find resource 
'org.apache.maven.plugins:maven-eclipse-plugin:maven-plugin:2.9-SNAPSHOT' in 
repository scala-tools.org (http://scala-tools.org/repo-releases)
[INFO] [enforcer:enforce {execution: enforce-java}]
[INFO] [remote-resources:process {execution: default}]
[INFO] [resources:resources {execution: default-resources}]
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 3 resources
[INFO] Copying 3 resources
[INFO] [antrun:run {execution: default}]
[INFO] Executing tasks
 [echo] ** WARNING (SLING-443) 
**
 [echo] On most platforms, you'll get OutOfMemoryErrors when building 
unless you set
 [echo] MAVEN_OPTS="-Xmx256M -XX:MaxPermSize=128M", see SLING-443.
 [echo] 
*
[INFO] Executed tasks
[INFO] [compiler:compile {execution: default-compile}]
[INFO] Nothing to compile - all classes are up to date
[INFO] [scala:compile {execution: default}]
[INFO] Checking for multiple versions of scala
[INFO] includes = [**/*.scala,**/*.java,]
[INFO] excludes = []
[INFO] 
:-1:
 info: compiling
[INFO] Compiling 16 source files to 

 at 1299797610971
[WARNING] warning: there were deprecation warnings; re-run with -deprecation 
for details
[WARNING] one warning found
[INFO] prepare-compile in 0 s
[INFO] compile in 12 s
[INFO] [resources:testResources {execution: default-testResources}]
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory 

[INFO] Copying 3 resources
[INFO] [compiler:testCompile {execution: default-testCompile}]
[INFO] Nothing to compile - all classes are up to date
[INFO] [scala:testCompile {execution: default}]
[INFO] Checking for multiple versions of scala
[INFO] includes = [**/*.scala,**/*.java,]
[INFO] excludes = []
[INFO] 
:-1:
 info: compiling
[INFO] Compiling 7 source files to 

 at 1299797623511
[ERROR] 
:21:
 error: ServiceLoader is not a member of java.util
[INFO] import java.util.ServiceLoader
[INFO]^
[ERROR] 


Build failed in Jenkins: sling-contrib-1.5 #677

2011-03-10 Thread Apache Hudson Server
See 

Changes:

[mduerig] SLING-2012 Sling Scala Hello World example concurrent access fails
adding unit test demonstrating the issue

--
[...truncated 1259 lines...]
[INFO] Executing tasks
 [echo] ** WARNING (SLING-443) 
**
 [echo] On most platforms, you'll get OutOfMemoryErrors when building 
unless you set
 [echo] MAVEN_OPTS="-Xmx256M -XX:MaxPermSize=128M", see SLING-443.
 [echo] 
*
[INFO] Executed tasks
[INFO] [compiler:compile {execution: default-compile}]
[INFO] Compiling 8 source files to 

[INFO] [scr:scr {execution: generate-scr-scrdescriptor}]
[INFO] Writing abstract service descriptor 

 with 1 entries.
[INFO] Generating 1 Service Component Descriptors to 

[INFO] [resources:testResources {execution: default-testResources}]
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 6 resources
[INFO] Copying 3 resources
[INFO] [compiler:testCompile {execution: default-testCompile}]
[INFO] Compiling 5 source files to 

[INFO] [surefire:test {execution: default-test}]
[INFO] Surefire report directory: 


---
 T E S T S
---
Running org.apache.sling.scripting.jst.HtmlCodeGeneratorTest
Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.494 sec
Running org.apache.sling.scripting.jst.ScriptFilteredCopyTest
Tests run: 4, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.01 sec
Running org.apache.sling.scripting.jst.BodyOnlyScriptFilteredCopyTest
Tests run: 4, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.01 sec
Running org.apache.sling.scripting.jst.JsCodeGeneratorTest
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.012 sec

Results :

Tests run: 11, Failures: 0, Errors: 0, Skipped: 0

[JENKINS] Recording test results
[INFO] [bundle:bundle {execution: default-bundle}]
[WARNING] Warning building bundle 
org.apache.sling:org.apache.sling.scripting.jst:bundle:2.0.5-SNAPSHOT : Did not 
find matching referal for org.apache.bsf.*
[INFO] Preparing source:jar
[WARNING] Removing: jar from forked lifecycle, to prevent recursive invocation.
[JENKINS] Archiving 

 to 
/home/hudson/hudson/jobs/sling-contrib-1.5/modules/org.apache.sling$org.apache.sling.scripting.jst/builds/2011-03-10_22-46-48/archive/org.apache.sling/org.apache.sling.scripting.jst/2.0.5-SNAPSHOT/pom.xml
[JENKINS] Archiving 

 to 
/home/hudson/hudson/jobs/sling-contrib-1.5/modules/org.apache.sling$org.apache.sling.scripting.jst/builds/2011-03-10_22-46-48/archive/org.apache.sling/org.apache.sling.scripting.jst/2.0.5-SNAPSHOT/org.apache.sling.scripting.jst-2.0.5-SNAPSHOT.jar
[INFO] [enforcer:enforce {execution: enforce-java}]
[INFO] [source:jar {execution: attach-sources}]
[INFO] Building jar: 

[INFO] [ianal:verify-legal-files {execution: default}]
[INFO] Checking legal files in: 
org.apache.sling.scripting.jst-2.0.5-SNAPSHOT.jar
[INFO] Checking legal files in: 
org.apache.sling.scripting.jst-2.0.5-SNAPSHOT-sources.jar
[INFO] [install:install {execution: default-install}]
[INFO] Installing 

 to 
/home/hudson/.m2/repository/org/apache/sling/org.apache.sling.scripting.jst/2.0.5-SNAPSHOT/org.apache.sling.scripting.jst-2.0.5-SNAPSHOT.jar
[INFO] Installing 

 to 
/home/hudson/.m2/repository/org/apache/sling/org.apache.sling.scripting.jst/2.0.5-SNAPSHOT/org.apache.sling.scripting.jst-2.0.5-SNAPSHOT-sources.jar
[INFO] [bundle:install {execution: default-install}]
[INFO] Local OBR update disabled (en