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

Daniel Spicar commented on CLEREZZA-617:
----------------------------------------

The current code located in SVN at issues/CLEREZZA-617 fixes the issue for the 
webrendering service provided by the code in the attached 
renderingservice-minimal.zip.

NOTE: the current code only affects bundles registered using 
ScalaServerPagesService (the "new way"). However this issue also affects SSPs 
registered with the RenderletManager and could be solved there identically.

This solution is problematic for two reasons:

1. the code to extract the bundle classloader from a bundle context (located in 
TrackingCompiler.scala in the script-engine module) depends on a felix OSGi 
environment.

2. in order for any bundle to be able to register (and thus compile) SSPs, the 
bundle needs to declare some package imports manually. The provided 
renderingservice-minimal does this by declaring dynamic imports in its pom. 
Currently this is the responsibility of the developer of that bundle. Also this 
breaks backwards compatibility, thus would require all bundles that register 
SSPs to have dynamic imports declared. The symptom of not doing so is typically 
a ClassNotFoundException because SRenderlet can not be found.

There may be another issue I did not investigate yet. I am not 100% sure what 
TrackingCompiler is doing. It seems to be involved in sharing compilers in some 
way but I am not sure of the specifics. In the current solution the idea is 
that every bundle needs its own, new compiler. I did not yet test if this works 
correctly.
                
> Bug in org.apache.clerezza.platform.typerendering.WebRenderingService causes 
> a refresh of all bundles
> -----------------------------------------------------------------------------------------------------
>
>                 Key: CLEREZZA-617
>                 URL: https://issues.apache.org/jira/browse/CLEREZZA-617
>             Project: Clerezza
>          Issue Type: Bug
>         Environment: Mac OSx 10.6.6
> java version "1.6.0_26"
> Java(TM) SE Runtime Environment (build 1.6.0_26-b03-384-10M3425)
> Java HotSpot(TM) 64-Bit Server VM (build 20.1-b02-384, mixed mode)
>            Reporter: Tsuyoshi Ito
>            Assignee: Daniel Spicar
>            Priority: Critical
>         Attachments: refreshes.png, renderingservice-minimal.zip, 
> renderingservice.zip
>
>
> Updating a bundle which provides a WebrenderingService causes an update of 
> all bundles (after refresh). Even thougth there are no dependencies between 
> most of the bundles.
> test bundles to reproduce the bug attached.
> How to reproduce it:
> parent version 0.3-incubating-SNAPSHOT is used in test bundles (probably you 
> need  0.2-incubating-SNAPSHOT).
> attempt 1
> 1. Install and start bundle org.clerezza.app.webrenderingservice
> 2. Install and start bundle org.clerezza.app.webrenderingserviceconsumer
> 3. Go to http://localhost:8080/admin/renderingtest, The WebrenderingService 
> produces the text "hello test". WebrenderingService is used in an ssp in the 
> webrenderingserviceconsumer bundle
> 4. update org.clerezza.app.webrenderingservice, 
> 5. enter ":f refresh", a refresh is necessary. all bundles are updated
> Furthermore the following error occured, which makes Clerezza Console 
> unavailable.
> org.apache.clerezza.shell.InterruptibleInputStream$$anon$1@2053076f: caught 
> java.io.IOException: Bad file descriptor
> java.io.IOException: Bad file descriptor
>       at sun.nio.ch.FileDispatcher.read0(Native Method)
>       at sun.nio.ch.FileDispatcher.read(FileDispatcher.java:26)
>       at sun.nio.ch.IOUtil.readIntoNativeBuffer(IOUtil.java:202)
>       at sun.nio.ch.IOUtil.read(IOUtil.java:175)
>       at sun.nio.ch.FileChannelImpl.read(FileChannelImpl.java:144)
>       at sun.nio.ch.ChannelInputStream.read(ChannelInputStream.java:48)
>       at sun.nio.ch.ChannelInputStream.read(ChannelInputStream.java:92)
>       at sun.nio.ch.ChannelInputStream.read(ChannelInputStream.java:86)
>       at java.io.InputStream.read(InputStream.java:85)
>       at sun.nio.ch.ChannelInputStream.read(ChannelInputStream.java:64)
>       at 
> org.apache.clerezza.shell.InterruptibleInputStream$$anon$1$$anonfun$act$1$$anonfun$apply$1.apply(InterruptibleInputStream.scala:40)
>       at 
> org.apache.clerezza.shell.InterruptibleInputStream$$anon$1$$anonfun$act$1$$anonfun$apply$1.apply(InterruptibleInputStream.scala:35)
>       at scala.actors.ReactorTask.run(ReactorTask.scala:34)
>       at scala.actors.Reactor$class.resumeReceiver(Reactor.scala:129)
>       at 
> org.apache.clerezza.shell.InterruptibleInputStream$$anon$1.scala$actors$ReplyReactor$$super$resumeReceiver(InterruptibleInputStream.scala:32)
>       at scala.actors.ReplyReactor$class.resumeReceiver(ReplyReactor.scala:69)
>       at 
> org.apache.clerezza.shell.InterruptibleInputStream$$anon$1.resumeReceiver(InterruptibleInputStream.scala:32)
>       at scala.actors.Actor$class.searchMailbox(Actor.scala:478)
>       at 
> org.apache.clerezza.shell.InterruptibleInputStream$$anon$1.searchMailbox(InterruptibleInputStream.scala:32)
>       at 
> scala.actors.Reactor$$anonfun$startSearch$1$$anonfun$apply$mcV$sp$1.apply(Reactor.scala:114)
>       at 
> scala.actors.Reactor$$anonfun$startSearch$1$$anonfun$apply$mcV$sp$1.apply(Reactor.scala:114)
>       at scala.actors.ReactorTask.run(ReactorTask.scala:36)
>       at 
> scala.concurrent.forkjoin.ForkJoinPool$AdaptedRunnable.exec(ForkJoinPool.java:611)
>       at 
> scala.concurrent.forkjoin.ForkJoinTask.quietlyExec(ForkJoinTask.java:422)
>       at 
> scala.concurrent.forkjoin.ForkJoinWorkerThread.mainLoop(ForkJoinWorkerThread.java:340)
>       at 
> scala.concurrent.forkjoin.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:325)
> Because Clerezza Console is unavailable I have used 
> http://localhost:8080/system/console/shell 
> attempt 2
> 1 .Update bundle org.clerezza.app.webrenderingservice again without visiting 
> http://localhost:8080/admin/renderingtest first (not compiling the ssp)
> 2. enter refresh => no refresh necessary

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to